@habit.analytics/habit-claims-journey-components 2.1.7 → 2.1.9

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.
Files changed (3) hide show
  1. package/dist/index.cjs +10 -10
  2. package/dist/index.mjs +640 -628
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:root,.jb-widget-root{--claims-journey-background: 210 25% 96.5%;--claims-journey-foreground: 222.2 84% 4.9%;--claims-journey-font-heading: "Poppins", sans-serif;--claims-journey-font-body: "Roboto", sans-serif;--claims-journey-card: 0 0% 100%;--claims-journey-card-foreground: 222.2 84% 4.9%;--claims-journey-popover: 0 0% 100%;--claims-journey-popover-foreground: 222.2 84% 4.9%;--claims-journey-primary: 222.2 47.4% 11.2%;--claims-journey-primary-foreground: 210 40% 98%;--claims-journey-secondary: 210 40% 96.1%;--claims-journey-secondary-foreground: 222.2 47.4% 11.2%;--claims-journey-muted: 210 40% 96.1%;--claims-journey-muted-foreground: 215.4 16.3% 46.9%;--claims-journey-accent: 210 40% 96.1%;--claims-journey-accent-foreground: 222.2 47.4% 11.2%;--claims-journey-destructive: 0 84.2% 60.2%;--claims-journey-destructive-foreground: 210 40% 98%;--claims-journey-border: 214.3 31.8% 91.4%;--claims-journey-input: 214.3 31.8% 91.4%;--claims-journey-ring: 222.2 84% 4.9%;--claims-journey-radius: .75rem;--claims-journey-success: 142 71% 45%;--claims-journey-success-foreground: 0 0% 100%;--claims-journey-sidebar-background: 0 0% 98%;--claims-journey-sidebar-foreground: 240 5.3% 26.1%;--claims-journey-sidebar-primary: 240 5.9% 10%;--claims-journey-sidebar-primary-foreground: 0 0% 98%;--claims-journey-sidebar-accent: 240 4.8% 95.9%;--claims-journey-sidebar-accent-foreground: 240 5.9% 10%;--claims-journey-sidebar-border: 220 13% 91%;--claims-journey-sidebar-ring: 217.2 91.2% 59.8%}.dark{--claims-journey-background: 222.2 84% 4.9%;--claims-journey-foreground: 210 40% 98%;--claims-journey-card: 222.2 84% 4.9%;--claims-journey-card-foreground: 210 40% 98%;--claims-journey-popover: 222.2 84% 4.9%;--claims-journey-popover-foreground: 210 40% 98%;--claims-journey-primary: 210 40% 98%;--claims-journey-primary-foreground: 222.2 47.4% 11.2%;--claims-journey-secondary: 217.2 32.6% 17.5%;--claims-journey-secondary-foreground: 210 40% 98%;--claims-journey-muted: 217.2 32.6% 17.5%;--claims-journey-muted-foreground: 215 20.2% 65.1%;--claims-journey-accent: 217.2 32.6% 17.5%;--claims-journey-accent-foreground: 210 40% 98%;--claims-journey-destructive: 0 62.8% 30.6%;--claims-journey-destructive-foreground: 210 40% 98%;--claims-journey-border: 217.2 32.6% 17.5%;--claims-journey-input: 217.2 32.6% 17.5%;--claims-journey-ring: 212.7 26.8% 83.9%;--claims-journey-sidebar-background: 240 5.9% 10%;--claims-journey-sidebar-foreground: 240 4.8% 95.9%;--claims-journey-sidebar-primary: 224.3 76.3% 48%;--claims-journey-sidebar-primary-foreground: 0 0% 100%;--claims-journey-sidebar-accent: 240 3.7% 15.9%;--claims-journey-sidebar-accent-foreground: 240 4.8% 95.9%;--claims-journey-sidebar-border: 240 3.7% 15.9%;--claims-journey-sidebar-ring: 217.2 91.2% 59.8%}.jb-widget-root,.jb-widget-root *,.jb-widget-root *:before,.jb-widget-root *:after{border-color:hsl(var(--claims-journey-border));box-sizing:border-box}.jb-widget-root{background-color:hsl(var(--claims-journey-background));color:hsl(var(--claims-journey-foreground))}.cj-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.cj-pointer-events-none{pointer-events:none!important}.cj-pointer-events-auto{pointer-events:auto!important}.cj-invisible{visibility:hidden!important}.cj-fixed{position:fixed!important}.cj-absolute{position:absolute!important}.cj-relative{position:relative!important}.cj-sticky{position:sticky!important}.cj-inset-0{top:0!important;right:0!important;bottom:0!important;left:0!important}.cj-inset-x-0{left:0!important;right:0!important}.cj-inset-y-0{top:0!important;bottom:0!important}.-cj-bottom-12{bottom:-3rem!important}.-cj-bottom-2{bottom:-.5rem!important}.-cj-left-12{left:-3rem!important}.-cj-right-1{right:-.25rem!important}.-cj-right-12{right:-3rem!important}.-cj-top-1{top:-.25rem!important}.-cj-top-12{top:-3rem!important}.cj-bottom-0{bottom:0!important}.cj-left-0{left:0!important}.cj-left-1{left:.25rem!important}.cj-left-1\\/2{left:50%!important}.cj-left-2{left:.5rem!important}.cj-left-2\\.5{left:.625rem!important}.cj-left-3{left:.75rem!important}.cj-left-\\[50\\%\\]{left:50%!important}.cj-right-0{right:0!important}.cj-right-1{right:.25rem!important}.cj-right-2{right:.5rem!important}.cj-right-3{right:.75rem!important}.cj-right-4{right:1rem!important}.cj-top-0{top:0!important}.cj-top-1{top:.25rem!important}.cj-top-1\\.5{top:.375rem!important}.cj-top-1\\/2{top:50%!important}.cj-top-2{top:.5rem!important}.cj-top-2\\.5{top:.625rem!important}.cj-top-3\\.5{top:.875rem!important}.cj-top-4{top:1rem!important}.cj-top-\\[1px\\]{top:1px!important}.cj-top-\\[50\\%\\]{top:50%!important}.cj-top-\\[60\\%\\]{top:60%!important}.cj-top-full{top:100%!important}.cj-z-10{z-index:10!important}.cj-z-20{z-index:20!important}.cj-z-50{z-index:50!important}.cj-z-\\[100\\]{z-index:100!important}.cj-z-\\[1\\]{z-index:1!important}.cj-m-0{margin:0!important}.-cj-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.cj-mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.cj-mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.cj-mx-3\\.5{margin-left:.875rem!important;margin-right:.875rem!important}.cj-mx-auto{margin-left:auto!important;margin-right:auto!important}.cj-my-0\\.5{margin-top:.125rem!important;margin-bottom:.125rem!important}.cj-my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.-cj-ml-4{margin-left:-1rem!important}.-cj-mt-4{margin-top:-1rem!important}.cj-mb-1{margin-bottom:.25rem!important}.cj-mb-1\\.5{margin-bottom:.375rem!important}.cj-mb-2{margin-bottom:.5rem!important}.cj-mb-3{margin-bottom:.75rem!important}.cj-mb-4{margin-bottom:1rem!important}.cj-mb-6{margin-bottom:1.5rem!important}.cj-ml-0\\.5{margin-left:.125rem!important}.cj-ml-1{margin-left:.25rem!important}.cj-ml-1\\.5{margin-left:.375rem!important}.cj-ml-2{margin-left:.5rem!important}.cj-ml-auto{margin-left:auto!important}.cj-mr-1{margin-right:.25rem!important}.cj-mr-1\\.5{margin-right:.375rem!important}.cj-mr-2{margin-right:.5rem!important}.cj-mt-0{margin-top:0!important}.cj-mt-0\\.5{margin-top:.125rem!important}.cj-mt-1{margin-top:.25rem!important}.cj-mt-1\\.5{margin-top:.375rem!important}.cj-mt-2{margin-top:.5rem!important}.cj-mt-24{margin-top:6rem!important}.cj-mt-3{margin-top:.75rem!important}.cj-mt-4{margin-top:1rem!important}.cj-mt-auto{margin-top:auto!important}.cj-block{display:block!important}.cj-flex{display:flex!important}.cj-inline-flex{display:inline-flex!important}.cj-grid{display:grid!important}.cj-hidden{display:none!important}.cj-aspect-square{aspect-ratio:1 / 1!important}.cj-aspect-video{aspect-ratio:16 / 9!important}.cj-size-4{width:1rem!important;height:1rem!important}.\\!cj-h-3{height:.75rem!important}.cj-h-1{height:.25rem!important}.cj-h-1\\.5{height:.375rem!important}.cj-h-10{height:2.5rem!important}.cj-h-11{height:2.75rem!important}.cj-h-12{height:3rem!important}.cj-h-14{height:3.5rem!important}.cj-h-16{height:4rem!important}.cj-h-2{height:.5rem!important}.cj-h-2\\.5{height:.625rem!important}.cj-h-3{height:.75rem!important}.cj-h-3\\.5{height:.875rem!important}.cj-h-4{height:1rem!important}.cj-h-5{height:1.25rem!important}.cj-h-6{height:1.5rem!important}.cj-h-7{height:1.75rem!important}.cj-h-8{height:2rem!important}.cj-h-9{height:2.25rem!important}.cj-h-\\[1px\\]{height:1px!important}.cj-h-\\[200px\\]{height:200px!important}.cj-h-\\[var\\(--radix-navigation-menu-viewport-height\\)\\]{height:var(--radix-navigation-menu-viewport-height)!important}.cj-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)!important}.cj-h-auto{height:auto!important}.cj-h-full{height:100%!important}.cj-h-px{height:1px!important}.cj-h-svh{height:100svh!important}.cj-max-h-40{max-height:10rem!important}.cj-max-h-60{max-height:15rem!important}.cj-max-h-80{max-height:20rem!important}.cj-max-h-96{max-height:24rem!important}.cj-max-h-\\[300px\\]{max-height:300px!important}.cj-max-h-\\[85vh\\]{max-height:85vh!important}.cj-max-h-\\[calc\\(100vh-5rem\\)\\]{max-height:calc(100vh - 5rem)!important}.cj-max-h-screen{max-height:100vh!important}.cj-min-h-0{min-height:0px!important}.cj-min-h-12{min-height:3rem!important}.cj-min-h-\\[100px\\]{min-height:100px!important}.cj-min-h-\\[120px\\]{min-height:120px!important}.cj-min-h-\\[200px\\]{min-height:200px!important}.cj-min-h-\\[56px\\]{min-height:56px!important}.cj-min-h-full{min-height:100%!important}.cj-min-h-screen{min-height:100vh!important}.cj-min-h-svh{min-height:100svh!important}.\\!cj-w-3{width:.75rem!important}.cj-w-0{width:0px!important}.cj-w-1{width:.25rem!important}.cj-w-1\\.5{width:.375rem!important}.cj-w-10{width:2.5rem!important}.cj-w-11{width:2.75rem!important}.cj-w-12{width:3rem!important}.cj-w-16{width:4rem!important}.cj-w-2{width:.5rem!important}.cj-w-2\\.5{width:.625rem!important}.cj-w-24{width:6rem!important}.cj-w-28{width:7rem!important}.cj-w-3{width:.75rem!important}.cj-w-3\\.5{width:.875rem!important}.cj-w-3\\/4{width:75%!important}.cj-w-32{width:8rem!important}.cj-w-4{width:1rem!important}.cj-w-5{width:1.25rem!important}.cj-w-6{width:1.5rem!important}.cj-w-64{width:16rem!important}.cj-w-7{width:1.75rem!important}.cj-w-72{width:18rem!important}.cj-w-8{width:2rem!important}.cj-w-9{width:2.25rem!important}.cj-w-96{width:24rem!important}.cj-w-\\[--sidebar-width\\]{width:var(--sidebar-width)!important}.cj-w-\\[100px\\]{width:100px!important}.cj-w-\\[1px\\]{width:1px!important}.cj-w-\\[260px\\]{width:260px!important}.cj-w-\\[360px\\]{width:360px!important}.cj-w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)!important}.cj-w-auto{width:auto!important}.cj-w-full{width:100%!important}.cj-w-max{width:-moz-max-content!important;width:max-content!important}.cj-w-px{width:1px!important}.cj-min-w-0{min-width:0px!important}.cj-min-w-5{min-width:1.25rem!important}.cj-min-w-\\[1\\.75rem\\]{min-width:1.75rem!important}.cj-min-w-\\[12rem\\]{min-width:12rem!important}.cj-min-w-\\[140px\\]{min-width:140px!important}.cj-min-w-\\[180px\\]{min-width:180px!important}.cj-min-w-\\[220px\\]{min-width:220px!important}.cj-min-w-\\[8rem\\]{min-width:8rem!important}.cj-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)!important}.cj-max-w-2xl{max-width:42rem!important}.cj-max-w-3xl{max-width:48rem!important}.cj-max-w-4xl{max-width:56rem!important}.cj-max-w-\\[--skeleton-width\\]{max-width:var(--skeleton-width)!important}.cj-max-w-\\[160px\\]{max-width:160px!important}.cj-max-w-\\[200px\\]{max-width:200px!important}.cj-max-w-\\[240px\\]{max-width:240px!important}.cj-max-w-lg{max-width:32rem!important}.cj-max-w-max{max-width:-moz-max-content!important;max-width:max-content!important}.cj-max-w-md{max-width:28rem!important}.cj-max-w-xl{max-width:36rem!important}.cj-flex-1{flex:1 1 0%!important}.cj-flex-shrink-0,.cj-shrink-0{flex-shrink:0!important}.cj-grow{flex-grow:1!important}.cj-grow-0{flex-grow:0!important}.cj-basis-full{flex-basis:100%!important}.cj-caption-bottom{caption-side:bottom!important}.cj-border-collapse{border-collapse:collapse!important}.-cj-translate-x-1\\/2{--tw-translate-x: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-cj-translate-x-px{--tw-translate-x: -1px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-cj-translate-y-1\\/2,.cj--translate-y-1\\/2{--tw-translate-y: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-translate-x-\\[-50\\%\\]{--tw-translate-x: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-translate-x-px{--tw-translate-x: 1px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-translate-y-\\[-50\\%\\]{--tw-translate-y: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-cj-rotate-90{--tw-rotate: -90deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-rotate-180{--tw-rotate: 180deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-rotate-45{--tw-rotate: 45deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-rotate-90{--tw-rotate: 90deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-animate-\\[fadeSlideIn_0\\.35s_ease-out_both\\]{animation:fadeSlideIn .35s ease-out both!important}.cj-animate-\\[fadeSlideIn_0\\.3s_ease-out_both\\]{animation:fadeSlideIn .3s ease-out both!important}@keyframes cj-pulse{50%{opacity:.5}}.cj-animate-pulse{animation:cj-pulse 2s cubic-bezier(.4,0,.6,1) infinite!important}@keyframes cj-spin{to{transform:rotate(360deg)}}.cj-animate-spin{animation:cj-spin 1s linear infinite!important}.cj-cursor-default{cursor:default!important}.cj-cursor-grab{cursor:grab!important}.cj-cursor-pointer{cursor:pointer!important}.cj-cursor-wait{cursor:wait!important}.cj-touch-none{touch-action:none!important}.cj-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.cj-list-inside{list-style-position:inside!important}.cj-list-disc{list-style-type:disc!important}.cj-list-none{list-style-type:none!important}.cj-appearance-none{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important}.cj-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.cj-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.cj-flex-row{flex-direction:row!important}.cj-flex-col{flex-direction:column!important}.cj-flex-col-reverse{flex-direction:column-reverse!important}.cj-flex-wrap{flex-wrap:wrap!important}.cj-items-start{align-items:flex-start!important}.cj-items-end{align-items:flex-end!important}.cj-items-center{align-items:center!important}.cj-items-stretch{align-items:stretch!important}.cj-justify-end{justify-content:flex-end!important}.cj-justify-center{justify-content:center!important}.cj-justify-between{justify-content:space-between!important}.cj-gap-0\\.5{gap:.125rem!important}.cj-gap-1{gap:.25rem!important}.cj-gap-1\\.5{gap:.375rem!important}.cj-gap-2{gap:.5rem!important}.cj-gap-3{gap:.75rem!important}.cj-gap-4{gap:1rem!important}.cj-gap-6{gap:1.5rem!important}.cj-space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(.25rem * var(--tw-space-x-reverse))!important;margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))!important}.cj-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(1rem * var(--tw-space-x-reverse))!important;margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))!important}.cj-space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.125rem * var(--tw-space-y-reverse))!important}.cj-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.25rem * var(--tw-space-y-reverse))!important}.cj-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.375rem * var(--tw-space-y-reverse))!important}.cj-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.5rem * var(--tw-space-y-reverse))!important}.cj-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.75rem * var(--tw-space-y-reverse))!important}.cj-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1rem * var(--tw-space-y-reverse))!important}.cj-space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))!important}.cj-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))!important}.cj-space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(2rem * var(--tw-space-y-reverse))!important}.cj-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px * var(--tw-divide-y-reverse))!important}.cj-divide-border\\/30>:not([hidden])~:not([hidden]){border-color:hsl(var(--claims-journey-border) / .3)!important}.cj-self-start{align-self:flex-start!important}.cj-overflow-auto{overflow:auto!important}.cj-overflow-hidden{overflow:hidden!important}.cj-overflow-visible{overflow:visible!important}.cj-overflow-y-auto{overflow-y:auto!important}.cj-overflow-x-hidden{overflow-x:hidden!important}.cj-truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.cj-whitespace-nowrap{white-space:nowrap!important}.cj-break-words{overflow-wrap:break-word!important}.cj-break-all{word-break:break-all!important}.cj-rounded{border-radius:.25rem!important}.cj-rounded-2xl{border-radius:1rem!important}.cj-rounded-\\[2px\\]{border-radius:2px!important}.cj-rounded-\\[inherit\\]{border-radius:inherit!important}.cj-rounded-full{border-radius:9999px!important}.cj-rounded-lg{border-radius:var(--claims-journey-radius)!important}.cj-rounded-md{border-radius:calc(var(--claims-journey-radius) - 2px)!important}.cj-rounded-none{border-radius:0!important}.cj-rounded-sm{border-radius:calc(var(--claims-journey-radius) - 4px)!important}.cj-rounded-xl{border-radius:.75rem!important}.cj-rounded-t-\\[10px\\]{border-top-left-radius:10px!important;border-top-right-radius:10px!important}.cj-rounded-tl-sm{border-top-left-radius:calc(var(--claims-journey-radius) - 4px)!important}.\\!cj-border-2{border-width:2px!important}.cj-border{border-width:1px!important}.cj-border-0{border-width:0px!important}.cj-border-2{border-width:2px!important}.cj-border-\\[1\\.5px\\]{border-width:1.5px!important}.cj-border-y{border-top-width:1px!important;border-bottom-width:1px!important}.cj-border-b{border-bottom-width:1px!important}.cj-border-b-2{border-bottom-width:2px!important}.cj-border-l{border-left-width:1px!important}.cj-border-r{border-right-width:1px!important}.cj-border-t{border-top-width:1px!important}.cj-border-dashed{border-style:dashed!important}.cj-border-none{border-style:none!important}.\\!cj-border-background{border-color:hsl(var(--claims-journey-background))!important}.\\!cj-border-border{border-color:hsl(var(--claims-journey-border))!important}.cj-border-\\[--color-border\\]{border-color:var(--color-border)!important}.cj-border-background{border-color:hsl(var(--claims-journey-background))!important}.cj-border-border{border-color:hsl(var(--claims-journey-border))!important}.cj-border-border\\/30{border-color:hsl(var(--claims-journey-border) / .3)!important}.cj-border-border\\/40{border-color:hsl(var(--claims-journey-border) / .4)!important}.cj-border-border\\/50{border-color:hsl(var(--claims-journey-border) / .5)!important}.cj-border-border\\/60{border-color:hsl(var(--claims-journey-border) / .6)!important}.cj-border-card{border-color:hsl(var(--claims-journey-card))!important}.cj-border-destructive{border-color:hsl(var(--claims-journey-destructive))!important}.cj-border-destructive\\/30{border-color:hsl(var(--claims-journey-destructive) / .3)!important}.cj-border-destructive\\/40{border-color:hsl(var(--claims-journey-destructive) / .4)!important}.cj-border-destructive\\/50{border-color:hsl(var(--claims-journey-destructive) / .5)!important}.cj-border-input{border-color:hsl(var(--claims-journey-input))!important}.cj-border-muted-foreground\\/25{border-color:hsl(var(--claims-journey-muted-foreground) / .25)!important}.cj-border-primary{border-color:hsl(var(--claims-journey-primary))!important}.cj-border-primary\\/40{border-color:hsl(var(--claims-journey-primary) / .4)!important}.cj-border-primary\\/50{border-color:hsl(var(--claims-journey-primary) / .5)!important}.cj-border-sidebar-border{border-color:hsl(var(--claims-journey-sidebar-border))!important}.cj-border-transparent{border-color:transparent!important}.cj-border-yellow-500{--tw-border-opacity: 1 !important;border-color:rgb(234 179 8 / var(--tw-border-opacity, 1))!important}.cj-border-l-transparent{border-left-color:transparent!important}.cj-border-t-transparent{border-top-color:transparent!important}.\\!cj-bg-background{background-color:hsl(var(--claims-journey-background))!important}.\\!cj-bg-primary{background-color:hsl(var(--claims-journey-primary))!important}.cj-bg-\\[--color-bg\\]{background-color:var(--color-bg)!important}.cj-bg-\\[hsl\\(var\\(--claims-journey-success\\)\\/0\\.15\\)\\]{background-color:hsl(var(--claims-journey-success)/.15)!important}.cj-bg-accent{background-color:hsl(var(--claims-journey-accent))!important}.cj-bg-background{background-color:hsl(var(--claims-journey-background))!important}.cj-bg-background\\/50{background-color:hsl(var(--claims-journey-background) / .5)!important}.cj-bg-black\\/80{background-color:#000c!important}.cj-bg-blue-50{--tw-bg-opacity: 1 !important;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))!important}.cj-bg-blue-500{--tw-bg-opacity: 1 !important;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))!important}.cj-bg-border{background-color:hsl(var(--claims-journey-border))!important}.cj-bg-card{background-color:hsl(var(--claims-journey-card))!important}.cj-bg-cyan-500{--tw-bg-opacity: 1 !important;background-color:rgb(6 182 212 / var(--tw-bg-opacity, 1))!important}.cj-bg-destructive{background-color:hsl(var(--claims-journey-destructive))!important}.cj-bg-destructive\\/10{background-color:hsl(var(--claims-journey-destructive) / .1)!important}.cj-bg-emerald-500{--tw-bg-opacity: 1 !important;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))!important}.cj-bg-foreground{background-color:hsl(var(--claims-journey-foreground))!important}.cj-bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))!important}.cj-bg-indigo-500{--tw-bg-opacity: 1 !important;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))!important}.cj-bg-lime-500{--tw-bg-opacity: 1 !important;background-color:rgb(132 204 22 / var(--tw-bg-opacity, 1))!important}.cj-bg-muted{background-color:hsl(var(--claims-journey-muted))!important}.cj-bg-muted\\/20{background-color:hsl(var(--claims-journey-muted) / .2)!important}.cj-bg-muted\\/30{background-color:hsl(var(--claims-journey-muted) / .3)!important}.cj-bg-muted\\/50{background-color:hsl(var(--claims-journey-muted) / .5)!important}.cj-bg-orange-500{--tw-bg-opacity: 1 !important;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))!important}.cj-bg-popover{background-color:hsl(var(--claims-journey-popover))!important}.cj-bg-primary{background-color:hsl(var(--claims-journey-primary))!important}.cj-bg-primary\\/10{background-color:hsl(var(--claims-journey-primary) / .1)!important}.cj-bg-primary\\/5{background-color:hsl(var(--claims-journey-primary) / .05)!important}.cj-bg-purple-500{--tw-bg-opacity: 1 !important;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))!important}.cj-bg-rose-500{--tw-bg-opacity: 1 !important;background-color:rgb(244 63 94 / var(--tw-bg-opacity, 1))!important}.cj-bg-secondary{background-color:hsl(var(--claims-journey-secondary))!important}.cj-bg-sidebar{background-color:hsl(var(--claims-journey-sidebar-background))!important}.cj-bg-sidebar-border{background-color:hsl(var(--claims-journey-sidebar-border))!important}.cj-bg-teal-500{--tw-bg-opacity: 1 !important;background-color:rgb(20 184 166 / var(--tw-bg-opacity, 1))!important}.cj-bg-transparent{background-color:transparent!important}.cj-bg-yellow-500{--tw-bg-opacity: 1 !important;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))!important}.cj-fill-current{fill:currentColor!important}.cj-p-0{padding:0!important}.cj-p-0\\.5{padding:.125rem!important}.cj-p-1{padding:.25rem!important}.cj-p-2{padding:.5rem!important}.cj-p-3{padding:.75rem!important}.cj-p-4{padding:1rem!important}.cj-p-5{padding:1.25rem!important}.cj-p-6{padding:1.5rem!important}.cj-p-8{padding:2rem!important}.cj-p-\\[1px\\]{padding:1px!important}.cj-px-1{padding-left:.25rem!important;padding-right:.25rem!important}.cj-px-2{padding-left:.5rem!important;padding-right:.5rem!important}.cj-px-2\\.5{padding-left:.625rem!important;padding-right:.625rem!important}.cj-px-3{padding-left:.75rem!important;padding-right:.75rem!important}.cj-px-4{padding-left:1rem!important;padding-right:1rem!important}.cj-px-5{padding-left:1.25rem!important;padding-right:1.25rem!important}.cj-px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.cj-px-8{padding-left:2rem!important;padding-right:2rem!important}.cj-py-0\\.5{padding-top:.125rem!important;padding-bottom:.125rem!important}.cj-py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.cj-py-1\\.5{padding-top:.375rem!important;padding-bottom:.375rem!important}.cj-py-12{padding-top:3rem!important;padding-bottom:3rem!important}.cj-py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.cj-py-2\\.5{padding-top:.625rem!important;padding-bottom:.625rem!important}.cj-py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.cj-py-3\\.5{padding-top:.875rem!important;padding-bottom:.875rem!important}.cj-py-4{padding-top:1rem!important;padding-bottom:1rem!important}.cj-py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.cj-py-8{padding-top:2rem!important;padding-bottom:2rem!important}.cj-pb-1{padding-bottom:.25rem!important}.cj-pb-2{padding-bottom:.5rem!important}.cj-pb-3{padding-bottom:.75rem!important}.cj-pb-4{padding-bottom:1rem!important}.cj-pl-2{padding-left:.5rem!important}.cj-pl-2\\.5{padding-left:.625rem!important}.cj-pl-4{padding-left:1rem!important}.cj-pl-8{padding-left:2rem!important}.cj-pl-9{padding-left:2.25rem!important}.cj-pr-1{padding-right:.25rem!important}.cj-pr-12{padding-right:3rem!important}.cj-pr-2{padding-right:.5rem!important}.cj-pr-2\\.5{padding-right:.625rem!important}.cj-pr-3{padding-right:.75rem!important}.cj-pr-4{padding-right:1rem!important}.cj-pr-6{padding-right:1.5rem!important}.cj-pr-8{padding-right:2rem!important}.cj-pt-0{padding-top:0!important}.cj-pt-1{padding-top:.25rem!important}.cj-pt-2{padding-top:.5rem!important}.cj-pt-3{padding-top:.75rem!important}.cj-pt-4{padding-top:1rem!important}.cj-pt-8{padding-top:2rem!important}.cj-text-left{text-align:left!important}.cj-text-center{text-align:center!important}.cj-text-right{text-align:right!important}.cj-align-middle{vertical-align:middle!important}.cj-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important}.cj-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.cj-text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.cj-text-\\[10px\\]{font-size:10px!important}.cj-text-\\[11px\\]{font-size:11px!important}.cj-text-\\[9px\\]{font-size:9px!important}.cj-text-base{font-size:1rem!important;line-height:1.5rem!important}.cj-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.cj-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.cj-text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.cj-text-xs{font-size:.75rem!important;line-height:1rem!important}.cj-font-bold{font-weight:700!important}.cj-font-medium{font-weight:500!important}.cj-font-normal{font-weight:400!important}.cj-font-semibold{font-weight:600!important}.cj-uppercase{text-transform:uppercase!important}.cj-capitalize{text-transform:capitalize!important}.cj-italic{font-style:italic!important}.cj-tabular-nums{--tw-numeric-spacing: tabular-nums !important;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)!important}.cj-leading-none{line-height:1!important}.cj-leading-relaxed{line-height:1.625!important}.cj-leading-snug{line-height:1.375!important}.cj-leading-tight{line-height:1.25!important}.cj-tracking-tight{letter-spacing:-.025em!important}.cj-tracking-wide{letter-spacing:.025em!important}.cj-tracking-wider{letter-spacing:.05em!important}.cj-tracking-widest{letter-spacing:.1em!important}.cj-text-\\[hsl\\(var\\(--claims-journey-success\\)\\)\\]{color:hsl(var(--claims-journey-success))!important}.cj-text-card-foreground{color:hsl(var(--claims-journey-card-foreground))!important}.cj-text-current{color:currentColor!important}.cj-text-destructive{color:hsl(var(--claims-journey-destructive))!important}.cj-text-destructive-foreground{color:hsl(var(--claims-journey-destructive-foreground))!important}.cj-text-destructive\\/80{color:hsl(var(--claims-journey-destructive) / .8)!important}.cj-text-foreground{color:hsl(var(--claims-journey-foreground))!important}.cj-text-foreground\\/50{color:hsl(var(--claims-journey-foreground) / .5)!important}.cj-text-foreground\\/80{color:hsl(var(--claims-journey-foreground) / .8)!important}.cj-text-green-500{--tw-text-opacity: 1 !important;color:rgb(34 197 94 / var(--tw-text-opacity, 1))!important}.cj-text-muted-foreground{color:hsl(var(--claims-journey-muted-foreground))!important}.cj-text-muted-foreground\\/40{color:hsl(var(--claims-journey-muted-foreground) / .4)!important}.cj-text-muted-foreground\\/60{color:hsl(var(--claims-journey-muted-foreground) / .6)!important}.cj-text-muted-foreground\\/70{color:hsl(var(--claims-journey-muted-foreground) / .7)!important}.cj-text-popover-foreground{color:hsl(var(--claims-journey-popover-foreground))!important}.cj-text-primary{color:hsl(var(--claims-journey-primary))!important}.cj-text-primary-foreground{color:hsl(var(--claims-journey-primary-foreground))!important}.cj-text-secondary-foreground{color:hsl(var(--claims-journey-secondary-foreground))!important}.cj-text-sidebar-foreground{color:hsl(var(--claims-journey-sidebar-foreground))!important}.cj-text-sidebar-foreground\\/70{color:hsl(var(--claims-journey-sidebar-foreground) / .7)!important}.cj-text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.cj-text-yellow-500{--tw-text-opacity: 1 !important;color:rgb(234 179 8 / var(--tw-text-opacity, 1))!important}.cj-text-yellow-600{--tw-text-opacity: 1 !important;color:rgb(202 138 4 / var(--tw-text-opacity, 1))!important}.cj-underline{text-decoration-line:underline!important}.cj-underline-offset-4{text-underline-offset:4px!important}.cj-opacity-0{opacity:0!important}.cj-opacity-40{opacity:.4!important}.cj-opacity-50{opacity:.5!important}.cj-opacity-60{opacity:.6!important}.cj-opacity-70{opacity:.7!important}.cj-opacity-90{opacity:.9!important}.cj-shadow-\\[0_0_0_1px_hsl\\(var\\(--claims-journey-sidebar-border\\)\\)\\]{--tw-shadow: 0 0 0 1px hsl(var(--claims-journey-sidebar-border)) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-none{--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-primary\\/20{--tw-shadow-color: hsl(var(--claims-journey-primary) / .2) !important;--tw-shadow: var(--tw-shadow-colored) !important}.cj-outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.cj-ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.cj-ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.cj-ring-destructive\\/40{--tw-ring-color: hsl(var(--claims-journey-destructive) / .4) !important}.cj-ring-primary\\/20{--tw-ring-color: hsl(var(--claims-journey-primary) / .2) !important}.cj-ring-primary\\/30{--tw-ring-color: hsl(var(--claims-journey-primary) / .3) !important}.cj-ring-primary\\/50{--tw-ring-color: hsl(var(--claims-journey-primary) / .5) !important}.cj-ring-ring{--tw-ring-color: hsl(var(--claims-journey-ring)) !important}.cj-ring-sidebar-ring{--tw-ring-color: hsl(var(--claims-journey-sidebar-ring)) !important}.cj-ring-offset-background{--tw-ring-offset-color: hsl(var(--claims-journey-background)) !important}.cj-transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[left\\,right\\,width\\]{transition-property:left,right,width!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[margin\\,opa\\]{transition-property:margin,opa!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[width\\,height\\,padding\\]{transition-property:width,height,padding!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[width\\]{transition-property:width!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-opacity{transition-property:opacity!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-transform{transition-property:transform!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-duration-1000{transition-duration:1s!important}.cj-duration-150{transition-duration:.15s!important}.cj-duration-200{transition-duration:.2s!important}.cj-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.cj-ease-linear{transition-timing-function:linear!important}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.cj-animate-in{animation-name:enter!important;animation-duration:.15s!important;--tw-enter-opacity: initial !important;--tw-enter-scale: initial !important;--tw-enter-rotate: initial !important;--tw-enter-translate-x: initial !important;--tw-enter-translate-y: initial !important}.cj-fade-in-0{--tw-enter-opacity: 0 !important}.cj-fade-in-80{--tw-enter-opacity: .8 !important}.cj-zoom-in-95{--tw-enter-scale: .95 !important}.cj-duration-1000{animation-duration:1s!important}.cj-duration-150{animation-duration:.15s!important}.cj-duration-200{animation-duration:.2s!important}.cj-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)!important}.cj-ease-linear{animation-timing-function:linear!important}@keyframes fadeSlideIn{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.file\\:cj-border-0::file-selector-button{border-width:0px!important}.file\\:cj-bg-transparent::file-selector-button{background-color:transparent!important}.file\\:cj-text-sm::file-selector-button{font-size:.875rem!important;line-height:1.25rem!important}.file\\:cj-font-medium::file-selector-button{font-weight:500!important}.file\\:cj-text-foreground::file-selector-button{color:hsl(var(--claims-journey-foreground))!important}.placeholder\\:cj-text-muted-foreground::-moz-placeholder{color:hsl(var(--claims-journey-muted-foreground))!important}.placeholder\\:cj-text-muted-foreground::placeholder{color:hsl(var(--claims-journey-muted-foreground))!important}.after\\:cj-absolute:after{content:var(--tw-content)!important;position:absolute!important}.after\\:-cj-inset-2:after{content:var(--tw-content)!important;top:-.5rem!important;right:-.5rem!important;bottom:-.5rem!important;left:-.5rem!important}.after\\:cj-inset-y-0:after{content:var(--tw-content)!important;top:0!important;bottom:0!important}.after\\:cj-left-1\\/2:after{content:var(--tw-content)!important;left:50%!important}.after\\:cj-w-1:after{content:var(--tw-content)!important;width:.25rem!important}.after\\:cj-w-\\[2px\\]:after{content:var(--tw-content)!important;width:2px!important}.after\\:-cj-translate-x-1\\/2:after{content:var(--tw-content)!important;--tw-translate-x: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.first\\:cj-rounded-l-md:first-child{border-top-left-radius:calc(var(--claims-journey-radius) - 2px)!important;border-bottom-left-radius:calc(var(--claims-journey-radius) - 2px)!important}.first\\:cj-border-l:first-child{border-left-width:1px!important}.last\\:cj-rounded-r-md:last-child{border-top-right-radius:calc(var(--claims-journey-radius) - 2px)!important;border-bottom-right-radius:calc(var(--claims-journey-radius) - 2px)!important}.focus-within\\:cj-relative:focus-within{position:relative!important}.focus-within\\:cj-z-20:focus-within{z-index:20!important}.hover\\:\\!cj-h-4:hover{height:1rem!important}.hover\\:\\!cj-w-4:hover{width:1rem!important}.hover\\:cj-border-destructive\\/75:hover{border-color:hsl(var(--claims-journey-destructive) / .75)!important}.hover\\:cj-border-muted-foreground\\/50:hover{border-color:hsl(var(--claims-journey-muted-foreground) / .5)!important}.hover\\:cj-border-primary\\/40:hover{border-color:hsl(var(--claims-journey-primary) / .4)!important}.hover\\:cj-border-primary\\/50:hover{border-color:hsl(var(--claims-journey-primary) / .5)!important}.hover\\:cj-border-primary\\/60:hover{border-color:hsl(var(--claims-journey-primary) / .6)!important}.hover\\:\\!cj-bg-primary\\/80:hover{background-color:hsl(var(--claims-journey-primary) / .8)!important}.hover\\:cj-bg-accent:hover{background-color:hsl(var(--claims-journey-accent))!important}.hover\\:cj-bg-accent\\/40:hover{background-color:hsl(var(--claims-journey-accent) / .4)!important}.hover\\:cj-bg-accent\\/50:hover{background-color:hsl(var(--claims-journey-accent) / .5)!important}.hover\\:cj-bg-accent\\/60:hover{background-color:hsl(var(--claims-journey-accent) / .6)!important}.hover\\:cj-bg-destructive\\/10:hover{background-color:hsl(var(--claims-journey-destructive) / .1)!important}.hover\\:cj-bg-destructive\\/80:hover{background-color:hsl(var(--claims-journey-destructive) / .8)!important}.hover\\:cj-bg-destructive\\/90:hover{background-color:hsl(var(--claims-journey-destructive) / .9)!important}.hover\\:cj-bg-muted:hover{background-color:hsl(var(--claims-journey-muted))!important}.hover\\:cj-bg-muted\\/50:hover{background-color:hsl(var(--claims-journey-muted) / .5)!important}.hover\\:cj-bg-primary:hover{background-color:hsl(var(--claims-journey-primary))!important}.hover\\:cj-bg-primary\\/80:hover{background-color:hsl(var(--claims-journey-primary) / .8)!important}.hover\\:cj-bg-primary\\/90:hover{background-color:hsl(var(--claims-journey-primary) / .9)!important}.hover\\:cj-bg-secondary:hover{background-color:hsl(var(--claims-journey-secondary))!important}.hover\\:cj-bg-secondary\\/80:hover{background-color:hsl(var(--claims-journey-secondary) / .8)!important}.hover\\:cj-bg-sidebar-accent:hover{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.hover\\:cj-text-accent-foreground:hover{color:hsl(var(--claims-journey-accent-foreground))!important}.hover\\:cj-text-destructive:hover{color:hsl(var(--claims-journey-destructive))!important}.hover\\:cj-text-foreground:hover{color:hsl(var(--claims-journey-foreground))!important}.hover\\:cj-text-muted-foreground:hover{color:hsl(var(--claims-journey-muted-foreground))!important}.hover\\:cj-text-primary-foreground:hover{color:hsl(var(--claims-journey-primary-foreground))!important}.hover\\:cj-text-primary\\/90:hover{color:hsl(var(--claims-journey-primary) / .9)!important}.hover\\:cj-text-sidebar-accent-foreground:hover{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.hover\\:cj-text-yellow-600:hover{--tw-text-opacity: 1 !important;color:rgb(202 138 4 / var(--tw-text-opacity, 1))!important}.hover\\:cj-underline:hover{text-decoration-line:underline!important}.hover\\:cj-opacity-100:hover{opacity:1!important}.hover\\:cj-shadow-\\[0_0_0_1px_hsl\\(var\\(--claims-journey-sidebar-accent\\)\\)\\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--claims-journey-sidebar-accent)) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.hover\\:cj-shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.hover\\:after\\:cj-bg-sidebar-border:hover:after{content:var(--tw-content)!important;background-color:hsl(var(--claims-journey-sidebar-border))!important}.focus\\:cj-bg-accent:focus{background-color:hsl(var(--claims-journey-accent))!important}.focus\\:cj-bg-primary:focus{background-color:hsl(var(--claims-journey-primary))!important}.focus\\:cj-text-accent-foreground:focus{color:hsl(var(--claims-journey-accent-foreground))!important}.focus\\:cj-text-primary-foreground:focus{color:hsl(var(--claims-journey-primary-foreground))!important}.focus\\:cj-opacity-100:focus{opacity:1!important}.focus\\:cj-outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.focus\\:cj-ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus\\:cj-ring-ring:focus{--tw-ring-color: hsl(var(--claims-journey-ring)) !important}.focus\\:cj-ring-offset-2:focus{--tw-ring-offset-width: 2px !important}.focus-visible\\:cj-outline-none:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.focus-visible\\:cj-ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus-visible\\:cj-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus-visible\\:cj-ring-destructive:focus-visible{--tw-ring-color: hsl(var(--claims-journey-destructive)) !important}.focus-visible\\:cj-ring-ring:focus-visible{--tw-ring-color: hsl(var(--claims-journey-ring)) !important}.focus-visible\\:cj-ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--claims-journey-sidebar-ring)) !important}.focus-visible\\:cj-ring-offset-1:focus-visible{--tw-ring-offset-width: 1px !important}.focus-visible\\:cj-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px !important}.focus-visible\\:cj-ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--claims-journey-background)) !important}.active\\:cj-cursor-grabbing:active{cursor:grabbing!important}.active\\:cj-bg-sidebar-accent:active{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.active\\:cj-text-sidebar-accent-foreground:active{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.disabled\\:cj-pointer-events-none:disabled{pointer-events:none!important}.disabled\\:cj-cursor-not-allowed:disabled{cursor:not-allowed!important}.disabled\\:cj-opacity-50:disabled{opacity:.5!important}.cj-group\\/menu-item:focus-within .group-focus-within\\/menu-item\\:cj-opacity-100{opacity:1!important}.cj-group:hover .group-hover\\:cj-text-foreground{color:hsl(var(--claims-journey-foreground))!important}.cj-group\\/menu-item:hover .group-hover\\/menu-item\\:cj-opacity-100,.cj-group:hover .group-hover\\:cj-opacity-100{opacity:1!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:cj-border-muted\\/40{border-color:hsl(var(--claims-journey-muted) / .4)!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-border-border{border-color:hsl(var(--claims-journey-border))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-bg-muted{background-color:hsl(var(--claims-journey-muted))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-bg-primary{background-color:hsl(var(--claims-journey-primary))!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-bg-background{background-color:hsl(var(--claims-journey-background))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:cj-text-red-300{--tw-text-opacity: 1 !important;color:rgb(252 165 165 / var(--tw-text-opacity, 1))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-text-muted-foreground{color:hsl(var(--claims-journey-muted-foreground))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-text-primary-foreground{color:hsl(var(--claims-journey-primary-foreground))!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-text-foreground{color:hsl(var(--claims-journey-foreground))!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-border-destructive\\/30:hover{border-color:hsl(var(--claims-journey-destructive) / .3)!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-bg-destructive:hover{background-color:hsl(var(--claims-journey-destructive))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-text-destructive-foreground:hover{color:hsl(var(--claims-journey-destructive-foreground))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-text-red-50:hover{--tw-text-opacity: 1 !important;color:rgb(254 242 242 / var(--tw-text-opacity, 1))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:focus\\:cj-ring-destructive:focus{--tw-ring-color: hsl(var(--claims-journey-destructive)) !important}.cj-group.destructive .group-\\[\\.destructive\\]\\:focus\\:cj-ring-red-400:focus{--tw-ring-opacity: 1 !important;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1)) !important}.cj-group.destructive .group-\\[\\.destructive\\]\\:focus\\:cj-ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626 !important}.cj-peer\\/menu-button:hover~.peer-hover\\/menu-button\\:cj-text-sidebar-accent-foreground{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.cj-peer:disabled~.peer-disabled\\:cj-cursor-not-allowed{cursor:not-allowed!important}.cj-peer:disabled~.peer-disabled\\:cj-opacity-70{opacity:.7!important}.has-\\[\\[data-variant\\=inset\\]\\]\\:cj-bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--claims-journey-sidebar-background))!important}.has-\\[\\:disabled\\]\\:cj-opacity-50:has(:disabled){opacity:.5!important}.cj-group\\/menu-item:has([data-sidebar=menu-action]) .group-has-\\[\\[data-sidebar\\=menu-action\\]\\]\\/menu-item\\:cj-pr-8{padding-right:2rem!important}.aria-disabled\\:cj-pointer-events-none[aria-disabled=true]{pointer-events:none!important}.aria-disabled\\:cj-opacity-50[aria-disabled=true]{opacity:.5!important}.aria-selected\\:cj-bg-accent[aria-selected=true]{background-color:hsl(var(--claims-journey-accent))!important}.aria-selected\\:cj-bg-accent\\/50[aria-selected=true]{background-color:hsl(var(--claims-journey-accent) / .5)!important}.aria-selected\\:cj-text-accent-foreground[aria-selected=true]{color:hsl(var(--claims-journey-accent-foreground))!important}.aria-selected\\:cj-text-muted-foreground[aria-selected=true]{color:hsl(var(--claims-journey-muted-foreground))!important}.aria-selected\\:cj-opacity-100[aria-selected=true]{opacity:1!important}.aria-selected\\:cj-opacity-30[aria-selected=true]{opacity:.3!important}.data-\\[disabled\\=true\\]\\:cj-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:cj-pointer-events-none[data-disabled]{pointer-events:none!important}.data-\\[panel-group-direction\\=vertical\\]\\:cj-h-px[data-panel-group-direction=vertical]{height:1px!important}.data-\\[panel-group-direction\\=vertical\\]\\:cj-w-full[data-panel-group-direction=vertical]{width:100%!important}.data-\\[side\\=bottom\\]\\:cj-translate-y-1[data-side=bottom]{--tw-translate-y: .25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[side\\=left\\]\\:-cj-translate-x-1[data-side=left]{--tw-translate-x: -.25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[side\\=right\\]\\:cj-translate-x-1[data-side=right]{--tw-translate-x: .25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[side\\=top\\]\\:-cj-translate-y-1[data-side=top]{--tw-translate-y: -.25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[state\\=checked\\]\\:cj-translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[state\\=unchecked\\]\\:cj-translate-x-0[data-state=unchecked],.data-\\[swipe\\=cancel\\]\\:cj-translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[swipe\\=end\\]\\:cj-translate-x-\\[var\\(--radix-toast-swipe-end-x\\)\\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x) !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[swipe\\=move\\]\\:cj-translate-x-\\[var\\(--radix-toast-swipe-move-x\\)\\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x) !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}@keyframes cj-accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\\[state\\=closed\\]\\:cj-animate-accordion-up[data-state=closed]{animation:cj-accordion-up .2s ease-out!important}@keyframes cj-accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\\[state\\=open\\]\\:cj-animate-accordion-down[data-state=open]{animation:cj-accordion-down .2s ease-out!important}.data-\\[panel-group-direction\\=vertical\\]\\:cj-flex-col[data-panel-group-direction=vertical]{flex-direction:column!important}.data-\\[state\\=active\\]\\:cj-border-primary[data-state=active]{border-color:hsl(var(--claims-journey-primary))!important}.data-\\[state\\=checked\\]\\:cj-border-primary\\/40[data-state=checked]{border-color:hsl(var(--claims-journey-primary) / .4)!important}.data-\\[active\\=true\\]\\:cj-bg-sidebar-accent[data-active=true]{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.data-\\[active\\]\\:cj-bg-accent\\/50[data-active]{background-color:hsl(var(--claims-journey-accent) / .5)!important}.data-\\[selected\\=\\'true\\'\\]\\:cj-bg-accent[data-selected=true]{background-color:hsl(var(--claims-journey-accent))!important}.data-\\[state\\=active\\]\\:cj-bg-background[data-state=active]{background-color:hsl(var(--claims-journey-background))!important}.data-\\[state\\=active\\]\\:cj-bg-transparent[data-state=active]{background-color:transparent!important}.data-\\[state\\=checked\\]\\:cj-bg-primary[data-state=checked]{background-color:hsl(var(--claims-journey-primary))!important}.data-\\[state\\=checked\\]\\:cj-bg-primary\\/5[data-state=checked]{background-color:hsl(var(--claims-journey-primary) / .05)!important}.data-\\[state\\=on\\]\\:cj-bg-accent[data-state=on],.data-\\[state\\=open\\]\\:cj-bg-accent[data-state=open]{background-color:hsl(var(--claims-journey-accent))!important}.data-\\[state\\=open\\]\\:cj-bg-accent\\/50[data-state=open]{background-color:hsl(var(--claims-journey-accent) / .5)!important}.data-\\[state\\=open\\]\\:cj-bg-secondary[data-state=open]{background-color:hsl(var(--claims-journey-secondary))!important}.data-\\[state\\=selected\\]\\:cj-bg-muted[data-state=selected]{background-color:hsl(var(--claims-journey-muted))!important}.data-\\[state\\=unchecked\\]\\:cj-bg-input[data-state=unchecked]{background-color:hsl(var(--claims-journey-input))!important}.data-\\[active\\=true\\]\\:cj-font-medium[data-active=true]{font-weight:500!important}.data-\\[active\\=true\\]\\:cj-text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.data-\\[selected\\=true\\]\\:cj-text-accent-foreground[data-selected=true]{color:hsl(var(--claims-journey-accent-foreground))!important}.data-\\[state\\=active\\]\\:cj-text-foreground[data-state=active]{color:hsl(var(--claims-journey-foreground))!important}.data-\\[state\\=checked\\]\\:cj-text-primary-foreground[data-state=checked]{color:hsl(var(--claims-journey-primary-foreground))!important}.data-\\[state\\=on\\]\\:cj-text-accent-foreground[data-state=on],.data-\\[state\\=open\\]\\:cj-text-accent-foreground[data-state=open]{color:hsl(var(--claims-journey-accent-foreground))!important}.data-\\[state\\=open\\]\\:cj-text-muted-foreground[data-state=open]{color:hsl(var(--claims-journey-muted-foreground))!important}.data-\\[disabled\\=true\\]\\:cj-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:cj-opacity-50[data-disabled]{opacity:.5!important}.data-\\[state\\=open\\]\\:cj-opacity-100[data-state=open]{opacity:1!important}.data-\\[state\\=active\\]\\:cj-shadow-none[data-state=active]{--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.data-\\[state\\=active\\]\\:cj-shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.data-\\[swipe\\=move\\]\\:cj-transition-none[data-swipe=move]{transition-property:none!important}.data-\\[state\\=closed\\]\\:cj-duration-300[data-state=closed]{transition-duration:.3s!important}.data-\\[state\\=open\\]\\:cj-duration-500[data-state=open]{transition-duration:.5s!important}.data-\\[motion\\^\\=from-\\]\\:cj-animate-in[data-motion^=from-],.data-\\[state\\=open\\]\\:cj-animate-in[data-state=open],.data-\\[state\\=visible\\]\\:cj-animate-in[data-state=visible]{animation-name:enter!important;animation-duration:.15s!important;--tw-enter-opacity: initial !important;--tw-enter-scale: initial !important;--tw-enter-rotate: initial !important;--tw-enter-translate-x: initial !important;--tw-enter-translate-y: initial !important}.data-\\[motion\\^\\=to-\\]\\:cj-animate-out[data-motion^=to-],.data-\\[state\\=closed\\]\\:cj-animate-out[data-state=closed],.data-\\[state\\=hidden\\]\\:cj-animate-out[data-state=hidden],.data-\\[swipe\\=end\\]\\:cj-animate-out[data-swipe=end]{animation-name:exit!important;animation-duration:.15s!important;--tw-exit-opacity: initial !important;--tw-exit-scale: initial !important;--tw-exit-rotate: initial !important;--tw-exit-translate-x: initial !important;--tw-exit-translate-y: initial !important}.data-\\[motion\\^\\=from-\\]\\:cj-fade-in[data-motion^=from-]{--tw-enter-opacity: 0 !important}.data-\\[motion\\^\\=to-\\]\\:cj-fade-out[data-motion^=to-],.data-\\[state\\=closed\\]\\:cj-fade-out-0[data-state=closed]{--tw-exit-opacity: 0 !important}.data-\\[state\\=closed\\]\\:cj-fade-out-80[data-state=closed]{--tw-exit-opacity: .8 !important}.data-\\[state\\=hidden\\]\\:cj-fade-out[data-state=hidden]{--tw-exit-opacity: 0 !important}.data-\\[state\\=open\\]\\:cj-fade-in-0[data-state=open],.data-\\[state\\=visible\\]\\:cj-fade-in[data-state=visible]{--tw-enter-opacity: 0 !important}.data-\\[state\\=closed\\]\\:cj-zoom-out-95[data-state=closed]{--tw-exit-scale: .95 !important}.data-\\[state\\=open\\]\\:cj-zoom-in-90[data-state=open]{--tw-enter-scale: .9 !important}.data-\\[state\\=open\\]\\:cj-zoom-in-95[data-state=open]{--tw-enter-scale: .95 !important}.data-\\[motion\\=from-end\\]\\:cj-slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem !important}.data-\\[motion\\=from-start\\]\\:cj-slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem !important}.data-\\[motion\\=to-end\\]\\:cj-slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem !important}.data-\\[motion\\=to-start\\]\\:cj-slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem !important}.data-\\[side\\=bottom\\]\\:cj-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem !important}.data-\\[side\\=left\\]\\:cj-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem !important}.data-\\[side\\=right\\]\\:cj-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem !important}.data-\\[side\\=top\\]\\:cj-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x: -50% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-right[data-state=closed],.data-\\[state\\=closed\\]\\:cj-slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y: -48% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x: -50% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y: -48% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100% !important}.data-\\[state\\=closed\\]\\:cj-duration-300[data-state=closed]{animation-duration:.3s!important}.data-\\[state\\=open\\]\\:cj-duration-500[data-state=open]{animation-duration:.5s!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;left:0!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;height:.25rem!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;width:100%!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:-cj-translate-y-1\\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;--tw-translate-y: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;--tw-translate-x: 0px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[state\\=open\\]\\:hover\\:cj-bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.data-\\[state\\=open\\]\\:hover\\:cj-text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-left-\\[calc\\(var\\(--sidebar-width\\)\\*-1\\)\\]{left:calc(var(--sidebar-width) * -1)!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-right-\\[calc\\(var\\(--sidebar-width\\)\\*-1\\)\\]{right:calc(var(--sidebar-width) * -1)!important}.cj-group[data-side=left] .group-data-\\[side\\=left\\]\\:-cj-right-4{right:-1rem!important}.cj-group[data-side=right] .group-data-\\[side\\=right\\]\\:cj-left-0{left:0!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:-cj-mt-8{margin-top:-2rem!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-hidden{display:none!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-w-\\[--sidebar-width-icon\\]{width:var(--sidebar-width-icon)!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-w-\\[calc\\(var\\(--sidebar-width-icon\\)_\\+_theme\\(spacing\\.4\\)\\)\\]{width:calc(var(--sidebar-width-icon) + 1rem)!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-w-\\[calc\\(var\\(--sidebar-width-icon\\)_\\+_theme\\(spacing\\.4\\)_\\+2px\\)\\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-w-0{width:0px!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-translate-x-0{--tw-translate-x: 0px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-group[data-side=right] .group-data-\\[side\\=right\\]\\:cj-rotate-180,.cj-group[data-state=open] .group-data-\\[state\\=open\\]\\:cj-rotate-180{--tw-rotate: 180deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-overflow-hidden{overflow:hidden!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-rounded-lg{border-radius:var(--claims-journey-radius)!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-border{border-width:1px!important}.cj-group[data-side=left] .group-data-\\[side\\=left\\]\\:cj-border-r{border-right-width:1px!important}.cj-group[data-side=right] .group-data-\\[side\\=right\\]\\:cj-border-l{border-left-width:1px!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-border-sidebar-border{border-color:hsl(var(--claims-journey-sidebar-border))!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-opacity-0{opacity:0!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:after\\:cj-left-full:after{content:var(--tw-content)!important;left:100%!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:hover\\:cj-bg-sidebar:hover{background-color:hsl(var(--claims-journey-sidebar-background))!important}.cj-peer\\/menu-button[data-size=default]~.peer-data-\\[size\\=default\\]\\/menu-button\\:cj-top-1\\.5{top:.375rem!important}.cj-peer\\/menu-button[data-size=lg]~.peer-data-\\[size\\=lg\\]\\/menu-button\\:cj-top-2\\.5{top:.625rem!important}.cj-peer\\/menu-button[data-size=sm]~.peer-data-\\[size\\=sm\\]\\/menu-button\\:cj-top-1{top:.25rem!important}.cj-peer[data-variant=inset]~.peer-data-\\[variant\\=inset\\]\\:cj-min-h-\\[calc\\(100svh-theme\\(spacing\\.4\\)\\)\\]{min-height:calc(100svh - 1rem)!important}.cj-peer\\/menu-button[data-active=true]~.peer-data-\\[active\\=true\\]\\/menu-button\\:cj-text-sidebar-accent-foreground{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.dark\\:cj-border-destructive:is(.cj-dark *){border-color:hsl(var(--claims-journey-destructive))!important}.dark\\:cj-bg-blue-950:is(.cj-dark *){--tw-bg-opacity: 1 !important;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))!important}@media (min-width: 640px){.sm\\:cj-bottom-0{bottom:0!important}.sm\\:cj-right-0{right:0!important}.sm\\:cj-top-auto{top:auto!important}.sm\\:cj-mt-0{margin-top:0!important}.sm\\:cj-flex{display:flex!important}.sm\\:cj-w-\\[420px\\]{width:420px!important}.sm\\:cj-max-w-lg{max-width:32rem!important}.sm\\:cj-max-w-sm{max-width:24rem!important}.sm\\:cj-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.sm\\:cj-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.sm\\:cj-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.sm\\:cj-flex-row{flex-direction:row!important}.sm\\:cj-flex-col{flex-direction:column!important}.sm\\:cj-justify-end{justify-content:flex-end!important}.sm\\:cj-justify-between{justify-content:space-between!important}.sm\\:cj-gap-2\\.5{gap:.625rem!important}.sm\\:cj-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(.5rem * var(--tw-space-x-reverse))!important;margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))!important}.sm\\:cj-rounded-lg{border-radius:var(--claims-journey-radius)!important}.sm\\:cj-p-10{padding:2.5rem!important}.sm\\:cj-p-7{padding:1.75rem!important}.sm\\:cj-px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.sm\\:cj-text-left{text-align:left!important}.sm\\:cj-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.sm\\:cj-text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.data-\\[state\\=open\\]\\:sm\\:cj-slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100% !important}}@media (min-width: 768px){.md\\:cj-absolute{position:absolute!important}.md\\:cj-block{display:block!important}.md\\:cj-flex{display:flex!important}.md\\:cj-hidden{display:none!important}.md\\:cj-w-\\[30\\%\\]{width:30%!important}.md\\:cj-w-\\[70\\%\\]{width:70%!important}.md\\:cj-w-\\[var\\(--radix-navigation-menu-viewport-width\\)\\]{width:var(--radix-navigation-menu-viewport-width)!important}.md\\:cj-w-auto{width:auto!important}.md\\:cj-max-w-\\[420px\\]{max-width:420px!important}.md\\:cj-shrink-0{flex-shrink:0!important}.md\\:cj-flex-row{flex-direction:row!important}.md\\:cj-px-3{padding-left:.75rem!important;padding-right:.75rem!important}.md\\:cj-py-8{padding-top:2rem!important;padding-bottom:2rem!important}.md\\:cj-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.md\\:cj-opacity-0{opacity:0!important}.after\\:md\\:cj-hidden:after{content:var(--tw-content)!important;display:none!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-m-2{margin:.5rem!important}.cj-peer[data-state=collapsed][data-variant=inset]~.md\\:peer-data-\\[state\\=collapsed\\]\\:peer-data-\\[variant\\=inset\\]\\:cj-ml-2{margin-left:.5rem!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-ml-0{margin-left:0!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-rounded-xl{border-radius:.75rem!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}}.\\[\\&\\:has\\(\\[aria-selected\\]\\)\\]\\:cj-bg-accent:has([aria-selected]){background-color:hsl(var(--claims-journey-accent))!important}.first\\:\\[\\&\\:has\\(\\[aria-selected\\]\\)\\]\\:cj-rounded-l-full:has([aria-selected]):first-child{border-top-left-radius:9999px!important;border-bottom-left-radius:9999px!important}.last\\:\\[\\&\\:has\\(\\[aria-selected\\]\\)\\]\\:cj-rounded-r-full:has([aria-selected]):last-child{border-top-right-radius:9999px!important;border-bottom-right-radius:9999px!important}.\\[\\&\\:has\\(\\[aria-selected\\]\\.day-outside\\)\\]\\:cj-bg-accent\\/50:has([aria-selected].day-outside){background-color:hsl(var(--claims-journey-accent) / .5)!important}.\\[\\&\\:has\\(\\[aria-selected\\]\\.day-range-end\\)\\]\\:cj-rounded-r-full:has([aria-selected].day-range-end){border-top-right-radius:9999px!important;border-bottom-right-radius:9999px!important}.\\[\\&\\:has\\(\\[role\\=checkbox\\]\\)\\]\\:cj-pr-0:has([role=checkbox]){padding-right:0!important}.\\[\\&\\>button\\]\\:cj-hidden>button{display:none!important}.\\[\\&\\>div\\>div\\]\\:\\!cj-block>div>div{display:block!important}.\\[\\&\\>div\\]\\:\\!cj-block>div{display:block!important}.\\[\\&\\>div\\]\\:cj-w-full>div{width:100%!important}.\\[\\&\\>div\\]\\:\\!cj-min-w-0>div{min-width:0px!important}.\\[\\&\\>span\\:last-child\\]\\:cj-truncate>span:last-child{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.\\[\\&\\>span\\]\\:cj-line-clamp-1>span{overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:1!important}.\\[\\&\\>svg\\+div\\]\\:cj-translate-y-\\[-3px\\]>svg+div{--tw-translate-y: -3px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.\\[\\&\\>svg\\]\\:cj-absolute>svg{position:absolute!important}.\\[\\&\\>svg\\]\\:cj-left-4>svg{left:1rem!important}.\\[\\&\\>svg\\]\\:cj-top-4>svg{top:1rem!important}.\\[\\&\\>svg\\]\\:cj-size-3\\.5>svg{width:.875rem!important;height:.875rem!important}.\\[\\&\\>svg\\]\\:cj-size-4>svg{width:1rem!important;height:1rem!important}.\\[\\&\\>svg\\]\\:cj-h-2\\.5>svg{height:.625rem!important}.\\[\\&\\>svg\\]\\:cj-h-3>svg{height:.75rem!important}.\\[\\&\\>svg\\]\\:cj-w-2\\.5>svg{width:.625rem!important}.\\[\\&\\>svg\\]\\:cj-w-3>svg{width:.75rem!important}.\\[\\&\\>svg\\]\\:cj-shrink-0>svg{flex-shrink:0!important}.\\[\\&\\>svg\\]\\:cj-text-destructive>svg{color:hsl(var(--claims-journey-destructive))!important}.\\[\\&\\>svg\\]\\:cj-text-foreground>svg{color:hsl(var(--claims-journey-foreground))!important}.\\[\\&\\>svg\\]\\:cj-text-muted-foreground>svg{color:hsl(var(--claims-journey-muted-foreground))!important}.\\[\\&\\>svg\\]\\:cj-text-sidebar-accent-foreground>svg{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.\\[\\&\\>svg\\~\\*\\]\\:cj-pl-7>svg~*{padding-left:1.75rem!important}.\\[\\&\\>tr\\]\\:last\\:cj-border-b-0:last-child>tr{border-bottom-width:0px!important}.\\[\\&\\[data-panel-group-direction\\=vertical\\]\\>div\\]\\:cj-rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.\\[\\&\\[data-state\\=open\\]\\>svg\\]\\:cj-rotate-180[data-state=open]>svg{--tw-rotate: 180deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.\\[\\&_\\.recharts-cartesian-axis-tick_text\\]\\:cj-fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--claims-journey-muted-foreground))!important}.\\[\\&_\\.recharts-cartesian-grid_line\\[stroke\\=\\'\\#ccc\\'\\]\\]\\:cj-stroke-border\\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--claims-journey-border) / .5)!important}.\\[\\&_\\.recharts-curve\\.recharts-tooltip-cursor\\]\\:cj-stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--claims-journey-border))!important}.\\[\\&_\\.recharts-dot\\[stroke\\=\\'\\#fff\\'\\]\\]\\:cj-stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent!important}.\\[\\&_\\.recharts-layer\\]\\:cj-outline-none .recharts-layer{outline:2px solid transparent!important;outline-offset:2px!important}.\\[\\&_\\.recharts-polar-grid_\\[stroke\\=\\'\\#ccc\\'\\]\\]\\:cj-stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--claims-journey-border))!important}.\\[\\&_\\.recharts-radial-bar-background-sector\\]\\:cj-fill-muted .recharts-radial-bar-background-sector,.\\[\\&_\\.recharts-rectangle\\.recharts-tooltip-cursor\\]\\:cj-fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--claims-journey-muted))!important}.\\[\\&_\\.recharts-reference-line_\\[stroke\\=\\'\\#ccc\\'\\]\\]\\:cj-stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--claims-journey-border))!important}.\\[\\&_\\.recharts-sector\\[stroke\\=\\'\\#fff\\'\\]\\]\\:cj-stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent!important}.\\[\\&_\\.recharts-sector\\]\\:cj-outline-none .recharts-sector,.\\[\\&_\\.recharts-surface\\]\\:cj-outline-none .recharts-surface{outline:2px solid transparent!important;outline-offset:2px!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-px-2 [cmdk-group-heading]{padding-left:.5rem!important;padding-right:.5rem!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-py-1\\.5 [cmdk-group-heading]{padding-top:.375rem!important;padding-bottom:.375rem!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-text-xs [cmdk-group-heading]{font-size:.75rem!important;line-height:1rem!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-font-medium [cmdk-group-heading]{font-weight:500!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-text-muted-foreground [cmdk-group-heading]{color:hsl(var(--claims-journey-muted-foreground))!important}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:cj-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0!important}.\\[\\&_\\[cmdk-group\\]\\]\\:cj-px-2 [cmdk-group]{padding-left:.5rem!important;padding-right:.5rem!important}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:cj-h-5 [cmdk-input-wrapper] svg{height:1.25rem!important}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:cj-w-5 [cmdk-input-wrapper] svg{width:1.25rem!important}.\\[\\&_\\[cmdk-input\\]\\]\\:cj-h-12 [cmdk-input]{height:3rem!important}.\\[\\&_\\[cmdk-item\\]\\]\\:cj-px-2 [cmdk-item]{padding-left:.5rem!important;padding-right:.5rem!important}.\\[\\&_\\[cmdk-item\\]\\]\\:cj-py-3 [cmdk-item]{padding-top:.75rem!important;padding-bottom:.75rem!important}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:cj-h-5 [cmdk-item] svg{height:1.25rem!important}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:cj-w-5 [cmdk-item] svg{width:1.25rem!important}.\\[\\&_button\\]\\:cj-ring-offset-0 button,.\\[\\&_input\\]\\:cj-ring-offset-0 input{--tw-ring-offset-width: 0px !important}.\\[\\&_input\\]\\:focus-visible\\:cj-border-ring:focus-visible input{border-color:hsl(var(--claims-journey-ring))!important}.\\[\\&_input\\]\\:focus-visible\\:cj-ring-0:focus-visible input{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.\\[\\&_p\\]\\:cj-leading-relaxed p{line-height:1.625!important}.\\[\\&_svg\\]\\:cj-pointer-events-none svg{pointer-events:none!important}.\\[\\&_svg\\]\\:cj-size-4 svg{width:1rem!important;height:1rem!important}.\\[\\&_svg\\]\\:cj-shrink-0 svg{flex-shrink:0!important}.\\[\\&_tr\\:last-child\\]\\:cj-border-0 tr:last-child{border-width:0px!important}.\\[\\&_tr\\]\\:cj-border-b tr{border-bottom-width:1px!important}[data-side=left][data-collapsible=offcanvas] .\\[\\[data-side\\=left\\]\\[data-collapsible\\=offcanvas\\]_\\&\\]\\:-cj-right-2{right:-.5rem!important}[data-side=left][data-state=collapsed] .\\[\\[data-side\\=left\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cj-cursor-e-resize{cursor:e-resize!important}[data-side=left] .\\[\\[data-side\\=left\\]_\\&\\]\\:cj-cursor-w-resize{cursor:w-resize!important}[data-side=right][data-collapsible=offcanvas] .\\[\\[data-side\\=right\\]\\[data-collapsible\\=offcanvas\\]_\\&\\]\\:-cj-left-2{left:-.5rem!important}[data-side=right][data-state=collapsed] .\\[\\[data-side\\=right\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cj-cursor-w-resize{cursor:w-resize!important}[data-side=right] .\\[\\[data-side\\=right\\]_\\&\\]\\:cj-cursor-e-resize{cursor:e-resize!important}[data-state=closed]>.\\[\\[data-state\\=closed\\]\\>\\&\\]\\:cj-rotate-\\[-90deg\\]{--tw-rotate: -90deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- "use strict";var Np=Object.defineProperty;var Sp=(e,t,n)=>t in e?Np(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>Sp(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),y=require("react"),fs=require("react-dom");function Vc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const h=Vc(y),Co=Vc(fs),yi=e=>{let t;const n=new Set,r=(d,u)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const m=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,m))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d))},l=t=e(r,o,i);return i},Cp=e=>e?yi(e):yi,kp=e=>e;function Pp(e,t=kp){const n=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(n),n}const vi=e=>{const t=Cp(e),n=r=>Pp(t,r);return Object.assign(n,t),n},Ep=e=>e?vi(e):vi,Te=e=>`${e}_${Date.now()}_${Math.random().toString(36).slice(2,7)}`;function xi(){return{steps:[],fields:[],summary:{title:"Summary",show_pricing:!1,sections:[]},init:{values:{}}}}function Mp(e){return!!e&&typeof e=="object"&&"claimspec_id"in e}function bi(e){return{field_id:Te("field"),namespace:e.namespace,label:e.label,specId:e.id,schema:e.schema,options:e.options,actor:"customer",required:!1,bindings:[{target_namespace:e.namespace}],placeholder:e.placeholder??void 0,helpText:e.help_text??void 0}}function wi(e){const t=e.bindings&&e.bindings.length>0?e.bindings.map(n=>({target_namespace:n.target_namespace})):[{target_namespace:e.namespace}];return{field_id:Te("field"),namespace:e.namespace,label:e.label,specId:e.specId??"custom",schema:e.schema,options:e.options??null,actor:e.actor??"customer",required:e.required??!1,bindings:t,widget:e.widget,uploadConfig:e.uploadConfig,allowFuture:e.allowFuture}}function Gc(e){const t=(e.nodes||[]).map(a=>Dp(a)),n=new Map;(e.nodes||[]).forEach((a,s)=>n.set(a.node_id,t[s].field_id));const r=e.mode==="grouped"&&(e.groups||[]).length>0;let o;if(r){const a=Ni((e.groups||[]).map(s=>s.group_id),e.edges||[],e.start_node_id??null);o=a.map(s=>{const i=(e.groups||[]).find(u=>u.group_id===s),l=(i.sections||[]).map(u=>({row_id:Te("row"),layout:"horizontal",field_ids:u.node_ids.map(f=>n.get(f)).filter(f=>!!f)})),d=Si(s,e.edges||[],a,u=>u);return{step_id:s,title:i.title||"Step",description:"",rows:l.length>0?l:[{row_id:Te("row"),layout:"horizontal",field_ids:[]}],navigation:d}})}else{const a=Ni((e.nodes||[]).map(s=>s.node_id),e.edges||[],e.start_node_id??null);o=a.map(s=>{const i=n.get(s),l=(e.nodes||[]).find(u=>u.node_id===s),d=Si(s,e.edges||[],a,u=>u);return{step_id:s,title:l.label_override||l.label||l.question_key,description:"",rows:[{row_id:Te("row"),layout:"horizontal",field_ids:i?[i]:[]}],navigation:d}})}return{steps:o,fields:t,summary:{title:"Summary",show_pricing:!1,sections:[]},init:{values:{}}}}function Dp(e){var t;return{field_id:Te("field"),namespace:e.question_key,label:e.label_override||e.label||e.question_key,labelOverride:e.label_override,specId:e.source_property_spec_id||"custom",schema:e.schema||"v1_string",options:e.options??null,actor:e.actor||"customer",bindings:e.bindings||[{target_namespace:e.question_key}],widget:(t=e.ui)!=null&&t.widget&&e.ui.widget!=="auto"?e.ui.widget:void 0,required:!!e.required,uploadConfig:e.upload_config,allowFuture:e.allow_future}}function Ni(e,t,n){var l;if(e.length===0)return[];const r=new Set(t.map(d=>d.to_node_id)),o=n&&e.includes(n)?n:e.find(d=>!r.has(d))||e[0],a=[],s=new Set;let i=o;for(;i&&!s.has(i);){s.add(i),a.push(i);const d=t.filter(m=>m.from_node_id===i);if(d.length===0)break;const u=[...d].sort((m,p)=>(p.priority||0)-(m.priority||0)),f=u.find(m=>m.is_default);i=((f==null?void 0:f.to_node_id)||((l=u[0])==null?void 0:l.to_node_id))??null}for(const d of e)s.has(d)||a.push(d);return a}function Si(e,t,n,r){const a=t.filter(s=>s.from_node_id===e).sort((s,i)=>(i.priority||0)-(s.priority||0)).map(s=>({rule_id:Te("rule"),condition:s.condition||null,next_step_id:r(s.to_node_id),priority:s.priority||0}));if(a.length===0){const s=n.indexOf(e),i=s>=0&&s<n.length-1?r(n[s+1]):"__submit__";a.push({rule_id:Te("rule"),condition:null,next_step_id:i,priority:0})}return{rules:a}}const wt=Ep((e,t)=>{const n=()=>{const{formConfig:a,theme:s}=t();return{formConfig:JSON.parse(JSON.stringify(a)),theme:JSON.parse(JSON.stringify(s))}},r=()=>{const a=n();e({_history:[...t()._history.slice(-50),a],_future:[],isDirty:!0})},o=a=>{r(),e({formConfig:a(t().formConfig)})};return{formConfig:xi(),theme:{},activeTab:"steps",activeStepId:null,selectedFieldId:null,isDirty:!1,_history:[],_future:[],_push:r,undo:()=>{const{_history:a}=t();if(a.length===0)return;const s=a[a.length-1],i=n();e({formConfig:s.formConfig,theme:s.theme,_history:a.slice(0,-1),_future:[...t()._future,i]})},redo:()=>{const{_future:a}=t();if(a.length===0)return;const s=a[a.length-1],i=n();e({formConfig:s.formConfig,theme:s.theme,_future:a.slice(0,-1),_history:[...t()._history,i]})},canUndo:()=>t()._history.length>0,canRedo:()=>t()._future.length>0,markClean:()=>e({isDirty:!1}),setActiveTab:a=>e({activeTab:a}),setActiveStep:a=>e({activeStepId:a,selectedFieldId:null}),setSelectedField:a=>e({selectedFieldId:a}),updateTheme:a=>{r(),e({theme:{...t().theme,...a}})},resetTheme:()=>{r(),e({theme:{}})},addStep:a=>{const s=Te("step");return o(i=>({...i,steps:[...i.steps,{step_id:s,title:a||`Step ${i.steps.length+1}`,description:"",rows:[{row_id:Te("row"),layout:"horizontal",field_ids:[]}],navigation:{rules:[{rule_id:Te("rule"),condition:null,next_step_id:"__submit__",priority:0}]}}]})),e({activeStepId:s}),s},updateStep:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,...s}:l)})),deleteStep:a=>{var s;o(i=>({...i,steps:i.steps.filter(l=>l.step_id!==a).map(l=>({...l,navigation:{...l.navigation,rules:l.navigation.rules.map(d=>d.next_step_id===a?{...d,next_step_id:"__submit__"}:d)}}))})),t().activeStepId===a&&e({activeStepId:((s=t().formConfig.steps[0])==null?void 0:s.step_id)||null})},reorderSteps:a=>o(s=>({...s,steps:a.map(i=>s.steps.find(l=>l.step_id===i)).filter(i=>!!i)})),moveStep:(a,s)=>o(i=>{const l=i.steps.findIndex(f=>f.step_id===a);if(l<0)return i;const d=s==="up"?l-1:l+1;if(d<0||d>=i.steps.length)return i;const u=[...i.steps];return[u[l],u[d]]=[u[d],u[l]],{...i,steps:u}}),addRow:(a,s="horizontal")=>{const i=Te("row");return o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:[...d.rows,{row_id:i,layout:s,field_ids:[]}]}:d)})),i},updateRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:d.rows.map(u=>u.row_id===s?{...u,...i}:u)}:d)})),deleteRow:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,rows:l.rows.filter(d=>d.row_id!==s)}:l)})),moveRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>{if(d.step_id!==a)return d;const u=d.rows.findIndex(p=>p.row_id===s);if(u<0)return d;const f=i==="up"?u-1:u+1;if(f<0||f>=d.rows.length)return d;const m=[...d.rows];return[m[u],m[f]]=[m[f],m[u]],{...d,rows:m}})})),createField:a=>{const s=wi(a);return o(i=>({...i,fields:[...i.fields,s]})),s.field_id},createFieldFromSpec:a=>{const s=bi(a);return o(i=>({...i,fields:[...i.fields,s]})),s.field_id},updateField:(a,s)=>o(i=>({...i,fields:i.fields.map(l=>l.field_id===a?{...l,...s}:l)})),deleteField:a=>{o(s=>({...s,fields:s.fields.filter(i=>i.field_id!==a),steps:s.steps.map(i=>({...i,rows:i.rows.map(l=>({...l,field_ids:l.field_ids.filter(d=>d!==a)}))})),summary:{...s.summary,sections:s.summary.sections.map(i=>({...i,display_fields:i.display_fields.filter(l=>l.field_id!==a)}))}})),t().selectedFieldId===a&&e({selectedFieldId:null})},addFieldToRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:d.rows.map(u=>u.row_id===s?u.field_ids.includes(i)?u:{...u,field_ids:[...u.field_ids,i]}:u)}:d)})),addNewFieldToRow:(a,s,i)=>{const l=Mp(i)?bi(i):wi(i);return o(d=>({...d,fields:[...d.fields,l],steps:d.steps.map(u=>u.step_id===a?{...u,rows:u.rows.map(f=>f.row_id===s?{...f,field_ids:[...f.field_ids,l.field_id]}:f)}:u)})),e({selectedFieldId:l.field_id}),l.field_id},removeFieldFromRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:d.rows.map(u=>u.row_id===s?{...u,field_ids:u.field_ids.filter(f=>f!==i)}:u)}:d)})),moveFieldInRow:(a,s,i,l)=>o(d=>({...d,steps:d.steps.map(u=>u.step_id!==a?u:{...u,rows:u.rows.map(f=>{if(f.row_id!==s)return f;const m=f.field_ids.indexOf(i);if(m<0)return f;const p=l==="left"?m-1:m+1;if(p<0||p>=f.field_ids.length)return f;const j=[...f.field_ids];return[j[m],j[p]]=[j[p],j[m]],{...f,field_ids:j}})})})),updateStepNavigation:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,...s}}:l)})),setStepApiCall:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,api_call:s}}:l)})),addNavRule:a=>{const s=Te("rule");return o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,rules:[...l.navigation.rules,{rule_id:s,condition:null,next_step_id:"__submit__",priority:0}]}}:l)})),s},updateNavRule:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,navigation:{...d.navigation,rules:d.navigation.rules.map(u=>u.rule_id===s?{...u,...i}:u)}}:d)})),deleteNavRule:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,rules:l.navigation.rules.filter(d=>d.rule_id!==s)}}:l)})),updateSummary:a=>o(s=>({...s,summary:{...s.summary,...a}})),addSummarySection:a=>{const s=Te("section");return o(i=>({...i,summary:{...i.summary,sections:[...i.summary.sections,{section_id:s,title:a||"Section",display_fields:[]}]}})),s},updateSummarySection:(a,s)=>o(i=>({...i,summary:{...i.summary,sections:i.summary.sections.map(l=>l.section_id===a?{...l,...s}:l)}})),deleteSummarySection:a=>o(s=>({...s,summary:{...s.summary,sections:s.summary.sections.filter(i=>i.section_id!==a)}})),addDisplayField:(a,s="form_field")=>{const i=Te("display");return o(l=>({...l,summary:{...l.summary,sections:l.summary.sections.map(d=>d.section_id===a?{...d,display_fields:[...d.display_fields,{display_id:i,source:s,label:"",format:"text"}]}:d)}})),i},updateDisplayField:(a,s,i)=>o(l=>({...l,summary:{...l.summary,sections:l.summary.sections.map(d=>d.section_id===a?{...d,display_fields:d.display_fields.map(u=>u.display_id===s?{...u,...i}:u)}:d)}})),deleteDisplayField:(a,s)=>o(i=>({...i,summary:{...i.summary,sections:i.summary.sections.map(l=>l.section_id===a?{...l,display_fields:l.display_fields.filter(d=>d.display_id!==s)}:l)}})),updateInit:a=>o(s=>({...s,init:{...s.init,...a}})),importJourneySpec:a=>{var i;const s=a.form_config?La(a.form_config):Gc(a);e({formConfig:s,theme:a.theme||{},activeStepId:((i=s.steps[0])==null?void 0:i.step_id)||null,selectedFieldId:null,_history:[],_future:[],isDirty:!1})},loadFormConfig:(a,s)=>{var i;e({formConfig:La(a),theme:s||{},activeStepId:((i=a.steps[0])==null?void 0:i.step_id)||null,selectedFieldId:null,_history:[],_future:[],isDirty:!1})},exportJourneySpec:a=>{const{formConfig:s,theme:i}=t(),l={journey_id:(a==null?void 0:a.journey_id)||`journey_${Date.now()}`,claimspec_id:(a==null?void 0:a.claimspec_id)||"",version:(a==null?void 0:a.version)||"2.0.0",form_config:s};return i&&Object.keys(i).length>0&&(l.theme=i),l},reset:()=>{e({formConfig:xi(),theme:{},activeStepId:null,selectedFieldId:null,_history:[],_future:[],isDirty:!1})}}});function La(e){var t,n,r,o,a;return{steps:(e.steps||[]).map(s=>{var i,l,d;return{step_id:s.step_id||Te("step"),title:s.title||"Step",description:s.description||"",rows:(s.rows&&s.rows.length>0?s.rows:[{row_id:Te("row"),layout:"horizontal",field_ids:[]}]).map(u=>({row_id:u.row_id||Te("row"),layout:u.layout||"horizontal",field_ids:u.field_ids||[]})),navigation:{api_call:(i=s.navigation)==null?void 0:i.api_call,button_label:(l=s.navigation)==null?void 0:l.button_label,rules:(d=s.navigation)!=null&&d.rules&&s.navigation.rules.length>0?s.navigation.rules.map(u=>({rule_id:u.rule_id||Te("rule"),condition:u.condition||null,next_step_id:u.next_step_id||"__submit__",priority:u.priority||0})):[{rule_id:Te("rule"),condition:null,next_step_id:"__submit__",priority:0}]}}}),fields:(e.fields||[]).map(s=>({...s,field_id:s.field_id||Te("field")})),summary:{title:((t=e.summary)==null?void 0:t.title)||"Summary",show_pricing:!!((n=e.summary)!=null&&n.show_pricing),sections:(((r=e.summary)==null?void 0:r.sections)||[]).map(s=>({section_id:s.section_id||Te("section"),title:s.title||"Section",visible_from_step:s.visible_from_step,until_step:s.until_step,display_fields:(s.display_fields||[]).map(i=>({...i,display_id:i.display_id||Te("display"),format:i.format||"text"}))}))},init:{values:((o=e.init)==null?void 0:o.values)||{},api:(a=e.init)==null?void 0:a.api}}}function Ci(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pn(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Ci(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Ci(e[o],null)}}}}function he(...e){return h.useCallback(Pn(...e),e)}var Tp=Symbol.for("react.lazy"),io=h[" use ".trim().toString()];function Rp(e){return typeof e=="object"&&e!==null&&"then"in e}function Uc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Tp&&"_payload"in e&&Rp(e._payload)}function ko(e){const t=Ap(e),n=h.forwardRef((r,o)=>{let{children:a,...s}=r;Uc(a)&&typeof io=="function"&&(a=io(a._payload));const i=h.Children.toArray(a),l=i.find(Ip);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var Op=ko("Slot");function Ap(e){const t=h.forwardRef((n,r)=>{let{children:o,...a}=n;if(Uc(o)&&typeof io=="function"&&(o=io(o._payload)),h.isValidElement(o)){const s=$p(o),i=Wp(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zp=Symbol("radix.slottable");function Ip(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zp}function Wp(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function $p(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Xc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Xc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Kc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Xc(e))&&(r&&(r+=" "),r+=t);return r}const ki=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Pi=Kc,Po=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Pi(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,s=Object.keys(o).map(d=>{const u=n==null?void 0:n[d],f=a==null?void 0:a[d];if(u===null)return null;const m=ki(u)||ki(f);return o[d][m]}),i=n&&Object.entries(n).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...p}=u;return Object.entries(p).every(j=>{let[_,g]=j;return Array.isArray(g)?g.includes({...a,...i}[_]):{...a,...i}[_]===g})?[...d,f,m]:d},[]);return Pi(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},ms="-",Fp=e=>{const t=Bp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const i=s.split(ms);return i[0]===""&&i.length!==1&&i.shift(),Jc(i,t)||Lp(s)},getConflictingClassGroupIds:(s,i)=>{const l=n[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},Jc=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Jc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(ms);return(s=t.validators.find(({validator:i})=>i(a)))==null?void 0:s.classGroupId},Ei=/^\[(.+)\]$/,Lp=e=>{if(Ei.test(e)){const t=Ei.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Bp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Yp(Object.entries(e.classGroups),n).forEach(([a,s])=>{Ba(s,r,a,t)}),r},Ba=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:Mi(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(Hp(o)){Ba(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,s])=>{Ba(s,Mi(t,a),n,r)})})},Mi=(e,t)=>{let n=e;return t.split(ms).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Hp=e=>e.isThemeGetter,Yp=(e,t)=>t?e.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,i])=>[t+s,i])):a);return[n,o]}):e,qp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return o(a,s),s},set(a,s){n.has(a)?n.set(a,s):o(a,s)}}},Qc="!",Vp=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],a=t.length,s=i=>{const l=[];let d=0,u=0,f;for(let g=0;g<i.length;g++){let v=i[g];if(d===0){if(v===o&&(r||i.slice(g,g+a)===t)){l.push(i.slice(u,g)),u=g+a;continue}if(v==="/"){f=g;continue}}v==="["?d++:v==="]"&&d--}const m=l.length===0?i:i.substring(u),p=m.startsWith(Qc),j=p?m.substring(1):m,_=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:j,maybePostfixModifierPosition:_}};return n?i=>n({className:i,parseClassName:s}):s},Gp=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Up=e=>({cache:qp(e.cacheSize),parseClassName:Vp(e),...Fp(e)}),Xp=/\s+/,Kp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],s=e.trim().split(Xp);let i="";for(let l=s.length-1;l>=0;l-=1){const d=s[l],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=n(d);let j=!!p,_=r(j?m.substring(0,p):m);if(!_){if(!j){i=d+(i.length>0?" "+i:i);continue}if(_=r(m),!_){i=d+(i.length>0?" "+i:i);continue}j=!1}const g=Gp(u).join(":"),v=f?g+Qc:g,x=v+_;if(a.includes(x))continue;a.push(x);const b=o(_,j);for(let w=0;w<b.length;++w){const S=b[w];a.push(v+S)}i=d+(i.length>0?" "+i:i)}return i};function Jp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Zc(t))&&(r&&(r+=" "),r+=n);return r}const Zc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Di(e,...t){let n,r,o,a=s;function s(l){const d=t.reduce((u,f)=>f(u),e());return n=Up(d),r=n.cache.get,o=n.cache.set,a=i,i(l)}function i(l){const d=r(l);if(d)return d;const u=Kp(l,n);return o(l,u),u}return function(){return a(Jp.apply(null,arguments))}}const Ce=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},el=/^\[(?:([a-z-]+):)?(.+)\]$/i,Qp=/^\d+\/\d+$/,Zp=new Set(["px","full","screen"]),eh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,th=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wt=e=>Bn(e)||Zp.has(e)||Qp.test(e),Qt=e=>Qn(e,"length",fh),Bn=e=>!!e&&!Number.isNaN(Number(e)),pa=e=>Qn(e,"number",Bn),cr=e=>!!e&&Number.isInteger(Number(e)),ah=e=>e.endsWith("%")&&Bn(e.slice(0,-1)),de=e=>el.test(e),Zt=e=>eh.test(e),sh=new Set(["length","size","percentage"]),ih=e=>Qn(e,sh,tl),ch=e=>Qn(e,"position",tl),lh=new Set(["image","url"]),dh=e=>Qn(e,lh,ph),uh=e=>Qn(e,"",mh),lr=()=>!0,Qn=(e,t,n)=>{const r=el.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},fh=e=>th.test(e)&&!nh.test(e),tl=()=>!1,mh=e=>rh.test(e),ph=e=>oh.test(e),Ti=()=>{const e=Ce("colors"),t=Ce("spacing"),n=Ce("blur"),r=Ce("brightness"),o=Ce("borderColor"),a=Ce("borderRadius"),s=Ce("borderSpacing"),i=Ce("borderWidth"),l=Ce("contrast"),d=Ce("grayscale"),u=Ce("hueRotate"),f=Ce("invert"),m=Ce("gap"),p=Ce("gradientColorStops"),j=Ce("gradientColorStopPositions"),_=Ce("inset"),g=Ce("margin"),v=Ce("opacity"),x=Ce("padding"),b=Ce("saturate"),w=Ce("scale"),S=Ce("sepia"),N=Ce("skew"),C=Ce("space"),E=Ce("translate"),k=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",de,t],T=()=>[de,t],$=()=>["",Wt,Qt],A=()=>["auto",Bn,de],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",de],oe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[Bn,de];return{cacheSize:500,separator:":",theme:{colors:[lr],spacing:[Wt,Qt],blur:["none","",Zt,de],brightness:le(),borderColor:[e],borderRadius:["none","","full",Zt,de],borderSpacing:T(),borderWidth:$(),contrast:le(),grayscale:z(),hueRotate:le(),invert:z(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[ah,Qt],inset:D(),margin:D(),opacity:le(),padding:T(),saturate:le(),scale:le(),sepia:z(),skew:le(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[Zt]}],"break-after":[{"break-after":oe()}],"break-before":[{"break-before":oe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),de]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",cr,de]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",cr,de]}],"grid-cols":[{"grid-cols":[lr]}],"col-start-end":[{col:["auto",{span:["full",cr,de]},de]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[lr]}],"row-start-end":[{row:["auto",{span:[cr,de]},de]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[Zt]},Zt]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zt,Qt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",pa]}],"font-family":[{font:[lr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",de]}],"line-clamp":[{"line-clamp":["none",Bn,pa]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wt,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wt,Qt]}],"underline-offset":[{"underline-offset":["auto",Wt,de]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),ch]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ih]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[Wt,de]}],"outline-w":[{outline:[Wt,Qt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Wt,Qt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zt,uh]}],"shadow-color":[{shadow:[lr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Zt,de]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:le()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:le()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[cr,de]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wt,Qt,pa]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},hh=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:o,extend:a={},override:s={}})=>{fr(e,"cacheSize",t),fr(e,"prefix",n),fr(e,"separator",r),fr(e,"experimentalParseClassName",o);for(const i in s)_h(e[i],s[i]);for(const i in a)gh(e[i],a[i]);return e},fr=(e,t,n)=>{n!==void 0&&(e[t]=n)},_h=(e,t)=>{if(t)for(const n in t)fr(e,n,t[n])},gh=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},jh=(e,...t)=>typeof e=="function"?Di(Ti,e,...t):Di(()=>hh(Ti(),e),...t),yh=jh({prefix:"cj-"});function ne(...e){return yh(Kc(e))}const ps=Po("cj-inline-flex cj-items-center cj-justify-center cj-gap-2 cj-whitespace-nowrap cj-rounded-md cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-colors focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50 [&_svg]:cj-pointer-events-none [&_svg]:cj-size-4 [&_svg]:cj-shrink-0",{variants:{variant:{default:"cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/90",destructive:"cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/90",outline:"cj-border cj-border-input cj-bg-background hover:cj-bg-accent hover:cj-text-accent-foreground",secondary:"cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",ghost:"hover:cj-bg-accent hover:cj-text-accent-foreground",link:"cj-text-primary cj-underline-offset-4 hover:cj-underline"},size:{default:"cj-h-12 cj-px-4 cj-py-2",sm:"cj-h-10 cj-rounded-md cj-px-3",lg:"cj-h-14 cj-rounded-md cj-px-8",icon:"cj-h-12 cj-w-12"}},defaultVariants:{variant:"default",size:"default"}}),Z=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const s=r?Op:"button";return c.jsx(s,{className:ne(ps({variant:t,size:n,className:e})),ref:a,...o})});Z.displayName="Button";const vh=Po("cj-inline-flex cj-items-center cj-rounded-full cj-border cj-px-2.5 cj-py-0.5 cj-text-xs cj-font-semibold cj-transition-colors focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2",{variants:{variant:{default:"cj-border-transparent cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/80",secondary:"cj-border-transparent cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",destructive:"cj-border-transparent cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/80",outline:"cj-text-foreground"}},defaultVariants:{variant:"default"}});function jt({className:e,variant:t,...n}){return c.jsx("div",{className:ne(vh({variant:t}),e),...n})}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function xh(e,t){const n=h.createContext(t),r=a=>{const{children:s,...i}=a,l=h.useMemo(()=>i,Object.values(i));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(a){const s=h.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function st(e,t=[]){let n=[];function r(a,s){const i=h.createContext(s),l=n.length;n=[...n,s];const d=f=>{var v;const{scope:m,children:p,...j}=f,_=((v=m==null?void 0:m[e])==null?void 0:v[l])||i,g=h.useMemo(()=>j,Object.values(j));return c.jsx(_.Provider,{value:g,children:p})};d.displayName=a+"Provider";function u(f,m){var _;const p=((_=m==null?void 0:m[e])==null?void 0:_[l])||i,j=h.useContext(p);if(j)return j;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[d,u]}const o=()=>{const a=n.map(s=>h.createContext(s));return function(i){const l=(i==null?void 0:i[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,bh(o,...t)]}function bh(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((i,{useScope:l,scopeName:d})=>{const f=l(a)[`__scope${d}`];return{...i,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ri(e){const t=wh(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Sh);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function wh(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=kh(o),i=Ch(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nh=Symbol("radix.slottable");function Sh(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nh}function Ch(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function kh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function nl(e){const t=e+"CollectionProvider",[n,r]=st(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=_=>{const{scope:g,children:v}=_,x=y.useRef(null),b=y.useRef(new Map).current;return c.jsx(o,{scope:g,itemMap:b,collectionRef:x,children:v})};s.displayName=t;const i=e+"CollectionSlot",l=Ri(i),d=y.forwardRef((_,g)=>{const{scope:v,children:x}=_,b=a(i,v),w=he(g,b.collectionRef);return c.jsx(l,{ref:w,children:x})});d.displayName=i;const u=e+"CollectionItemSlot",f="data-radix-collection-item",m=Ri(u),p=y.forwardRef((_,g)=>{const{scope:v,children:x,...b}=_,w=y.useRef(null),S=he(g,w),N=a(u,v);return y.useEffect(()=>(N.itemMap.set(w,{ref:w,...b}),()=>void N.itemMap.delete(w))),c.jsx(m,{[f]:"",ref:S,children:x})});p.displayName=u;function j(_){const g=a(e+"CollectionConsumer",_);return y.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(g.itemMap.values()).sort((N,C)=>b.indexOf(N.ref.current)-b.indexOf(C.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:s,Slot:d,ItemSlot:p},j,r]}var Ye=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Ph=h[" useId ".trim().toString()]||(()=>{}),Eh=0;function Dt(e){const[t,n]=h.useState(Ph());return Ye(()=>{n(r=>r??String(Eh++))},[e]),t?`radix-${t}`:""}function Mh(e){const t=Dh(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Rh);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Dh(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=Ah(o),i=Oh(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Th=Symbol("radix.slottable");function Rh(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Th}function Oh(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Ah(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],se=zh.reduce((e,t)=>{const n=Mh(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ih(e,t){e&&Co.flushSync(()=>e.dispatchEvent(t))}function Ue(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Wh=h[" useInsertionEffect ".trim().toString()]||Ye;function Ht({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,s]=$h({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const f=u.current;f!==i&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,r])}const d=h.useCallback(u=>{var f;if(i){const m=Fh(u)?u(e):u;m!==e&&((f=s.current)==null||f.call(s,m))}else a(u)},[i,e,a,s]);return[l,d]}function $h({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),a=h.useRef(t);return Wh(()=>{a.current=t},[t]),h.useEffect(()=>{var s;o.current!==n&&((s=a.current)==null||s.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Fh(e){return typeof e=="function"}var Lh=h.createContext(void 0);function kr(e){const t=h.useContext(Lh);return e||t||"ltr"}var ha="rovingFocusGroup.onEntryFocus",Bh={bubbles:!1,cancelable:!0},Pr="RovingFocusGroup",[Ha,rl,Hh]=nl(Pr),[Yh,Eo]=st(Pr,[Hh]),[qh,Vh]=Yh(Pr),ol=h.forwardRef((e,t)=>c.jsx(Ha.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Ha.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Gh,{...e,ref:t})})}));ol.displayName=Pr;var Gh=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,m=h.useRef(null),p=he(t,m),j=kr(a),[_,g]=Ht({prop:s,defaultProp:i??null,onChange:l,caller:Pr}),[v,x]=h.useState(!1),b=Ue(d),w=rl(n),S=h.useRef(!1),[N,C]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ha,b),()=>E.removeEventListener(ha,b)},[b]),c.jsx(qh,{scope:n,orientation:r,dir:j,loop:o,currentTabStopId:_,onItemFocus:h.useCallback(E=>g(E),[g]),onItemShiftTab:h.useCallback(()=>x(!0),[]),onFocusableItemAdd:h.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>C(E=>E-1),[]),children:c.jsx(se.div,{tabIndex:v||N===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{S.current=!0}),onFocus:re(e.onFocus,E=>{const k=!S.current;if(E.target===E.currentTarget&&k&&!v){const M=new CustomEvent(ha,Bh);if(E.currentTarget.dispatchEvent(M),!M.defaultPrevented){const D=w().filter(W=>W.focusable),T=D.find(W=>W.active),$=D.find(W=>W.id===_),H=[T,$,...D].filter(Boolean).map(W=>W.ref.current);il(H,u)}}S.current=!1}),onBlur:re(e.onBlur,()=>x(!1))})})}),al="RovingFocusGroupItem",sl=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...i}=e,l=Dt(),d=a||l,u=Vh(al,n),f=u.currentTabStopId===d,m=rl(n),{onFocusableItemAdd:p,onFocusableItemRemove:j,currentTabStopId:_}=u;return h.useEffect(()=>{if(r)return p(),()=>j()},[r,p,j]),c.jsx(Ha.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:c.jsx(se.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:re(e.onMouseDown,g=>{r?u.onItemFocus(d):g.preventDefault()}),onFocus:re(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:re(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=Kh(g,u.orientation,u.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=m().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const w=b.indexOf(g.currentTarget);b=u.loop?Jh(b,w+1):b.slice(w+1)}setTimeout(()=>il(b))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:_!=null}):s})})});sl.displayName=al;var Uh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Xh(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Kh(e,t,n){const r=Xh(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Uh[r]}function il(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Jh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cl=ol,ll=sl;function Qh(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var it=e=>{const{present:t,children:n}=e,r=Zh(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),a=he(r.ref,e_(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:a}):null};it.displayName="Presence";function Zh(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),a=h.useRef("none"),s=e?"mounted":"unmounted",[i,l]=Qh(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=Hr(r.current);a.current=i==="mounted"?d:"none"},[i]),Ye(()=>{const d=r.current,u=o.current;if(u!==e){const m=a.current,p=Hr(d);e?l("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ye(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=p=>{const _=Hr(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&_&&(l("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},m=p=>{p.target===t&&(a.current=Hr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:h.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Hr(e){return(e==null?void 0:e.animationName)||"none"}function e_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mo="Tabs",[t_]=st(Mo,[Eo]),dl=Eo(),[n_,hs]=t_(Mo),ul=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:i,activationMode:l="automatic",...d}=e,u=kr(i),[f,m]=Ht({prop:r,onChange:o,defaultProp:a??"",caller:Mo});return c.jsx(n_,{scope:n,baseId:Dt(),value:f,onValueChange:m,orientation:s,dir:u,activationMode:l,children:c.jsx(se.div,{dir:u,"data-orientation":s,...d,ref:t})})});ul.displayName=Mo;var fl="TabsList",ml=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,a=hs(fl,n),s=dl(n);return c.jsx(cl,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:c.jsx(se.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});ml.displayName=fl;var pl="TabsTrigger",hl=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=e,s=hs(pl,n),i=dl(n),l=jl(s.baseId,r),d=yl(s.baseId,r),u=r===s.value;return c.jsx(ll,{asChild:!0,...i,focusable:!o,active:u,children:c.jsx(se.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:re(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:re(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:re(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})})});hl.displayName=pl;var _l="TabsContent",gl=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=e,i=hs(_l,n),l=jl(i.baseId,r),d=yl(i.baseId,r),u=r===i.value,f=h.useRef(u);return h.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),c.jsx(it,{present:o||u,children:({present:m})=>c.jsx(se.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&a})})});gl.displayName=_l;function jl(e,t){return`${e}-trigger-${t}`}function yl(e,t){return`${e}-content-${t}`}var r_=ul,vl=ml,xl=hl,bl=gl;const o_=r_,wl=h.forwardRef(({className:e,...t},n)=>c.jsx(vl,{ref:n,className:ne("cj-inline-flex cj-h-10 cj-items-center cj-justify-center cj-rounded-md cj-bg-muted cj-p-1 cj-text-muted-foreground",e),...t}));wl.displayName=vl.displayName;const mr=h.forwardRef(({className:e,...t},n)=>c.jsx(xl,{ref:n,className:ne("cj-inline-flex cj-items-center cj-justify-center cj-whitespace-nowrap cj-rounded-sm cj-px-3 cj-py-1.5 cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-all data-[state=active]:cj-bg-background data-[state=active]:cj-text-foreground data-[state=active]:cj-shadow-sm focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50",e),...t}));mr.displayName=xl.displayName;const a_=h.forwardRef(({className:e,...t},n)=>c.jsx(bl,{ref:n,className:ne("cj-mt-2 cj-ring-offset-background focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2",e),...t}));a_.displayName=bl.displayName;/**
2
+ "use strict";var Np=Object.defineProperty;var Sp=(e,t,n)=>t in e?Np(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>Sp(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),v=require("react"),fs=require("react-dom");function Vc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const h=Vc(v),Co=Vc(fs),yi=e=>{let t;const n=new Set,r=(d,u)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const m=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,m))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d))},l=t=e(r,o,i);return i},Cp=e=>e?yi(e):yi,kp=e=>e;function Pp(e,t=kp){const n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}const vi=e=>{const t=Cp(e),n=r=>Pp(t,r);return Object.assign(n,t),n},Ep=e=>e?vi(e):vi,Te=e=>`${e}_${Date.now()}_${Math.random().toString(36).slice(2,7)}`;function xi(){return{steps:[],fields:[],summary:{title:"Summary",show_pricing:!1,sections:[]},init:{values:{}}}}function Mp(e){return!!e&&typeof e=="object"&&"claimspec_id"in e}function bi(e){return{field_id:Te("field"),namespace:e.namespace,label:e.label,specId:e.id,schema:e.schema,options:e.options,actor:"customer",required:!1,bindings:[{target_namespace:e.namespace}],placeholder:e.placeholder??void 0,helpText:e.help_text??void 0}}function wi(e){const t=e.bindings&&e.bindings.length>0?e.bindings.map(n=>({target_namespace:n.target_namespace})):[{target_namespace:e.namespace}];return{field_id:Te("field"),namespace:e.namespace,label:e.label,specId:e.specId??"custom",schema:e.schema,options:e.options??null,actor:e.actor??"customer",required:e.required??!1,bindings:t,widget:e.widget,uploadConfig:e.uploadConfig,allowFuture:e.allowFuture}}function Gc(e){const t=(e.nodes||[]).map(a=>Dp(a)),n=new Map;(e.nodes||[]).forEach((a,s)=>n.set(a.node_id,t[s].field_id));const r=e.mode==="grouped"&&(e.groups||[]).length>0;let o;if(r){const a=Ni((e.groups||[]).map(s=>s.group_id),e.edges||[],e.start_node_id??null);o=a.map(s=>{const i=(e.groups||[]).find(u=>u.group_id===s),l=(i.sections||[]).map(u=>({row_id:Te("row"),layout:"horizontal",field_ids:u.node_ids.map(f=>n.get(f)).filter(f=>!!f)})),d=Si(s,e.edges||[],a,u=>u);return{step_id:s,title:i.title||"Step",description:"",rows:l.length>0?l:[{row_id:Te("row"),layout:"horizontal",field_ids:[]}],navigation:d}})}else{const a=Ni((e.nodes||[]).map(s=>s.node_id),e.edges||[],e.start_node_id??null);o=a.map(s=>{const i=n.get(s),l=(e.nodes||[]).find(u=>u.node_id===s),d=Si(s,e.edges||[],a,u=>u);return{step_id:s,title:l.label_override||l.label||l.question_key,description:"",rows:[{row_id:Te("row"),layout:"horizontal",field_ids:i?[i]:[]}],navigation:d}})}return{steps:o,fields:t,summary:{title:"Summary",show_pricing:!1,sections:[]},init:{values:{}}}}function Dp(e){var t;return{field_id:Te("field"),namespace:e.question_key,label:e.label_override||e.label||e.question_key,labelOverride:e.label_override,specId:e.source_property_spec_id||"custom",schema:e.schema||"v1_string",options:e.options??null,actor:e.actor||"customer",bindings:e.bindings||[{target_namespace:e.question_key}],widget:(t=e.ui)!=null&&t.widget&&e.ui.widget!=="auto"?e.ui.widget:void 0,required:!!e.required,uploadConfig:e.upload_config,allowFuture:e.allow_future}}function Ni(e,t,n){var l;if(e.length===0)return[];const r=new Set(t.map(d=>d.to_node_id)),o=n&&e.includes(n)?n:e.find(d=>!r.has(d))||e[0],a=[],s=new Set;let i=o;for(;i&&!s.has(i);){s.add(i),a.push(i);const d=t.filter(m=>m.from_node_id===i);if(d.length===0)break;const u=[...d].sort((m,p)=>(p.priority||0)-(m.priority||0)),f=u.find(m=>m.is_default);i=((f==null?void 0:f.to_node_id)||((l=u[0])==null?void 0:l.to_node_id))??null}for(const d of e)s.has(d)||a.push(d);return a}function Si(e,t,n,r){const a=t.filter(s=>s.from_node_id===e).sort((s,i)=>(i.priority||0)-(s.priority||0)).map(s=>({rule_id:Te("rule"),condition:s.condition||null,next_step_id:r(s.to_node_id),priority:s.priority||0}));if(a.length===0){const s=n.indexOf(e),i=s>=0&&s<n.length-1?r(n[s+1]):"__submit__";a.push({rule_id:Te("rule"),condition:null,next_step_id:i,priority:0})}return{rules:a}}const wt=Ep((e,t)=>{const n=()=>{const{formConfig:a,theme:s}=t();return{formConfig:JSON.parse(JSON.stringify(a)),theme:JSON.parse(JSON.stringify(s))}},r=()=>{const a=n();e({_history:[...t()._history.slice(-50),a],_future:[],isDirty:!0})},o=a=>{r(),e({formConfig:a(t().formConfig)})};return{formConfig:xi(),theme:{},activeTab:"steps",activeStepId:null,selectedFieldId:null,isDirty:!1,_history:[],_future:[],_push:r,undo:()=>{const{_history:a}=t();if(a.length===0)return;const s=a[a.length-1],i=n();e({formConfig:s.formConfig,theme:s.theme,_history:a.slice(0,-1),_future:[...t()._future,i]})},redo:()=>{const{_future:a}=t();if(a.length===0)return;const s=a[a.length-1],i=n();e({formConfig:s.formConfig,theme:s.theme,_future:a.slice(0,-1),_history:[...t()._history,i]})},canUndo:()=>t()._history.length>0,canRedo:()=>t()._future.length>0,markClean:()=>e({isDirty:!1}),setActiveTab:a=>e({activeTab:a}),setActiveStep:a=>e({activeStepId:a,selectedFieldId:null}),setSelectedField:a=>e({selectedFieldId:a}),updateTheme:a=>{r(),e({theme:{...t().theme,...a}})},resetTheme:()=>{r(),e({theme:{}})},addStep:a=>{const s=Te("step");return o(i=>({...i,steps:[...i.steps,{step_id:s,title:a||`Step ${i.steps.length+1}`,description:"",rows:[{row_id:Te("row"),layout:"horizontal",field_ids:[]}],navigation:{rules:[{rule_id:Te("rule"),condition:null,next_step_id:"__submit__",priority:0}]}}]})),e({activeStepId:s}),s},updateStep:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,...s}:l)})),deleteStep:a=>{var s;o(i=>({...i,steps:i.steps.filter(l=>l.step_id!==a).map(l=>({...l,navigation:{...l.navigation,rules:l.navigation.rules.map(d=>d.next_step_id===a?{...d,next_step_id:"__submit__"}:d)}}))})),t().activeStepId===a&&e({activeStepId:((s=t().formConfig.steps[0])==null?void 0:s.step_id)||null})},reorderSteps:a=>o(s=>({...s,steps:a.map(i=>s.steps.find(l=>l.step_id===i)).filter(i=>!!i)})),moveStep:(a,s)=>o(i=>{const l=i.steps.findIndex(f=>f.step_id===a);if(l<0)return i;const d=s==="up"?l-1:l+1;if(d<0||d>=i.steps.length)return i;const u=[...i.steps];return[u[l],u[d]]=[u[d],u[l]],{...i,steps:u}}),addRow:(a,s="horizontal")=>{const i=Te("row");return o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:[...d.rows,{row_id:i,layout:s,field_ids:[]}]}:d)})),i},updateRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:d.rows.map(u=>u.row_id===s?{...u,...i}:u)}:d)})),deleteRow:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,rows:l.rows.filter(d=>d.row_id!==s)}:l)})),moveRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>{if(d.step_id!==a)return d;const u=d.rows.findIndex(p=>p.row_id===s);if(u<0)return d;const f=i==="up"?u-1:u+1;if(f<0||f>=d.rows.length)return d;const m=[...d.rows];return[m[u],m[f]]=[m[f],m[u]],{...d,rows:m}})})),createField:a=>{const s=wi(a);return o(i=>({...i,fields:[...i.fields,s]})),s.field_id},createFieldFromSpec:a=>{const s=bi(a);return o(i=>({...i,fields:[...i.fields,s]})),s.field_id},updateField:(a,s)=>o(i=>({...i,fields:i.fields.map(l=>l.field_id===a?{...l,...s}:l)})),deleteField:a=>{o(s=>({...s,fields:s.fields.filter(i=>i.field_id!==a),steps:s.steps.map(i=>({...i,rows:i.rows.map(l=>({...l,field_ids:l.field_ids.filter(d=>d!==a)}))})),summary:{...s.summary,sections:s.summary.sections.map(i=>({...i,display_fields:i.display_fields.filter(l=>l.field_id!==a)}))}})),t().selectedFieldId===a&&e({selectedFieldId:null})},addFieldToRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:d.rows.map(u=>u.row_id===s?u.field_ids.includes(i)?u:{...u,field_ids:[...u.field_ids,i]}:u)}:d)})),addNewFieldToRow:(a,s,i)=>{const l=Mp(i)?bi(i):wi(i);return o(d=>({...d,fields:[...d.fields,l],steps:d.steps.map(u=>u.step_id===a?{...u,rows:u.rows.map(f=>f.row_id===s?{...f,field_ids:[...f.field_ids,l.field_id]}:f)}:u)})),e({selectedFieldId:l.field_id}),l.field_id},removeFieldFromRow:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,rows:d.rows.map(u=>u.row_id===s?{...u,field_ids:u.field_ids.filter(f=>f!==i)}:u)}:d)})),moveFieldInRow:(a,s,i,l)=>o(d=>({...d,steps:d.steps.map(u=>u.step_id!==a?u:{...u,rows:u.rows.map(f=>{if(f.row_id!==s)return f;const m=f.field_ids.indexOf(i);if(m<0)return f;const p=l==="left"?m-1:m+1;if(p<0||p>=f.field_ids.length)return f;const g=[...f.field_ids];return[g[m],g[p]]=[g[p],g[m]],{...f,field_ids:g}})})})),updateStepNavigation:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,...s}}:l)})),setStepApiCall:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,api_call:s}}:l)})),addNavRule:a=>{const s=Te("rule");return o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,rules:[...l.navigation.rules,{rule_id:s,condition:null,next_step_id:"__submit__",priority:0}]}}:l)})),s},updateNavRule:(a,s,i)=>o(l=>({...l,steps:l.steps.map(d=>d.step_id===a?{...d,navigation:{...d.navigation,rules:d.navigation.rules.map(u=>u.rule_id===s?{...u,...i}:u)}}:d)})),deleteNavRule:(a,s)=>o(i=>({...i,steps:i.steps.map(l=>l.step_id===a?{...l,navigation:{...l.navigation,rules:l.navigation.rules.filter(d=>d.rule_id!==s)}}:l)})),updateSummary:a=>o(s=>({...s,summary:{...s.summary,...a}})),addSummarySection:a=>{const s=Te("section");return o(i=>({...i,summary:{...i.summary,sections:[...i.summary.sections,{section_id:s,title:a||"Section",display_fields:[]}]}})),s},updateSummarySection:(a,s)=>o(i=>({...i,summary:{...i.summary,sections:i.summary.sections.map(l=>l.section_id===a?{...l,...s}:l)}})),deleteSummarySection:a=>o(s=>({...s,summary:{...s.summary,sections:s.summary.sections.filter(i=>i.section_id!==a)}})),addDisplayField:(a,s="form_field")=>{const i=Te("display");return o(l=>({...l,summary:{...l.summary,sections:l.summary.sections.map(d=>d.section_id===a?{...d,display_fields:[...d.display_fields,{display_id:i,source:s,label:"",format:"text"}]}:d)}})),i},updateDisplayField:(a,s,i)=>o(l=>({...l,summary:{...l.summary,sections:l.summary.sections.map(d=>d.section_id===a?{...d,display_fields:d.display_fields.map(u=>u.display_id===s?{...u,...i}:u)}:d)}})),deleteDisplayField:(a,s)=>o(i=>({...i,summary:{...i.summary,sections:i.summary.sections.map(l=>l.section_id===a?{...l,display_fields:l.display_fields.filter(d=>d.display_id!==s)}:l)}})),updateInit:a=>o(s=>({...s,init:{...s.init,...a}})),importJourneySpec:a=>{var i;const s=a.form_config?La(a.form_config):Gc(a);e({formConfig:s,theme:a.theme||{},activeStepId:((i=s.steps[0])==null?void 0:i.step_id)||null,selectedFieldId:null,_history:[],_future:[],isDirty:!1})},loadFormConfig:(a,s)=>{var i;e({formConfig:La(a),theme:s||{},activeStepId:((i=a.steps[0])==null?void 0:i.step_id)||null,selectedFieldId:null,_history:[],_future:[],isDirty:!1})},exportJourneySpec:a=>{const{formConfig:s,theme:i}=t(),l={journey_id:(a==null?void 0:a.journey_id)||`journey_${Date.now()}`,claimspec_id:(a==null?void 0:a.claimspec_id)||"",version:(a==null?void 0:a.version)||"2.0.0",form_config:s};return i&&Object.keys(i).length>0&&(l.theme=i),l},reset:()=>{e({formConfig:xi(),theme:{},activeStepId:null,selectedFieldId:null,_history:[],_future:[],isDirty:!1})}}});function La(e){var t,n,r,o,a;return{steps:(e.steps||[]).map(s=>{var i,l,d;return{step_id:s.step_id||Te("step"),title:s.title||"Step",description:s.description||"",rows:(s.rows&&s.rows.length>0?s.rows:[{row_id:Te("row"),layout:"horizontal",field_ids:[]}]).map(u=>({row_id:u.row_id||Te("row"),layout:u.layout||"horizontal",field_ids:u.field_ids||[]})),navigation:{api_call:(i=s.navigation)==null?void 0:i.api_call,button_label:(l=s.navigation)==null?void 0:l.button_label,rules:(d=s.navigation)!=null&&d.rules&&s.navigation.rules.length>0?s.navigation.rules.map(u=>({rule_id:u.rule_id||Te("rule"),condition:u.condition||null,next_step_id:u.next_step_id||"__submit__",priority:u.priority||0})):[{rule_id:Te("rule"),condition:null,next_step_id:"__submit__",priority:0}]}}}),fields:(e.fields||[]).map(s=>({...s,field_id:s.field_id||Te("field")})),summary:{title:((t=e.summary)==null?void 0:t.title)||"Summary",show_pricing:!!((n=e.summary)!=null&&n.show_pricing),sections:(((r=e.summary)==null?void 0:r.sections)||[]).map(s=>({section_id:s.section_id||Te("section"),title:s.title||"Section",visible_from_step:s.visible_from_step,until_step:s.until_step,display_fields:(s.display_fields||[]).map(i=>({...i,display_id:i.display_id||Te("display"),format:i.format||"text"}))}))},init:{values:((o=e.init)==null?void 0:o.values)||{},api:(a=e.init)==null?void 0:a.api}}}function Ci(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pn(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Ci(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Ci(e[o],null)}}}}function he(...e){return h.useCallback(Pn(...e),e)}var Tp=Symbol.for("react.lazy"),io=h[" use ".trim().toString()];function Rp(e){return typeof e=="object"&&e!==null&&"then"in e}function Uc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Tp&&"_payload"in e&&Rp(e._payload)}function ko(e){const t=Ap(e),n=h.forwardRef((r,o)=>{let{children:a,...s}=r;Uc(a)&&typeof io=="function"&&(a=io(a._payload));const i=h.Children.toArray(a),l=i.find(Ip);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var Op=ko("Slot");function Ap(e){const t=h.forwardRef((n,r)=>{let{children:o,...a}=n;if(Uc(o)&&typeof io=="function"&&(o=io(o._payload)),h.isValidElement(o)){const s=$p(o),i=Wp(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zp=Symbol("radix.slottable");function Ip(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zp}function Wp(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function $p(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Xc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Xc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Kc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Xc(e))&&(r&&(r+=" "),r+=t);return r}const ki=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Pi=Kc,Po=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Pi(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,s=Object.keys(o).map(d=>{const u=n==null?void 0:n[d],f=a==null?void 0:a[d];if(u===null)return null;const m=ki(u)||ki(f);return o[d][m]}),i=n&&Object.entries(n).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...p}=u;return Object.entries(p).every(g=>{let[_,j]=g;return Array.isArray(j)?j.includes({...a,...i}[_]):{...a,...i}[_]===j})?[...d,f,m]:d},[]);return Pi(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},ms="-",Fp=e=>{const t=Bp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const i=s.split(ms);return i[0]===""&&i.length!==1&&i.shift(),Jc(i,t)||Lp(s)},getConflictingClassGroupIds:(s,i)=>{const l=n[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},Jc=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Jc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(ms);return(s=t.validators.find(({validator:i})=>i(a)))==null?void 0:s.classGroupId},Ei=/^\[(.+)\]$/,Lp=e=>{if(Ei.test(e)){const t=Ei.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Bp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Yp(Object.entries(e.classGroups),n).forEach(([a,s])=>{Ba(s,r,a,t)}),r},Ba=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:Mi(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(Hp(o)){Ba(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,s])=>{Ba(s,Mi(t,a),n,r)})})},Mi=(e,t)=>{let n=e;return t.split(ms).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Hp=e=>e.isThemeGetter,Yp=(e,t)=>t?e.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,i])=>[t+s,i])):a);return[n,o]}):e,qp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return o(a,s),s},set(a,s){n.has(a)?n.set(a,s):o(a,s)}}},Qc="!",Vp=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],a=t.length,s=i=>{const l=[];let d=0,u=0,f;for(let j=0;j<i.length;j++){let y=i[j];if(d===0){if(y===o&&(r||i.slice(j,j+a)===t)){l.push(i.slice(u,j)),u=j+a;continue}if(y==="/"){f=j;continue}}y==="["?d++:y==="]"&&d--}const m=l.length===0?i:i.substring(u),p=m.startsWith(Qc),g=p?m.substring(1):m,_=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:_}};return n?i=>n({className:i,parseClassName:s}):s},Gp=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Up=e=>({cache:qp(e.cacheSize),parseClassName:Vp(e),...Fp(e)}),Xp=/\s+/,Kp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],s=e.trim().split(Xp);let i="";for(let l=s.length-1;l>=0;l-=1){const d=s[l],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=n(d);let g=!!p,_=r(g?m.substring(0,p):m);if(!_){if(!g){i=d+(i.length>0?" "+i:i);continue}if(_=r(m),!_){i=d+(i.length>0?" "+i:i);continue}g=!1}const j=Gp(u).join(":"),y=f?j+Qc:j,x=y+_;if(a.includes(x))continue;a.push(x);const b=o(_,g);for(let w=0;w<b.length;++w){const S=b[w];a.push(y+S)}i=d+(i.length>0?" "+i:i)}return i};function Jp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Zc(t))&&(r&&(r+=" "),r+=n);return r}const Zc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Di(e,...t){let n,r,o,a=s;function s(l){const d=t.reduce((u,f)=>f(u),e());return n=Up(d),r=n.cache.get,o=n.cache.set,a=i,i(l)}function i(l){const d=r(l);if(d)return d;const u=Kp(l,n);return o(l,u),u}return function(){return a(Jp.apply(null,arguments))}}const Ce=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},el=/^\[(?:([a-z-]+):)?(.+)\]$/i,Qp=/^\d+\/\d+$/,Zp=new Set(["px","full","screen"]),eh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,th=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wt=e=>Bn(e)||Zp.has(e)||Qp.test(e),Qt=e=>Qn(e,"length",fh),Bn=e=>!!e&&!Number.isNaN(Number(e)),pa=e=>Qn(e,"number",Bn),cr=e=>!!e&&Number.isInteger(Number(e)),ah=e=>e.endsWith("%")&&Bn(e.slice(0,-1)),de=e=>el.test(e),Zt=e=>eh.test(e),sh=new Set(["length","size","percentage"]),ih=e=>Qn(e,sh,tl),ch=e=>Qn(e,"position",tl),lh=new Set(["image","url"]),dh=e=>Qn(e,lh,ph),uh=e=>Qn(e,"",mh),lr=()=>!0,Qn=(e,t,n)=>{const r=el.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},fh=e=>th.test(e)&&!nh.test(e),tl=()=>!1,mh=e=>rh.test(e),ph=e=>oh.test(e),Ti=()=>{const e=Ce("colors"),t=Ce("spacing"),n=Ce("blur"),r=Ce("brightness"),o=Ce("borderColor"),a=Ce("borderRadius"),s=Ce("borderSpacing"),i=Ce("borderWidth"),l=Ce("contrast"),d=Ce("grayscale"),u=Ce("hueRotate"),f=Ce("invert"),m=Ce("gap"),p=Ce("gradientColorStops"),g=Ce("gradientColorStopPositions"),_=Ce("inset"),j=Ce("margin"),y=Ce("opacity"),x=Ce("padding"),b=Ce("saturate"),w=Ce("scale"),S=Ce("sepia"),N=Ce("skew"),C=Ce("space"),E=Ce("translate"),k=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",de,t],T=()=>[de,t],$=()=>["",Wt,Qt],A=()=>["auto",Bn,de],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",de],oe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[Bn,de];return{cacheSize:500,separator:":",theme:{colors:[lr],spacing:[Wt,Qt],blur:["none","",Zt,de],brightness:le(),borderColor:[e],borderRadius:["none","","full",Zt,de],borderSpacing:T(),borderWidth:$(),contrast:le(),grayscale:z(),hueRotate:le(),invert:z(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[ah,Qt],inset:D(),margin:D(),opacity:le(),padding:T(),saturate:le(),scale:le(),sepia:z(),skew:le(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[Zt]}],"break-after":[{"break-after":oe()}],"break-before":[{"break-before":oe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),de]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",cr,de]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",cr,de]}],"grid-cols":[{"grid-cols":[lr]}],"col-start-end":[{col:["auto",{span:["full",cr,de]},de]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[lr]}],"row-start-end":[{row:["auto",{span:[cr,de]},de]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[Zt]},Zt]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zt,Qt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",pa]}],"font-family":[{font:[lr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",de]}],"line-clamp":[{"line-clamp":["none",Bn,pa]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wt,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wt,Qt]}],"underline-offset":[{"underline-offset":["auto",Wt,de]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),ch]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ih]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[Wt,de]}],"outline-w":[{outline:[Wt,Qt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Wt,Qt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zt,uh]}],"shadow-color":[{shadow:[lr]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Zt,de]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:le()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:le()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[cr,de]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wt,Qt,pa]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},hh=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:o,extend:a={},override:s={}})=>{fr(e,"cacheSize",t),fr(e,"prefix",n),fr(e,"separator",r),fr(e,"experimentalParseClassName",o);for(const i in s)_h(e[i],s[i]);for(const i in a)gh(e[i],a[i]);return e},fr=(e,t,n)=>{n!==void 0&&(e[t]=n)},_h=(e,t)=>{if(t)for(const n in t)fr(e,n,t[n])},gh=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},jh=(e,...t)=>typeof e=="function"?Di(Ti,e,...t):Di(()=>hh(Ti(),e),...t),yh=jh({prefix:"cj-"});function ne(...e){return yh(Kc(e))}const ps=Po("cj-inline-flex cj-items-center cj-justify-center cj-gap-2 cj-whitespace-nowrap cj-rounded-md cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-colors focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50 [&_svg]:cj-pointer-events-none [&_svg]:cj-size-4 [&_svg]:cj-shrink-0",{variants:{variant:{default:"cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/90",destructive:"cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/90",outline:"cj-border cj-border-input cj-bg-background hover:cj-bg-accent hover:cj-text-accent-foreground",secondary:"cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",ghost:"hover:cj-bg-accent hover:cj-text-accent-foreground",link:"cj-text-primary cj-underline-offset-4 hover:cj-underline"},size:{default:"cj-h-12 cj-px-4 cj-py-2",sm:"cj-h-10 cj-rounded-md cj-px-3",lg:"cj-h-14 cj-rounded-md cj-px-8",icon:"cj-h-12 cj-w-12"}},defaultVariants:{variant:"default",size:"default"}}),Z=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const s=r?Op:"button";return c.jsx(s,{className:ne(ps({variant:t,size:n,className:e})),ref:a,...o})});Z.displayName="Button";const vh=Po("cj-inline-flex cj-items-center cj-rounded-full cj-border cj-px-2.5 cj-py-0.5 cj-text-xs cj-font-semibold cj-transition-colors focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2",{variants:{variant:{default:"cj-border-transparent cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/80",secondary:"cj-border-transparent cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",destructive:"cj-border-transparent cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/80",outline:"cj-text-foreground"}},defaultVariants:{variant:"default"}});function jt({className:e,variant:t,...n}){return c.jsx("div",{className:ne(vh({variant:t}),e),...n})}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function xh(e,t){const n=h.createContext(t),r=a=>{const{children:s,...i}=a,l=h.useMemo(()=>i,Object.values(i));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(a){const s=h.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function st(e,t=[]){let n=[];function r(a,s){const i=h.createContext(s),l=n.length;n=[...n,s];const d=f=>{var y;const{scope:m,children:p,...g}=f,_=((y=m==null?void 0:m[e])==null?void 0:y[l])||i,j=h.useMemo(()=>g,Object.values(g));return c.jsx(_.Provider,{value:j,children:p})};d.displayName=a+"Provider";function u(f,m){var _;const p=((_=m==null?void 0:m[e])==null?void 0:_[l])||i,g=h.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[d,u]}const o=()=>{const a=n.map(s=>h.createContext(s));return function(i){const l=(i==null?void 0:i[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,bh(o,...t)]}function bh(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((i,{useScope:l,scopeName:d})=>{const f=l(a)[`__scope${d}`];return{...i,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ri(e){const t=wh(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Sh);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function wh(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=kh(o),i=Ch(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nh=Symbol("radix.slottable");function Sh(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nh}function Ch(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function kh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function nl(e){const t=e+"CollectionProvider",[n,r]=st(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=_=>{const{scope:j,children:y}=_,x=v.useRef(null),b=v.useRef(new Map).current;return c.jsx(o,{scope:j,itemMap:b,collectionRef:x,children:y})};s.displayName=t;const i=e+"CollectionSlot",l=Ri(i),d=v.forwardRef((_,j)=>{const{scope:y,children:x}=_,b=a(i,y),w=he(j,b.collectionRef);return c.jsx(l,{ref:w,children:x})});d.displayName=i;const u=e+"CollectionItemSlot",f="data-radix-collection-item",m=Ri(u),p=v.forwardRef((_,j)=>{const{scope:y,children:x,...b}=_,w=v.useRef(null),S=he(j,w),N=a(u,y);return v.useEffect(()=>(N.itemMap.set(w,{ref:w,...b}),()=>void N.itemMap.delete(w))),c.jsx(m,{[f]:"",ref:S,children:x})});p.displayName=u;function g(_){const j=a(e+"CollectionConsumer",_);return v.useCallback(()=>{const x=j.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(j.itemMap.values()).sort((N,C)=>b.indexOf(N.ref.current)-b.indexOf(C.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:s,Slot:d,ItemSlot:p},g,r]}var Ye=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Ph=h[" useId ".trim().toString()]||(()=>{}),Eh=0;function Dt(e){const[t,n]=h.useState(Ph());return Ye(()=>{n(r=>r??String(Eh++))},[e]),t?`radix-${t}`:""}function Mh(e){const t=Dh(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Rh);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Dh(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=Ah(o),i=Oh(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Th=Symbol("radix.slottable");function Rh(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Th}function Oh(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Ah(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],se=zh.reduce((e,t)=>{const n=Mh(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ih(e,t){e&&Co.flushSync(()=>e.dispatchEvent(t))}function Ue(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Wh=h[" useInsertionEffect ".trim().toString()]||Ye;function Ht({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,s]=$h({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const f=u.current;f!==i&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,r])}const d=h.useCallback(u=>{var f;if(i){const m=Fh(u)?u(e):u;m!==e&&((f=s.current)==null||f.call(s,m))}else a(u)},[i,e,a,s]);return[l,d]}function $h({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),a=h.useRef(t);return Wh(()=>{a.current=t},[t]),h.useEffect(()=>{var s;o.current!==n&&((s=a.current)==null||s.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Fh(e){return typeof e=="function"}var Lh=h.createContext(void 0);function kr(e){const t=h.useContext(Lh);return e||t||"ltr"}var ha="rovingFocusGroup.onEntryFocus",Bh={bubbles:!1,cancelable:!0},Pr="RovingFocusGroup",[Ha,rl,Hh]=nl(Pr),[Yh,Eo]=st(Pr,[Hh]),[qh,Vh]=Yh(Pr),ol=h.forwardRef((e,t)=>c.jsx(Ha.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Ha.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Gh,{...e,ref:t})})}));ol.displayName=Pr;var Gh=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,m=h.useRef(null),p=he(t,m),g=kr(a),[_,j]=Ht({prop:s,defaultProp:i??null,onChange:l,caller:Pr}),[y,x]=h.useState(!1),b=Ue(d),w=rl(n),S=h.useRef(!1),[N,C]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ha,b),()=>E.removeEventListener(ha,b)},[b]),c.jsx(qh,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:_,onItemFocus:h.useCallback(E=>j(E),[j]),onItemShiftTab:h.useCallback(()=>x(!0),[]),onFocusableItemAdd:h.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>C(E=>E-1),[]),children:c.jsx(se.div,{tabIndex:y||N===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{S.current=!0}),onFocus:re(e.onFocus,E=>{const k=!S.current;if(E.target===E.currentTarget&&k&&!y){const M=new CustomEvent(ha,Bh);if(E.currentTarget.dispatchEvent(M),!M.defaultPrevented){const D=w().filter(W=>W.focusable),T=D.find(W=>W.active),$=D.find(W=>W.id===_),H=[T,$,...D].filter(Boolean).map(W=>W.ref.current);il(H,u)}}S.current=!1}),onBlur:re(e.onBlur,()=>x(!1))})})}),al="RovingFocusGroupItem",sl=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...i}=e,l=Dt(),d=a||l,u=Vh(al,n),f=u.currentTabStopId===d,m=rl(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:_}=u;return h.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),c.jsx(Ha.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:c.jsx(se.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:re(e.onMouseDown,j=>{r?u.onItemFocus(d):j.preventDefault()}),onFocus:re(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:re(e.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){u.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const y=Kh(j,u.orientation,u.dir);if(y!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let b=m().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const w=b.indexOf(j.currentTarget);b=u.loop?Jh(b,w+1):b.slice(w+1)}setTimeout(()=>il(b))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:_!=null}):s})})});sl.displayName=al;var Uh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Xh(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Kh(e,t,n){const r=Xh(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Uh[r]}function il(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Jh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cl=ol,ll=sl;function Qh(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var it=e=>{const{present:t,children:n}=e,r=Zh(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),a=he(r.ref,e_(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:a}):null};it.displayName="Presence";function Zh(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),a=h.useRef("none"),s=e?"mounted":"unmounted",[i,l]=Qh(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=Hr(r.current);a.current=i==="mounted"?d:"none"},[i]),Ye(()=>{const d=r.current,u=o.current;if(u!==e){const m=a.current,p=Hr(d);e?l("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ye(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=p=>{const _=Hr(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&_&&(l("ANIMATION_END"),!o.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},m=p=>{p.target===t&&(a.current=Hr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:h.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Hr(e){return(e==null?void 0:e.animationName)||"none"}function e_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mo="Tabs",[t_]=st(Mo,[Eo]),dl=Eo(),[n_,hs]=t_(Mo),ul=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:i,activationMode:l="automatic",...d}=e,u=kr(i),[f,m]=Ht({prop:r,onChange:o,defaultProp:a??"",caller:Mo});return c.jsx(n_,{scope:n,baseId:Dt(),value:f,onValueChange:m,orientation:s,dir:u,activationMode:l,children:c.jsx(se.div,{dir:u,"data-orientation":s,...d,ref:t})})});ul.displayName=Mo;var fl="TabsList",ml=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,a=hs(fl,n),s=dl(n);return c.jsx(cl,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:c.jsx(se.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});ml.displayName=fl;var pl="TabsTrigger",hl=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=e,s=hs(pl,n),i=dl(n),l=jl(s.baseId,r),d=yl(s.baseId,r),u=r===s.value;return c.jsx(ll,{asChild:!0,...i,focusable:!o,active:u,children:c.jsx(se.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:re(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:re(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:re(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})})});hl.displayName=pl;var _l="TabsContent",gl=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=e,i=hs(_l,n),l=jl(i.baseId,r),d=yl(i.baseId,r),u=r===i.value,f=h.useRef(u);return h.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),c.jsx(it,{present:o||u,children:({present:m})=>c.jsx(se.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&a})})});gl.displayName=_l;function jl(e,t){return`${e}-trigger-${t}`}function yl(e,t){return`${e}-content-${t}`}var r_=ul,vl=ml,xl=hl,bl=gl;const o_=r_,wl=h.forwardRef(({className:e,...t},n)=>c.jsx(vl,{ref:n,className:ne("cj-inline-flex cj-h-10 cj-items-center cj-justify-center cj-rounded-md cj-bg-muted cj-p-1 cj-text-muted-foreground",e),...t}));wl.displayName=vl.displayName;const mr=h.forwardRef(({className:e,...t},n)=>c.jsx(xl,{ref:n,className:ne("cj-inline-flex cj-items-center cj-justify-center cj-whitespace-nowrap cj-rounded-sm cj-px-3 cj-py-1.5 cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-all data-[state=active]:cj-bg-background data-[state=active]:cj-text-foreground data-[state=active]:cj-shadow-sm focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50",e),...t}));mr.displayName=xl.displayName;const a_=h.forwardRef(({className:e,...t},n)=>c.jsx(bl,{ref:n,className:ne("cj-mt-2 cj-ring-offset-background focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2",e),...t}));a_.displayName=bl.displayName;/**
3
3
  * @license lucide-react v0.462.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
@@ -14,12 +14,12 @@
14
14
  *
15
15
  * This source code is licensed under the ISC license.
16
16
  * See the LICENSE file in the root directory of this source tree.
17
- */const c_=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:s,...i},l)=>y.createElement("svg",{ref:l,...i_,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Nl("lucide",o),...i},[...s.map(([d,u])=>y.createElement(d,u)),...Array.isArray(a)?a:[a]]));/**
17
+ */const c_=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:s,...i},l)=>v.createElement("svg",{ref:l,...i_,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Nl("lucide",o),...i},[...s.map(([d,u])=>v.createElement(d,u)),...Array.isArray(a)?a:[a]]));/**
18
18
  * @license lucide-react v0.462.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
- */const ue=(e,t)=>{const n=y.forwardRef(({className:r,...o},a)=>y.createElement(c_,{ref:a,iconNode:t,className:Nl(`lucide-${s_(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
22
+ */const ue=(e,t)=>{const n=v.forwardRef(({className:r,...o},a)=>v.createElement(c_,{ref:a,iconNode:t,className:Nl(`lucide-${s_(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
23
23
  * @license lucide-react v0.462.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
@@ -224,7 +224,7 @@
224
224
  *
225
225
  * This source code is licensed under the ISC license.
226
226
  * See the LICENSE file in the root directory of this source tree.
227
- */const Tl=ue("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),To=y.createContext(null);To.displayName="PanelGroupContext";const ze={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},gs=10,vn=y.useLayoutEffect,Oi=h.useId,O_=typeof Oi=="function"?Oi:()=>null;let A_=0;function js(e=null){const t=O_(),n=y.useRef(e||t||null);return n.current===null&&(n.current=""+A_++),e??n.current}function Rl({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:a,id:s,maxSize:i,minSize:l,onCollapse:d,onExpand:u,onResize:f,order:m,style:p,tagName:j="div",..._}){const g=y.useContext(To);if(g===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:x,getPanelSize:b,getPanelStyle:w,groupId:S,isPanelCollapsed:N,reevaluatePanelConstraints:C,registerPanel:E,resizePanel:k,unregisterPanel:M}=g,D=js(s),T=y.useRef({callbacks:{onCollapse:d,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:i,minSize:l},id:D,idIsFromProps:s!==void 0,order:m});y.useRef({didLogMissingDefaultSizeWarning:!1}),vn(()=>{const{callbacks:A,constraints:H}=T.current,W={...H};T.current.id=D,T.current.idIsFromProps=s!==void 0,T.current.order=m,A.onCollapse=d,A.onExpand=u,A.onResize=f,H.collapsedSize=n,H.collapsible=r,H.defaultSize=o,H.maxSize=i,H.minSize=l,(W.collapsedSize!==H.collapsedSize||W.collapsible!==H.collapsible||W.maxSize!==H.maxSize||W.minSize!==H.minSize)&&C(T.current,W)}),vn(()=>{const A=T.current;return E(A),()=>{M(A)}},[m,D,E,M]),y.useImperativeHandle(a,()=>({collapse:()=>{v(T.current)},expand:A=>{x(T.current,A)},getId(){return D},getSize(){return b(T.current)},isCollapsed(){return N(T.current)},isExpanded(){return!N(T.current)},resize:A=>{k(T.current,A)}}),[v,x,b,N,D,k]);const $=w(T.current,o);return y.createElement(j,{..._,children:e,className:t,id:D,style:{...$,...p},[ze.groupId]:S,[ze.panel]:"",[ze.panelCollapsible]:r||void 0,[ze.panelId]:D,[ze.panelSize]:parseFloat(""+$.flexGrow).toFixed(1)})}const Ol=y.forwardRef((e,t)=>y.createElement(Rl,{...e,forwardedRef:t}));Rl.displayName="Panel";Ol.displayName="forwardRef(Panel)";let Ya=null,no=-1,rn=null;function z_(e,t){if(t){const n=(t&$l)!==0,r=(t&Fl)!==0,o=(t&Ll)!==0,a=(t&Bl)!==0;if(n)return o?"se-resize":a?"ne-resize":"e-resize";if(r)return o?"sw-resize":a?"nw-resize":"w-resize";if(o)return"s-resize";if(a)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function I_(){rn!==null&&(document.head.removeChild(rn),Ya=null,rn=null,no=-1)}function ga(e,t){var n,r;const o=z_(e,t);if(Ya!==o){if(Ya=o,rn===null&&(rn=document.createElement("style"),document.head.appendChild(rn)),no>=0){var a;(a=rn.sheet)===null||a===void 0||a.removeRule(no)}no=(n=(r=rn.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function Al(e){return e.type==="keydown"}function zl(e){return e.type.startsWith("pointer")}function Il(e){return e.type.startsWith("mouse")}function Ro(e){if(zl(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Il(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function W_(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function $_(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function F_(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ii(e),b:Ii(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;me(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:zi(Ai(n.a)),b:zi(Ai(n.b))};if(o.a===o.b){const a=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let i=a.length;for(;i--;){const l=a[i];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const L_=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function B_(e){var t;const n=getComputedStyle((t=Wl(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function H_(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||B_(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||L_.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ai(e){let t=e.length;for(;t--;){const n=e[t];if(me(n,"Missing node"),H_(n))return n}return null}function zi(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ii(e){const t=[];for(;e;)t.push(e),e=Wl(e);return t}function Wl(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const $l=1,Fl=2,Ll=4,Bl=8,Y_=W_()==="coarse";let yt=[],Hn=!1,gn=new Map,Oo=new Map;const xr=new Set;function q_(e,t,n,r,o){var a;const{ownerDocument:s}=t,i={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(a=gn.get(s))!==null&&a!==void 0?a:0;return gn.set(s,l+1),xr.add(i),lo(),function(){var u;Oo.delete(e),xr.delete(i);const f=(u=gn.get(s))!==null&&u!==void 0?u:1;if(gn.set(s,f-1),lo(),f===1&&gn.delete(s),yt.includes(i)){const m=yt.indexOf(i);m>=0&&yt.splice(m,1),vs(),o("up",!0,null)}}}function V_(e){const{target:t}=e,{x:n,y:r}=Ro(e);Hn=!0,ys({target:t,x:n,y:r}),lo(),yt.length>0&&(uo("down",e),e.preventDefault(),Hl(t)||e.stopImmediatePropagation())}function ja(e){const{x:t,y:n}=Ro(e);if(Hn&&e.buttons===0&&(Hn=!1,uo("up",e)),!Hn){const{target:r}=e;ys({target:r,x:t,y:n})}uo("move",e),vs(),yt.length>0&&e.preventDefault()}function ya(e){const{target:t}=e,{x:n,y:r}=Ro(e);Oo.clear(),Hn=!1,yt.length>0&&(e.preventDefault(),Hl(t)||e.stopImmediatePropagation()),uo("up",e),ys({target:t,x:n,y:r}),vs(),lo()}function Hl(e){let t=e;for(;t;){if(t.hasAttribute(ze.resizeHandle))return!0;t=t.parentElement}return!1}function ys({target:e,x:t,y:n}){yt.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),xr.forEach(o=>{const{element:a,hitAreaMargins:s}=o,i=a.getBoundingClientRect(),{bottom:l,left:d,right:u,top:f}=i,m=Y_?s.coarse:s.fine;if(t>=d-m&&t<=u+m&&n>=f-m&&n<=l+m){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&F_(r,a)>0){let j=r,_=!1;for(;j&&!j.contains(a);){if($_(j.getBoundingClientRect(),i)){_=!0;break}j=j.parentElement}if(_)return}yt.push(o)}})}function va(e,t){Oo.set(e,t)}function vs(){let e=!1,t=!1;yt.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Oo.forEach(r=>{n|=r}),e&&t?ga("intersection",n):e?ga("horizontal",n):t?ga("vertical",n):I_()}let xa=new AbortController;function lo(){xa.abort(),xa=new AbortController;const e={capture:!0,signal:xa.signal};xr.size&&(Hn?(yt.length>0&&gn.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("contextmenu",ya,e),r.addEventListener("pointerleave",ja,e),r.addEventListener("pointermove",ja,e))}),window.addEventListener("pointerup",ya,e),window.addEventListener("pointercancel",ya,e)):gn.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("pointerdown",V_,e),r.addEventListener("pointermove",ja,e))}))}function uo(e,t){xr.forEach(n=>{const{setResizeHandlerState:r}=n,o=yt.includes(n);r(e,o,t)})}function G_(){const[e,t]=y.useState(0);return y.useCallback(()=>t(n=>n+1),[])}function me(e,t){if(!e)throw console.error(t),Error(t)}function xn(e,t,n=gs){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function $t(e,t,n=gs){return xn(e,t,n)===0}function tt(e,t,n){return xn(e,t,n)===0}function U_(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],a=t[r];if(!tt(o,a,n))return!1}return!0}function Ln({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];me(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:a,maxSize:s=100,minSize:i=0}=r;if(xn(n,i)<0)if(a){const l=(o+i)/2;xn(n,l)<0?n=o:n=i}else n=i;return n=Math.min(s,n),n=parseFloat(n.toFixed(gs)),n}function pr({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:a}){if(tt(e,0))return t;const s=[...t],[i,l]=r;me(i!=null,"Invalid first pivot index"),me(l!=null,"Invalid second pivot index");let d=0;if(a==="keyboard"){{const f=e<0?l:i,m=n[f];me(m,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:j,minSize:_=0}=m;if(j){const g=t[f];if(me(g!=null,`Previous layout not found for panel index ${f}`),tt(g,p)){const v=_-g;xn(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const f=e<0?i:l,m=n[f];me(m,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:j,minSize:_=0}=m;if(j){const g=t[f];if(me(g!=null,`Previous layout not found for panel index ${f}`),tt(g,_)){const v=g-p;xn(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}}{const f=e<0?1:-1;let m=e<0?l:i,p=0;for(;;){const _=t[m];me(_!=null,`Previous layout not found for panel index ${m}`);const v=Ln({panelConstraints:n,panelIndex:m,size:100})-_;if(p+=v,m+=f,m<0||m>=n.length)break}const j=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-j:j}{let m=e<0?i:l;for(;m>=0&&m<n.length;){const p=Math.abs(e)-Math.abs(d),j=t[m];me(j!=null,`Previous layout not found for panel index ${m}`);const _=j-p,g=Ln({panelConstraints:n,panelIndex:m,size:_});if(!tt(j,g)&&(d+=j-g,s[m]=g,d.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?m--:m++}}if(U_(o,s))return o;{const f=e<0?l:i,m=t[f];me(m!=null,`Previous layout not found for panel index ${f}`);const p=m+d,j=Ln({panelConstraints:n,panelIndex:f,size:p});if(s[f]=j,!tt(j,p)){let _=p-j,v=e<0?l:i;for(;v>=0&&v<n.length;){const x=s[v];me(x!=null,`Previous layout not found for panel index ${v}`);const b=x+_,w=Ln({panelConstraints:n,panelIndex:v,size:b});if(tt(x,w)||(_-=w-x,s[v]=w),tt(_,0))break;e>0?v--:v++}}}const u=s.reduce((f,m)=>m+f,0);return tt(u,100)?s:o}function X_({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,a=0,s=0;const i=n[0];me(i!=null,"No pivot index found"),t.forEach((f,m)=>{const{constraints:p}=f,{maxSize:j=100,minSize:_=0}=p;m===i?(r=_,o=j):(a+=_,s+=j)});const l=Math.min(o,100-a),d=Math.max(r,100-s),u=e[i];return{valueMax:l,valueMin:d,valueNow:u}}function br(e,t=document){return Array.from(t.querySelectorAll(`[${ze.resizeHandleId}][data-panel-group-id="${e}"]`))}function Yl(e,t,n=document){const o=br(e,n).findIndex(a=>a.getAttribute(ze.resizeHandleId)===t);return o??null}function ql(e,t,n){const r=Yl(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Vl(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Ao(e,t=document){const n=t.querySelector(`[${ze.resizeHandleId}="${e}"]`);return n||null}function K_(e,t,n,r=document){var o,a,s,i;const l=Ao(t,r),d=br(e,r),u=l?d.indexOf(l):-1,f=(o=(a=n[u])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null,m=(s=(i=n[u+1])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null;return[f,m]}function J_({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:a,setLayout:s}){y.useRef({didWarnAboutMissingResizeHandle:!1}),vn(()=>{if(!a)return;const i=br(n,a);for(let l=0;l<o.length-1;l++){const{valueMax:d,valueMin:u,valueNow:f}=X_({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),m=i[l];if(m!=null){const p=o[l];me(p,`No panel data found for index "${l}"`),m.setAttribute("aria-controls",p.id),m.setAttribute("aria-valuemax",""+Math.round(d)),m.setAttribute("aria-valuemin",""+Math.round(u)),m.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{i.forEach((l,d)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,a]),y.useEffect(()=>{if(!a)return;const i=t.current;me(i,"Eager values not found");const{panelDataArray:l}=i,d=Vl(n,a);me(d!=null,`No group found for id "${n}"`);const u=br(n,a);me(u,`No resize handles found for group id "${n}"`);const f=u.map(m=>{const p=m.getAttribute(ze.resizeHandleId);me(p,"Resize handle element has no handle id attribute");const[j,_]=K_(n,p,l,a);if(j==null||_==null)return()=>{};const g=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const x=l.findIndex(b=>b.id===j);if(x>=0){const b=l[x];me(b,`No panel data found for index ${x}`);const w=r[x],{collapsedSize:S=0,collapsible:N,minSize:C=0}=b.constraints;if(w!=null&&N){const E=pr({delta:tt(w,S)?C-S:S-w,initialLayout:r,panelConstraints:l.map(k=>k.constraints),pivotIndices:ql(n,p,a),prevLayout:r,trigger:"keyboard"});r!==E&&s(E)}}break}}};return m.addEventListener("keydown",g),()=>{m.removeEventListener("keydown",g)}});return()=>{f.forEach(m=>m())}},[a,e,t,n,r,o,s])}function Wi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Gl(e,t){const n=e==="horizontal",{x:r,y:o}=Ro(t);return n?r:o}function Q_(e,t,n,r,o){const a=n==="horizontal",s=Ao(t,o);me(s,`No resize handle element found for id "${t}"`);const i=s.getAttribute(ze.groupId);me(i,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const d=Gl(n,e),u=Vl(i,o);me(u,`No group element found for id "${i}"`);const f=u.getBoundingClientRect(),m=a?f.width:f.height;return(d-l)/m*100}function Z_(e,t,n,r,o,a){if(Al(e)){const s=n==="horizontal";let i=0;e.shiftKey?i=100:o!=null?i=o:i=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:i;break;case"ArrowLeft":l=s?-i:0;break;case"ArrowRight":l=s?i:0;break;case"ArrowUp":l=s?0:-i;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:Q_(e,t,n,r,a)}function eg({panelDataArray:e}){const t=Array(e.length),n=e.map(a=>a.constraints);let r=0,o=100;for(let a=0;a<e.length;a++){const s=n[a];me(s,`Panel constraints not found for index ${a}`);const{defaultSize:i}=s;i!=null&&(r++,t[a]=i,o-=i)}for(let a=0;a<e.length;a++){const s=n[a];me(s,`Panel constraints not found for index ${a}`);const{defaultSize:i}=s;if(i!=null)continue;const l=e.length-r,d=o/l;r++,t[a]=d,o-=d}return t}function Tn(e,t,n){t.forEach((r,o)=>{const a=e[o];me(a,`Panel data not found for index ${o}`);const{callbacks:s,constraints:i,id:l}=a,{collapsedSize:d=0,collapsible:u}=i,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:m,onExpand:p,onResize:j}=s;j&&j(r,f),u&&(m||p)&&(p&&(f==null||$t(f,d))&&!$t(r,d)&&p(),m&&(f==null||!$t(f,d))&&$t(r,d)&&m())}})}function Yr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function tg({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:a=3}){const s=n[o];let i;return s==null?i=e!=null?e.toPrecision(a):"1":r.length===1?i="1":i=s.toPrecision(a),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function ng(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function $i(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Ul(e){return`react-resizable-panels:${e}`}function Xl(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:a}=t;return o?r:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function Kl(e,t){try{const n=Ul(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function rg(e,t,n){var r,o;const a=(r=Kl(e,n))!==null&&r!==void 0?r:{},s=Xl(t);return(o=a[s])!==null&&o!==void 0?o:null}function og(e,t,n,r,o){var a;const s=Ul(e),i=Xl(t),l=(a=Kl(e,o))!==null&&a!==void 0?a:{};l[i]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(d){console.error(d)}}function Fi({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((a,s)=>a+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!tt(r,100)&&n.length>0)for(let a=0;a<t.length;a++){const s=n[a];me(s!=null,`No layout data found for index ${a}`);const i=100/r*s;n[a]=i}let o=0;for(let a=0;a<t.length;a++){const s=n[a];me(s!=null,`No layout data found for index ${a}`);const i=Ln({panelConstraints:t,panelIndex:a,size:s});s!=i&&(o+=s-i,n[a]=i)}if(!tt(o,0))for(let a=0;a<t.length;a++){const s=n[a];me(s!=null,`No layout data found for index ${a}`);const i=s+o,l=Ln({panelConstraints:t,panelIndex:a,size:i});if(s!==l&&(o-=l-s,n[a]=l,tt(o,0)))break}return n}const ag=100,hr={getItem:e=>($i(hr),hr.getItem(e)),setItem:(e,t)=>{$i(hr),hr.setItem(e,t)}},Li={};function Jl({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:a=null,onLayout:s=null,keyboardResizeBy:i=null,storage:l=hr,style:d,tagName:u="div",...f}){const m=js(a),p=y.useRef(null),[j,_]=y.useState(null),[g,v]=y.useState([]),x=G_(),b=y.useRef({}),w=y.useRef(new Map),S=y.useRef(0),N=y.useRef({autoSaveId:e,direction:r,dragState:j,id:m,keyboardResizeBy:i,onLayout:s,storage:l}),C=y.useRef({layout:g,panelDataArray:[],panelDataArrayChanged:!1});y.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),y.useImperativeHandle(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:R}=C.current;return R},setLayout:R=>{const{onLayout:I}=N.current,{layout:Y,panelDataArray:U}=C.current,P=Fi({layout:R,panelConstraints:U.map(O=>O.constraints)});Wi(Y,P)||(v(P),C.current.layout=P,I&&I(P),Tn(U,P,b.current))}}),[]),vn(()=>{N.current.autoSaveId=e,N.current.direction=r,N.current.dragState=j,N.current.id=m,N.current.onLayout=s,N.current.storage=l}),J_({committedValuesRef:N,eagerValuesRef:C,groupId:m,layout:g,panelDataArray:C.current.panelDataArray,setLayout:v,panelGroupElement:p.current}),y.useEffect(()=>{const{panelDataArray:R}=C.current;if(e){if(g.length===0||g.length!==R.length)return;let I=Li[e];I==null&&(I=ng(og,ag),Li[e]=I);const Y=[...R],U=new Map(w.current);I(e,Y,U,g,l)}},[e,g,l]),y.useEffect(()=>{});const E=y.useCallback(R=>{const{onLayout:I}=N.current,{layout:Y,panelDataArray:U}=C.current;if(R.constraints.collapsible){const P=U.map(V=>V.constraints),{collapsedSize:O=0,panelSize:B,pivotIndices:L}=pn(U,R,Y);if(me(B!=null,`Panel size not found for panel "${R.id}"`),!$t(B,O)){w.current.set(R.id,B);const ee=$n(U,R)===U.length-1?B-O:O-B,ae=pr({delta:ee,initialLayout:Y,panelConstraints:P,pivotIndices:L,prevLayout:Y,trigger:"imperative-api"});Yr(Y,ae)||(v(ae),C.current.layout=ae,I&&I(ae),Tn(U,ae,b.current))}}},[]),k=y.useCallback((R,I)=>{const{onLayout:Y}=N.current,{layout:U,panelDataArray:P}=C.current;if(R.constraints.collapsible){const O=P.map(_e=>_e.constraints),{collapsedSize:B=0,panelSize:L=0,minSize:V=0,pivotIndices:ee}=pn(P,R,U),ae=I??V;if($t(L,B)){const _e=w.current.get(R.id),Se=_e!=null&&_e>=ae?_e:ae,Be=$n(P,R)===P.length-1?L-Se:Se-L,ke=pr({delta:Be,initialLayout:U,panelConstraints:O,pivotIndices:ee,prevLayout:U,trigger:"imperative-api"});Yr(U,ke)||(v(ke),C.current.layout=ke,Y&&Y(ke),Tn(P,ke,b.current))}}},[]),M=y.useCallback(R=>{const{layout:I,panelDataArray:Y}=C.current,{panelSize:U}=pn(Y,R,I);return me(U!=null,`Panel size not found for panel "${R.id}"`),U},[]),D=y.useCallback((R,I)=>{const{panelDataArray:Y}=C.current,U=$n(Y,R);return tg({defaultSize:I,dragState:j,layout:g,panelData:Y,panelIndex:U})},[j,g]),T=y.useCallback(R=>{const{layout:I,panelDataArray:Y}=C.current,{collapsedSize:U=0,collapsible:P,panelSize:O}=pn(Y,R,I);return me(O!=null,`Panel size not found for panel "${R.id}"`),P===!0&&$t(O,U)},[]),$=y.useCallback(R=>{const{layout:I,panelDataArray:Y}=C.current,{collapsedSize:U=0,collapsible:P,panelSize:O}=pn(Y,R,I);return me(O!=null,`Panel size not found for panel "${R.id}"`),!P||xn(O,U)>0},[]),A=y.useCallback(R=>{const{panelDataArray:I}=C.current;I.push(R),I.sort((Y,U)=>{const P=Y.order,O=U.order;return P==null&&O==null?0:P==null?-1:O==null?1:P-O}),C.current.panelDataArrayChanged=!0,x()},[x]);vn(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:R,onLayout:I,storage:Y}=N.current,{layout:U,panelDataArray:P}=C.current;let O=null;if(R){const L=rg(R,P,Y);L&&(w.current=new Map(Object.entries(L.expandToSizes)),O=L.layout)}O==null&&(O=eg({panelDataArray:P}));const B=Fi({layout:O,panelConstraints:P.map(L=>L.constraints)});Wi(U,B)||(v(B),C.current.layout=B,I&&I(B),Tn(P,B,b.current))}}),vn(()=>{const R=C.current;return()=>{R.layout=[]}},[]);const H=y.useCallback(R=>{let I=!1;const Y=p.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(I=!0),function(P){P.preventDefault();const O=p.current;if(!O)return()=>null;const{direction:B,dragState:L,id:V,keyboardResizeBy:ee,onLayout:ae}=N.current,{layout:_e,panelDataArray:Se}=C.current,{initialLayout:Me}=L??{},Be=ql(V,R,O);let ke=Z_(P,R,B,L,ee,O);const ft=B==="horizontal";ft&&I&&(ke=-ke);const Mn=Se.map(ct=>ct.constraints),Ze=pr({delta:ke,initialLayout:Me??_e,panelConstraints:Mn,pivotIndices:Be,prevLayout:_e,trigger:Al(P)?"keyboard":"mouse-or-touch"}),fn=!Yr(_e,Ze);(zl(P)||Il(P))&&S.current!=ke&&(S.current=ke,!fn&&ke!==0?ft?va(R,ke<0?$l:Fl):va(R,ke<0?Ll:Bl):va(R,0)),fn&&(v(Ze),C.current.layout=Ze,ae&&ae(Ze),Tn(Se,Ze,b.current))}},[]),W=y.useCallback((R,I)=>{const{onLayout:Y}=N.current,{layout:U,panelDataArray:P}=C.current,O=P.map(_e=>_e.constraints),{panelSize:B,pivotIndices:L}=pn(P,R,U);me(B!=null,`Panel size not found for panel "${R.id}"`);const ee=$n(P,R)===P.length-1?B-I:I-B,ae=pr({delta:ee,initialLayout:U,panelConstraints:O,pivotIndices:L,prevLayout:U,trigger:"imperative-api"});Yr(U,ae)||(v(ae),C.current.layout=ae,Y&&Y(ae),Tn(P,ae,b.current))},[]),Q=y.useCallback((R,I)=>{const{layout:Y,panelDataArray:U}=C.current,{collapsedSize:P=0,collapsible:O}=I,{collapsedSize:B=0,collapsible:L,maxSize:V=100,minSize:ee=0}=R.constraints,{panelSize:ae}=pn(U,R,Y);ae!=null&&(O&&L&&$t(ae,P)?$t(P,B)||W(R,B):ae<ee?W(R,ee):ae>V&&W(R,V))},[W]),G=y.useCallback((R,I)=>{const{direction:Y}=N.current,{layout:U}=C.current;if(!p.current)return;const P=Ao(R,p.current);me(P,`Drag handle element not found for id "${R}"`);const O=Gl(Y,I);_({dragHandleId:R,dragHandleRect:P.getBoundingClientRect(),initialCursorPosition:O,initialLayout:U})},[]),z=y.useCallback(()=>{_(null)},[]),oe=y.useCallback(R=>{const{panelDataArray:I}=C.current,Y=$n(I,R);Y>=0&&(I.splice(Y,1),delete b.current[R.id],C.current.panelDataArrayChanged=!0,x())},[x]),le=y.useMemo(()=>({collapsePanel:E,direction:r,dragState:j,expandPanel:k,getPanelSize:M,getPanelStyle:D,groupId:m,isPanelCollapsed:T,isPanelExpanded:$,reevaluatePanelConstraints:Q,registerPanel:A,registerResizeHandle:H,resizePanel:W,startDragging:G,stopDragging:z,unregisterPanel:oe,panelGroupElement:p.current}),[E,j,r,k,M,D,m,T,$,Q,A,H,W,G,z,oe]),ie={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return y.createElement(To.Provider,{value:le},y.createElement(u,{...f,children:t,className:n,id:a,ref:p,style:{...ie,...d},[ze.group]:"",[ze.groupDirection]:r,[ze.groupId]:m}))}const Ql=y.forwardRef((e,t)=>y.createElement(Jl,{...e,forwardedRef:t}));Jl.displayName="PanelGroup";Ql.displayName="forwardRef(PanelGroup)";function $n(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function pn(e,t,n){const r=$n(e,t),a=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:a}}function sg({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){y.useEffect(()=>{if(e||n==null||r==null)return;const o=Ao(t,r);if(o==null)return;const a=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=o.getAttribute(ze.groupId);me(i,`No group element found for id "${i}"`);const l=br(i,r),d=Yl(i,t,r);me(d!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?d>0?d-1:l.length-1:d+1<l.length?d+1:0;l[u].focus();break}}};return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a)}},[r,e,t,n])}function Zl({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:a,onClick:s,onDragging:i,onFocus:l,onPointerDown:d,onPointerUp:u,style:f={},tabIndex:m=0,tagName:p="div",...j}){var _,g;const v=y.useRef(null),x=y.useRef({onClick:s,onDragging:i,onPointerDown:d,onPointerUp:u});y.useEffect(()=>{x.current.onClick=s,x.current.onDragging=i,x.current.onPointerDown=d,x.current.onPointerUp=u});const b=y.useContext(To);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:S,registerResizeHandle:N,startDragging:C,stopDragging:E,panelGroupElement:k}=b,M=js(o),[D,T]=y.useState("inactive"),[$,A]=y.useState(!1),[H,W]=y.useState(null),Q=y.useRef({state:D});vn(()=>{Q.current.state=D}),y.useEffect(()=>{if(n)W(null);else{const le=N(M);W(()=>le)}},[n,M,N]);const G=(_=r==null?void 0:r.coarse)!==null&&_!==void 0?_:15,z=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;y.useEffect(()=>{if(n||H==null)return;const le=v.current;me(le,"Element ref not attached");let ie=!1;return q_(M,le,w,{coarse:G,fine:z},(I,Y,U)=>{if(!Y){T("inactive");return}switch(I){case"down":{T("drag"),ie=!1,me(U,'Expected event to be defined for "down" action'),C(M,U);const{onDragging:P,onPointerDown:O}=x.current;P==null||P(!0),O==null||O();break}case"move":{const{state:P}=Q.current;ie=!0,P!=="drag"&&T("hover"),me(U,'Expected event to be defined for "move" action'),H(U);break}case"up":{T("hover"),E();const{onClick:P,onDragging:O,onPointerUp:B}=x.current;O==null||O(!1),B==null||B(),ie||P==null||P();break}}})},[G,w,n,z,N,M,H,C,E]),sg({disabled:n,handleId:M,resizeHandler:H,panelGroupElement:k});const oe={touchAction:"none",userSelect:"none"};return y.createElement(p,{...j,children:e,className:t,id:o,onBlur:()=>{A(!1),a==null||a()},onFocus:()=>{A(!0),l==null||l()},ref:v,role:"separator",style:{...oe,...f},tabIndex:m,[ze.groupDirection]:w,[ze.groupId]:S,[ze.resizeHandle]:"",[ze.resizeHandleActive]:D==="drag"?"pointer":$?"keyboard":void 0,[ze.resizeHandleEnabled]:!n,[ze.resizeHandleId]:M,[ze.resizeHandleState]:D})}Zl.displayName="PanelResizeHandle";const ig=({className:e,...t})=>c.jsx(Ql,{className:ne("cj-flex cj-h-full cj-w-full data-[panel-group-direction=vertical]:cj-flex-col",e),...t}),ba=Ol,Bi=({withHandle:e,className:t,...n})=>c.jsx(Zl,{className:ne("cj-relative cj-flex cj-w-px cj-items-center cj-justify-center cj-bg-border after:cj-absolute after:cj-inset-y-0 after:cj-left-1/2 after:cj-w-1 after:-cj-translate-x-1/2 data-[panel-group-direction=vertical]:cj-h-px data-[panel-group-direction=vertical]:cj-w-full data-[panel-group-direction=vertical]:after:cj-left-0 data-[panel-group-direction=vertical]:after:cj-h-1 data-[panel-group-direction=vertical]:after:cj-w-full data-[panel-group-direction=vertical]:after:-cj-translate-y-1/2 data-[panel-group-direction=vertical]:after:cj-translate-x-0 focus-visible:cj-outline-none focus-visible:cj-ring-1 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-1 [&[data-panel-group-direction=vertical]>div]:cj-rotate-90",t),...n,children:e&&c.jsx("div",{className:"cj-z-10 cj-flex cj-h-4 cj-w-3 cj-items-center cj-justify-center cj-rounded-sm cj-border cj-bg-border",children:c.jsx(Pl,{className:"cj-h-2.5 cj-w-2.5"})})});function qa(e,[t,n]){return Math.min(n,Math.max(t,e))}function cg(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var xs="ScrollArea",[ed]=st(xs),[lg,ut]=ed(xs),td=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:a=600,...s}=e,[i,l]=h.useState(null),[d,u]=h.useState(null),[f,m]=h.useState(null),[p,j]=h.useState(null),[_,g]=h.useState(null),[v,x]=h.useState(0),[b,w]=h.useState(0),[S,N]=h.useState(!1),[C,E]=h.useState(!1),k=he(t,D=>l(D)),M=kr(o);return c.jsx(lg,{scope:n,type:r,dir:M,scrollHideDelay:a,scrollArea:i,viewport:d,onViewportChange:u,content:f,onContentChange:m,scrollbarX:p,onScrollbarXChange:j,scrollbarXEnabled:S,onScrollbarXEnabledChange:N,scrollbarY:_,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:w,children:c.jsx(se.div,{dir:M,...s,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});td.displayName=xs;var nd="ScrollAreaViewport",rd=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...a}=e,s=ut(nd,n),i=h.useRef(null),l=he(t,i,s.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(se.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});rd.displayName=nd;var At="ScrollAreaScrollbar",bs=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ut(At,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return h.useEffect(()=>(i?a(!0):s(!0),()=>{i?a(!1):s(!1)}),[i,a,s]),o.type==="hover"?c.jsx(dg,{...r,ref:t,forceMount:n}):o.type==="scroll"?c.jsx(ug,{...r,ref:t,forceMount:n}):o.type==="auto"?c.jsx(od,{...r,ref:t,forceMount:n}):o.type==="always"?c.jsx(ws,{...r,ref:t}):null});bs.displayName=At;var dg=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ut(At,e.__scopeScrollArea),[a,s]=h.useState(!1);return h.useEffect(()=>{const i=o.scrollArea;let l=0;if(i){const d=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",d),i.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",d),i.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),c.jsx(it,{present:n||a,children:c.jsx(od,{"data-state":a?"visible":"hidden",...r,ref:t})})}),ug=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ut(At,e.__scopeScrollArea),a=e.orientation==="horizontal",s=Io(()=>l("SCROLL_END"),100),[i,l]=cg("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(i==="idle"){const d=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[i,o.scrollHideDelay,l]),h.useEffect(()=>{const d=o.viewport,u=a?"scrollLeft":"scrollTop";if(d){let f=d[u];const m=()=>{const p=d[u];f!==p&&(l("SCROLL"),s()),f=p};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[o.viewport,a,l,s]),c.jsx(it,{present:n||i!=="hidden",children:c.jsx(ws,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:re(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:re(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),od=h.forwardRef((e,t)=>{const n=ut(At,e.__scopeScrollArea),{forceMount:r,...o}=e,[a,s]=h.useState(!1),i=e.orientation==="horizontal",l=Io(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(i?d:u)}},10);return Gn(n.viewport,l),Gn(n.content,l),c.jsx(it,{present:r||a,children:c.jsx(ws,{"data-state":a?"visible":"hidden",...o,ref:t})})}),ws=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ut(At,e.__scopeScrollArea),a=h.useRef(null),s=h.useRef(0),[i,l]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ld(i.viewport,i.content),u={...r,sizes:i,onSizesChange:l,hasThumb:d>0&&d<1,onThumbChange:m=>a.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function f(m,p){return gg(m,s.current,i,p)}return n==="horizontal"?c.jsx(fg,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const m=o.viewport.scrollLeft,p=Hi(m,i,o.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=f(m,o.dir))}}):n==="vertical"?c.jsx(mg,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const m=o.viewport.scrollTop,p=Hi(m,i);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=f(m))}}):null}),fg=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=ut(At,e.__scopeScrollArea),[s,i]=h.useState(),l=h.useRef(null),d=he(t,l,a.onScrollbarXChange);return h.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),c.jsx(sd,{"data-orientation":"horizontal",...o,ref:d,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":zo(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(a.viewport){const m=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(m),ud(m,f)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:mo(s.paddingLeft),paddingEnd:mo(s.paddingRight)}})}})}),mg=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=ut(At,e.__scopeScrollArea),[s,i]=h.useState(),l=h.useRef(null),d=he(t,l,a.onScrollbarYChange);return h.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),c.jsx(sd,{"data-orientation":"vertical",...o,ref:d,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":zo(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(a.viewport){const m=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(m),ud(m,f)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:mo(s.paddingTop),paddingEnd:mo(s.paddingBottom)}})}})}),[pg,ad]=ed(At),sd=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:a,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:u,onResize:f,...m}=e,p=ut(At,n),[j,_]=h.useState(null),g=he(t,k=>_(k)),v=h.useRef(null),x=h.useRef(""),b=p.viewport,w=r.content-r.viewport,S=Ue(u),N=Ue(l),C=Io(f,10);function E(k){if(v.current){const M=k.clientX-v.current.left,D=k.clientY-v.current.top;d({x:M,y:D})}}return h.useEffect(()=>{const k=M=>{const D=M.target;(j==null?void 0:j.contains(D))&&S(M,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[b,j,w,S]),h.useEffect(N,[r,N]),Gn(j,C),Gn(p.content,C),c.jsx(pg,{scope:n,scrollbar:j,hasThumb:o,onThumbChange:Ue(a),onThumbPointerUp:Ue(s),onThumbPositionChange:N,onThumbPointerDown:Ue(i),children:c.jsx(se.div,{...m,ref:g,style:{position:"absolute",...m.style},onPointerDown:re(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),v.current=j.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(k))}),onPointerMove:re(e.onPointerMove,E),onPointerUp:re(e.onPointerUp,k=>{const M=k.target;M.hasPointerCapture(k.pointerId)&&M.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),fo="ScrollAreaThumb",id=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ad(fo,e.__scopeScrollArea);return c.jsx(it,{present:n||o.hasThumb,children:c.jsx(hg,{ref:t,...r})})}),hg=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,a=ut(fo,n),s=ad(fo,n),{onThumbPositionChange:i}=s,l=he(t,f=>s.onThumbChange(f)),d=h.useRef(void 0),u=Io(()=>{d.current&&(d.current(),d.current=void 0)},100);return h.useEffect(()=>{const f=a.viewport;if(f){const m=()=>{if(u(),!d.current){const p=jg(f,i);d.current=p,i()}};return i(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[a.viewport,u,i]),c.jsx(se.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:re(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),j=f.clientX-p.left,_=f.clientY-p.top;s.onThumbPointerDown({x:j,y:_})}),onPointerUp:re(e.onPointerUp,s.onThumbPointerUp)})});id.displayName=fo;var Ns="ScrollAreaCorner",cd=h.forwardRef((e,t)=>{const n=ut(Ns,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(_g,{...e,ref:t}):null});cd.displayName=Ns;var _g=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ut(Ns,n),[a,s]=h.useState(0),[i,l]=h.useState(0),d=!!(a&&i);return Gn(o.scrollbarX,()=>{var f;const u=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Gn(o.scrollbarY,()=>{var f;const u=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),d?c.jsx(se.div,{...r,ref:t,style:{width:a,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function mo(e){return e?parseInt(e,10):0}function ld(e,t){const n=e/t;return isNaN(n)?0:n}function zo(e){const t=ld(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function gg(e,t,n,r="ltr"){const o=zo(n),a=o/2,s=t||a,i=o-s,l=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-i,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return dd([l,d],f)(e)}function Hi(e,t,n="ltr"){const r=zo(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,s=t.content-t.viewport,i=a-r,l=n==="ltr"?[0,s]:[s*-1,0],d=qa(e,l);return dd([0,s],[0,i])(d)}function dd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ud(e,t){return e>0&&e<t}var jg=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},s=n.left!==a.left,i=n.top!==a.top;(s||i)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Io(e,t){const n=Ue(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Gn(e,t){const n=Ue(t);Ye(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var fd=td,yg=rd,vg=cd;const Rt=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(fd,{ref:r,className:ne("cj-relative cj-overflow-hidden",e),...n,children:[c.jsx(yg,{className:"cj-h-full cj-w-full cj-rounded-[inherit] [&>div]:!cj-block [&>div]:!cj-min-w-0 [&>div]:cj-w-full",style:{overflowY:"auto"},children:t}),c.jsx(md,{}),c.jsx(vg,{})]}));Rt.displayName=fd.displayName;const md=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(bs,{ref:r,orientation:t,className:ne("cj-flex cj-touch-none cj-select-none cj-transition-colors",t==="vertical"&&"cj-h-full cj-w-2.5 cj-border-l cj-border-l-transparent cj-p-[1px]",t==="horizontal"&&"cj-h-2.5 cj-flex-col cj-border-t cj-border-t-transparent cj-p-[1px]",e),...n,children:c.jsx(id,{className:"cj-relative cj-flex-1 cj-rounded-full cj-bg-border"})}));md.displayName=bs.displayName;const Va={back:"Back",next:"Next",reset:"Reset",cancel:"Cancel",submit:"Submit",save:"Save",delete:"Delete",close:"Close",empty:"(empty)",path:"Path",unknown:"Unknown",runner_title:"Form Runner",runner_save_exit:"Save & Exit",runner_ready_title:"Ready to begin",runner_onboarding_subtitle:"Before you start, make sure you have the following:",runner_onboarding_line1:"Before you start, please have the relevant information about the incident ready.",runner_onboarding_line2:"We may ask for details such as a description of the incident, the date, location, or supporting documents.",runner_onboarding_photos:"Photos of the incident (damage, location, context)",runner_onboarding_documents:"Relevant documents (policy, ID, etc.)",runner_onboarding_datetime:"Date and time of the event",runner_onboarding_location:"Location",runner_onboarding_description:"Brief description of what happened",runner_start_claim:"Start claim",runner_review_title:"Review Your Answers",runner_no_answers:"No answers recorded.",runner_summary_all_answers:"All answers",runner_review:"Review",runner_step:"Step {{step}}/{{total}}",runner_no_journey:"No journey has been built yet.",runner_no_data:"No journey data available.",builder_title:"Journey Builder",builder_read_only:"Read Only",builder_publish:"Publish",builder_unlock_edit:"Unlock Edit",builder_open_runner:"Open Runner",builder_auto_layout:"Auto Layout",builder_export_json:"Export JSON",builder_export_copied:"Journey spec copied to clipboard",specs_title:"Property Specs",specs_search_placeholder:"Search specs...",specs_filter_all:"All Types",specs_create_custom:"Create Custom Field",specs_count:"{{filtered}} of {{total}} specs",specs_no_results:"No specs found",props_select_hint:"Select a node or edge to edit",props_drag_hint:"Drag specs from the left panel onto the canvas to create nodes",node_props_title:"Node Properties",node_schema_type:"Schema Type",node_source_spec:"Source Spec ID",node_namespace:"Namespace",node_required:"Required",node_required_hint:"Block navigation if empty",node_original_label:"Original Label",node_label_override:"Label Override (optional)",node_label_override_placeholder:"Custom label to display…",node_actor:"Actor",node_actor_customer:"Customer",node_actor_operator:"Operator",node_widget:"Widget Override",node_widget_auto:"Auto (from schema)",node_widget_text:"Text Input",node_widget_textarea:"Textarea",node_widget_select:"Select Dropdown",node_widget_radio:"Radio Group",node_widget_datepicker:"Date Picker",node_widget_timepicker:"Time Picker",node_widget_datetimepicker:"Date & Time Picker",node_widget_currency:"Currency Input",node_widget_upload:"File Upload",node_widget_email:"Email",node_widget_phone:"Phone",node_widget_location:"Location",node_allow_future:"Allow future dates",node_allow_future_hint:"When off, only past or today are selectable",node_bindings_title:"Bindings",node_bindings_target:"Target Namespace",node_bindings_add:"Add Binding",node_delete:"Delete Node",node_options_title:"Options",upload_config_title:"Upload Configuration",upload_file_type_preset:"File type preset",upload_any_file:"Any file",upload_images_only:"Images only",upload_documents_only:"Documents only",upload_images_pdf:"Images + PDFs",upload_custom:"Custom",upload_accepted_types:"Accepted types (custom)",upload_accepted_types_placeholder:"e.g. image/*,.pdf",upload_max_size:"Max file size (MB)",upload_max_size_placeholder:"e.g. 10",edge_props_title:"Edge Properties",edge_connection:"Connection",edge_default:"Default Edge",edge_default_hint:"Used when no other conditions match",edge_priority:"Priority",edge_priority_hint:"Higher priority edges are evaluated first",edge_quick_pick:"Quick pick from source options:",edge_condition:"Condition",edge_visual:"Visual",edge_advanced:"Advanced",edge_json_logic:"JSON Logic condition",edge_delete:"Delete Edge",preview_title:"Form Preview",preview_step_of:"Step {{current}} of {{total}}",preview_start:"Start Preview",preview_add_nodes_hint:"Add nodes to the canvas to preview the form flow.",preview_start_hint:'Click "Start Preview" to test the form flow interactively.',preview_no_node:"No current node selected.",preview_required_hint:"This field is required",preview_validation_hint:"Fix validation errors first",import_title:"Import Journey Spec",import_description:"Load a JourneySpec JSON file or paste JSON to populate the canvas.",import_paste_tab:"Paste JSON",import_upload_tab:"Upload File",import_paste_clipboard:"Paste from Clipboard",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Import Journey",import_validation_errors:"Validation errors:",validation_title:"Graph Validation",validation_no_issues:"No issues found",validation_issue_count:"{{count}} issue{{plural}} found",validation_good:"Graph looks good!",validation_no_issues_actor:"No issues",validation_validate:"Validate",create_node_title:"Create Custom Field",create_node_label:"Label *",create_node_label_placeholder:"Enter a display label",create_node_namespace:"Namespace",create_node_namespace_hint:"Auto-generated from label. Override if needed.",create_node_schema:"Schema Type",upload_drag_drop:"Drag & drop a file here, or click to select",upload_uploading:"Uploading…",widget_unknown_schema:"Unknown schema type: {{schema}}",widget_yes:"Yes",widget_no:"No",widget_no_widget:"No widget available for this field type.",widget_no_options:"No options configured for this select field.",widget_pick_date:"Pick a date",widget_invalid_date:"Enter a valid date",widget_pick_time:"Pick a time",widget_select_option:"Select an option...",widget_search_country:"Search country...",widget_no_country:"No country found.",widget_invalid_phone:"Enter a valid phone number",widget_invalid_email:"Enter a valid email address",widget_file_too_large:"File exceeds {{max}} MB limit ({{size}} MB)",widget_file_type_rejected:"File type not accepted. Allowed: {{accept}}",widget_upload_failed:"Upload failed",widget_accepted_hint:"Accepted: {{accept}}",widget_max_size_hint:"Max {{max}} MB",location_placeholder:"Start typing an address…",location_no_api_key:"Google Maps API key is required for the location widget.",placeholder_text:"Type here…",placeholder_select:"Select an option…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@example.com",placeholder_date:"Select a date…",not_found_title:"404",not_found_message:"Oops! Page not found",not_found_link:"Return to Home",runner_page_back:"Builder",fc_title:"Form Configurator",fc_read_only:"Read-only",fc_undo:"Undo",fc_redo:"Redo",fc_preview_form:"Preview Form",fc_save:"Save",fc_publish:"Publish",fc_unlock_edit:"Unlock edit",fc_tab_steps:"Steps",fc_tab_fields:"Fields",fc_tab_init:"Init",fc_tab_json:"JSON",fc_form_steps:"Form Steps",fc_add_step:"Add Step",fc_step_untitled:"(untitled)",fc_step_meta:"{{rows}} rows, {{fields}} fields",fc_no_steps:"No steps yet.",fc_no_steps_hint_click:"Click",fc_no_steps_hint_to_begin:"to begin.",fc_confirm_title:"Are you sure?",fc_confirm_delete_step:"Delete this step?",fc_step_empty_select:"Select a step on the left.",fc_step_empty_create:"Add a step from the left panel to begin.",fc_step_title_label:"Step Title",fc_step_title_placeholder:"Step title",fc_step_description_label:"Description",fc_step_description_placeholder:"Optional",fc_add_row:"Add Row",fc_row_n:"Row {{n}}",fc_layout_horizontal:"Horizontal",fc_layout_vertical:"Vertical",fc_confirm_delete_row:"Delete this row?",fc_add_field_btn:"Add field",fc_no_fields:"No fields.",fc_edit:"Edit",fc_remove_from_row:"Remove from row",fc_nav_title:"Step Navigation",fc_nav_api_call:"API call on continue",fc_nav_api_call_hint:"Executed before evaluating the rules.",fc_nav_body_template:"Body template (JSON)",fc_nav_body_template_hint_prefix:"Use",fc_nav_body_template_hint_suffix:"tokens.",fc_nav_on_error:"On error",fc_nav_on_error_block:"Block — stay on this step",fc_nav_on_error_continue:"Continue — evaluate rules anyway",fc_nav_on_error_goto:"Go to: {{step}}",fc_nav_on_error_summary:"Go to: Summary",fc_nav_on_error_hint:"What happens if the call throws or the network fails.",fc_nav_continue_button:"Continue button",fc_nav_continue_placeholder:"Continue",fc_nav_rules:"Navigation rules",fc_nav_add_rule:"Add rule",fc_nav_rules_hint:'Rules evaluated in order. First match wins. Use "always" as the last fallback.',fc_nav_rule_n:"Rule {{n}}",fc_nav_has_condition:"Has condition",fc_nav_go_to:"Go to",fc_nav_submit_form:"— Submit form —",fc_nav_field_requires_value:'Field "{{label}}" requires a value.',fc_summary_panel:"Summary Panel",fc_summary_title_label:"Summary Title",fc_summary_sections:"Sections",fc_summary_add_section:"Add Section",fc_summary_section_title_placeholder:"Section title",fc_summary_visible_from:"Visible from step",fc_summary_until_step:"Until step (optional)",fc_summary_all_steps:"All steps",fc_summary_step_n:"Step {{n}}",fc_summary_display_fields:"Display Fields",fc_summary_add:"Add",fc_summary_no_display_fields:"No display fields yet.",fc_summary_no_sections:"No sections yet.",fc_summary_confirm_delete_section:"Delete this section?",fc_summary_source:"Source",fc_summary_source_form_field:"Form Field",fc_summary_source_api_response:"API Response",fc_summary_format:"Format",fc_summary_format_text:"Text",fc_summary_format_number:"Number",fc_summary_format_currency:"Currency",fc_summary_format_date:"Date",fc_summary_format_datetime:"Date & Time",fc_summary_display_label:"Label",fc_summary_display_label_placeholder:"Display label",fc_summary_field:"Field",fc_summary_select:"Select…",fc_summary_from_step_api:"From step API",fc_summary_response_path:"Response Path (dot-notation)",fc_fields_catalog:"Fields catalog",fc_fields_catalog_hint:"All fields used across the form. Edit here to update them everywhere.",fc_fields_add:"Add Field",fc_fields_search:"Search fields…",fc_fields_filter_all:"All",fc_fields_filter_used:"Used",fc_fields_filter_unused:"Unused",fc_fields_unused_badge:"Unused",fc_fields_used_in_one:"Used in {{count}} step",fc_fields_used_in_many:"Used in {{count}} steps",fc_fields_go_to_step:'Go to step "{{title}}"',fc_fields_no_fields:"No fields yet.",fc_fields_no_match:"No fields match the current filter.",fc_fields_confirm_delete:"Delete this field?",fc_init_title:"Initial values",fc_init_subtitle:"Static answers pre-loaded into the runner before the user starts.",fc_init_static:"Static values",fc_init_add:"Add",fc_init_no_values:"No initial values yet.",fc_init_prefill:"Pre-fill from API",fc_init_prefill_hint:"Fetch answers from an endpoint when the runner mounts.",fc_init_mapping:"Mapping (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"Raw JourneySpec (form_config + theme). Edit and click Apply to update the configurator.",fc_json_refresh:"Reload from configurator",fc_json_refresh_hint:"Discard JSON edits and reload from the current configurator state",fc_json_copy:"Copy",fc_json_download:"Download",fc_json_import:"Apply changes",fc_json_apply_hint:"Apply the JSON edits to the configurator",fc_json_imported_ok:"Imported successfully",fc_json_copied:"Copied to clipboard",fc_json_invalid:"Invalid JSON",fc_json_upload:"Upload File",fc_json_file_error:"Could not read the file.",fc_create_field_title:"Add field",fc_create_field_subtitle:"Pick from the catalog or create a custom field.",fc_create_from_catalog:"From catalog ({{count}})",fc_create_custom:"Custom field",fc_create_search_specs:"Search specs…",fc_create_no_specs:"No specs match.",fc_create_label_required:"Label *",fc_create_label_placeholder:"e.g. Customer Name",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"e.g. customer.name (auto if empty)",fc_create_schema:"Schema",fc_create_options:"Options",fc_create_option_value_placeholder:"value",fc_create_option_label_placeholder:"Label",fc_create_cancel:"Cancel",fc_create_create:"Create",fc_field_props:"Field properties",fc_field_no_selected:"No field selected.",fc_field_label:"Label *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Help text",fc_field_required:"Required",fc_field_required_hint:"User must fill before continuing.",fc_field_actor:"Actor",fc_field_actor_customer:"Customer",fc_field_actor_operator:"Operator",fc_field_widget:"Widget",fc_field_widget_auto:"Auto",fc_field_widget_text:"Text",fc_field_widget_textarea:"Textarea",fc_field_widget_select:"Select",fc_field_widget_radio:"Radio",fc_field_widget_date:"Date",fc_field_widget_time:"Time",fc_field_widget_datetime:"Date & Time",fc_field_widget_currency:"Currency",fc_field_widget_upload:"Upload",fc_field_widget_email:"Email",fc_field_widget_phone:"Phone",fc_field_widget_location:"Location",fc_field_widget_boolean:"Boolean (Yes/No)",fc_field_allow_future:"Allow future dates",fc_field_allow_future_hint:"Allow dates after today.",fc_field_display_style:"Display style",fc_field_display_auto:"Auto (radio ≤5, dropdown >5)",fc_field_display_radio:"Radio list",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Segmented buttons",fc_field_display_hint:"Controls how options render at runtime.",fc_field_display_switch:"Switch (toggle)",fc_field_display_yesno:"Segmented (Yes / No buttons)",fc_field_boolean_hint:"Override Yes/No labels by adding 2 options below (first = true, second = false).",fc_field_options:"Options",fc_field_no_options:"No options yet.",fc_field_upload_validation:"Upload validation",fc_field_upload_accept:"Accepted MIME types/extensions",fc_field_upload_max:"Max size (MB)",fc_field_delete:"Delete field",fc_field_done:"Done",fc_field_confirm_delete:"Delete this field from the catalog (and all rows that use it)?",theme_button:"Theme",theme_reset:"Reset",theme_colors:"Colors",theme_primary:"Primary",theme_background:"Background",theme_card:"Card",theme_foreground:"Foreground",theme_color_picker_aria:"{{label}} color picker",theme_color_placeholder:"e.g. 222 47% 11%",theme_color_hint:"Pick a color or type an HSL triplet",theme_typography:"Typography",theme_heading_font:"Heading font",theme_body_font:"Body font",theme_font_default:"Default",theme_font_size:"Base font size (px)",theme_shape_spacing:"Shape & spacing",theme_border_radius:"Border radius (rem)",theme_spacing:"Spacing",theme_spacing_cozy_default:"Cozy (default)",theme_spacing_compact:"Compact",theme_spacing_cozy:"Cozy",theme_spacing_spacious:"Spacious",theme_live_preview:"Live preview",theme_heading_sample:"Heading sample",theme_body_sample:"The quick brown fox jumps over the lazy dog. Body text uses your selected font, size and spacing.",theme_input_sample:"Sample input",theme_primary_action:"Primary action",runner_toast_required_fields:"Please fill the required fields.",runner_toast_api_failed:"API call failed.",runner_toast_answers_copied:"Answers copied to clipboard!",runner_toast_partial_saved:"Partial answers saved (logged).",runner_toast_file_uploaded:"Uploaded {{name}} for {{key}}",runner_loading_preview:"Loading preview…",runner_no_form:"No form configured yet.",runner_back_to_builder:"Back to builder",runner_preset_full:"Full",runner_iframe_title:"Form runner preview",import_invalid_json:"Invalid JSON: could not parse the input.",import_success:"Journey imported successfully",import_clipboard_failed:"Could not read clipboard",shortcut_selected_nodes_one:"Selected {{count}} node",shortcut_selected_nodes_other:"Selected {{count}} nodes",shortcut_deleted:"Deleted",shortcut_undo:"Undo",shortcut_redo:"Redo",shortcut_copied:"Copied to clipboard",shortcut_pasted:"Pasted",shortcut_duplicated:"Duplicated"},xg={back:"Atrás",next:"Siguiente",reset:"Reiniciar",cancel:"Cancelar",submit:"Enviar",save:"Guardar",delete:"Eliminar",close:"Cerrar",empty:"(vacío)",path:"Ruta",unknown:"Desconocido",runner_title:"Formulario",runner_save_exit:"Guardar y Salir",runner_ready_title:"Listo para comenzar",runner_onboarding_subtitle:"Antes de empezar, asegúrate de tener lo siguiente:",runner_onboarding_line1:"Antes de empezar, por favor tenga preparada la información relevante sobre lo ocurrido.",runner_onboarding_line2:"Podremos pedir detalles como una descripción del incidente, la fecha, el lugar o documentos de apoyo.",runner_onboarding_photos:"Fotos del incidente (daño, lugar, contexto)",runner_onboarding_documents:"Documentos relevantes (póliza, identificación, etc.)",runner_onboarding_datetime:"Fecha y hora del suceso",runner_onboarding_location:"Ubicación",runner_onboarding_description:"Descripción breve de lo ocurrido",runner_start_claim:"Comenzar parte",runner_review_title:"Revisa tus respuestas",runner_no_answers:"No hay respuestas registradas.",runner_summary_all_answers:"Todas las respuestas",runner_review:"Revisar",runner_step:"Paso {{step}}/{{total}}",runner_no_journey:"Aún no se ha creado ningún recorrido.",runner_no_data:"Datos del recorrido no disponibles.",builder_title:"Constructor de Recorridos",builder_read_only:"Solo Lectura",builder_publish:"Publicar",builder_unlock_edit:"Desbloquear Edición",builder_open_runner:"Abrir Formulario",builder_auto_layout:"Diseño Automático",builder_export_json:"Exportar JSON",builder_export_copied:"Especificación copiada al portapapeles",specs_title:"Propiedades",specs_search_placeholder:"Buscar...",specs_filter_all:"Todos los Tipos",specs_create_custom:"Crear Campo Personalizado",specs_count:"{{filtered}} de {{total}} propiedades",specs_no_results:"No se encontraron propiedades",props_select_hint:"Selecciona un nodo o arista para editar",props_drag_hint:"Arrastra propiedades del panel izquierdo al lienzo para crear nodos",node_props_title:"Propiedades del Nodo",node_schema_type:"Tipo de Schema",node_source_spec:"ID de Propiedad",node_namespace:"Namespace",node_required:"Obligatorio",node_required_hint:"Bloquear navegación si está vacío",node_original_label:"Etiqueta Original",node_label_override:"Etiqueta Personalizada (opcional)",node_label_override_placeholder:"Etiqueta personalizada…",node_actor:"Actor",node_actor_customer:"Cliente",node_actor_operator:"Operador",node_widget:"Widget",node_widget_auto:"Automático (del schema)",node_widget_text:"Campo de Texto",node_widget_textarea:"Área de Texto",node_widget_select:"Lista Desplegable",node_widget_radio:"Grupo de Radio",node_widget_datepicker:"Selector de Fecha",node_widget_timepicker:"Selector de Hora",node_widget_datetimepicker:"Selector de Fecha y Hora",node_widget_currency:"Campo Monetario",node_widget_upload:"Carga de Archivo",node_widget_email:"Email",node_widget_phone:"Teléfono",node_widget_location:"Ubicación",node_allow_future:"Permitir fechas futuras",node_allow_future_hint:"Cuando está desactivado, solo permite fechas pasadas u hoy",node_bindings_title:"Vínculos",node_bindings_target:"Namespace Destino",node_bindings_add:"Agregar Binding",node_delete:"Eliminar Nodo",node_options_title:"Opciones",upload_config_title:"Configuración de Carga",upload_file_type_preset:"Tipo de archivo",upload_any_file:"Cualquier archivo",upload_images_only:"Solo imágenes",upload_documents_only:"Solo documentos",upload_images_pdf:"Imágenes + PDFs",upload_custom:"Personalizado",upload_accepted_types:"Tipos aceptados (personalizado)",upload_accepted_types_placeholder:"ej: image/*,.pdf",upload_max_size:"Tamaño máximo (MB)",upload_max_size_placeholder:"ej: 10",edge_props_title:"Propiedades de la Arista",edge_connection:"Conexión",edge_default:"Arista Predeterminada",edge_default_hint:"Se usa cuando ninguna otra condición coincide",edge_priority:"Prioridad",edge_priority_hint:"Las aristas con mayor prioridad se evalúan primero",edge_quick_pick:"Selección rápida de opciones:",edge_condition:"Condición",edge_visual:"Visual",edge_advanced:"Avanzado",edge_json_logic:"Condición JSON Logic",edge_delete:"Eliminar Arista",preview_title:"Vista Previa",preview_step_of:"Paso {{current}} de {{total}}",preview_start:"Iniciar Vista Previa",preview_add_nodes_hint:"Agrega nodos al lienzo para previsualizar el flujo.",preview_start_hint:'Haz clic en "Iniciar Vista Previa" para probar el flujo interactivamente.',preview_no_node:"Ningún nodo seleccionado.",preview_required_hint:"Este campo es obligatorio",preview_validation_hint:"Corrige los errores de validación primero",import_title:"Importar Especificación",import_description:"Carga un archivo JSON o pega el JSON para poblar el lienzo.",import_paste_tab:"Pegar JSON",import_upload_tab:"Cargar Archivo",import_paste_clipboard:"Pegar del Portapapeles",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importar",import_validation_errors:"Errores de validación:",validation_title:"Validación del Grafo",validation_no_issues:"Sin problemas encontrados",validation_issue_count:"{{count}} problema{{plural}} encontrado{{plural}}",validation_good:"¡El grafo está correcto!",validation_no_issues_actor:"Sin problemas",validation_validate:"Validar",create_node_title:"Crear Campo Personalizado",create_node_label:"Etiqueta *",create_node_label_placeholder:"Ingresa una etiqueta",create_node_namespace:"Namespace",create_node_namespace_hint:"Generado automáticamente a partir de la etiqueta.",create_node_schema:"Tipo de Schema",upload_drag_drop:"Arrastra y suelta un archivo aquí, o haz clic para seleccionar",upload_uploading:"Cargando…",widget_unknown_schema:"Tipo de schema desconocido: {{schema}}",widget_yes:"Sí",widget_no:"No",widget_no_widget:"No hay widget disponible para este tipo de campo.",widget_no_options:"No hay opciones configuradas para este campo de selección.",widget_pick_date:"Seleccionar fecha",widget_invalid_date:"Introduce una fecha válida",widget_pick_time:"Seleccionar hora",widget_select_option:"Seleccionar una opción...",widget_search_country:"Buscar país...",widget_no_country:"País no encontrado.",widget_invalid_phone:"Ingrese un número de teléfono válido",widget_invalid_email:"Ingrese un correo electrónico válido",widget_file_too_large:"El archivo excede el límite de {{max}} MB ({{size}} MB)",widget_file_type_rejected:"Tipo de archivo no aceptado. Permitidos: {{accept}}",widget_upload_failed:"Error al cargar",widget_accepted_hint:"Aceptados: {{accept}}",widget_max_size_hint:"Máx {{max}} MB",location_placeholder:"Empieza a escribir una dirección…",location_no_api_key:"Se requiere una clave de API de Google Maps para el widget de ubicación.",placeholder_text:"Insertar…",placeholder_select:"Seleccionar…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@ejemplo.com",placeholder_date:"Seleccionar fecha…",not_found_title:"404",not_found_message:"Página no encontrada",not_found_link:"Volver al Inicio",runner_page_back:"Constructor",fc_title:"Configurador de Formulario",fc_read_only:"Solo lectura",fc_undo:"Deshacer",fc_redo:"Rehacer",fc_preview_form:"Vista previa",fc_save:"Guardar",fc_publish:"Publicar",fc_unlock_edit:"Desbloquear edición",fc_tab_steps:"Pasos",fc_tab_fields:"Campos",fc_tab_init:"Inicialización",fc_tab_json:"JSON",fc_form_steps:"Pasos del Formulario",fc_add_step:"Añadir Paso",fc_step_untitled:"(sin título)",fc_step_meta:"{{rows}} filas, {{fields}} campos",fc_no_steps:"Aún sin pasos.",fc_no_steps_hint_click:"Haz clic en",fc_no_steps_hint_to_begin:"para empezar.",fc_confirm_title:"¿Estás seguro?",fc_confirm_delete_step:"¿Eliminar este paso?",fc_step_empty_select:"Selecciona un paso a la izquierda.",fc_step_empty_create:"Añade un paso desde el panel izquierdo para empezar.",fc_step_title_label:"Título del Paso",fc_step_title_placeholder:"Título del paso",fc_step_description_label:"Descripción",fc_step_description_placeholder:"Opcional",fc_add_row:"Añadir Fila",fc_row_n:"Fila {{n}}",fc_layout_horizontal:"Horizontal",fc_layout_vertical:"Vertical",fc_confirm_delete_row:"¿Eliminar esta fila?",fc_add_field_btn:"Añadir campo",fc_no_fields:"Sin campos.",fc_edit:"Editar",fc_remove_from_row:"Quitar de la fila",fc_nav_title:"Navegación del Paso",fc_nav_api_call:"Llamada API al continuar",fc_nav_api_call_hint:"Se ejecuta antes de evaluar las reglas.",fc_nav_body_template:"Plantilla del body (JSON)",fc_nav_body_template_hint_prefix:"Usa tokens",fc_nav_body_template_hint_suffix:".",fc_nav_on_error:"En caso de error",fc_nav_on_error_block:"Bloquear — permanece en este paso",fc_nav_on_error_continue:"Continuar — evalúa las reglas igualmente",fc_nav_on_error_goto:"Ir a: {{step}}",fc_nav_on_error_summary:"Ir a: Resumen",fc_nav_on_error_hint:"Qué ocurre si la llamada falla o la red cae.",fc_nav_continue_button:"Botón continuar",fc_nav_continue_placeholder:"Continuar",fc_nav_rules:"Reglas de navegación",fc_nav_add_rule:"Añadir regla",fc_nav_rules_hint:'Reglas evaluadas en orden. Gana la primera. Usa "siempre" como último recurso.',fc_nav_rule_n:"Regla {{n}}",fc_nav_has_condition:"Tiene condición",fc_nav_go_to:"Ir a",fc_nav_submit_form:"— Enviar formulario —",fc_nav_field_requires_value:'El campo "{{label}}" requiere un valor.',fc_summary_panel:"Panel de Resumen",fc_summary_title_label:"Título del Resumen",fc_summary_sections:"Secciones",fc_summary_add_section:"Añadir Sección",fc_summary_section_title_placeholder:"Título de la sección",fc_summary_visible_from:"Visible desde el paso",fc_summary_until_step:"Hasta el paso (opcional)",fc_summary_all_steps:"Todos los pasos",fc_summary_step_n:"Paso {{n}}",fc_summary_display_fields:"Campos a Mostrar",fc_summary_add:"Añadir",fc_summary_no_display_fields:"Aún sin campos a mostrar.",fc_summary_no_sections:"Aún sin secciones.",fc_summary_confirm_delete_section:"¿Eliminar esta sección?",fc_summary_source:"Origen",fc_summary_source_form_field:"Campo del Formulario",fc_summary_source_api_response:"Respuesta de la API",fc_summary_format:"Formato",fc_summary_format_text:"Texto",fc_summary_format_number:"Número",fc_summary_format_currency:"Moneda",fc_summary_format_date:"Fecha",fc_summary_format_datetime:"Fecha y hora",fc_summary_display_label:"Etiqueta",fc_summary_display_label_placeholder:"Etiqueta a mostrar",fc_summary_field:"Campo",fc_summary_select:"Seleccionar…",fc_summary_from_step_api:"Desde API del paso",fc_summary_response_path:"Ruta de respuesta (notación con puntos)",fc_fields_catalog:"Catálogo de campos",fc_fields_catalog_hint:"Todos los campos usados en el formulario. Edítalos aquí para actualizarlos en todas partes.",fc_fields_add:"Añadir Campo",fc_fields_search:"Buscar campos…",fc_fields_filter_all:"Todos",fc_fields_filter_used:"Usados",fc_fields_filter_unused:"No usados",fc_fields_unused_badge:"No usado",fc_fields_used_in_one:"Usado en {{count}} paso",fc_fields_used_in_many:"Usado en {{count}} pasos",fc_fields_go_to_step:'Ir al paso "{{title}}"',fc_fields_no_fields:"Aún sin campos.",fc_fields_no_match:"Ningún campo coincide con el filtro.",fc_fields_confirm_delete:"¿Eliminar este campo?",fc_init_title:"Valores iniciales",fc_init_subtitle:"Respuestas estáticas precargadas en el runner antes de que el usuario empiece.",fc_init_static:"Valores estáticos",fc_init_add:"Añadir",fc_init_no_values:"Aún sin valores iniciales.",fc_init_prefill:"Precargar desde API",fc_init_prefill_hint:"Obtener respuestas desde un endpoint cuando el runner monta.",fc_init_mapping:"Mapeo (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"JourneySpec en bruto (form_config + theme). Edita y haz clic en Aplicar para actualizar el configurador.",fc_json_refresh:"Recargar del configurador",fc_json_refresh_hint:"Descarta las ediciones del JSON y recarga desde el estado actual del configurador",fc_json_copy:"Copiar",fc_json_download:"Descargar",fc_json_import:"Aplicar cambios",fc_json_apply_hint:"Aplica las ediciones del JSON al configurador",fc_json_imported_ok:"Importado correctamente",fc_json_copied:"Copiado al portapapeles",fc_json_invalid:"JSON no válido",fc_json_upload:"Subir archivo",fc_json_file_error:"No se pudo leer el archivo.",fc_create_field_title:"Añadir campo",fc_create_field_subtitle:"Elige del catálogo o crea un campo personalizado.",fc_create_from_catalog:"Del catálogo ({{count}})",fc_create_custom:"Campo personalizado",fc_create_search_specs:"Buscar specs…",fc_create_no_specs:"Sin specs coincidentes.",fc_create_label_required:"Etiqueta *",fc_create_label_placeholder:"p. ej., Nombre del Cliente",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"p. ej., customer.name (auto si vacío)",fc_create_schema:"Schema",fc_create_options:"Opciones",fc_create_option_value_placeholder:"valor",fc_create_option_label_placeholder:"Etiqueta",fc_create_cancel:"Cancelar",fc_create_create:"Crear",fc_field_props:"Propiedades del campo",fc_field_no_selected:"Ningún campo seleccionado.",fc_field_label:"Etiqueta *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Texto de ayuda",fc_field_required:"Obligatorio",fc_field_required_hint:"El usuario debe rellenarlo antes de continuar.",fc_field_actor:"Actor",fc_field_actor_customer:"Cliente",fc_field_actor_operator:"Operador",fc_field_widget:"Widget",fc_field_widget_auto:"Automático",fc_field_widget_text:"Texto",fc_field_widget_textarea:"Área de texto",fc_field_widget_select:"Lista",fc_field_widget_radio:"Radio",fc_field_widget_date:"Fecha",fc_field_widget_time:"Hora",fc_field_widget_datetime:"Fecha y hora",fc_field_widget_currency:"Moneda",fc_field_widget_upload:"Subida",fc_field_widget_email:"Email",fc_field_widget_phone:"Teléfono",fc_field_widget_location:"Ubicación",fc_field_widget_boolean:"Booleano (Sí/No)",fc_field_allow_future:"Permitir fechas futuras",fc_field_allow_future_hint:"Permitir fechas posteriores a hoy.",fc_field_display_style:"Estilo de presentación",fc_field_display_auto:"Automático (radio ≤5, dropdown >5)",fc_field_display_radio:"Lista radio",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Botones segmentados",fc_field_display_hint:"Controla cómo se muestran las opciones en runtime.",fc_field_display_switch:"Switch (toggle)",fc_field_display_yesno:"Segmentado (botones Sí / No)",fc_field_boolean_hint:"Sustituye las etiquetas Sí/No añadiendo 2 opciones debajo (primera = true, segunda = false).",fc_field_options:"Opciones",fc_field_no_options:"Aún sin opciones.",fc_field_upload_validation:"Validación de la subida",fc_field_upload_accept:"Tipos MIME/extensiones aceptados",fc_field_upload_max:"Tamaño máximo (MB)",fc_field_delete:"Eliminar campo",fc_field_done:"Listo",fc_field_confirm_delete:"¿Eliminar este campo del catálogo (y de todas las filas que lo usan)?",theme_button:"Tema",theme_reset:"Restablecer",theme_colors:"Colores",theme_primary:"Primario",theme_background:"Fondo",theme_card:"Tarjeta",theme_foreground:"Texto",theme_color_picker_aria:"Selector de color {{label}}",theme_color_placeholder:"p. ej., 222 47% 11%",theme_color_hint:"Elige un color o escribe un triplet HSL",theme_typography:"Tipografía",theme_heading_font:"Fuente de títulos",theme_body_font:"Fuente del cuerpo",theme_font_default:"Predeterminada",theme_font_size:"Tamaño base de fuente (px)",theme_shape_spacing:"Forma y espaciado",theme_border_radius:"Radio de bordes (rem)",theme_spacing:"Espaciado",theme_spacing_cozy_default:"Cómodo (predeterminado)",theme_spacing_compact:"Compacto",theme_spacing_cozy:"Cómodo",theme_spacing_spacious:"Espacioso",theme_live_preview:"Vista previa",theme_heading_sample:"Ejemplo de título",theme_body_sample:"El veloz murciélago hindú comía feliz cardillo y kiwi. El texto del cuerpo usa la fuente, tamaño y espaciado que elegiste.",theme_input_sample:"Input de ejemplo",theme_primary_action:"Acción primaria",runner_toast_required_fields:"Completa los campos obligatorios.",runner_toast_api_failed:"La llamada a la API falló.",runner_toast_answers_copied:"¡Respuestas copiadas al portapapeles!",runner_toast_partial_saved:"Respuestas parciales guardadas (registradas).",runner_toast_file_uploaded:"Subido {{name}} para {{key}}",runner_loading_preview:"Cargando vista previa…",runner_no_form:"Ningún formulario configurado.",runner_back_to_builder:"Volver al constructor",runner_preset_full:"Completo",runner_iframe_title:"Vista previa del formulario",import_invalid_json:"JSON inválido: no se pudo analizar la entrada.",import_success:"Journey importada con éxito",import_clipboard_failed:"No se pudo leer el portapapeles",shortcut_selected_nodes_one:"{{count}} nodo seleccionado",shortcut_selected_nodes_other:"{{count}} nodos seleccionados",shortcut_deleted:"Eliminado",shortcut_undo:"Deshacer",shortcut_redo:"Rehacer",shortcut_copied:"Copiado al portapapeles",shortcut_pasted:"Pegado",shortcut_duplicated:"Duplicado"},bg={back:"Voltar",next:"Seguinte",reset:"Reiniciar",cancel:"Cancelar",submit:"Submeter",save:"Guardar",delete:"Eliminar",close:"Fechar",empty:"(vazio)",path:"Caminho",unknown:"Desconhecido",runner_title:"Formulário",runner_save_exit:"Guardar e Sair",runner_ready_title:"Antes de começar, garanta que tem os seguintes dados:",runner_onboarding_subtitle:"Antes de começar, garanta que tem os seguintes dados:",runner_onboarding_line1:"Antes de começar, por favor tenha preparada a informação relevante sobre o ocorrido.",runner_onboarding_line2:"Poderemos pedir detalhes como a descrição do ocorrido, a data, a localização ou documentos de apoio.",runner_onboarding_photos:"Fotos do incidente (dano, local, contexto)",runner_onboarding_documents:"Documentos relevantes (apólice, identificação, etc.)",runner_onboarding_datetime:"Data e hora do ocorrido",runner_onboarding_location:"Localização",runner_onboarding_description:"Descrição breve do que aconteceu",runner_start_claim:"Começar participação",runner_review_title:"Reveja as suas respostas",runner_no_answers:"Nenhuma resposta registada.",runner_summary_all_answers:"Todas as respostas",runner_review:"Rever",runner_step:"Passo {{step}}/{{total}}",runner_no_journey:"Ainda não foi criado nenhum percurso.",runner_no_data:"Dados do percurso indisponíveis.",builder_title:"Construtor de Percursos",builder_read_only:"Só Leitura",builder_publish:"Publicar",builder_unlock_edit:"Desbloquear Edição",builder_open_runner:"Abrir Formulário",builder_auto_layout:"Disposição Auto",builder_export_json:"Exportar JSON",builder_export_copied:"Especificação copiada para a área de transferência",specs_title:"Propriedades",specs_search_placeholder:"Pesquisar...",specs_filter_all:"Todos os Tipos",specs_create_custom:"Criar Campo Personalizado",specs_count:"{{filtered}} de {{total}} propriedades",specs_no_results:"Nenhuma propriedade encontrada",props_select_hint:"Selecione um nó ou aresta para editar",props_drag_hint:"Arraste propriedades do painel esquerdo para a tela para criar nós",node_props_title:"Propriedades do Nó",node_schema_type:"Tipo de Schema",node_source_spec:"ID da Propriedade",node_namespace:"Namespace",node_required:"Obrigatório",node_required_hint:"Bloquear navegação se vazio",node_original_label:"Etiqueta Original",node_label_override:"Etiqueta Personalizada (opcional)",node_label_override_placeholder:"Etiqueta personalizada…",node_actor:"Ator",node_actor_customer:"Cliente",node_actor_operator:"Operador",node_widget:"Widget",node_widget_auto:"Automático (do schema)",node_widget_text:"Campo de Texto",node_widget_textarea:"Área de Texto",node_widget_select:"Lista Suspensa",node_widget_radio:"Grupo de Rádio",node_widget_datepicker:"Seletor de Data",node_widget_timepicker:"Seletor de Hora",node_widget_datetimepicker:"Seletor de Data e Hora",node_widget_currency:"Campo Monetário",node_widget_upload:"Carregamento de Ficheiro",node_widget_email:"Email",node_widget_phone:"Telefone",node_widget_location:"Localização",node_allow_future:"Permitir datas futuras",node_allow_future_hint:"Quando desativado, só permite datas passadas ou hoje",node_bindings_title:"Ligações",node_bindings_target:"Namespace Destino",node_bindings_add:"Adicionar Binding",node_delete:"Eliminar Nó",node_options_title:"Opções",upload_config_title:"Configuração de Upload",upload_file_type_preset:"Tipo de ficheiro",upload_any_file:"Qualquer ficheiro",upload_images_only:"Apenas imagens",upload_documents_only:"Apenas documentos",upload_images_pdf:"Imagens + PDFs",upload_custom:"Personalizado",upload_accepted_types:"Tipos aceites (personalizado)",upload_accepted_types_placeholder:"ex: image/*,.pdf",upload_max_size:"Tamanho máximo (MB)",upload_max_size_placeholder:"ex: 10",edge_props_title:"Propriedades da Aresta",edge_connection:"Ligação",edge_default:"Aresta Padrão",edge_default_hint:"Usada quando nenhuma outra condição coincide",edge_priority:"Prioridade",edge_priority_hint:"Arestas com maior prioridade são avaliadas primeiro",edge_quick_pick:"Seleção rápida das opções:",edge_condition:"Condição",edge_visual:"Visual",edge_advanced:"Avançado",edge_json_logic:"Condição JSON Logic",edge_delete:"Eliminar Aresta",preview_title:"Pré-visualização",preview_step_of:"Passo {{current}} de {{total}}",preview_start:"Iniciar Pré-visualização",preview_add_nodes_hint:"Adicione nós à tela para pré-visualizar o fluxo.",preview_start_hint:'Clique em "Iniciar Pré-visualização" para testar o fluxo interativamente.',preview_no_node:"Nenhum nó selecionado.",preview_required_hint:"Este campo é obrigatório",preview_validation_hint:"Corrija os erros de validação primeiro",import_title:"Importar Especificação",import_description:"Carregue um ficheiro JSON ou cole o JSON para popular a tela.",import_paste_tab:"Colar JSON",import_upload_tab:"Carregar Ficheiro",import_paste_clipboard:"Colar da Área de Transferência",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importar",import_validation_errors:"Erros de validação:",validation_title:"Validação do Grafo",validation_no_issues:"Sem problemas encontrados",validation_issue_count:"{{count}} problema{{plural}} encontrado{{plural}}",validation_good:"O grafo está correto!",validation_no_issues_actor:"Sem problemas",validation_validate:"Validar",create_node_title:"Criar Campo Personalizado",create_node_label:"Etiqueta *",create_node_label_placeholder:"Introduza uma etiqueta",create_node_namespace:"Namespace",create_node_namespace_hint:"Gerado automaticamente a partir da etiqueta.",create_node_schema:"Tipo de Schema",upload_drag_drop:"Arraste e largue um ficheiro aqui, ou clique para selecionar",upload_uploading:"A carregar…",widget_unknown_schema:"Tipo de schema desconhecido: {{schema}}",widget_yes:"Sim",widget_no:"Não",widget_no_widget:"Nenhum widget disponível para este tipo de campo.",widget_no_options:"Nenhuma opção configurada para este campo de seleção.",widget_pick_date:"Selecionar data",widget_invalid_date:"Introduza uma data válida",widget_pick_time:"Selecionar hora",widget_select_option:"Selecionar uma opção...",widget_search_country:"Pesquisar país...",widget_no_country:"País não encontrado.",widget_invalid_phone:"Introduza um número de telefone válido",widget_invalid_email:"Introduza um e-mail válido",widget_file_too_large:"O ficheiro excede o limite de {{max}} MB ({{size}} MB)",widget_file_type_rejected:"Tipo de ficheiro não aceite. Permitidos: {{accept}}",widget_upload_failed:"Falha ao carregar",widget_accepted_hint:"Aceites: {{accept}}",widget_max_size_hint:"Máx {{max}} MB",location_placeholder:"Comece a digitar um endereço…",location_no_api_key:"É necessária uma chave de API do Google Maps para o widget de localização.",placeholder_text:"Inserir…",placeholder_select:"Selecionar…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@exemplo.com",placeholder_date:"Selecionar data…",not_found_title:"404",not_found_message:"Página não encontrada",not_found_link:"Voltar ao Início",runner_page_back:"Construtor",fc_title:"Configurador de Formulário",fc_read_only:"Só leitura",fc_undo:"Desfazer",fc_redo:"Refazer",fc_preview_form:"Pré-visualizar",fc_save:"Guardar",fc_publish:"Publicar",fc_unlock_edit:"Desbloquear edição",fc_tab_steps:"Passos",fc_tab_fields:"Campos",fc_tab_init:"Inicialização",fc_tab_json:"JSON",fc_form_steps:"Passos do Formulário",fc_add_step:"Adicionar Passo",fc_step_untitled:"(sem título)",fc_step_meta:"{{rows}} linhas, {{fields}} campos",fc_no_steps:"Ainda sem passos.",fc_no_steps_hint_click:"Clique em",fc_no_steps_hint_to_begin:"para começar.",fc_confirm_title:"Tem a certeza?",fc_confirm_delete_step:"Eliminar este passo?",fc_step_empty_select:"Selecione um passo à esquerda.",fc_step_empty_create:"Adicione um passo no painel à esquerda para começar.",fc_step_title_label:"Título do Passo",fc_step_title_placeholder:"Título do passo",fc_step_description_label:"Descrição",fc_step_description_placeholder:"Opcional",fc_add_row:"Adicionar Linha",fc_row_n:"Linha {{n}}",fc_layout_horizontal:"Horizontal",fc_layout_vertical:"Vertical",fc_confirm_delete_row:"Eliminar esta linha?",fc_add_field_btn:"Adicionar campo",fc_no_fields:"Sem campos.",fc_edit:"Editar",fc_remove_from_row:"Remover da linha",fc_nav_title:"Navegação do Passo",fc_nav_api_call:"Chamada API ao continuar",fc_nav_api_call_hint:"Executada antes de avaliar as regras.",fc_nav_body_template:"Template do body (JSON)",fc_nav_body_template_hint_prefix:"Use tokens",fc_nav_body_template_hint_suffix:".",fc_nav_on_error:"Em caso de erro",fc_nav_on_error_block:"Bloquear — permanece neste passo",fc_nav_on_error_continue:"Continuar — avalia as regras na mesma",fc_nav_on_error_goto:"Ir para: {{step}}",fc_nav_on_error_summary:"Ir para: Resumo",fc_nav_on_error_hint:"O que acontece se a chamada falhar ou a rede cair.",fc_nav_continue_button:"Botão continuar",fc_nav_continue_placeholder:"Continuar",fc_nav_rules:"Regras de navegação",fc_nav_add_rule:"Adicionar regra",fc_nav_rules_hint:'Regras avaliadas por ordem. Vence a primeira. Use "sempre" como último fallback.',fc_nav_rule_n:"Regra {{n}}",fc_nav_has_condition:"Tem condição",fc_nav_go_to:"Ir para",fc_nav_submit_form:"— Submeter formulário —",fc_nav_field_requires_value:'O campo "{{label}}" requer um valor.',fc_summary_panel:"Painel de Resumo",fc_summary_title_label:"Título do Resumo",fc_summary_sections:"Secções",fc_summary_add_section:"Adicionar Secção",fc_summary_section_title_placeholder:"Título da secção",fc_summary_visible_from:"Visível a partir do passo",fc_summary_until_step:"Até ao passo (opcional)",fc_summary_all_steps:"Todos os passos",fc_summary_step_n:"Passo {{n}}",fc_summary_display_fields:"Campos a Mostrar",fc_summary_add:"Adicionar",fc_summary_no_display_fields:"Ainda sem campos a mostrar.",fc_summary_no_sections:"Ainda sem secções.",fc_summary_confirm_delete_section:"Eliminar esta secção?",fc_summary_source:"Origem",fc_summary_source_form_field:"Campo do Formulário",fc_summary_source_api_response:"Resposta da API",fc_summary_format:"Formato",fc_summary_format_text:"Texto",fc_summary_format_number:"Número",fc_summary_format_currency:"Moeda",fc_summary_format_date:"Data",fc_summary_format_datetime:"Data e Hora",fc_summary_display_label:"Etiqueta",fc_summary_display_label_placeholder:"Etiqueta a apresentar",fc_summary_field:"Campo",fc_summary_select:"Selecionar…",fc_summary_from_step_api:"Do API do passo",fc_summary_response_path:"Caminho da resposta (notação por pontos)",fc_fields_catalog:"Catálogo de campos",fc_fields_catalog_hint:"Todos os campos usados no formulário. Editar aqui atualiza-os em todo o lado.",fc_fields_add:"Adicionar Campo",fc_fields_search:"Pesquisar campos…",fc_fields_filter_all:"Todos",fc_fields_filter_used:"Usados",fc_fields_filter_unused:"Não usados",fc_fields_unused_badge:"Não usado",fc_fields_used_in_one:"Usado em {{count}} passo",fc_fields_used_in_many:"Usado em {{count}} passos",fc_fields_go_to_step:'Ir para o passo "{{title}}"',fc_fields_no_fields:"Ainda sem campos.",fc_fields_no_match:"Nenhum campo corresponde ao filtro.",fc_fields_confirm_delete:"Eliminar este campo?",fc_init_title:"Valores iniciais",fc_init_subtitle:"Respostas estáticas pré-carregadas no runner antes do utilizador começar.",fc_init_static:"Valores estáticos",fc_init_add:"Adicionar",fc_init_no_values:"Ainda sem valores iniciais.",fc_init_prefill:"Pré-preencher a partir de API",fc_init_prefill_hint:"Obter respostas de um endpoint quando o runner monta.",fc_init_mapping:"Mapeamento (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"JourneySpec em bruto (form_config + theme). Edite e clique em Aplicar para atualizar o configurador.",fc_json_refresh:"Recarregar do configurador",fc_json_refresh_hint:"Descarta as edições do JSON e recarrega o estado atual do configurador",fc_json_copy:"Copiar",fc_json_download:"Descarregar",fc_json_import:"Aplicar alterações",fc_json_apply_hint:"Aplica as edições do JSON ao configurador",fc_json_imported_ok:"Importado com sucesso",fc_json_copied:"Copiado para a área de transferência",fc_json_invalid:"JSON inválido",fc_json_upload:"Carregar Ficheiro",fc_json_file_error:"Não foi possível ler o ficheiro.",fc_create_field_title:"Adicionar campo",fc_create_field_subtitle:"Escolha do catálogo ou crie um campo personalizado.",fc_create_from_catalog:"Do catálogo ({{count}})",fc_create_custom:"Campo personalizado",fc_create_search_specs:"Pesquisar specs…",fc_create_no_specs:"Sem specs correspondentes.",fc_create_label_required:"Etiqueta *",fc_create_label_placeholder:"ex.: Nome do Cliente",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"ex.: customer.name (automático se vazio)",fc_create_schema:"Schema",fc_create_options:"Opções",fc_create_option_value_placeholder:"valor",fc_create_option_label_placeholder:"Etiqueta",fc_create_cancel:"Cancelar",fc_create_create:"Criar",fc_field_props:"Propriedades do campo",fc_field_no_selected:"Nenhum campo selecionado.",fc_field_label:"Etiqueta *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Texto de ajuda",fc_field_required:"Obrigatório",fc_field_required_hint:"O utilizador tem de preencher antes de continuar.",fc_field_actor:"Ator",fc_field_actor_customer:"Cliente",fc_field_actor_operator:"Operador",fc_field_widget:"Widget",fc_field_widget_auto:"Automático",fc_field_widget_text:"Texto",fc_field_widget_textarea:"Área de texto",fc_field_widget_select:"Lista",fc_field_widget_radio:"Radio",fc_field_widget_date:"Data",fc_field_widget_time:"Hora",fc_field_widget_datetime:"Data e Hora",fc_field_widget_currency:"Moeda",fc_field_widget_upload:"Upload",fc_field_widget_email:"Email",fc_field_widget_phone:"Telefone",fc_field_widget_location:"Localização",fc_field_widget_boolean:"Booleano (Sim/Não)",fc_field_allow_future:"Permitir datas futuras",fc_field_allow_future_hint:"Permitir datas após hoje.",fc_field_display_style:"Estilo de apresentação",fc_field_display_auto:"Automático (radio ≤5, dropdown >5)",fc_field_display_radio:"Lista radio",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Botões segmentados",fc_field_display_hint:"Controla como as opções aparecem em runtime.",fc_field_display_switch:"Switch (toggle)",fc_field_display_yesno:"Segmentado (botões Sim / Não)",fc_field_boolean_hint:"Substitua as etiquetas Sim/Não adicionando 2 opções abaixo (primeira = true, segunda = false).",fc_field_options:"Opções",fc_field_no_options:"Ainda sem opções.",fc_field_upload_validation:"Validação do upload",fc_field_upload_accept:"Tipos MIME/extensões aceites",fc_field_upload_max:"Tamanho máximo (MB)",fc_field_delete:"Eliminar campo",fc_field_done:"Concluído",fc_field_confirm_delete:"Eliminar este campo do catálogo (e de todas as linhas que o usam)?",theme_button:"Tema",theme_reset:"Repor",theme_colors:"Cores",theme_primary:"Primária",theme_background:"Fundo",theme_card:"Cartão",theme_foreground:"Texto",theme_color_picker_aria:"Seletor de cor {{label}}",theme_color_placeholder:"ex.: 222 47% 11%",theme_color_hint:"Escolha uma cor ou escreva um triplet HSL",theme_typography:"Tipografia",theme_heading_font:"Fonte dos títulos",theme_body_font:"Fonte do corpo",theme_font_default:"Predefinido",theme_font_size:"Tamanho base da fonte (px)",theme_shape_spacing:"Forma e espaçamento",theme_border_radius:"Raio das bordas (rem)",theme_spacing:"Espaçamento",theme_spacing_cozy_default:"Cómodo (predefinido)",theme_spacing_compact:"Compacto",theme_spacing_cozy:"Cómodo",theme_spacing_spacious:"Espaçoso",theme_live_preview:"Pré-visualização",theme_heading_sample:"Exemplo de título",theme_body_sample:"A rápida raposa castanha salta sobre o cão preguiçoso. O texto do corpo usa a fonte, tamanho e espaçamento que escolheu.",theme_input_sample:"Input de exemplo",theme_primary_action:"Ação primária",runner_toast_required_fields:"Preencha os campos obrigatórios.",runner_toast_api_failed:"A chamada à API falhou.",runner_toast_answers_copied:"Respostas copiadas para a área de transferência!",runner_toast_partial_saved:"Respostas parciais guardadas (registadas).",runner_toast_file_uploaded:"Enviado {{name}} para {{key}}",runner_loading_preview:"A carregar pré-visualização…",runner_no_form:"Nenhum formulário configurado.",runner_back_to_builder:"Voltar ao construtor",runner_preset_full:"Total",runner_iframe_title:"Pré-visualização do formulário",import_invalid_json:"JSON inválido: não foi possível analisar a entrada.",import_success:"Journey importada com sucesso",import_clipboard_failed:"Não foi possível ler a área de transferência",shortcut_selected_nodes_one:"{{count}} nó selecionado",shortcut_selected_nodes_other:"{{count}} nós selecionados",shortcut_deleted:"Eliminado",shortcut_undo:"Desfazer",shortcut_redo:"Refazer",shortcut_copied:"Copiado para a área de transferência",shortcut_pasted:"Colado",shortcut_duplicated:"Duplicado"},wg={back:"Wstecz",next:"Dalej",reset:"Resetuj",cancel:"Anuluj",submit:"Wyślij",save:"Zapisz",delete:"Usuń",close:"Zamknij",empty:"(puste)",path:"Ścieżka",unknown:"Nieznany",runner_title:"Formularz",runner_save_exit:"Zapisz i wyjdź",runner_ready_title:"Zanim zaczniesz, upewnij się, że masz następujące dane:",runner_onboarding_subtitle:"Zanim zaczniesz, upewnij się, że masz następujące dane:",runner_onboarding_line1:"Zanim zaczniesz, proszę przygotuj odpowiednie informacje o zdarzeniu.",runner_onboarding_line2:"Możemy poprosić o szczegóły, takie jak opis zdarzenia, datę, lokalizację lub dokumenty pomocnicze.",runner_onboarding_photos:"Zdjęcia incydentu (szkoda, miejsce, kontekst)",runner_onboarding_documents:"Istotne dokumenty (polisa, dowód tożsamości itp.)",runner_onboarding_datetime:"Data i godzina zdarzenia",runner_onboarding_location:"Lokalizacja",runner_onboarding_description:"Krótki opis tego, co się wydarzyło",runner_start_claim:"Rozpocznij zgłoszenie",runner_review_title:"Przejrzyj swoje odpowiedzi",runner_no_answers:"Brak zarejestrowanych odpowiedzi.",runner_summary_all_answers:"Wszystkie odpowiedzi",runner_review:"Przegląd",runner_step:"Krok {{step}}/{{total}}",runner_no_journey:"Nie utworzono jeszcze żadnej ścieżki.",runner_no_data:"Dane ścieżki niedostępne.",builder_title:"Kreator ścieżek",builder_read_only:"Tylko do odczytu",builder_publish:"Publikuj",builder_unlock_edit:"Odblokuj edycję",builder_open_runner:"Otwórz formularz",builder_auto_layout:"Auto-układ",builder_export_json:"Eksportuj JSON",builder_export_copied:"Specyfikacja skopiowana do schowka",specs_title:"Właściwości",specs_search_placeholder:"Szukaj...",specs_filter_all:"Wszystkie typy",specs_create_custom:"Utwórz pole niestandardowe",specs_count:"{{filtered}} z {{total}} właściwości",specs_no_results:"Nie znaleziono właściwości",props_select_hint:"Wybierz węzeł lub krawędź do edycji",props_drag_hint:"Przeciągnij właściwości z lewego panelu na płótno, aby utworzyć węzły",node_props_title:"Właściwości węzła",node_schema_type:"Typ schematu",node_source_spec:"ID właściwości",node_namespace:"Namespace",node_required:"Wymagane",node_required_hint:"Blokuj nawigację, jeśli puste",node_original_label:"Oryginalna etykieta",node_label_override:"Etykieta niestandardowa (opcjonalna)",node_label_override_placeholder:"Etykieta niestandardowa…",node_actor:"Aktor",node_actor_customer:"Klient",node_actor_operator:"Operator",node_widget:"Widżet",node_widget_auto:"Automatyczny (ze schematu)",node_widget_text:"Pole tekstowe",node_widget_textarea:"Obszar tekstowy",node_widget_select:"Lista rozwijana",node_widget_radio:"Grupa radio",node_widget_datepicker:"Wybór daty",node_widget_timepicker:"Wybór godziny",node_widget_datetimepicker:"Wybór daty i godziny",node_widget_currency:"Pole walutowe",node_widget_upload:"Przesyłanie pliku",node_widget_email:"E-mail",node_widget_phone:"Telefon",node_widget_location:"Lokalizacja",node_allow_future:"Zezwól na przyszłe daty",node_allow_future_hint:"Gdy wyłączone, zezwala tylko na daty z przeszłości lub dzisiaj",node_bindings_title:"Powiązania",node_bindings_target:"Docelowy namespace",node_bindings_add:"Dodaj powiązanie",node_delete:"Usuń węzeł",node_options_title:"Opcje",upload_config_title:"Konfiguracja przesyłania",upload_file_type_preset:"Typ pliku",upload_any_file:"Dowolny plik",upload_images_only:"Tylko obrazy",upload_documents_only:"Tylko dokumenty",upload_images_pdf:"Obrazy + PDF",upload_custom:"Niestandardowy",upload_accepted_types:"Akceptowane typy (niestandardowe)",upload_accepted_types_placeholder:"np.: image/*,.pdf",upload_max_size:"Maksymalny rozmiar (MB)",upload_max_size_placeholder:"np.: 10",edge_props_title:"Właściwości krawędzi",edge_connection:"Połączenie",edge_default:"Krawędź domyślna",edge_default_hint:"Używana, gdy żaden inny warunek nie jest spełniony",edge_priority:"Priorytet",edge_priority_hint:"Krawędzie o wyższym priorytecie są oceniane jako pierwsze",edge_quick_pick:"Szybki wybór opcji:",edge_condition:"Warunek",edge_visual:"Wizualny",edge_advanced:"Zaawansowany",edge_json_logic:"Warunek JSON Logic",edge_delete:"Usuń krawędź",preview_title:"Podgląd",preview_step_of:"Krok {{current}} z {{total}}",preview_start:"Rozpocznij podgląd",preview_add_nodes_hint:"Dodaj węzły do płótna, aby wyświetlić podgląd przepływu.",preview_start_hint:"Kliknij „Rozpocznij podgląd”, aby interaktywnie przetestować przepływ.",preview_no_node:"Nie wybrano węzła.",preview_required_hint:"To pole jest wymagane",preview_validation_hint:"Najpierw popraw błędy walidacji",import_title:"Importuj specyfikację",import_description:"Wgraj plik JSON lub wklej JSON, aby wypełnić płótno.",import_paste_tab:"Wklej JSON",import_upload_tab:"Wgraj plik",import_paste_clipboard:"Wklej ze schowka",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importuj",import_validation_errors:"Błędy walidacji:",validation_title:"Walidacja grafu",validation_no_issues:"Nie znaleziono problemów",validation_issue_count:"Znaleziono {{count}} problem{{plural}}",validation_good:"Graf jest poprawny!",validation_no_issues_actor:"Brak problemów",validation_validate:"Waliduj",create_node_title:"Utwórz pole niestandardowe",create_node_label:"Etykieta *",create_node_label_placeholder:"Wprowadź etykietę",create_node_namespace:"Namespace",create_node_namespace_hint:"Generowany automatycznie z etykiety.",create_node_schema:"Typ schematu",upload_drag_drop:"Przeciągnij i upuść plik tutaj lub kliknij, aby wybrać",upload_uploading:"Przesyłanie…",widget_unknown_schema:"Nieznany typ schematu: {{schema}}",widget_yes:"Tak",widget_no:"Nie",widget_no_widget:"Brak dostępnego widżetu dla tego typu pola.",widget_no_options:"Brak skonfigurowanych opcji dla tego pola wyboru.",widget_pick_date:"Wybierz datę",widget_invalid_date:"Wprowadź prawidłową datę",widget_pick_time:"Wybierz godzinę",widget_select_option:"Wybierz opcję...",widget_search_country:"Szukaj kraju...",widget_no_country:"Nie znaleziono kraju.",widget_invalid_phone:"Wprowadź prawidłowy numer telefonu",widget_invalid_email:"Wprowadź prawidłowy e-mail",widget_file_too_large:"Plik przekracza limit {{max}} MB ({{size}} MB)",widget_file_type_rejected:"Typ pliku nie jest akceptowany. Dozwolone: {{accept}}",widget_upload_failed:"Przesyłanie nie powiodło się",widget_accepted_hint:"Akceptowane: {{accept}}",widget_max_size_hint:"Maks. {{max}} MB",location_placeholder:"Zacznij wpisywać adres…",location_no_api_key:"Klucz API Google Maps jest wymagany dla widżetu lokalizacji.",placeholder_text:"Wpisz…",placeholder_select:"Wybierz…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@przyklad.pl",placeholder_date:"Wybierz datę…",not_found_title:"404",not_found_message:"Strona nie znaleziona",not_found_link:"Powrót do strony głównej",runner_page_back:"Kreator",fc_title:"Konfigurator Formularza",fc_read_only:"Tylko do odczytu",fc_undo:"Cofnij",fc_redo:"Ponów",fc_preview_form:"Podgląd",fc_save:"Zapisz",fc_publish:"Opublikuj",fc_unlock_edit:"Odblokuj edycję",fc_tab_steps:"Kroki",fc_tab_fields:"Pola",fc_tab_init:"Inicjalizacja",fc_tab_json:"JSON",fc_form_steps:"Kroki Formularza",fc_add_step:"Dodaj Krok",fc_step_untitled:"(bez tytułu)",fc_step_meta:"{{rows}} wierszy, {{fields}} pól",fc_no_steps:"Brak kroków.",fc_no_steps_hint_click:"Kliknij",fc_no_steps_hint_to_begin:"aby rozpocząć.",fc_confirm_title:"Czy na pewno?",fc_confirm_delete_step:"Usunąć ten krok?",fc_step_empty_select:"Wybierz krok po lewej.",fc_step_empty_create:"Dodaj krok z lewego panelu, aby rozpocząć.",fc_step_title_label:"Tytuł kroku",fc_step_title_placeholder:"Tytuł kroku",fc_step_description_label:"Opis",fc_step_description_placeholder:"Opcjonalnie",fc_add_row:"Dodaj wiersz",fc_row_n:"Wiersz {{n}}",fc_layout_horizontal:"Poziomy",fc_layout_vertical:"Pionowy",fc_confirm_delete_row:"Usunąć ten wiersz?",fc_add_field_btn:"Dodaj pole",fc_no_fields:"Brak pól.",fc_edit:"Edytuj",fc_remove_from_row:"Usuń z wiersza",fc_nav_title:"Nawigacja kroku",fc_nav_api_call:"Wywołanie API przy kontynuacji",fc_nav_api_call_hint:"Wykonywane przed oceną reguł.",fc_nav_body_template:"Szablon body (JSON)",fc_nav_body_template_hint_prefix:"Użyj tokenów",fc_nav_body_template_hint_suffix:".",fc_nav_on_error:"W przypadku błędu",fc_nav_on_error_block:"Zablokuj — pozostań na tym kroku",fc_nav_on_error_continue:"Kontynuuj — oceń reguły mimo to",fc_nav_on_error_goto:"Przejdź do: {{step}}",fc_nav_on_error_summary:"Przejdź do: Podsumowanie",fc_nav_on_error_hint:"Co się dzieje, jeśli wywołanie się nie powiedzie lub sieć padnie.",fc_nav_continue_button:"Przycisk kontynuacji",fc_nav_continue_placeholder:"Kontynuuj",fc_nav_rules:"Reguły nawigacji",fc_nav_add_rule:"Dodaj regułę",fc_nav_rules_hint:'Reguły oceniane po kolei. Wygrywa pierwsza. Użyj "zawsze" jako ostatniej.',fc_nav_rule_n:"Reguła {{n}}",fc_nav_has_condition:"Ma warunek",fc_nav_go_to:"Przejdź do",fc_nav_submit_form:"— Wyślij formularz —",fc_nav_field_requires_value:'Pole "{{label}}" wymaga wartości.',fc_summary_panel:"Panel podsumowania",fc_summary_title_label:"Tytuł podsumowania",fc_summary_sections:"Sekcje",fc_summary_add_section:"Dodaj sekcję",fc_summary_section_title_placeholder:"Tytuł sekcji",fc_summary_visible_from:"Widoczna od kroku",fc_summary_until_step:"Do kroku (opcjonalne)",fc_summary_all_steps:"Wszystkie kroki",fc_summary_step_n:"Krok {{n}}",fc_summary_display_fields:"Pola do wyświetlenia",fc_summary_add:"Dodaj",fc_summary_no_display_fields:"Brak pól do wyświetlenia.",fc_summary_no_sections:"Brak sekcji.",fc_summary_confirm_delete_section:"Usunąć tę sekcję?",fc_summary_source:"Źródło",fc_summary_source_form_field:"Pole formularza",fc_summary_source_api_response:"Odpowiedź API",fc_summary_format:"Format",fc_summary_format_text:"Tekst",fc_summary_format_number:"Liczba",fc_summary_format_currency:"Waluta",fc_summary_format_date:"Data",fc_summary_format_datetime:"Data i godzina",fc_summary_display_label:"Etykieta",fc_summary_display_label_placeholder:"Etykieta do wyświetlenia",fc_summary_field:"Pole",fc_summary_select:"Wybierz…",fc_summary_from_step_api:"Z API kroku",fc_summary_response_path:"Ścieżka odpowiedzi (notacja z kropkami)",fc_fields_catalog:"Katalog pól",fc_fields_catalog_hint:"Wszystkie pola używane w formularzu. Edycja tutaj aktualizuje wszędzie.",fc_fields_add:"Dodaj pole",fc_fields_search:"Szukaj pól…",fc_fields_filter_all:"Wszystkie",fc_fields_filter_used:"Używane",fc_fields_filter_unused:"Nieużywane",fc_fields_unused_badge:"Nieużywane",fc_fields_used_in_one:"Używane w {{count}} kroku",fc_fields_used_in_many:"Używane w {{count}} krokach",fc_fields_go_to_step:'Przejdź do kroku "{{title}}"',fc_fields_no_fields:"Brak pól.",fc_fields_no_match:"Żadne pole nie pasuje do filtra.",fc_fields_confirm_delete:"Usunąć to pole?",fc_init_title:"Wartości początkowe",fc_init_subtitle:"Statyczne odpowiedzi wstępnie wczytane do runnera przed rozpoczęciem.",fc_init_static:"Wartości statyczne",fc_init_add:"Dodaj",fc_init_no_values:"Brak wartości początkowych.",fc_init_prefill:"Wstępne wypełnienie z API",fc_init_prefill_hint:"Pobierz odpowiedzi z endpointu przy montowaniu runnera.",fc_init_mapping:"Mapowanie (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"Surowy JourneySpec (form_config + theme). Edytuj i kliknij Zastosuj, aby zaktualizować konfigurator.",fc_json_refresh:"Wczytaj z konfiguratora",fc_json_refresh_hint:"Odrzuć zmiany w JSON i wczytaj ponownie aktualny stan konfiguratora",fc_json_copy:"Kopiuj",fc_json_download:"Pobierz",fc_json_import:"Zastosuj zmiany",fc_json_apply_hint:"Zastosuj zmiany JSON w konfiguratorze",fc_json_imported_ok:"Zaimportowano pomyślnie",fc_json_copied:"Skopiowano do schowka",fc_json_invalid:"Nieprawidłowy JSON",fc_json_upload:"Prześlij plik",fc_json_file_error:"Nie udało się odczytać pliku.",fc_create_field_title:"Dodaj pole",fc_create_field_subtitle:"Wybierz z katalogu lub utwórz pole niestandardowe.",fc_create_from_catalog:"Z katalogu ({{count}})",fc_create_custom:"Pole niestandardowe",fc_create_search_specs:"Szukaj specs…",fc_create_no_specs:"Brak pasujących specs.",fc_create_label_required:"Etykieta *",fc_create_label_placeholder:"np. Nazwa klienta",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"np. customer.name (automatycznie jeśli puste)",fc_create_schema:"Schema",fc_create_options:"Opcje",fc_create_option_value_placeholder:"wartość",fc_create_option_label_placeholder:"Etykieta",fc_create_cancel:"Anuluj",fc_create_create:"Utwórz",fc_field_props:"Właściwości pola",fc_field_no_selected:"Nie wybrano pola.",fc_field_label:"Etykieta *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Tekst pomocy",fc_field_required:"Wymagane",fc_field_required_hint:"Użytkownik musi wypełnić przed kontynuacją.",fc_field_actor:"Aktor",fc_field_actor_customer:"Klient",fc_field_actor_operator:"Operator",fc_field_widget:"Widget",fc_field_widget_auto:"Automatyczny",fc_field_widget_text:"Tekst",fc_field_widget_textarea:"Pole tekstowe",fc_field_widget_select:"Lista",fc_field_widget_radio:"Radio",fc_field_widget_date:"Data",fc_field_widget_time:"Godzina",fc_field_widget_datetime:"Data i godzina",fc_field_widget_currency:"Waluta",fc_field_widget_upload:"Załącznik",fc_field_widget_email:"Email",fc_field_widget_phone:"Telefon",fc_field_widget_location:"Lokalizacja",fc_field_widget_boolean:"Boolean (Tak/Nie)",fc_field_allow_future:"Zezwól na przyszłe daty",fc_field_allow_future_hint:"Zezwól na daty po dzisiejszej.",fc_field_display_style:"Styl wyświetlania",fc_field_display_auto:"Auto (radio ≤5, dropdown >5)",fc_field_display_radio:"Lista radio",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Przyciski segmentowane",fc_field_display_hint:"Kontroluje wygląd opcji w runtime.",fc_field_display_switch:"Switch (przełącznik)",fc_field_display_yesno:"Segmentowany (przyciski Tak / Nie)",fc_field_boolean_hint:"Nadpisz etykiety Tak/Nie dodając 2 opcje poniżej (pierwsza = true, druga = false).",fc_field_options:"Opcje",fc_field_no_options:"Brak opcji.",fc_field_upload_validation:"Walidacja załącznika",fc_field_upload_accept:"Akceptowane typy MIME/rozszerzenia",fc_field_upload_max:"Maksymalny rozmiar (MB)",fc_field_delete:"Usuń pole",fc_field_done:"Gotowe",fc_field_confirm_delete:"Usunąć to pole z katalogu (i ze wszystkich wierszy, które go używają)?",theme_button:"Motyw",theme_reset:"Resetuj",theme_colors:"Kolory",theme_primary:"Podstawowy",theme_background:"Tło",theme_card:"Karta",theme_foreground:"Tekst",theme_color_picker_aria:"Wybór koloru {{label}}",theme_color_placeholder:"np. 222 47% 11%",theme_color_hint:"Wybierz kolor lub wpisz triplet HSL",theme_typography:"Typografia",theme_heading_font:"Czcionka nagłówków",theme_body_font:"Czcionka treści",theme_font_default:"Domyślna",theme_font_size:"Bazowy rozmiar czcionki (px)",theme_shape_spacing:"Kształt i odstępy",theme_border_radius:"Promień zaokrąglenia (rem)",theme_spacing:"Odstępy",theme_spacing_cozy_default:"Komfortowe (domyślne)",theme_spacing_compact:"Kompaktowe",theme_spacing_cozy:"Komfortowe",theme_spacing_spacious:"Przestronne",theme_live_preview:"Podgląd na żywo",theme_heading_sample:"Przykładowy nagłówek",theme_body_sample:"Zażółć gęślą jaźń. Tekst treści używa wybranej czcionki, rozmiaru i odstępów.",theme_input_sample:"Przykładowe pole",theme_primary_action:"Akcja podstawowa",runner_toast_required_fields:"Wypełnij wymagane pola.",runner_toast_api_failed:"Wywołanie API nie powiodło się.",runner_toast_answers_copied:"Odpowiedzi skopiowane do schowka!",runner_toast_partial_saved:"Częściowe odpowiedzi zapisane (zalogowane).",runner_toast_file_uploaded:"Przesłano {{name}} dla {{key}}",runner_loading_preview:"Ładowanie podglądu…",runner_no_form:"Nie skonfigurowano formularza.",runner_back_to_builder:"Wróć do kreatora",runner_preset_full:"Pełny",runner_iframe_title:"Podgląd formularza",import_invalid_json:"Nieprawidłowy JSON: nie można przeanalizować danych.",import_success:"Journey zaimportowana pomyślnie",import_clipboard_failed:"Nie można odczytać schowka",shortcut_selected_nodes_one:"Zaznaczono {{count}} węzeł",shortcut_selected_nodes_other:"Zaznaczono {{count}} węzłów",shortcut_deleted:"Usunięto",shortcut_undo:"Cofnij",shortcut_redo:"Ponów",shortcut_copied:"Skopiowano do schowka",shortcut_pasted:"Wklejono",shortcut_duplicated:"Zduplikowano"},Yi={en:Va,es:xg,pt:bg,pl:wg},Ss="language",wr="en";function Ng(){try{return localStorage.getItem(Ss)||wr}catch{return wr}}let yr=[],Cs=Ng();function Sg(e){return yr.push(e),()=>{yr=yr.filter(t=>t!==e)}}function Cg(){return Cs}function pd(e){try{localStorage.setItem(Ss,e)}catch{}Cs=e,yr.forEach(t=>t())}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ss&&(Cs=e.newValue||wr,yr.forEach(t=>t()))});function je(){const e=y.useSyncExternalStore(Sg,Cg,()=>wr),t=Yi[e]||Yi[wr]||Va;return{t:y.useCallback((r,o)=>{let a=t[r]??Va[r]??r;if(o)for(const[s,i]of Object.entries(o))a=a.replace(new RegExp(`\\{\\{${s}\\}\\}`,"g"),String(i));return a},[t]),language:e,setLanguage:pd}}function kg(e,t=globalThis==null?void 0:globalThis.document){const n=Ue(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Pg="DismissableLayer",Ga="dismissableLayer.update",Eg="dismissableLayer.pointerDownOutside",Mg="dismissableLayer.focusOutside",qi,hd=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:i,...l}=e,d=h.useContext(hd),[u,f]=h.useState(null),m=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),j=he(t,C=>f(C)),_=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=_.indexOf(g),x=u?_.indexOf(u):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,w=x>=v,S=Rg(C=>{const E=C.target,k=[...d.branches].some(M=>M.contains(E));!w||k||(o==null||o(C),s==null||s(C),C.defaultPrevented||i==null||i())},m),N=Og(C=>{const E=C.target;[...d.branches].some(M=>M.contains(E))||(a==null||a(C),s==null||s(C),C.defaultPrevented||i==null||i())},m);return kg(C=>{x===d.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&i&&(C.preventDefault(),i()))},m),h.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(qi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Vi(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=qi)}},[u,m,n,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Vi())},[u,d]),h.useEffect(()=>{const C=()=>p({});return document.addEventListener(Ga,C),()=>document.removeEventListener(Ga,C)},[]),c.jsx(se.div,{...l,ref:j,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,N.onFocusCapture),onBlurCapture:re(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,S.onPointerDownCapture)})});Wo.displayName=Pg;var Dg="DismissableLayerBranch",Tg=h.forwardRef((e,t)=>{const n=h.useContext(hd),r=h.useRef(null),o=he(t,r);return h.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),c.jsx(se.div,{...e,ref:o})});Tg.displayName=Dg;function Rg(e,t=globalThis==null?void 0:globalThis.document){const n=Ue(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const a=i=>{if(i.target&&!r.current){let l=function(){_d(Eg,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Og(e,t=globalThis==null?void 0:globalThis.document){const n=Ue(e),r=h.useRef(!1);return h.useEffect(()=>{const o=a=>{a.target&&!r.current&&_d(Mg,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vi(){const e=new CustomEvent(Ga);document.dispatchEvent(e)}function _d(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ih(o,a):o.dispatchEvent(a)}var wa="focusScope.autoFocusOnMount",Na="focusScope.autoFocusOnUnmount",Gi={bubbles:!1,cancelable:!0},Ag="FocusScope",$o=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,l]=h.useState(null),d=Ue(o),u=Ue(a),f=h.useRef(null),m=he(t,_=>l(_)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let _=function(b){if(p.paused||!i)return;const w=b.target;i.contains(w)?f.current=w:nn(f.current,{select:!0})},g=function(b){if(p.paused||!i)return;const w=b.relatedTarget;w!==null&&(i.contains(w)||nn(f.current,{select:!0}))},v=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&nn(i)};document.addEventListener("focusin",_),document.addEventListener("focusout",g);const x=new MutationObserver(v);return i&&x.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",g),x.disconnect()}}},[r,i,p.paused]),h.useEffect(()=>{if(i){Xi.add(p);const _=document.activeElement;if(!i.contains(_)){const v=new CustomEvent(wa,Gi);i.addEventListener(wa,d),i.dispatchEvent(v),v.defaultPrevented||(zg(Lg(gd(i)),{select:!0}),document.activeElement===_&&nn(i))}return()=>{i.removeEventListener(wa,d),setTimeout(()=>{const v=new CustomEvent(Na,Gi);i.addEventListener(Na,u),i.dispatchEvent(v),v.defaultPrevented||nn(_??document.body,{select:!0}),i.removeEventListener(Na,u),Xi.remove(p)},0)}}},[i,d,u,p]);const j=h.useCallback(_=>{if(!n&&!r||p.paused)return;const g=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,v=document.activeElement;if(g&&v){const x=_.currentTarget,[b,w]=Ig(x);b&&w?!_.shiftKey&&v===w?(_.preventDefault(),n&&nn(b,{select:!0})):_.shiftKey&&v===b&&(_.preventDefault(),n&&nn(w,{select:!0})):v===x&&_.preventDefault()}},[n,r,p.paused]);return c.jsx(se.div,{tabIndex:-1,...s,ref:m,onKeyDown:j})});$o.displayName=Ag;function zg(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nn(r,{select:t}),document.activeElement!==n)return}function Ig(e){const t=gd(e),n=Ui(t,e),r=Ui(t.reverse(),e);return[n,r]}function gd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ui(e,t){for(const n of e)if(!Wg(n,{upTo:t}))return n}function Wg(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $g(e){return e instanceof HTMLInputElement&&"select"in e}function nn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$g(e)&&t&&e.select()}}var Xi=Fg();function Fg(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ki(e,t),e.unshift(t)},remove(t){var n;e=Ki(e,t),(n=e[0])==null||n.resume()}}}function Ki(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Lg(e){return e.filter(t=>t.tagName!=="A")}var Bg="Portal",Fo=h.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,a]=h.useState(!1);Ye(()=>a(!0),[]);const s=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?fs.createPortal(c.jsx(se.div,{...r,ref:t}),s):null});Fo.displayName=Bg;var Sa=0;function ks(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ji()),document.body.insertAdjacentElement("beforeend",e[1]??Ji()),Sa++,()=>{Sa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Sa--}},[])}function Ji(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ct.apply(this,arguments)};function jd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Hg(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ro="right-scroll-bar-position",oo="width-before-scroll-bar",Yg="with-scroll-bars-hidden",qg="--removed-body-scroll-bar-size";function Ca(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Vg(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Gg=typeof window<"u"?h.useLayoutEffect:h.useEffect,Qi=new WeakMap;function Ug(e,t){var n=Vg(null,function(r){return e.forEach(function(o){return Ca(o,r)})});return Gg(function(){var r=Qi.get(n);if(r){var o=new Set(r),a=new Set(e),s=n.current;o.forEach(function(i){a.has(i)||Ca(i,null)}),a.forEach(function(i){o.has(i)||Ca(i,s)})}Qi.set(n,e)},[e]),n}function Xg(e){return e}function Kg(e,t){t===void 0&&(t=Xg);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(i){return a(i)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var i=n;n=[],i.forEach(a),s=n}var l=function(){var u=s;s=[],u.forEach(a)},d=function(){return Promise.resolve().then(l)};d(),n={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),n}}}};return o}function Jg(e){e===void 0&&(e={});var t=Kg(null);return t.options=Ct({async:!0,ssr:!1},e),t}var yd=function(e){var t=e.sideCar,n=jd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ct({},n))};yd.isSideCarExport=!0;function Qg(e,t){return e.useMedium(t),yd}var vd=Jg(),ka=function(){},Lo=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:ka,onWheelCapture:ka,onTouchMoveCapture:ka}),o=r[0],a=r[1],s=e.forwardProps,i=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,j=e.noIsolation,_=e.inert,g=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,b=e.gapMode,w=jd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,N=Ug([n,t]),C=Ct(Ct({},w),o);return h.createElement(h.Fragment,null,u&&h.createElement(S,{sideCar:vd,removeScrollBar:d,shards:f,noRelative:p,noIsolation:j,inert:_,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),s?h.cloneElement(h.Children.only(i),Ct(Ct({},C),{ref:N})):h.createElement(x,Ct({},C,{className:l,ref:N}),i))});Lo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lo.classNames={fullWidth:oo,zeroRight:ro};var Zg=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ej(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zg();return t&&e.setAttribute("nonce",t),e}function tj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ej())&&(tj(t,n),nj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oj=function(){var e=rj();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xd=function(){var e=oj(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},aj={left:0,top:0,right:0,gap:0},Pa=function(e){return parseInt(e||"",10)||0},sj=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Pa(n),Pa(r),Pa(o)]},ij=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aj;var t=sj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},cj=xd(),Yn="data-scroll-locked",lj=function(e,t,n,r){var o=e.left,a=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),`
227
+ */const Tl=ue("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),To=v.createContext(null);To.displayName="PanelGroupContext";const ze={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},gs=10,vn=v.useLayoutEffect,Oi=h.useId,O_=typeof Oi=="function"?Oi:()=>null;let A_=0;function js(e=null){const t=O_(),n=v.useRef(e||t||null);return n.current===null&&(n.current=""+A_++),e??n.current}function Rl({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:a,id:s,maxSize:i,minSize:l,onCollapse:d,onExpand:u,onResize:f,order:m,style:p,tagName:g="div",..._}){const j=v.useContext(To);if(j===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:x,getPanelSize:b,getPanelStyle:w,groupId:S,isPanelCollapsed:N,reevaluatePanelConstraints:C,registerPanel:E,resizePanel:k,unregisterPanel:M}=j,D=js(s),T=v.useRef({callbacks:{onCollapse:d,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:i,minSize:l},id:D,idIsFromProps:s!==void 0,order:m});v.useRef({didLogMissingDefaultSizeWarning:!1}),vn(()=>{const{callbacks:A,constraints:H}=T.current,W={...H};T.current.id=D,T.current.idIsFromProps=s!==void 0,T.current.order=m,A.onCollapse=d,A.onExpand=u,A.onResize=f,H.collapsedSize=n,H.collapsible=r,H.defaultSize=o,H.maxSize=i,H.minSize=l,(W.collapsedSize!==H.collapsedSize||W.collapsible!==H.collapsible||W.maxSize!==H.maxSize||W.minSize!==H.minSize)&&C(T.current,W)}),vn(()=>{const A=T.current;return E(A),()=>{M(A)}},[m,D,E,M]),v.useImperativeHandle(a,()=>({collapse:()=>{y(T.current)},expand:A=>{x(T.current,A)},getId(){return D},getSize(){return b(T.current)},isCollapsed(){return N(T.current)},isExpanded(){return!N(T.current)},resize:A=>{k(T.current,A)}}),[y,x,b,N,D,k]);const $=w(T.current,o);return v.createElement(g,{..._,children:e,className:t,id:D,style:{...$,...p},[ze.groupId]:S,[ze.panel]:"",[ze.panelCollapsible]:r||void 0,[ze.panelId]:D,[ze.panelSize]:parseFloat(""+$.flexGrow).toFixed(1)})}const Ol=v.forwardRef((e,t)=>v.createElement(Rl,{...e,forwardedRef:t}));Rl.displayName="Panel";Ol.displayName="forwardRef(Panel)";let Ya=null,no=-1,rn=null;function z_(e,t){if(t){const n=(t&$l)!==0,r=(t&Fl)!==0,o=(t&Ll)!==0,a=(t&Bl)!==0;if(n)return o?"se-resize":a?"ne-resize":"e-resize";if(r)return o?"sw-resize":a?"nw-resize":"w-resize";if(o)return"s-resize";if(a)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function I_(){rn!==null&&(document.head.removeChild(rn),Ya=null,rn=null,no=-1)}function ga(e,t){var n,r;const o=z_(e,t);if(Ya!==o){if(Ya=o,rn===null&&(rn=document.createElement("style"),document.head.appendChild(rn)),no>=0){var a;(a=rn.sheet)===null||a===void 0||a.removeRule(no)}no=(n=(r=rn.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function Al(e){return e.type==="keydown"}function zl(e){return e.type.startsWith("pointer")}function Il(e){return e.type.startsWith("mouse")}function Ro(e){if(zl(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Il(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function W_(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function $_(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function F_(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ii(e),b:Ii(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;me(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:zi(Ai(n.a)),b:zi(Ai(n.b))};if(o.a===o.b){const a=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let i=a.length;for(;i--;){const l=a[i];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const L_=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function B_(e){var t;const n=getComputedStyle((t=Wl(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function H_(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||B_(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||L_.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ai(e){let t=e.length;for(;t--;){const n=e[t];if(me(n,"Missing node"),H_(n))return n}return null}function zi(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ii(e){const t=[];for(;e;)t.push(e),e=Wl(e);return t}function Wl(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const $l=1,Fl=2,Ll=4,Bl=8,Y_=W_()==="coarse";let yt=[],Hn=!1,gn=new Map,Oo=new Map;const xr=new Set;function q_(e,t,n,r,o){var a;const{ownerDocument:s}=t,i={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(a=gn.get(s))!==null&&a!==void 0?a:0;return gn.set(s,l+1),xr.add(i),lo(),function(){var u;Oo.delete(e),xr.delete(i);const f=(u=gn.get(s))!==null&&u!==void 0?u:1;if(gn.set(s,f-1),lo(),f===1&&gn.delete(s),yt.includes(i)){const m=yt.indexOf(i);m>=0&&yt.splice(m,1),vs(),o("up",!0,null)}}}function V_(e){const{target:t}=e,{x:n,y:r}=Ro(e);Hn=!0,ys({target:t,x:n,y:r}),lo(),yt.length>0&&(uo("down",e),e.preventDefault(),Hl(t)||e.stopImmediatePropagation())}function ja(e){const{x:t,y:n}=Ro(e);if(Hn&&e.buttons===0&&(Hn=!1,uo("up",e)),!Hn){const{target:r}=e;ys({target:r,x:t,y:n})}uo("move",e),vs(),yt.length>0&&e.preventDefault()}function ya(e){const{target:t}=e,{x:n,y:r}=Ro(e);Oo.clear(),Hn=!1,yt.length>0&&(e.preventDefault(),Hl(t)||e.stopImmediatePropagation()),uo("up",e),ys({target:t,x:n,y:r}),vs(),lo()}function Hl(e){let t=e;for(;t;){if(t.hasAttribute(ze.resizeHandle))return!0;t=t.parentElement}return!1}function ys({target:e,x:t,y:n}){yt.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),xr.forEach(o=>{const{element:a,hitAreaMargins:s}=o,i=a.getBoundingClientRect(),{bottom:l,left:d,right:u,top:f}=i,m=Y_?s.coarse:s.fine;if(t>=d-m&&t<=u+m&&n>=f-m&&n<=l+m){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&F_(r,a)>0){let g=r,_=!1;for(;g&&!g.contains(a);){if($_(g.getBoundingClientRect(),i)){_=!0;break}g=g.parentElement}if(_)return}yt.push(o)}})}function va(e,t){Oo.set(e,t)}function vs(){let e=!1,t=!1;yt.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Oo.forEach(r=>{n|=r}),e&&t?ga("intersection",n):e?ga("horizontal",n):t?ga("vertical",n):I_()}let xa=new AbortController;function lo(){xa.abort(),xa=new AbortController;const e={capture:!0,signal:xa.signal};xr.size&&(Hn?(yt.length>0&&gn.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("contextmenu",ya,e),r.addEventListener("pointerleave",ja,e),r.addEventListener("pointermove",ja,e))}),window.addEventListener("pointerup",ya,e),window.addEventListener("pointercancel",ya,e)):gn.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("pointerdown",V_,e),r.addEventListener("pointermove",ja,e))}))}function uo(e,t){xr.forEach(n=>{const{setResizeHandlerState:r}=n,o=yt.includes(n);r(e,o,t)})}function G_(){const[e,t]=v.useState(0);return v.useCallback(()=>t(n=>n+1),[])}function me(e,t){if(!e)throw console.error(t),Error(t)}function xn(e,t,n=gs){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function $t(e,t,n=gs){return xn(e,t,n)===0}function tt(e,t,n){return xn(e,t,n)===0}function U_(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],a=t[r];if(!tt(o,a,n))return!1}return!0}function Ln({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];me(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:a,maxSize:s=100,minSize:i=0}=r;if(xn(n,i)<0)if(a){const l=(o+i)/2;xn(n,l)<0?n=o:n=i}else n=i;return n=Math.min(s,n),n=parseFloat(n.toFixed(gs)),n}function pr({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:a}){if(tt(e,0))return t;const s=[...t],[i,l]=r;me(i!=null,"Invalid first pivot index"),me(l!=null,"Invalid second pivot index");let d=0;if(a==="keyboard"){{const f=e<0?l:i,m=n[f];me(m,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:g,minSize:_=0}=m;if(g){const j=t[f];if(me(j!=null,`Previous layout not found for panel index ${f}`),tt(j,p)){const y=_-j;xn(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}{const f=e<0?i:l,m=n[f];me(m,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:g,minSize:_=0}=m;if(g){const j=t[f];if(me(j!=null,`Previous layout not found for panel index ${f}`),tt(j,_)){const y=j-p;xn(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const f=e<0?1:-1;let m=e<0?l:i,p=0;for(;;){const _=t[m];me(_!=null,`Previous layout not found for panel index ${m}`);const y=Ln({panelConstraints:n,panelIndex:m,size:100})-_;if(p+=y,m+=f,m<0||m>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let m=e<0?i:l;for(;m>=0&&m<n.length;){const p=Math.abs(e)-Math.abs(d),g=t[m];me(g!=null,`Previous layout not found for panel index ${m}`);const _=g-p,j=Ln({panelConstraints:n,panelIndex:m,size:_});if(!tt(g,j)&&(d+=g-j,s[m]=j,d.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?m--:m++}}if(U_(o,s))return o;{const f=e<0?l:i,m=t[f];me(m!=null,`Previous layout not found for panel index ${f}`);const p=m+d,g=Ln({panelConstraints:n,panelIndex:f,size:p});if(s[f]=g,!tt(g,p)){let _=p-g,y=e<0?l:i;for(;y>=0&&y<n.length;){const x=s[y];me(x!=null,`Previous layout not found for panel index ${y}`);const b=x+_,w=Ln({panelConstraints:n,panelIndex:y,size:b});if(tt(x,w)||(_-=w-x,s[y]=w),tt(_,0))break;e>0?y--:y++}}}const u=s.reduce((f,m)=>m+f,0);return tt(u,100)?s:o}function X_({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,a=0,s=0;const i=n[0];me(i!=null,"No pivot index found"),t.forEach((f,m)=>{const{constraints:p}=f,{maxSize:g=100,minSize:_=0}=p;m===i?(r=_,o=g):(a+=_,s+=g)});const l=Math.min(o,100-a),d=Math.max(r,100-s),u=e[i];return{valueMax:l,valueMin:d,valueNow:u}}function br(e,t=document){return Array.from(t.querySelectorAll(`[${ze.resizeHandleId}][data-panel-group-id="${e}"]`))}function Yl(e,t,n=document){const o=br(e,n).findIndex(a=>a.getAttribute(ze.resizeHandleId)===t);return o??null}function ql(e,t,n){const r=Yl(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Vl(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Ao(e,t=document){const n=t.querySelector(`[${ze.resizeHandleId}="${e}"]`);return n||null}function K_(e,t,n,r=document){var o,a,s,i;const l=Ao(t,r),d=br(e,r),u=l?d.indexOf(l):-1,f=(o=(a=n[u])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null,m=(s=(i=n[u+1])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null;return[f,m]}function J_({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:a,setLayout:s}){v.useRef({didWarnAboutMissingResizeHandle:!1}),vn(()=>{if(!a)return;const i=br(n,a);for(let l=0;l<o.length-1;l++){const{valueMax:d,valueMin:u,valueNow:f}=X_({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),m=i[l];if(m!=null){const p=o[l];me(p,`No panel data found for index "${l}"`),m.setAttribute("aria-controls",p.id),m.setAttribute("aria-valuemax",""+Math.round(d)),m.setAttribute("aria-valuemin",""+Math.round(u)),m.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{i.forEach((l,d)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,a]),v.useEffect(()=>{if(!a)return;const i=t.current;me(i,"Eager values not found");const{panelDataArray:l}=i,d=Vl(n,a);me(d!=null,`No group found for id "${n}"`);const u=br(n,a);me(u,`No resize handles found for group id "${n}"`);const f=u.map(m=>{const p=m.getAttribute(ze.resizeHandleId);me(p,"Resize handle element has no handle id attribute");const[g,_]=K_(n,p,l,a);if(g==null||_==null)return()=>{};const j=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const x=l.findIndex(b=>b.id===g);if(x>=0){const b=l[x];me(b,`No panel data found for index ${x}`);const w=r[x],{collapsedSize:S=0,collapsible:N,minSize:C=0}=b.constraints;if(w!=null&&N){const E=pr({delta:tt(w,S)?C-S:S-w,initialLayout:r,panelConstraints:l.map(k=>k.constraints),pivotIndices:ql(n,p,a),prevLayout:r,trigger:"keyboard"});r!==E&&s(E)}}break}}};return m.addEventListener("keydown",j),()=>{m.removeEventListener("keydown",j)}});return()=>{f.forEach(m=>m())}},[a,e,t,n,r,o,s])}function Wi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Gl(e,t){const n=e==="horizontal",{x:r,y:o}=Ro(t);return n?r:o}function Q_(e,t,n,r,o){const a=n==="horizontal",s=Ao(t,o);me(s,`No resize handle element found for id "${t}"`);const i=s.getAttribute(ze.groupId);me(i,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const d=Gl(n,e),u=Vl(i,o);me(u,`No group element found for id "${i}"`);const f=u.getBoundingClientRect(),m=a?f.width:f.height;return(d-l)/m*100}function Z_(e,t,n,r,o,a){if(Al(e)){const s=n==="horizontal";let i=0;e.shiftKey?i=100:o!=null?i=o:i=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:i;break;case"ArrowLeft":l=s?-i:0;break;case"ArrowRight":l=s?i:0;break;case"ArrowUp":l=s?0:-i;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:Q_(e,t,n,r,a)}function eg({panelDataArray:e}){const t=Array(e.length),n=e.map(a=>a.constraints);let r=0,o=100;for(let a=0;a<e.length;a++){const s=n[a];me(s,`Panel constraints not found for index ${a}`);const{defaultSize:i}=s;i!=null&&(r++,t[a]=i,o-=i)}for(let a=0;a<e.length;a++){const s=n[a];me(s,`Panel constraints not found for index ${a}`);const{defaultSize:i}=s;if(i!=null)continue;const l=e.length-r,d=o/l;r++,t[a]=d,o-=d}return t}function Tn(e,t,n){t.forEach((r,o)=>{const a=e[o];me(a,`Panel data not found for index ${o}`);const{callbacks:s,constraints:i,id:l}=a,{collapsedSize:d=0,collapsible:u}=i,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:m,onExpand:p,onResize:g}=s;g&&g(r,f),u&&(m||p)&&(p&&(f==null||$t(f,d))&&!$t(r,d)&&p(),m&&(f==null||!$t(f,d))&&$t(r,d)&&m())}})}function Yr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function tg({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:a=3}){const s=n[o];let i;return s==null?i=e!=null?e.toPrecision(a):"1":r.length===1?i="1":i=s.toPrecision(a),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function ng(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function $i(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Ul(e){return`react-resizable-panels:${e}`}function Xl(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:a}=t;return o?r:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function Kl(e,t){try{const n=Ul(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function rg(e,t,n){var r,o;const a=(r=Kl(e,n))!==null&&r!==void 0?r:{},s=Xl(t);return(o=a[s])!==null&&o!==void 0?o:null}function og(e,t,n,r,o){var a;const s=Ul(e),i=Xl(t),l=(a=Kl(e,o))!==null&&a!==void 0?a:{};l[i]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(d){console.error(d)}}function Fi({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((a,s)=>a+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!tt(r,100)&&n.length>0)for(let a=0;a<t.length;a++){const s=n[a];me(s!=null,`No layout data found for index ${a}`);const i=100/r*s;n[a]=i}let o=0;for(let a=0;a<t.length;a++){const s=n[a];me(s!=null,`No layout data found for index ${a}`);const i=Ln({panelConstraints:t,panelIndex:a,size:s});s!=i&&(o+=s-i,n[a]=i)}if(!tt(o,0))for(let a=0;a<t.length;a++){const s=n[a];me(s!=null,`No layout data found for index ${a}`);const i=s+o,l=Ln({panelConstraints:t,panelIndex:a,size:i});if(s!==l&&(o-=l-s,n[a]=l,tt(o,0)))break}return n}const ag=100,hr={getItem:e=>($i(hr),hr.getItem(e)),setItem:(e,t)=>{$i(hr),hr.setItem(e,t)}},Li={};function Jl({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:a=null,onLayout:s=null,keyboardResizeBy:i=null,storage:l=hr,style:d,tagName:u="div",...f}){const m=js(a),p=v.useRef(null),[g,_]=v.useState(null),[j,y]=v.useState([]),x=G_(),b=v.useRef({}),w=v.useRef(new Map),S=v.useRef(0),N=v.useRef({autoSaveId:e,direction:r,dragState:g,id:m,keyboardResizeBy:i,onLayout:s,storage:l}),C=v.useRef({layout:j,panelDataArray:[],panelDataArrayChanged:!1});v.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),v.useImperativeHandle(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:R}=C.current;return R},setLayout:R=>{const{onLayout:I}=N.current,{layout:Y,panelDataArray:U}=C.current,P=Fi({layout:R,panelConstraints:U.map(O=>O.constraints)});Wi(Y,P)||(y(P),C.current.layout=P,I&&I(P),Tn(U,P,b.current))}}),[]),vn(()=>{N.current.autoSaveId=e,N.current.direction=r,N.current.dragState=g,N.current.id=m,N.current.onLayout=s,N.current.storage=l}),J_({committedValuesRef:N,eagerValuesRef:C,groupId:m,layout:j,panelDataArray:C.current.panelDataArray,setLayout:y,panelGroupElement:p.current}),v.useEffect(()=>{const{panelDataArray:R}=C.current;if(e){if(j.length===0||j.length!==R.length)return;let I=Li[e];I==null&&(I=ng(og,ag),Li[e]=I);const Y=[...R],U=new Map(w.current);I(e,Y,U,j,l)}},[e,j,l]),v.useEffect(()=>{});const E=v.useCallback(R=>{const{onLayout:I}=N.current,{layout:Y,panelDataArray:U}=C.current;if(R.constraints.collapsible){const P=U.map(V=>V.constraints),{collapsedSize:O=0,panelSize:B,pivotIndices:L}=pn(U,R,Y);if(me(B!=null,`Panel size not found for panel "${R.id}"`),!$t(B,O)){w.current.set(R.id,B);const ee=$n(U,R)===U.length-1?B-O:O-B,ae=pr({delta:ee,initialLayout:Y,panelConstraints:P,pivotIndices:L,prevLayout:Y,trigger:"imperative-api"});Yr(Y,ae)||(y(ae),C.current.layout=ae,I&&I(ae),Tn(U,ae,b.current))}}},[]),k=v.useCallback((R,I)=>{const{onLayout:Y}=N.current,{layout:U,panelDataArray:P}=C.current;if(R.constraints.collapsible){const O=P.map(_e=>_e.constraints),{collapsedSize:B=0,panelSize:L=0,minSize:V=0,pivotIndices:ee}=pn(P,R,U),ae=I??V;if($t(L,B)){const _e=w.current.get(R.id),Se=_e!=null&&_e>=ae?_e:ae,Be=$n(P,R)===P.length-1?L-Se:Se-L,ke=pr({delta:Be,initialLayout:U,panelConstraints:O,pivotIndices:ee,prevLayout:U,trigger:"imperative-api"});Yr(U,ke)||(y(ke),C.current.layout=ke,Y&&Y(ke),Tn(P,ke,b.current))}}},[]),M=v.useCallback(R=>{const{layout:I,panelDataArray:Y}=C.current,{panelSize:U}=pn(Y,R,I);return me(U!=null,`Panel size not found for panel "${R.id}"`),U},[]),D=v.useCallback((R,I)=>{const{panelDataArray:Y}=C.current,U=$n(Y,R);return tg({defaultSize:I,dragState:g,layout:j,panelData:Y,panelIndex:U})},[g,j]),T=v.useCallback(R=>{const{layout:I,panelDataArray:Y}=C.current,{collapsedSize:U=0,collapsible:P,panelSize:O}=pn(Y,R,I);return me(O!=null,`Panel size not found for panel "${R.id}"`),P===!0&&$t(O,U)},[]),$=v.useCallback(R=>{const{layout:I,panelDataArray:Y}=C.current,{collapsedSize:U=0,collapsible:P,panelSize:O}=pn(Y,R,I);return me(O!=null,`Panel size not found for panel "${R.id}"`),!P||xn(O,U)>0},[]),A=v.useCallback(R=>{const{panelDataArray:I}=C.current;I.push(R),I.sort((Y,U)=>{const P=Y.order,O=U.order;return P==null&&O==null?0:P==null?-1:O==null?1:P-O}),C.current.panelDataArrayChanged=!0,x()},[x]);vn(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:R,onLayout:I,storage:Y}=N.current,{layout:U,panelDataArray:P}=C.current;let O=null;if(R){const L=rg(R,P,Y);L&&(w.current=new Map(Object.entries(L.expandToSizes)),O=L.layout)}O==null&&(O=eg({panelDataArray:P}));const B=Fi({layout:O,panelConstraints:P.map(L=>L.constraints)});Wi(U,B)||(y(B),C.current.layout=B,I&&I(B),Tn(P,B,b.current))}}),vn(()=>{const R=C.current;return()=>{R.layout=[]}},[]);const H=v.useCallback(R=>{let I=!1;const Y=p.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(I=!0),function(P){P.preventDefault();const O=p.current;if(!O)return()=>null;const{direction:B,dragState:L,id:V,keyboardResizeBy:ee,onLayout:ae}=N.current,{layout:_e,panelDataArray:Se}=C.current,{initialLayout:Me}=L??{},Be=ql(V,R,O);let ke=Z_(P,R,B,L,ee,O);const ft=B==="horizontal";ft&&I&&(ke=-ke);const Mn=Se.map(ct=>ct.constraints),Ze=pr({delta:ke,initialLayout:Me??_e,panelConstraints:Mn,pivotIndices:Be,prevLayout:_e,trigger:Al(P)?"keyboard":"mouse-or-touch"}),fn=!Yr(_e,Ze);(zl(P)||Il(P))&&S.current!=ke&&(S.current=ke,!fn&&ke!==0?ft?va(R,ke<0?$l:Fl):va(R,ke<0?Ll:Bl):va(R,0)),fn&&(y(Ze),C.current.layout=Ze,ae&&ae(Ze),Tn(Se,Ze,b.current))}},[]),W=v.useCallback((R,I)=>{const{onLayout:Y}=N.current,{layout:U,panelDataArray:P}=C.current,O=P.map(_e=>_e.constraints),{panelSize:B,pivotIndices:L}=pn(P,R,U);me(B!=null,`Panel size not found for panel "${R.id}"`);const ee=$n(P,R)===P.length-1?B-I:I-B,ae=pr({delta:ee,initialLayout:U,panelConstraints:O,pivotIndices:L,prevLayout:U,trigger:"imperative-api"});Yr(U,ae)||(y(ae),C.current.layout=ae,Y&&Y(ae),Tn(P,ae,b.current))},[]),Q=v.useCallback((R,I)=>{const{layout:Y,panelDataArray:U}=C.current,{collapsedSize:P=0,collapsible:O}=I,{collapsedSize:B=0,collapsible:L,maxSize:V=100,minSize:ee=0}=R.constraints,{panelSize:ae}=pn(U,R,Y);ae!=null&&(O&&L&&$t(ae,P)?$t(P,B)||W(R,B):ae<ee?W(R,ee):ae>V&&W(R,V))},[W]),G=v.useCallback((R,I)=>{const{direction:Y}=N.current,{layout:U}=C.current;if(!p.current)return;const P=Ao(R,p.current);me(P,`Drag handle element not found for id "${R}"`);const O=Gl(Y,I);_({dragHandleId:R,dragHandleRect:P.getBoundingClientRect(),initialCursorPosition:O,initialLayout:U})},[]),z=v.useCallback(()=>{_(null)},[]),oe=v.useCallback(R=>{const{panelDataArray:I}=C.current,Y=$n(I,R);Y>=0&&(I.splice(Y,1),delete b.current[R.id],C.current.panelDataArrayChanged=!0,x())},[x]),le=v.useMemo(()=>({collapsePanel:E,direction:r,dragState:g,expandPanel:k,getPanelSize:M,getPanelStyle:D,groupId:m,isPanelCollapsed:T,isPanelExpanded:$,reevaluatePanelConstraints:Q,registerPanel:A,registerResizeHandle:H,resizePanel:W,startDragging:G,stopDragging:z,unregisterPanel:oe,panelGroupElement:p.current}),[E,g,r,k,M,D,m,T,$,Q,A,H,W,G,z,oe]),ie={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return v.createElement(To.Provider,{value:le},v.createElement(u,{...f,children:t,className:n,id:a,ref:p,style:{...ie,...d},[ze.group]:"",[ze.groupDirection]:r,[ze.groupId]:m}))}const Ql=v.forwardRef((e,t)=>v.createElement(Jl,{...e,forwardedRef:t}));Jl.displayName="PanelGroup";Ql.displayName="forwardRef(PanelGroup)";function $n(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function pn(e,t,n){const r=$n(e,t),a=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:a}}function sg({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){v.useEffect(()=>{if(e||n==null||r==null)return;const o=Ao(t,r);if(o==null)return;const a=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=o.getAttribute(ze.groupId);me(i,`No group element found for id "${i}"`);const l=br(i,r),d=Yl(i,t,r);me(d!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?d>0?d-1:l.length-1:d+1<l.length?d+1:0;l[u].focus();break}}};return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a)}},[r,e,t,n])}function Zl({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:a,onClick:s,onDragging:i,onFocus:l,onPointerDown:d,onPointerUp:u,style:f={},tabIndex:m=0,tagName:p="div",...g}){var _,j;const y=v.useRef(null),x=v.useRef({onClick:s,onDragging:i,onPointerDown:d,onPointerUp:u});v.useEffect(()=>{x.current.onClick=s,x.current.onDragging=i,x.current.onPointerDown=d,x.current.onPointerUp=u});const b=v.useContext(To);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:S,registerResizeHandle:N,startDragging:C,stopDragging:E,panelGroupElement:k}=b,M=js(o),[D,T]=v.useState("inactive"),[$,A]=v.useState(!1),[H,W]=v.useState(null),Q=v.useRef({state:D});vn(()=>{Q.current.state=D}),v.useEffect(()=>{if(n)W(null);else{const le=N(M);W(()=>le)}},[n,M,N]);const G=(_=r==null?void 0:r.coarse)!==null&&_!==void 0?_:15,z=(j=r==null?void 0:r.fine)!==null&&j!==void 0?j:5;v.useEffect(()=>{if(n||H==null)return;const le=y.current;me(le,"Element ref not attached");let ie=!1;return q_(M,le,w,{coarse:G,fine:z},(I,Y,U)=>{if(!Y){T("inactive");return}switch(I){case"down":{T("drag"),ie=!1,me(U,'Expected event to be defined for "down" action'),C(M,U);const{onDragging:P,onPointerDown:O}=x.current;P==null||P(!0),O==null||O();break}case"move":{const{state:P}=Q.current;ie=!0,P!=="drag"&&T("hover"),me(U,'Expected event to be defined for "move" action'),H(U);break}case"up":{T("hover"),E();const{onClick:P,onDragging:O,onPointerUp:B}=x.current;O==null||O(!1),B==null||B(),ie||P==null||P();break}}})},[G,w,n,z,N,M,H,C,E]),sg({disabled:n,handleId:M,resizeHandler:H,panelGroupElement:k});const oe={touchAction:"none",userSelect:"none"};return v.createElement(p,{...g,children:e,className:t,id:o,onBlur:()=>{A(!1),a==null||a()},onFocus:()=>{A(!0),l==null||l()},ref:y,role:"separator",style:{...oe,...f},tabIndex:m,[ze.groupDirection]:w,[ze.groupId]:S,[ze.resizeHandle]:"",[ze.resizeHandleActive]:D==="drag"?"pointer":$?"keyboard":void 0,[ze.resizeHandleEnabled]:!n,[ze.resizeHandleId]:M,[ze.resizeHandleState]:D})}Zl.displayName="PanelResizeHandle";const ig=({className:e,...t})=>c.jsx(Ql,{className:ne("cj-flex cj-h-full cj-w-full data-[panel-group-direction=vertical]:cj-flex-col",e),...t}),ba=Ol,Bi=({withHandle:e,className:t,...n})=>c.jsx(Zl,{className:ne("cj-relative cj-flex cj-w-px cj-items-center cj-justify-center cj-bg-border after:cj-absolute after:cj-inset-y-0 after:cj-left-1/2 after:cj-w-1 after:-cj-translate-x-1/2 data-[panel-group-direction=vertical]:cj-h-px data-[panel-group-direction=vertical]:cj-w-full data-[panel-group-direction=vertical]:after:cj-left-0 data-[panel-group-direction=vertical]:after:cj-h-1 data-[panel-group-direction=vertical]:after:cj-w-full data-[panel-group-direction=vertical]:after:-cj-translate-y-1/2 data-[panel-group-direction=vertical]:after:cj-translate-x-0 focus-visible:cj-outline-none focus-visible:cj-ring-1 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-1 [&[data-panel-group-direction=vertical]>div]:cj-rotate-90",t),...n,children:e&&c.jsx("div",{className:"cj-z-10 cj-flex cj-h-4 cj-w-3 cj-items-center cj-justify-center cj-rounded-sm cj-border cj-bg-border",children:c.jsx(Pl,{className:"cj-h-2.5 cj-w-2.5"})})});function qa(e,[t,n]){return Math.min(n,Math.max(t,e))}function cg(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var xs="ScrollArea",[ed]=st(xs),[lg,ut]=ed(xs),td=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:a=600,...s}=e,[i,l]=h.useState(null),[d,u]=h.useState(null),[f,m]=h.useState(null),[p,g]=h.useState(null),[_,j]=h.useState(null),[y,x]=h.useState(0),[b,w]=h.useState(0),[S,N]=h.useState(!1),[C,E]=h.useState(!1),k=he(t,D=>l(D)),M=kr(o);return c.jsx(lg,{scope:n,type:r,dir:M,scrollHideDelay:a,scrollArea:i,viewport:d,onViewportChange:u,content:f,onContentChange:m,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:N,scrollbarY:_,onScrollbarYChange:j,scrollbarYEnabled:C,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:w,children:c.jsx(se.div,{dir:M,...s,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});td.displayName=xs;var nd="ScrollAreaViewport",rd=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...a}=e,s=ut(nd,n),i=h.useRef(null),l=he(t,i,s.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(se.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});rd.displayName=nd;var At="ScrollAreaScrollbar",bs=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ut(At,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return h.useEffect(()=>(i?a(!0):s(!0),()=>{i?a(!1):s(!1)}),[i,a,s]),o.type==="hover"?c.jsx(dg,{...r,ref:t,forceMount:n}):o.type==="scroll"?c.jsx(ug,{...r,ref:t,forceMount:n}):o.type==="auto"?c.jsx(od,{...r,ref:t,forceMount:n}):o.type==="always"?c.jsx(ws,{...r,ref:t}):null});bs.displayName=At;var dg=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ut(At,e.__scopeScrollArea),[a,s]=h.useState(!1);return h.useEffect(()=>{const i=o.scrollArea;let l=0;if(i){const d=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",d),i.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",d),i.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),c.jsx(it,{present:n||a,children:c.jsx(od,{"data-state":a?"visible":"hidden",...r,ref:t})})}),ug=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ut(At,e.__scopeScrollArea),a=e.orientation==="horizontal",s=Io(()=>l("SCROLL_END"),100),[i,l]=cg("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(i==="idle"){const d=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[i,o.scrollHideDelay,l]),h.useEffect(()=>{const d=o.viewport,u=a?"scrollLeft":"scrollTop";if(d){let f=d[u];const m=()=>{const p=d[u];f!==p&&(l("SCROLL"),s()),f=p};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[o.viewport,a,l,s]),c.jsx(it,{present:n||i!=="hidden",children:c.jsx(ws,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:re(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:re(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),od=h.forwardRef((e,t)=>{const n=ut(At,e.__scopeScrollArea),{forceMount:r,...o}=e,[a,s]=h.useState(!1),i=e.orientation==="horizontal",l=Io(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(i?d:u)}},10);return Gn(n.viewport,l),Gn(n.content,l),c.jsx(it,{present:r||a,children:c.jsx(ws,{"data-state":a?"visible":"hidden",...o,ref:t})})}),ws=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ut(At,e.__scopeScrollArea),a=h.useRef(null),s=h.useRef(0),[i,l]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ld(i.viewport,i.content),u={...r,sizes:i,onSizesChange:l,hasThumb:d>0&&d<1,onThumbChange:m=>a.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function f(m,p){return gg(m,s.current,i,p)}return n==="horizontal"?c.jsx(fg,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const m=o.viewport.scrollLeft,p=Hi(m,i,o.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=f(m,o.dir))}}):n==="vertical"?c.jsx(mg,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const m=o.viewport.scrollTop,p=Hi(m,i);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=f(m))}}):null}),fg=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=ut(At,e.__scopeScrollArea),[s,i]=h.useState(),l=h.useRef(null),d=he(t,l,a.onScrollbarXChange);return h.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),c.jsx(sd,{"data-orientation":"horizontal",...o,ref:d,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":zo(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(a.viewport){const m=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(m),ud(m,f)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:mo(s.paddingLeft),paddingEnd:mo(s.paddingRight)}})}})}),mg=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=ut(At,e.__scopeScrollArea),[s,i]=h.useState(),l=h.useRef(null),d=he(t,l,a.onScrollbarYChange);return h.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),c.jsx(sd,{"data-orientation":"vertical",...o,ref:d,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":zo(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(a.viewport){const m=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(m),ud(m,f)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:mo(s.paddingTop),paddingEnd:mo(s.paddingBottom)}})}})}),[pg,ad]=ed(At),sd=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:a,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:u,onResize:f,...m}=e,p=ut(At,n),[g,_]=h.useState(null),j=he(t,k=>_(k)),y=h.useRef(null),x=h.useRef(""),b=p.viewport,w=r.content-r.viewport,S=Ue(u),N=Ue(l),C=Io(f,10);function E(k){if(y.current){const M=k.clientX-y.current.left,D=k.clientY-y.current.top;d({x:M,y:D})}}return h.useEffect(()=>{const k=M=>{const D=M.target;(g==null?void 0:g.contains(D))&&S(M,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[b,g,w,S]),h.useEffect(N,[r,N]),Gn(g,C),Gn(p.content,C),c.jsx(pg,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:Ue(a),onThumbPointerUp:Ue(s),onThumbPositionChange:N,onThumbPointerDown:Ue(i),children:c.jsx(se.div,{...m,ref:j,style:{position:"absolute",...m.style},onPointerDown:re(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(k))}),onPointerMove:re(e.onPointerMove,E),onPointerUp:re(e.onPointerUp,k=>{const M=k.target;M.hasPointerCapture(k.pointerId)&&M.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),fo="ScrollAreaThumb",id=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ad(fo,e.__scopeScrollArea);return c.jsx(it,{present:n||o.hasThumb,children:c.jsx(hg,{ref:t,...r})})}),hg=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,a=ut(fo,n),s=ad(fo,n),{onThumbPositionChange:i}=s,l=he(t,f=>s.onThumbChange(f)),d=h.useRef(void 0),u=Io(()=>{d.current&&(d.current(),d.current=void 0)},100);return h.useEffect(()=>{const f=a.viewport;if(f){const m=()=>{if(u(),!d.current){const p=jg(f,i);d.current=p,i()}};return i(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[a.viewport,u,i]),c.jsx(se.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:re(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),g=f.clientX-p.left,_=f.clientY-p.top;s.onThumbPointerDown({x:g,y:_})}),onPointerUp:re(e.onPointerUp,s.onThumbPointerUp)})});id.displayName=fo;var Ns="ScrollAreaCorner",cd=h.forwardRef((e,t)=>{const n=ut(Ns,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(_g,{...e,ref:t}):null});cd.displayName=Ns;var _g=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ut(Ns,n),[a,s]=h.useState(0),[i,l]=h.useState(0),d=!!(a&&i);return Gn(o.scrollbarX,()=>{var f;const u=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Gn(o.scrollbarY,()=>{var f;const u=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),d?c.jsx(se.div,{...r,ref:t,style:{width:a,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function mo(e){return e?parseInt(e,10):0}function ld(e,t){const n=e/t;return isNaN(n)?0:n}function zo(e){const t=ld(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function gg(e,t,n,r="ltr"){const o=zo(n),a=o/2,s=t||a,i=o-s,l=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-i,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return dd([l,d],f)(e)}function Hi(e,t,n="ltr"){const r=zo(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,s=t.content-t.viewport,i=a-r,l=n==="ltr"?[0,s]:[s*-1,0],d=qa(e,l);return dd([0,s],[0,i])(d)}function dd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ud(e,t){return e>0&&e<t}var jg=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},s=n.left!==a.left,i=n.top!==a.top;(s||i)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Io(e,t){const n=Ue(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Gn(e,t){const n=Ue(t);Ye(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var fd=td,yg=rd,vg=cd;const Rt=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(fd,{ref:r,className:ne("cj-relative cj-overflow-hidden",e),...n,children:[c.jsx(yg,{className:"cj-h-full cj-w-full cj-rounded-[inherit] [&>div]:!cj-block [&>div]:!cj-min-w-0 [&>div]:cj-w-full",style:{overflowY:"auto"},children:t}),c.jsx(md,{}),c.jsx(vg,{})]}));Rt.displayName=fd.displayName;const md=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(bs,{ref:r,orientation:t,className:ne("cj-flex cj-touch-none cj-select-none cj-transition-colors",t==="vertical"&&"cj-h-full cj-w-2.5 cj-border-l cj-border-l-transparent cj-p-[1px]",t==="horizontal"&&"cj-h-2.5 cj-flex-col cj-border-t cj-border-t-transparent cj-p-[1px]",e),...n,children:c.jsx(id,{className:"cj-relative cj-flex-1 cj-rounded-full cj-bg-border"})}));md.displayName=bs.displayName;const Va={back:"Back",next:"Next",reset:"Reset",cancel:"Cancel",submit:"Submit",save:"Save",delete:"Delete",close:"Close",empty:"(empty)",path:"Path",unknown:"Unknown",runner_title:"Form Runner",runner_save_exit:"Save & Exit",runner_ready_title:"Ready to begin",runner_onboarding_subtitle:"Before you start, make sure you have the following:",runner_onboarding_line1:"Before you start, please have the relevant information about the incident ready.",runner_onboarding_line2:"We may ask for details such as a description of the incident, the date, location, or supporting documents.",runner_onboarding_photos:"Photos of the incident (damage, location, context)",runner_onboarding_documents:"Relevant documents (policy, ID, etc.)",runner_onboarding_datetime:"Date and time of the event",runner_onboarding_location:"Location",runner_onboarding_description:"Brief description of what happened",runner_start_claim:"Start claim",runner_review_title:"Review Your Answers",runner_no_answers:"No answers recorded.",runner_summary_all_answers:"All answers",runner_review:"Review",runner_step:"Step {{step}}/{{total}}",runner_no_journey:"No journey has been built yet.",runner_no_data:"No journey data available.",builder_title:"Journey Builder",builder_read_only:"Read Only",builder_publish:"Publish",builder_unlock_edit:"Unlock Edit",builder_open_runner:"Open Runner",builder_auto_layout:"Auto Layout",builder_export_json:"Export JSON",builder_export_copied:"Journey spec copied to clipboard",specs_title:"Property Specs",specs_search_placeholder:"Search specs...",specs_filter_all:"All Types",specs_create_custom:"Create Custom Field",specs_count:"{{filtered}} of {{total}} specs",specs_no_results:"No specs found",props_select_hint:"Select a node or edge to edit",props_drag_hint:"Drag specs from the left panel onto the canvas to create nodes",node_props_title:"Node Properties",node_schema_type:"Schema Type",node_source_spec:"Source Spec ID",node_namespace:"Namespace",node_required:"Required",node_required_hint:"Block navigation if empty",node_original_label:"Original Label",node_label_override:"Label Override (optional)",node_label_override_placeholder:"Custom label to display…",node_actor:"Actor",node_actor_customer:"Customer",node_actor_operator:"Operator",node_widget:"Widget Override",node_widget_auto:"Auto (from schema)",node_widget_text:"Text Input",node_widget_textarea:"Textarea",node_widget_select:"Select Dropdown",node_widget_radio:"Radio Group",node_widget_datepicker:"Date Picker",node_widget_timepicker:"Time Picker",node_widget_datetimepicker:"Date & Time Picker",node_widget_currency:"Currency Input",node_widget_upload:"File Upload",node_widget_email:"Email",node_widget_phone:"Phone",node_widget_location:"Location",node_allow_future:"Allow future dates",node_allow_future_hint:"When off, only past or today are selectable",node_bindings_title:"Bindings",node_bindings_target:"Target Namespace",node_bindings_add:"Add Binding",node_delete:"Delete Node",node_options_title:"Options",upload_config_title:"Upload Configuration",upload_file_type_preset:"File type preset",upload_any_file:"Any file",upload_images_only:"Images only",upload_documents_only:"Documents only",upload_images_pdf:"Images + PDFs",upload_custom:"Custom",upload_accepted_types:"Accepted types (custom)",upload_accepted_types_placeholder:"e.g. image/*,.pdf",upload_max_size:"Max file size (MB)",upload_max_size_placeholder:"e.g. 10",edge_props_title:"Edge Properties",edge_connection:"Connection",edge_default:"Default Edge",edge_default_hint:"Used when no other conditions match",edge_priority:"Priority",edge_priority_hint:"Higher priority edges are evaluated first",edge_quick_pick:"Quick pick from source options:",edge_condition:"Condition",edge_visual:"Visual",edge_advanced:"Advanced",edge_json_logic:"JSON Logic condition",edge_delete:"Delete Edge",preview_title:"Form Preview",preview_step_of:"Step {{current}} of {{total}}",preview_start:"Start Preview",preview_add_nodes_hint:"Add nodes to the canvas to preview the form flow.",preview_start_hint:'Click "Start Preview" to test the form flow interactively.',preview_no_node:"No current node selected.",preview_required_hint:"This field is required",preview_validation_hint:"Fix validation errors first",import_title:"Import Journey Spec",import_description:"Load a JourneySpec JSON file or paste JSON to populate the canvas.",import_paste_tab:"Paste JSON",import_upload_tab:"Upload File",import_paste_clipboard:"Paste from Clipboard",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Import Journey",import_validation_errors:"Validation errors:",validation_title:"Graph Validation",validation_no_issues:"No issues found",validation_issue_count:"{{count}} issue{{plural}} found",validation_good:"Graph looks good!",validation_no_issues_actor:"No issues",validation_validate:"Validate",create_node_title:"Create Custom Field",create_node_label:"Label *",create_node_label_placeholder:"Enter a display label",create_node_namespace:"Namespace",create_node_namespace_hint:"Auto-generated from label. Override if needed.",create_node_schema:"Schema Type",upload_drag_drop:"Drag & drop a file here, or click to select",upload_uploading:"Uploading…",widget_unknown_schema:"Unknown schema type: {{schema}}",widget_yes:"Yes",widget_no:"No",widget_no_widget:"No widget available for this field type.",widget_no_options:"No options configured for this select field.",widget_pick_date:"Pick a date",widget_invalid_date:"Enter a valid date",widget_pick_time:"Pick a time",widget_select_option:"Select an option...",widget_search_country:"Search country...",widget_no_country:"No country found.",widget_invalid_phone:"Enter a valid phone number",widget_invalid_email:"Enter a valid email address",widget_file_too_large:"File exceeds {{max}} MB limit ({{size}} MB)",widget_file_type_rejected:"File type not accepted. Allowed: {{accept}}",widget_upload_failed:"Upload failed",widget_accepted_hint:"Accepted: {{accept}}",widget_max_size_hint:"Max {{max}} MB",location_placeholder:"Start typing an address…",location_no_api_key:"Google Maps API key is required for the location widget.",placeholder_text:"Type here…",placeholder_select:"Select an option…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@example.com",placeholder_date:"Select a date…",not_found_title:"404",not_found_message:"Oops! Page not found",not_found_link:"Return to Home",runner_page_back:"Builder",fc_title:"Form Configurator",fc_read_only:"Read-only",fc_undo:"Undo",fc_redo:"Redo",fc_preview_form:"Preview Form",fc_save:"Save",fc_publish:"Publish",fc_unlock_edit:"Unlock edit",fc_tab_steps:"Steps",fc_tab_fields:"Fields",fc_tab_init:"Init",fc_tab_json:"JSON",fc_form_steps:"Form Steps",fc_add_step:"Add Step",fc_step_untitled:"(untitled)",fc_step_meta:"{{rows}} rows, {{fields}} fields",fc_no_steps:"No steps yet.",fc_no_steps_hint_click:"Click",fc_no_steps_hint_to_begin:"to begin.",fc_confirm_title:"Are you sure?",fc_confirm_delete_step:"Delete this step?",fc_step_empty_select:"Select a step on the left.",fc_step_empty_create:"Add a step from the left panel to begin.",fc_step_title_label:"Step Title",fc_step_title_placeholder:"Step title",fc_step_description_label:"Description",fc_step_description_placeholder:"Optional",fc_add_row:"Add Row",fc_row_n:"Row {{n}}",fc_layout_horizontal:"Horizontal",fc_layout_vertical:"Vertical",fc_confirm_delete_row:"Delete this row?",fc_add_field_btn:"Add field",fc_no_fields:"No fields.",fc_edit:"Edit",fc_remove_from_row:"Remove from row",fc_nav_title:"Step Navigation",fc_nav_api_call:"API call on continue",fc_nav_api_call_hint:"Executed before evaluating the rules.",fc_nav_body_template:"Body template (JSON)",fc_nav_body_template_hint_prefix:"Use",fc_nav_body_template_hint_suffix:"tokens.",fc_nav_on_error:"On error",fc_nav_on_error_block:"Block — stay on this step",fc_nav_on_error_continue:"Continue — evaluate rules anyway",fc_nav_on_error_goto:"Go to: {{step}}",fc_nav_on_error_summary:"Go to: Summary",fc_nav_on_error_hint:"What happens if the call throws or the network fails.",fc_nav_continue_button:"Continue button",fc_nav_continue_placeholder:"Continue",fc_nav_rules:"Navigation rules",fc_nav_add_rule:"Add rule",fc_nav_rules_hint:'Rules evaluated in order. First match wins. Use "always" as the last fallback.',fc_nav_rule_n:"Rule {{n}}",fc_nav_has_condition:"Has condition",fc_nav_go_to:"Go to",fc_nav_submit_form:"— Submit form —",fc_nav_field_requires_value:'Field "{{label}}" requires a value.',fc_summary_panel:"Summary Panel",fc_summary_title_label:"Summary Title",fc_summary_sections:"Sections",fc_summary_add_section:"Add Section",fc_summary_section_title_placeholder:"Section title",fc_summary_visible_from:"Visible from step",fc_summary_until_step:"Until step (optional)",fc_summary_all_steps:"All steps",fc_summary_step_n:"Step {{n}}",fc_summary_display_fields:"Display Fields",fc_summary_add:"Add",fc_summary_no_display_fields:"No display fields yet.",fc_summary_no_sections:"No sections yet.",fc_summary_confirm_delete_section:"Delete this section?",fc_summary_source:"Source",fc_summary_source_form_field:"Form Field",fc_summary_source_api_response:"API Response",fc_summary_format:"Format",fc_summary_format_text:"Text",fc_summary_format_number:"Number",fc_summary_format_currency:"Currency",fc_summary_format_date:"Date",fc_summary_format_datetime:"Date & Time",fc_summary_display_label:"Label",fc_summary_display_label_placeholder:"Display label",fc_summary_field:"Field",fc_summary_select:"Select…",fc_summary_from_step_api:"From step API",fc_summary_response_path:"Response Path (dot-notation)",fc_fields_catalog:"Fields catalog",fc_fields_catalog_hint:"All fields used across the form. Edit here to update them everywhere.",fc_fields_add:"Add Field",fc_fields_search:"Search fields…",fc_fields_filter_all:"All",fc_fields_filter_used:"Used",fc_fields_filter_unused:"Unused",fc_fields_unused_badge:"Unused",fc_fields_used_in_one:"Used in {{count}} step",fc_fields_used_in_many:"Used in {{count}} steps",fc_fields_go_to_step:'Go to step "{{title}}"',fc_fields_no_fields:"No fields yet.",fc_fields_no_match:"No fields match the current filter.",fc_fields_confirm_delete:"Delete this field?",fc_init_title:"Initial values",fc_init_subtitle:"Static answers pre-loaded into the runner before the user starts.",fc_init_static:"Static values",fc_init_add:"Add",fc_init_no_values:"No initial values yet.",fc_init_prefill:"Pre-fill from API",fc_init_prefill_hint:"Fetch answers from an endpoint when the runner mounts.",fc_init_mapping:"Mapping (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"Raw JourneySpec (form_config + theme). Edit and click Apply to update the configurator.",fc_json_refresh:"Reload from configurator",fc_json_refresh_hint:"Discard JSON edits and reload from the current configurator state",fc_json_copy:"Copy",fc_json_download:"Download",fc_json_import:"Apply changes",fc_json_apply_hint:"Apply the JSON edits to the configurator",fc_json_imported_ok:"Imported successfully",fc_json_copied:"Copied to clipboard",fc_json_invalid:"Invalid JSON",fc_json_upload:"Upload File",fc_json_file_error:"Could not read the file.",fc_create_field_title:"Add field",fc_create_field_subtitle:"Pick from the catalog or create a custom field.",fc_create_from_catalog:"From catalog ({{count}})",fc_create_custom:"Custom field",fc_create_search_specs:"Search specs…",fc_create_no_specs:"No specs match.",fc_create_label_required:"Label *",fc_create_label_placeholder:"e.g. Customer Name",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"e.g. customer.name (auto if empty)",fc_create_schema:"Schema",fc_create_options:"Options",fc_create_option_value_placeholder:"value",fc_create_option_label_placeholder:"Label",fc_create_cancel:"Cancel",fc_create_create:"Create",fc_field_props:"Field properties",fc_field_no_selected:"No field selected.",fc_field_label:"Label *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Help text",fc_field_required:"Required",fc_field_required_hint:"User must fill before continuing.",fc_field_actor:"Actor",fc_field_actor_customer:"Customer",fc_field_actor_operator:"Operator",fc_field_widget:"Widget",fc_field_widget_auto:"Auto",fc_field_widget_text:"Text",fc_field_widget_textarea:"Textarea",fc_field_widget_select:"Select",fc_field_widget_radio:"Radio",fc_field_widget_date:"Date",fc_field_widget_time:"Time",fc_field_widget_datetime:"Date & Time",fc_field_widget_currency:"Currency",fc_field_widget_upload:"Upload",fc_field_widget_email:"Email",fc_field_widget_phone:"Phone",fc_field_widget_location:"Location",fc_field_widget_boolean:"Boolean (Yes/No)",fc_field_allow_future:"Allow future dates",fc_field_allow_future_hint:"Allow dates after today.",fc_field_display_style:"Display style",fc_field_display_auto:"Auto (radio ≤5, dropdown >5)",fc_field_display_radio:"Radio list",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Segmented buttons",fc_field_display_hint:"Controls how options render at runtime.",fc_field_display_switch:"Switch (toggle)",fc_field_display_yesno:"Segmented (Yes / No buttons)",fc_field_boolean_hint:"Override Yes/No labels by adding 2 options below (first = true, second = false).",fc_field_options:"Options",fc_field_no_options:"No options yet.",fc_field_upload_validation:"Upload validation",fc_field_upload_accept:"Accepted MIME types/extensions",fc_field_upload_max:"Max size (MB)",fc_field_delete:"Delete field",fc_field_done:"Done",fc_field_confirm_delete:"Delete this field from the catalog (and all rows that use it)?",theme_button:"Theme",theme_reset:"Reset",theme_colors:"Colors",theme_primary:"Primary",theme_background:"Background",theme_card:"Card",theme_foreground:"Foreground",theme_color_picker_aria:"{{label}} color picker",theme_color_placeholder:"e.g. 222 47% 11%",theme_color_hint:"Pick a color or type an HSL triplet",theme_typography:"Typography",theme_heading_font:"Heading font",theme_body_font:"Body font",theme_font_default:"Default",theme_font_size:"Base font size (px)",theme_shape_spacing:"Shape & spacing",theme_border_radius:"Border radius (rem)",theme_spacing:"Spacing",theme_spacing_cozy_default:"Cozy (default)",theme_spacing_compact:"Compact",theme_spacing_cozy:"Cozy",theme_spacing_spacious:"Spacious",theme_live_preview:"Live preview",theme_heading_sample:"Heading sample",theme_body_sample:"The quick brown fox jumps over the lazy dog. Body text uses your selected font, size and spacing.",theme_input_sample:"Sample input",theme_primary_action:"Primary action",runner_toast_required_fields:"Please fill the required fields.",runner_toast_api_failed:"API call failed.",runner_toast_answers_copied:"Answers copied to clipboard!",runner_toast_partial_saved:"Partial answers saved (logged).",runner_toast_file_uploaded:"Uploaded {{name}} for {{key}}",runner_loading_preview:"Loading preview…",runner_no_form:"No form configured yet.",runner_back_to_builder:"Back to builder",runner_preset_full:"Full",runner_iframe_title:"Form runner preview",import_invalid_json:"Invalid JSON: could not parse the input.",import_success:"Journey imported successfully",import_clipboard_failed:"Could not read clipboard",shortcut_selected_nodes_one:"Selected {{count}} node",shortcut_selected_nodes_other:"Selected {{count}} nodes",shortcut_deleted:"Deleted",shortcut_undo:"Undo",shortcut_redo:"Redo",shortcut_copied:"Copied to clipboard",shortcut_pasted:"Pasted",shortcut_duplicated:"Duplicated"},xg={back:"Atrás",next:"Siguiente",reset:"Reiniciar",cancel:"Cancelar",submit:"Enviar",save:"Guardar",delete:"Eliminar",close:"Cerrar",empty:"(vacío)",path:"Ruta",unknown:"Desconocido",runner_title:"Formulario",runner_save_exit:"Guardar y Salir",runner_ready_title:"Listo para comenzar",runner_onboarding_subtitle:"Antes de empezar, asegúrate de tener lo siguiente:",runner_onboarding_line1:"Antes de empezar, por favor tenga preparada la información relevante sobre lo ocurrido.",runner_onboarding_line2:"Podremos pedir detalles como una descripción del incidente, la fecha, el lugar o documentos de apoyo.",runner_onboarding_photos:"Fotos del incidente (daño, lugar, contexto)",runner_onboarding_documents:"Documentos relevantes (póliza, identificación, etc.)",runner_onboarding_datetime:"Fecha y hora del suceso",runner_onboarding_location:"Ubicación",runner_onboarding_description:"Descripción breve de lo ocurrido",runner_start_claim:"Comenzar parte",runner_review_title:"Revisa tus respuestas",runner_no_answers:"No hay respuestas registradas.",runner_summary_all_answers:"Todas las respuestas",runner_review:"Revisar",runner_step:"Paso {{step}}/{{total}}",runner_no_journey:"Aún no se ha creado ningún recorrido.",runner_no_data:"Datos del recorrido no disponibles.",builder_title:"Constructor de Recorridos",builder_read_only:"Solo Lectura",builder_publish:"Publicar",builder_unlock_edit:"Desbloquear Edición",builder_open_runner:"Abrir Formulario",builder_auto_layout:"Diseño Automático",builder_export_json:"Exportar JSON",builder_export_copied:"Especificación copiada al portapapeles",specs_title:"Propiedades",specs_search_placeholder:"Buscar...",specs_filter_all:"Todos los Tipos",specs_create_custom:"Crear Campo Personalizado",specs_count:"{{filtered}} de {{total}} propiedades",specs_no_results:"No se encontraron propiedades",props_select_hint:"Selecciona un nodo o arista para editar",props_drag_hint:"Arrastra propiedades del panel izquierdo al lienzo para crear nodos",node_props_title:"Propiedades del Nodo",node_schema_type:"Tipo de Schema",node_source_spec:"ID de Propiedad",node_namespace:"Namespace",node_required:"Obligatorio",node_required_hint:"Bloquear navegación si está vacío",node_original_label:"Etiqueta Original",node_label_override:"Etiqueta Personalizada (opcional)",node_label_override_placeholder:"Etiqueta personalizada…",node_actor:"Actor",node_actor_customer:"Cliente",node_actor_operator:"Operador",node_widget:"Widget",node_widget_auto:"Automático (del schema)",node_widget_text:"Campo de Texto",node_widget_textarea:"Área de Texto",node_widget_select:"Lista Desplegable",node_widget_radio:"Grupo de Radio",node_widget_datepicker:"Selector de Fecha",node_widget_timepicker:"Selector de Hora",node_widget_datetimepicker:"Selector de Fecha y Hora",node_widget_currency:"Campo Monetario",node_widget_upload:"Carga de Archivo",node_widget_email:"Email",node_widget_phone:"Teléfono",node_widget_location:"Ubicación",node_allow_future:"Permitir fechas futuras",node_allow_future_hint:"Cuando está desactivado, solo permite fechas pasadas u hoy",node_bindings_title:"Vínculos",node_bindings_target:"Namespace Destino",node_bindings_add:"Agregar Binding",node_delete:"Eliminar Nodo",node_options_title:"Opciones",upload_config_title:"Configuración de Carga",upload_file_type_preset:"Tipo de archivo",upload_any_file:"Cualquier archivo",upload_images_only:"Solo imágenes",upload_documents_only:"Solo documentos",upload_images_pdf:"Imágenes + PDFs",upload_custom:"Personalizado",upload_accepted_types:"Tipos aceptados (personalizado)",upload_accepted_types_placeholder:"ej: image/*,.pdf",upload_max_size:"Tamaño máximo (MB)",upload_max_size_placeholder:"ej: 10",edge_props_title:"Propiedades de la Arista",edge_connection:"Conexión",edge_default:"Arista Predeterminada",edge_default_hint:"Se usa cuando ninguna otra condición coincide",edge_priority:"Prioridad",edge_priority_hint:"Las aristas con mayor prioridad se evalúan primero",edge_quick_pick:"Selección rápida de opciones:",edge_condition:"Condición",edge_visual:"Visual",edge_advanced:"Avanzado",edge_json_logic:"Condición JSON Logic",edge_delete:"Eliminar Arista",preview_title:"Vista Previa",preview_step_of:"Paso {{current}} de {{total}}",preview_start:"Iniciar Vista Previa",preview_add_nodes_hint:"Agrega nodos al lienzo para previsualizar el flujo.",preview_start_hint:'Haz clic en "Iniciar Vista Previa" para probar el flujo interactivamente.',preview_no_node:"Ningún nodo seleccionado.",preview_required_hint:"Este campo es obligatorio",preview_validation_hint:"Corrige los errores de validación primero",import_title:"Importar Especificación",import_description:"Carga un archivo JSON o pega el JSON para poblar el lienzo.",import_paste_tab:"Pegar JSON",import_upload_tab:"Cargar Archivo",import_paste_clipboard:"Pegar del Portapapeles",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importar",import_validation_errors:"Errores de validación:",validation_title:"Validación del Grafo",validation_no_issues:"Sin problemas encontrados",validation_issue_count:"{{count}} problema{{plural}} encontrado{{plural}}",validation_good:"¡El grafo está correcto!",validation_no_issues_actor:"Sin problemas",validation_validate:"Validar",create_node_title:"Crear Campo Personalizado",create_node_label:"Etiqueta *",create_node_label_placeholder:"Ingresa una etiqueta",create_node_namespace:"Namespace",create_node_namespace_hint:"Generado automáticamente a partir de la etiqueta.",create_node_schema:"Tipo de Schema",upload_drag_drop:"Arrastra y suelta un archivo aquí, o haz clic para seleccionar",upload_uploading:"Cargando…",widget_unknown_schema:"Tipo de schema desconocido: {{schema}}",widget_yes:"Sí",widget_no:"No",widget_no_widget:"No hay widget disponible para este tipo de campo.",widget_no_options:"No hay opciones configuradas para este campo de selección.",widget_pick_date:"Seleccionar fecha",widget_invalid_date:"Introduce una fecha válida",widget_pick_time:"Seleccionar hora",widget_select_option:"Seleccionar una opción...",widget_search_country:"Buscar país...",widget_no_country:"País no encontrado.",widget_invalid_phone:"Ingrese un número de teléfono válido",widget_invalid_email:"Ingrese un correo electrónico válido",widget_file_too_large:"El archivo excede el límite de {{max}} MB ({{size}} MB)",widget_file_type_rejected:"Tipo de archivo no aceptado. Permitidos: {{accept}}",widget_upload_failed:"Error al cargar",widget_accepted_hint:"Aceptados: {{accept}}",widget_max_size_hint:"Máx {{max}} MB",location_placeholder:"Empieza a escribir una dirección…",location_no_api_key:"Se requiere una clave de API de Google Maps para el widget de ubicación.",placeholder_text:"Insertar…",placeholder_select:"Seleccionar…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@ejemplo.com",placeholder_date:"Seleccionar fecha…",not_found_title:"404",not_found_message:"Página no encontrada",not_found_link:"Volver al Inicio",runner_page_back:"Constructor",fc_title:"Configurador de Formulario",fc_read_only:"Solo lectura",fc_undo:"Deshacer",fc_redo:"Rehacer",fc_preview_form:"Vista previa",fc_save:"Guardar",fc_publish:"Publicar",fc_unlock_edit:"Desbloquear edición",fc_tab_steps:"Pasos",fc_tab_fields:"Campos",fc_tab_init:"Inicialización",fc_tab_json:"JSON",fc_form_steps:"Pasos del Formulario",fc_add_step:"Añadir Paso",fc_step_untitled:"(sin título)",fc_step_meta:"{{rows}} filas, {{fields}} campos",fc_no_steps:"Aún sin pasos.",fc_no_steps_hint_click:"Haz clic en",fc_no_steps_hint_to_begin:"para empezar.",fc_confirm_title:"¿Estás seguro?",fc_confirm_delete_step:"¿Eliminar este paso?",fc_step_empty_select:"Selecciona un paso a la izquierda.",fc_step_empty_create:"Añade un paso desde el panel izquierdo para empezar.",fc_step_title_label:"Título del Paso",fc_step_title_placeholder:"Título del paso",fc_step_description_label:"Descripción",fc_step_description_placeholder:"Opcional",fc_add_row:"Añadir Fila",fc_row_n:"Fila {{n}}",fc_layout_horizontal:"Horizontal",fc_layout_vertical:"Vertical",fc_confirm_delete_row:"¿Eliminar esta fila?",fc_add_field_btn:"Añadir campo",fc_no_fields:"Sin campos.",fc_edit:"Editar",fc_remove_from_row:"Quitar de la fila",fc_nav_title:"Navegación del Paso",fc_nav_api_call:"Llamada API al continuar",fc_nav_api_call_hint:"Se ejecuta antes de evaluar las reglas.",fc_nav_body_template:"Plantilla del body (JSON)",fc_nav_body_template_hint_prefix:"Usa tokens",fc_nav_body_template_hint_suffix:".",fc_nav_on_error:"En caso de error",fc_nav_on_error_block:"Bloquear — permanece en este paso",fc_nav_on_error_continue:"Continuar — evalúa las reglas igualmente",fc_nav_on_error_goto:"Ir a: {{step}}",fc_nav_on_error_summary:"Ir a: Resumen",fc_nav_on_error_hint:"Qué ocurre si la llamada falla o la red cae.",fc_nav_continue_button:"Botón continuar",fc_nav_continue_placeholder:"Continuar",fc_nav_rules:"Reglas de navegación",fc_nav_add_rule:"Añadir regla",fc_nav_rules_hint:'Reglas evaluadas en orden. Gana la primera. Usa "siempre" como último recurso.',fc_nav_rule_n:"Regla {{n}}",fc_nav_has_condition:"Tiene condición",fc_nav_go_to:"Ir a",fc_nav_submit_form:"— Enviar formulario —",fc_nav_field_requires_value:'El campo "{{label}}" requiere un valor.',fc_summary_panel:"Panel de Resumen",fc_summary_title_label:"Título del Resumen",fc_summary_sections:"Secciones",fc_summary_add_section:"Añadir Sección",fc_summary_section_title_placeholder:"Título de la sección",fc_summary_visible_from:"Visible desde el paso",fc_summary_until_step:"Hasta el paso (opcional)",fc_summary_all_steps:"Todos los pasos",fc_summary_step_n:"Paso {{n}}",fc_summary_display_fields:"Campos a Mostrar",fc_summary_add:"Añadir",fc_summary_no_display_fields:"Aún sin campos a mostrar.",fc_summary_no_sections:"Aún sin secciones.",fc_summary_confirm_delete_section:"¿Eliminar esta sección?",fc_summary_source:"Origen",fc_summary_source_form_field:"Campo del Formulario",fc_summary_source_api_response:"Respuesta de la API",fc_summary_format:"Formato",fc_summary_format_text:"Texto",fc_summary_format_number:"Número",fc_summary_format_currency:"Moneda",fc_summary_format_date:"Fecha",fc_summary_format_datetime:"Fecha y hora",fc_summary_display_label:"Etiqueta",fc_summary_display_label_placeholder:"Etiqueta a mostrar",fc_summary_field:"Campo",fc_summary_select:"Seleccionar…",fc_summary_from_step_api:"Desde API del paso",fc_summary_response_path:"Ruta de respuesta (notación con puntos)",fc_fields_catalog:"Catálogo de campos",fc_fields_catalog_hint:"Todos los campos usados en el formulario. Edítalos aquí para actualizarlos en todas partes.",fc_fields_add:"Añadir Campo",fc_fields_search:"Buscar campos…",fc_fields_filter_all:"Todos",fc_fields_filter_used:"Usados",fc_fields_filter_unused:"No usados",fc_fields_unused_badge:"No usado",fc_fields_used_in_one:"Usado en {{count}} paso",fc_fields_used_in_many:"Usado en {{count}} pasos",fc_fields_go_to_step:'Ir al paso "{{title}}"',fc_fields_no_fields:"Aún sin campos.",fc_fields_no_match:"Ningún campo coincide con el filtro.",fc_fields_confirm_delete:"¿Eliminar este campo?",fc_init_title:"Valores iniciales",fc_init_subtitle:"Respuestas estáticas precargadas en el runner antes de que el usuario empiece.",fc_init_static:"Valores estáticos",fc_init_add:"Añadir",fc_init_no_values:"Aún sin valores iniciales.",fc_init_prefill:"Precargar desde API",fc_init_prefill_hint:"Obtener respuestas desde un endpoint cuando el runner monta.",fc_init_mapping:"Mapeo (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"JourneySpec en bruto (form_config + theme). Edita y haz clic en Aplicar para actualizar el configurador.",fc_json_refresh:"Recargar del configurador",fc_json_refresh_hint:"Descarta las ediciones del JSON y recarga desde el estado actual del configurador",fc_json_copy:"Copiar",fc_json_download:"Descargar",fc_json_import:"Aplicar cambios",fc_json_apply_hint:"Aplica las ediciones del JSON al configurador",fc_json_imported_ok:"Importado correctamente",fc_json_copied:"Copiado al portapapeles",fc_json_invalid:"JSON no válido",fc_json_upload:"Subir archivo",fc_json_file_error:"No se pudo leer el archivo.",fc_create_field_title:"Añadir campo",fc_create_field_subtitle:"Elige del catálogo o crea un campo personalizado.",fc_create_from_catalog:"Del catálogo ({{count}})",fc_create_custom:"Campo personalizado",fc_create_search_specs:"Buscar specs…",fc_create_no_specs:"Sin specs coincidentes.",fc_create_label_required:"Etiqueta *",fc_create_label_placeholder:"p. ej., Nombre del Cliente",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"p. ej., customer.name (auto si vacío)",fc_create_schema:"Schema",fc_create_options:"Opciones",fc_create_option_value_placeholder:"valor",fc_create_option_label_placeholder:"Etiqueta",fc_create_cancel:"Cancelar",fc_create_create:"Crear",fc_field_props:"Propiedades del campo",fc_field_no_selected:"Ningún campo seleccionado.",fc_field_label:"Etiqueta *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Texto de ayuda",fc_field_required:"Obligatorio",fc_field_required_hint:"El usuario debe rellenarlo antes de continuar.",fc_field_actor:"Actor",fc_field_actor_customer:"Cliente",fc_field_actor_operator:"Operador",fc_field_widget:"Widget",fc_field_widget_auto:"Automático",fc_field_widget_text:"Texto",fc_field_widget_textarea:"Área de texto",fc_field_widget_select:"Lista",fc_field_widget_radio:"Radio",fc_field_widget_date:"Fecha",fc_field_widget_time:"Hora",fc_field_widget_datetime:"Fecha y hora",fc_field_widget_currency:"Moneda",fc_field_widget_upload:"Subida",fc_field_widget_email:"Email",fc_field_widget_phone:"Teléfono",fc_field_widget_location:"Ubicación",fc_field_widget_boolean:"Booleano (Sí/No)",fc_field_allow_future:"Permitir fechas futuras",fc_field_allow_future_hint:"Permitir fechas posteriores a hoy.",fc_field_display_style:"Estilo de presentación",fc_field_display_auto:"Automático (radio ≤5, dropdown >5)",fc_field_display_radio:"Lista radio",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Botones segmentados",fc_field_display_hint:"Controla cómo se muestran las opciones en runtime.",fc_field_display_switch:"Switch (toggle)",fc_field_display_yesno:"Segmentado (botones Sí / No)",fc_field_boolean_hint:"Sustituye las etiquetas Sí/No añadiendo 2 opciones debajo (primera = true, segunda = false).",fc_field_options:"Opciones",fc_field_no_options:"Aún sin opciones.",fc_field_upload_validation:"Validación de la subida",fc_field_upload_accept:"Tipos MIME/extensiones aceptados",fc_field_upload_max:"Tamaño máximo (MB)",fc_field_delete:"Eliminar campo",fc_field_done:"Listo",fc_field_confirm_delete:"¿Eliminar este campo del catálogo (y de todas las filas que lo usan)?",theme_button:"Tema",theme_reset:"Restablecer",theme_colors:"Colores",theme_primary:"Primario",theme_background:"Fondo",theme_card:"Tarjeta",theme_foreground:"Texto",theme_color_picker_aria:"Selector de color {{label}}",theme_color_placeholder:"p. ej., 222 47% 11%",theme_color_hint:"Elige un color o escribe un triplet HSL",theme_typography:"Tipografía",theme_heading_font:"Fuente de títulos",theme_body_font:"Fuente del cuerpo",theme_font_default:"Predeterminada",theme_font_size:"Tamaño base de fuente (px)",theme_shape_spacing:"Forma y espaciado",theme_border_radius:"Radio de bordes (rem)",theme_spacing:"Espaciado",theme_spacing_cozy_default:"Cómodo (predeterminado)",theme_spacing_compact:"Compacto",theme_spacing_cozy:"Cómodo",theme_spacing_spacious:"Espacioso",theme_live_preview:"Vista previa",theme_heading_sample:"Ejemplo de título",theme_body_sample:"El veloz murciélago hindú comía feliz cardillo y kiwi. El texto del cuerpo usa la fuente, tamaño y espaciado que elegiste.",theme_input_sample:"Input de ejemplo",theme_primary_action:"Acción primaria",runner_toast_required_fields:"Completa los campos obligatorios.",runner_toast_api_failed:"La llamada a la API falló.",runner_toast_answers_copied:"¡Respuestas copiadas al portapapeles!",runner_toast_partial_saved:"Respuestas parciales guardadas (registradas).",runner_toast_file_uploaded:"Subido {{name}} para {{key}}",runner_loading_preview:"Cargando vista previa…",runner_no_form:"Ningún formulario configurado.",runner_back_to_builder:"Volver al constructor",runner_preset_full:"Completo",runner_iframe_title:"Vista previa del formulario",import_invalid_json:"JSON inválido: no se pudo analizar la entrada.",import_success:"Journey importada con éxito",import_clipboard_failed:"No se pudo leer el portapapeles",shortcut_selected_nodes_one:"{{count}} nodo seleccionado",shortcut_selected_nodes_other:"{{count}} nodos seleccionados",shortcut_deleted:"Eliminado",shortcut_undo:"Deshacer",shortcut_redo:"Rehacer",shortcut_copied:"Copiado al portapapeles",shortcut_pasted:"Pegado",shortcut_duplicated:"Duplicado"},bg={back:"Voltar",next:"Seguinte",reset:"Reiniciar",cancel:"Cancelar",submit:"Submeter",save:"Guardar",delete:"Eliminar",close:"Fechar",empty:"(vazio)",path:"Caminho",unknown:"Desconhecido",runner_title:"Formulário",runner_save_exit:"Guardar e Sair",runner_ready_title:"Antes de começar, garanta que tem os seguintes dados:",runner_onboarding_subtitle:"Antes de começar, garanta que tem os seguintes dados:",runner_onboarding_line1:"Antes de começar, por favor tenha preparada a informação relevante sobre o ocorrido.",runner_onboarding_line2:"Poderemos pedir detalhes como a descrição do ocorrido, a data, a localização ou documentos de apoio.",runner_onboarding_photos:"Fotos do incidente (dano, local, contexto)",runner_onboarding_documents:"Documentos relevantes (apólice, identificação, etc.)",runner_onboarding_datetime:"Data e hora do ocorrido",runner_onboarding_location:"Localização",runner_onboarding_description:"Descrição breve do que aconteceu",runner_start_claim:"Começar participação",runner_review_title:"Reveja as suas respostas",runner_no_answers:"Nenhuma resposta registada.",runner_summary_all_answers:"Todas as respostas",runner_review:"Rever",runner_step:"Passo {{step}}/{{total}}",runner_no_journey:"Ainda não foi criado nenhum percurso.",runner_no_data:"Dados do percurso indisponíveis.",builder_title:"Construtor de Percursos",builder_read_only:"Só Leitura",builder_publish:"Publicar",builder_unlock_edit:"Desbloquear Edição",builder_open_runner:"Abrir Formulário",builder_auto_layout:"Disposição Auto",builder_export_json:"Exportar JSON",builder_export_copied:"Especificação copiada para a área de transferência",specs_title:"Propriedades",specs_search_placeholder:"Pesquisar...",specs_filter_all:"Todos os Tipos",specs_create_custom:"Criar Campo Personalizado",specs_count:"{{filtered}} de {{total}} propriedades",specs_no_results:"Nenhuma propriedade encontrada",props_select_hint:"Selecione um nó ou aresta para editar",props_drag_hint:"Arraste propriedades do painel esquerdo para a tela para criar nós",node_props_title:"Propriedades do Nó",node_schema_type:"Tipo de Schema",node_source_spec:"ID da Propriedade",node_namespace:"Namespace",node_required:"Obrigatório",node_required_hint:"Bloquear navegação se vazio",node_original_label:"Etiqueta Original",node_label_override:"Etiqueta Personalizada (opcional)",node_label_override_placeholder:"Etiqueta personalizada…",node_actor:"Ator",node_actor_customer:"Cliente",node_actor_operator:"Operador",node_widget:"Widget",node_widget_auto:"Automático (do schema)",node_widget_text:"Campo de Texto",node_widget_textarea:"Área de Texto",node_widget_select:"Lista Suspensa",node_widget_radio:"Grupo de Rádio",node_widget_datepicker:"Seletor de Data",node_widget_timepicker:"Seletor de Hora",node_widget_datetimepicker:"Seletor de Data e Hora",node_widget_currency:"Campo Monetário",node_widget_upload:"Carregamento de Ficheiro",node_widget_email:"Email",node_widget_phone:"Telefone",node_widget_location:"Localização",node_allow_future:"Permitir datas futuras",node_allow_future_hint:"Quando desativado, só permite datas passadas ou hoje",node_bindings_title:"Ligações",node_bindings_target:"Namespace Destino",node_bindings_add:"Adicionar Binding",node_delete:"Eliminar Nó",node_options_title:"Opções",upload_config_title:"Configuração de Upload",upload_file_type_preset:"Tipo de ficheiro",upload_any_file:"Qualquer ficheiro",upload_images_only:"Apenas imagens",upload_documents_only:"Apenas documentos",upload_images_pdf:"Imagens + PDFs",upload_custom:"Personalizado",upload_accepted_types:"Tipos aceites (personalizado)",upload_accepted_types_placeholder:"ex: image/*,.pdf",upload_max_size:"Tamanho máximo (MB)",upload_max_size_placeholder:"ex: 10",edge_props_title:"Propriedades da Aresta",edge_connection:"Ligação",edge_default:"Aresta Padrão",edge_default_hint:"Usada quando nenhuma outra condição coincide",edge_priority:"Prioridade",edge_priority_hint:"Arestas com maior prioridade são avaliadas primeiro",edge_quick_pick:"Seleção rápida das opções:",edge_condition:"Condição",edge_visual:"Visual",edge_advanced:"Avançado",edge_json_logic:"Condição JSON Logic",edge_delete:"Eliminar Aresta",preview_title:"Pré-visualização",preview_step_of:"Passo {{current}} de {{total}}",preview_start:"Iniciar Pré-visualização",preview_add_nodes_hint:"Adicione nós à tela para pré-visualizar o fluxo.",preview_start_hint:'Clique em "Iniciar Pré-visualização" para testar o fluxo interativamente.',preview_no_node:"Nenhum nó selecionado.",preview_required_hint:"Este campo é obrigatório",preview_validation_hint:"Corrija os erros de validação primeiro",import_title:"Importar Especificação",import_description:"Carregue um ficheiro JSON ou cole o JSON para popular a tela.",import_paste_tab:"Colar JSON",import_upload_tab:"Carregar Ficheiro",import_paste_clipboard:"Colar da Área de Transferência",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importar",import_validation_errors:"Erros de validação:",validation_title:"Validação do Grafo",validation_no_issues:"Sem problemas encontrados",validation_issue_count:"{{count}} problema{{plural}} encontrado{{plural}}",validation_good:"O grafo está correto!",validation_no_issues_actor:"Sem problemas",validation_validate:"Validar",create_node_title:"Criar Campo Personalizado",create_node_label:"Etiqueta *",create_node_label_placeholder:"Introduza uma etiqueta",create_node_namespace:"Namespace",create_node_namespace_hint:"Gerado automaticamente a partir da etiqueta.",create_node_schema:"Tipo de Schema",upload_drag_drop:"Arraste e largue um ficheiro aqui, ou clique para selecionar",upload_uploading:"A carregar…",widget_unknown_schema:"Tipo de schema desconhecido: {{schema}}",widget_yes:"Sim",widget_no:"Não",widget_no_widget:"Nenhum widget disponível para este tipo de campo.",widget_no_options:"Nenhuma opção configurada para este campo de seleção.",widget_pick_date:"Selecionar data",widget_invalid_date:"Introduza uma data válida",widget_pick_time:"Selecionar hora",widget_select_option:"Selecionar uma opção...",widget_search_country:"Pesquisar país...",widget_no_country:"País não encontrado.",widget_invalid_phone:"Introduza um número de telefone válido",widget_invalid_email:"Introduza um e-mail válido",widget_file_too_large:"O ficheiro excede o limite de {{max}} MB ({{size}} MB)",widget_file_type_rejected:"Tipo de ficheiro não aceite. Permitidos: {{accept}}",widget_upload_failed:"Falha ao carregar",widget_accepted_hint:"Aceites: {{accept}}",widget_max_size_hint:"Máx {{max}} MB",location_placeholder:"Comece a digitar um endereço…",location_no_api_key:"É necessária uma chave de API do Google Maps para o widget de localização.",placeholder_text:"Inserir…",placeholder_select:"Selecionar…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@exemplo.com",placeholder_date:"Selecionar data…",not_found_title:"404",not_found_message:"Página não encontrada",not_found_link:"Voltar ao Início",runner_page_back:"Construtor",fc_title:"Configurador de Formulário",fc_read_only:"Só leitura",fc_undo:"Desfazer",fc_redo:"Refazer",fc_preview_form:"Pré-visualizar",fc_save:"Guardar",fc_publish:"Publicar",fc_unlock_edit:"Desbloquear edição",fc_tab_steps:"Passos",fc_tab_fields:"Campos",fc_tab_init:"Inicialização",fc_tab_json:"JSON",fc_form_steps:"Passos do Formulário",fc_add_step:"Adicionar Passo",fc_step_untitled:"(sem título)",fc_step_meta:"{{rows}} linhas, {{fields}} campos",fc_no_steps:"Ainda sem passos.",fc_no_steps_hint_click:"Clique em",fc_no_steps_hint_to_begin:"para começar.",fc_confirm_title:"Tem a certeza?",fc_confirm_delete_step:"Eliminar este passo?",fc_step_empty_select:"Selecione um passo à esquerda.",fc_step_empty_create:"Adicione um passo no painel à esquerda para começar.",fc_step_title_label:"Título do Passo",fc_step_title_placeholder:"Título do passo",fc_step_description_label:"Descrição",fc_step_description_placeholder:"Opcional",fc_add_row:"Adicionar Linha",fc_row_n:"Linha {{n}}",fc_layout_horizontal:"Horizontal",fc_layout_vertical:"Vertical",fc_confirm_delete_row:"Eliminar esta linha?",fc_add_field_btn:"Adicionar campo",fc_no_fields:"Sem campos.",fc_edit:"Editar",fc_remove_from_row:"Remover da linha",fc_nav_title:"Navegação do Passo",fc_nav_api_call:"Chamada API ao continuar",fc_nav_api_call_hint:"Executada antes de avaliar as regras.",fc_nav_body_template:"Template do body (JSON)",fc_nav_body_template_hint_prefix:"Use tokens",fc_nav_body_template_hint_suffix:".",fc_nav_on_error:"Em caso de erro",fc_nav_on_error_block:"Bloquear — permanece neste passo",fc_nav_on_error_continue:"Continuar — avalia as regras na mesma",fc_nav_on_error_goto:"Ir para: {{step}}",fc_nav_on_error_summary:"Ir para: Resumo",fc_nav_on_error_hint:"O que acontece se a chamada falhar ou a rede cair.",fc_nav_continue_button:"Botão continuar",fc_nav_continue_placeholder:"Continuar",fc_nav_rules:"Regras de navegação",fc_nav_add_rule:"Adicionar regra",fc_nav_rules_hint:'Regras avaliadas por ordem. Vence a primeira. Use "sempre" como último fallback.',fc_nav_rule_n:"Regra {{n}}",fc_nav_has_condition:"Tem condição",fc_nav_go_to:"Ir para",fc_nav_submit_form:"— Submeter formulário —",fc_nav_field_requires_value:'O campo "{{label}}" requer um valor.',fc_summary_panel:"Painel de Resumo",fc_summary_title_label:"Título do Resumo",fc_summary_sections:"Secções",fc_summary_add_section:"Adicionar Secção",fc_summary_section_title_placeholder:"Título da secção",fc_summary_visible_from:"Visível a partir do passo",fc_summary_until_step:"Até ao passo (opcional)",fc_summary_all_steps:"Todos os passos",fc_summary_step_n:"Passo {{n}}",fc_summary_display_fields:"Campos a Mostrar",fc_summary_add:"Adicionar",fc_summary_no_display_fields:"Ainda sem campos a mostrar.",fc_summary_no_sections:"Ainda sem secções.",fc_summary_confirm_delete_section:"Eliminar esta secção?",fc_summary_source:"Origem",fc_summary_source_form_field:"Campo do Formulário",fc_summary_source_api_response:"Resposta da API",fc_summary_format:"Formato",fc_summary_format_text:"Texto",fc_summary_format_number:"Número",fc_summary_format_currency:"Moeda",fc_summary_format_date:"Data",fc_summary_format_datetime:"Data e Hora",fc_summary_display_label:"Etiqueta",fc_summary_display_label_placeholder:"Etiqueta a apresentar",fc_summary_field:"Campo",fc_summary_select:"Selecionar…",fc_summary_from_step_api:"Do API do passo",fc_summary_response_path:"Caminho da resposta (notação por pontos)",fc_fields_catalog:"Catálogo de campos",fc_fields_catalog_hint:"Todos os campos usados no formulário. Editar aqui atualiza-os em todo o lado.",fc_fields_add:"Adicionar Campo",fc_fields_search:"Pesquisar campos…",fc_fields_filter_all:"Todos",fc_fields_filter_used:"Usados",fc_fields_filter_unused:"Não usados",fc_fields_unused_badge:"Não usado",fc_fields_used_in_one:"Usado em {{count}} passo",fc_fields_used_in_many:"Usado em {{count}} passos",fc_fields_go_to_step:'Ir para o passo "{{title}}"',fc_fields_no_fields:"Ainda sem campos.",fc_fields_no_match:"Nenhum campo corresponde ao filtro.",fc_fields_confirm_delete:"Eliminar este campo?",fc_init_title:"Valores iniciais",fc_init_subtitle:"Respostas estáticas pré-carregadas no runner antes do utilizador começar.",fc_init_static:"Valores estáticos",fc_init_add:"Adicionar",fc_init_no_values:"Ainda sem valores iniciais.",fc_init_prefill:"Pré-preencher a partir de API",fc_init_prefill_hint:"Obter respostas de um endpoint quando o runner monta.",fc_init_mapping:"Mapeamento (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"JourneySpec em bruto (form_config + theme). Edite e clique em Aplicar para atualizar o configurador.",fc_json_refresh:"Recarregar do configurador",fc_json_refresh_hint:"Descarta as edições do JSON e recarrega o estado atual do configurador",fc_json_copy:"Copiar",fc_json_download:"Descarregar",fc_json_import:"Aplicar alterações",fc_json_apply_hint:"Aplica as edições do JSON ao configurador",fc_json_imported_ok:"Importado com sucesso",fc_json_copied:"Copiado para a área de transferência",fc_json_invalid:"JSON inválido",fc_json_upload:"Carregar Ficheiro",fc_json_file_error:"Não foi possível ler o ficheiro.",fc_create_field_title:"Adicionar campo",fc_create_field_subtitle:"Escolha do catálogo ou crie um campo personalizado.",fc_create_from_catalog:"Do catálogo ({{count}})",fc_create_custom:"Campo personalizado",fc_create_search_specs:"Pesquisar specs…",fc_create_no_specs:"Sem specs correspondentes.",fc_create_label_required:"Etiqueta *",fc_create_label_placeholder:"ex.: Nome do Cliente",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"ex.: customer.name (automático se vazio)",fc_create_schema:"Schema",fc_create_options:"Opções",fc_create_option_value_placeholder:"valor",fc_create_option_label_placeholder:"Etiqueta",fc_create_cancel:"Cancelar",fc_create_create:"Criar",fc_field_props:"Propriedades do campo",fc_field_no_selected:"Nenhum campo selecionado.",fc_field_label:"Etiqueta *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Texto de ajuda",fc_field_required:"Obrigatório",fc_field_required_hint:"O utilizador tem de preencher antes de continuar.",fc_field_actor:"Ator",fc_field_actor_customer:"Cliente",fc_field_actor_operator:"Operador",fc_field_widget:"Widget",fc_field_widget_auto:"Automático",fc_field_widget_text:"Texto",fc_field_widget_textarea:"Área de texto",fc_field_widget_select:"Lista",fc_field_widget_radio:"Radio",fc_field_widget_date:"Data",fc_field_widget_time:"Hora",fc_field_widget_datetime:"Data e Hora",fc_field_widget_currency:"Moeda",fc_field_widget_upload:"Upload",fc_field_widget_email:"Email",fc_field_widget_phone:"Telefone",fc_field_widget_location:"Localização",fc_field_widget_boolean:"Booleano (Sim/Não)",fc_field_allow_future:"Permitir datas futuras",fc_field_allow_future_hint:"Permitir datas após hoje.",fc_field_display_style:"Estilo de apresentação",fc_field_display_auto:"Automático (radio ≤5, dropdown >5)",fc_field_display_radio:"Lista radio",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Botões segmentados",fc_field_display_hint:"Controla como as opções aparecem em runtime.",fc_field_display_switch:"Switch (toggle)",fc_field_display_yesno:"Segmentado (botões Sim / Não)",fc_field_boolean_hint:"Substitua as etiquetas Sim/Não adicionando 2 opções abaixo (primeira = true, segunda = false).",fc_field_options:"Opções",fc_field_no_options:"Ainda sem opções.",fc_field_upload_validation:"Validação do upload",fc_field_upload_accept:"Tipos MIME/extensões aceites",fc_field_upload_max:"Tamanho máximo (MB)",fc_field_delete:"Eliminar campo",fc_field_done:"Concluído",fc_field_confirm_delete:"Eliminar este campo do catálogo (e de todas as linhas que o usam)?",theme_button:"Tema",theme_reset:"Repor",theme_colors:"Cores",theme_primary:"Primária",theme_background:"Fundo",theme_card:"Cartão",theme_foreground:"Texto",theme_color_picker_aria:"Seletor de cor {{label}}",theme_color_placeholder:"ex.: 222 47% 11%",theme_color_hint:"Escolha uma cor ou escreva um triplet HSL",theme_typography:"Tipografia",theme_heading_font:"Fonte dos títulos",theme_body_font:"Fonte do corpo",theme_font_default:"Predefinido",theme_font_size:"Tamanho base da fonte (px)",theme_shape_spacing:"Forma e espaçamento",theme_border_radius:"Raio das bordas (rem)",theme_spacing:"Espaçamento",theme_spacing_cozy_default:"Cómodo (predefinido)",theme_spacing_compact:"Compacto",theme_spacing_cozy:"Cómodo",theme_spacing_spacious:"Espaçoso",theme_live_preview:"Pré-visualização",theme_heading_sample:"Exemplo de título",theme_body_sample:"A rápida raposa castanha salta sobre o cão preguiçoso. O texto do corpo usa a fonte, tamanho e espaçamento que escolheu.",theme_input_sample:"Input de exemplo",theme_primary_action:"Ação primária",runner_toast_required_fields:"Preencha os campos obrigatórios.",runner_toast_api_failed:"A chamada à API falhou.",runner_toast_answers_copied:"Respostas copiadas para a área de transferência!",runner_toast_partial_saved:"Respostas parciais guardadas (registadas).",runner_toast_file_uploaded:"Enviado {{name}} para {{key}}",runner_loading_preview:"A carregar pré-visualização…",runner_no_form:"Nenhum formulário configurado.",runner_back_to_builder:"Voltar ao construtor",runner_preset_full:"Total",runner_iframe_title:"Pré-visualização do formulário",import_invalid_json:"JSON inválido: não foi possível analisar a entrada.",import_success:"Journey importada com sucesso",import_clipboard_failed:"Não foi possível ler a área de transferência",shortcut_selected_nodes_one:"{{count}} nó selecionado",shortcut_selected_nodes_other:"{{count}} nós selecionados",shortcut_deleted:"Eliminado",shortcut_undo:"Desfazer",shortcut_redo:"Refazer",shortcut_copied:"Copiado para a área de transferência",shortcut_pasted:"Colado",shortcut_duplicated:"Duplicado"},wg={back:"Wstecz",next:"Dalej",reset:"Resetuj",cancel:"Anuluj",submit:"Wyślij",save:"Zapisz",delete:"Usuń",close:"Zamknij",empty:"(puste)",path:"Ścieżka",unknown:"Nieznany",runner_title:"Formularz",runner_save_exit:"Zapisz i wyjdź",runner_ready_title:"Zanim zaczniesz, upewnij się, że masz następujące dane:",runner_onboarding_subtitle:"Zanim zaczniesz, upewnij się, że masz następujące dane:",runner_onboarding_line1:"Zanim zaczniesz, proszę przygotuj odpowiednie informacje o zdarzeniu.",runner_onboarding_line2:"Możemy poprosić o szczegóły, takie jak opis zdarzenia, datę, lokalizację lub dokumenty pomocnicze.",runner_onboarding_photos:"Zdjęcia incydentu (szkoda, miejsce, kontekst)",runner_onboarding_documents:"Istotne dokumenty (polisa, dowód tożsamości itp.)",runner_onboarding_datetime:"Data i godzina zdarzenia",runner_onboarding_location:"Lokalizacja",runner_onboarding_description:"Krótki opis tego, co się wydarzyło",runner_start_claim:"Rozpocznij zgłoszenie",runner_review_title:"Przejrzyj swoje odpowiedzi",runner_no_answers:"Brak zarejestrowanych odpowiedzi.",runner_summary_all_answers:"Wszystkie odpowiedzi",runner_review:"Przegląd",runner_step:"Krok {{step}}/{{total}}",runner_no_journey:"Nie utworzono jeszcze żadnej ścieżki.",runner_no_data:"Dane ścieżki niedostępne.",builder_title:"Kreator ścieżek",builder_read_only:"Tylko do odczytu",builder_publish:"Publikuj",builder_unlock_edit:"Odblokuj edycję",builder_open_runner:"Otwórz formularz",builder_auto_layout:"Auto-układ",builder_export_json:"Eksportuj JSON",builder_export_copied:"Specyfikacja skopiowana do schowka",specs_title:"Właściwości",specs_search_placeholder:"Szukaj...",specs_filter_all:"Wszystkie typy",specs_create_custom:"Utwórz pole niestandardowe",specs_count:"{{filtered}} z {{total}} właściwości",specs_no_results:"Nie znaleziono właściwości",props_select_hint:"Wybierz węzeł lub krawędź do edycji",props_drag_hint:"Przeciągnij właściwości z lewego panelu na płótno, aby utworzyć węzły",node_props_title:"Właściwości węzła",node_schema_type:"Typ schematu",node_source_spec:"ID właściwości",node_namespace:"Namespace",node_required:"Wymagane",node_required_hint:"Blokuj nawigację, jeśli puste",node_original_label:"Oryginalna etykieta",node_label_override:"Etykieta niestandardowa (opcjonalna)",node_label_override_placeholder:"Etykieta niestandardowa…",node_actor:"Aktor",node_actor_customer:"Klient",node_actor_operator:"Operator",node_widget:"Widżet",node_widget_auto:"Automatyczny (ze schematu)",node_widget_text:"Pole tekstowe",node_widget_textarea:"Obszar tekstowy",node_widget_select:"Lista rozwijana",node_widget_radio:"Grupa radio",node_widget_datepicker:"Wybór daty",node_widget_timepicker:"Wybór godziny",node_widget_datetimepicker:"Wybór daty i godziny",node_widget_currency:"Pole walutowe",node_widget_upload:"Przesyłanie pliku",node_widget_email:"E-mail",node_widget_phone:"Telefon",node_widget_location:"Lokalizacja",node_allow_future:"Zezwól na przyszłe daty",node_allow_future_hint:"Gdy wyłączone, zezwala tylko na daty z przeszłości lub dzisiaj",node_bindings_title:"Powiązania",node_bindings_target:"Docelowy namespace",node_bindings_add:"Dodaj powiązanie",node_delete:"Usuń węzeł",node_options_title:"Opcje",upload_config_title:"Konfiguracja przesyłania",upload_file_type_preset:"Typ pliku",upload_any_file:"Dowolny plik",upload_images_only:"Tylko obrazy",upload_documents_only:"Tylko dokumenty",upload_images_pdf:"Obrazy + PDF",upload_custom:"Niestandardowy",upload_accepted_types:"Akceptowane typy (niestandardowe)",upload_accepted_types_placeholder:"np.: image/*,.pdf",upload_max_size:"Maksymalny rozmiar (MB)",upload_max_size_placeholder:"np.: 10",edge_props_title:"Właściwości krawędzi",edge_connection:"Połączenie",edge_default:"Krawędź domyślna",edge_default_hint:"Używana, gdy żaden inny warunek nie jest spełniony",edge_priority:"Priorytet",edge_priority_hint:"Krawędzie o wyższym priorytecie są oceniane jako pierwsze",edge_quick_pick:"Szybki wybór opcji:",edge_condition:"Warunek",edge_visual:"Wizualny",edge_advanced:"Zaawansowany",edge_json_logic:"Warunek JSON Logic",edge_delete:"Usuń krawędź",preview_title:"Podgląd",preview_step_of:"Krok {{current}} z {{total}}",preview_start:"Rozpocznij podgląd",preview_add_nodes_hint:"Dodaj węzły do płótna, aby wyświetlić podgląd przepływu.",preview_start_hint:"Kliknij „Rozpocznij podgląd”, aby interaktywnie przetestować przepływ.",preview_no_node:"Nie wybrano węzła.",preview_required_hint:"To pole jest wymagane",preview_validation_hint:"Najpierw popraw błędy walidacji",import_title:"Importuj specyfikację",import_description:"Wgraj plik JSON lub wklej JSON, aby wypełnić płótno.",import_paste_tab:"Wklej JSON",import_upload_tab:"Wgraj plik",import_paste_clipboard:"Wklej ze schowka",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importuj",import_validation_errors:"Błędy walidacji:",validation_title:"Walidacja grafu",validation_no_issues:"Nie znaleziono problemów",validation_issue_count:"Znaleziono {{count}} problem{{plural}}",validation_good:"Graf jest poprawny!",validation_no_issues_actor:"Brak problemów",validation_validate:"Waliduj",create_node_title:"Utwórz pole niestandardowe",create_node_label:"Etykieta *",create_node_label_placeholder:"Wprowadź etykietę",create_node_namespace:"Namespace",create_node_namespace_hint:"Generowany automatycznie z etykiety.",create_node_schema:"Typ schematu",upload_drag_drop:"Przeciągnij i upuść plik tutaj lub kliknij, aby wybrać",upload_uploading:"Przesyłanie…",widget_unknown_schema:"Nieznany typ schematu: {{schema}}",widget_yes:"Tak",widget_no:"Nie",widget_no_widget:"Brak dostępnego widżetu dla tego typu pola.",widget_no_options:"Brak skonfigurowanych opcji dla tego pola wyboru.",widget_pick_date:"Wybierz datę",widget_invalid_date:"Wprowadź prawidłową datę",widget_pick_time:"Wybierz godzinę",widget_select_option:"Wybierz opcję...",widget_search_country:"Szukaj kraju...",widget_no_country:"Nie znaleziono kraju.",widget_invalid_phone:"Wprowadź prawidłowy numer telefonu",widget_invalid_email:"Wprowadź prawidłowy e-mail",widget_file_too_large:"Plik przekracza limit {{max}} MB ({{size}} MB)",widget_file_type_rejected:"Typ pliku nie jest akceptowany. Dozwolone: {{accept}}",widget_upload_failed:"Przesyłanie nie powiodło się",widget_accepted_hint:"Akceptowane: {{accept}}",widget_max_size_hint:"Maks. {{max}} MB",location_placeholder:"Zacznij wpisywać adres…",location_no_api_key:"Klucz API Google Maps jest wymagany dla widżetu lokalizacji.",placeholder_text:"Wpisz…",placeholder_select:"Wybierz…",placeholder_currency:"0,00",placeholder_phone:"555 000 0000",placeholder_email:"email@przyklad.pl",placeholder_date:"Wybierz datę…",not_found_title:"404",not_found_message:"Strona nie znaleziona",not_found_link:"Powrót do strony głównej",runner_page_back:"Kreator",fc_title:"Konfigurator Formularza",fc_read_only:"Tylko do odczytu",fc_undo:"Cofnij",fc_redo:"Ponów",fc_preview_form:"Podgląd",fc_save:"Zapisz",fc_publish:"Opublikuj",fc_unlock_edit:"Odblokuj edycję",fc_tab_steps:"Kroki",fc_tab_fields:"Pola",fc_tab_init:"Inicjalizacja",fc_tab_json:"JSON",fc_form_steps:"Kroki Formularza",fc_add_step:"Dodaj Krok",fc_step_untitled:"(bez tytułu)",fc_step_meta:"{{rows}} wierszy, {{fields}} pól",fc_no_steps:"Brak kroków.",fc_no_steps_hint_click:"Kliknij",fc_no_steps_hint_to_begin:"aby rozpocząć.",fc_confirm_title:"Czy na pewno?",fc_confirm_delete_step:"Usunąć ten krok?",fc_step_empty_select:"Wybierz krok po lewej.",fc_step_empty_create:"Dodaj krok z lewego panelu, aby rozpocząć.",fc_step_title_label:"Tytuł kroku",fc_step_title_placeholder:"Tytuł kroku",fc_step_description_label:"Opis",fc_step_description_placeholder:"Opcjonalnie",fc_add_row:"Dodaj wiersz",fc_row_n:"Wiersz {{n}}",fc_layout_horizontal:"Poziomy",fc_layout_vertical:"Pionowy",fc_confirm_delete_row:"Usunąć ten wiersz?",fc_add_field_btn:"Dodaj pole",fc_no_fields:"Brak pól.",fc_edit:"Edytuj",fc_remove_from_row:"Usuń z wiersza",fc_nav_title:"Nawigacja kroku",fc_nav_api_call:"Wywołanie API przy kontynuacji",fc_nav_api_call_hint:"Wykonywane przed oceną reguł.",fc_nav_body_template:"Szablon body (JSON)",fc_nav_body_template_hint_prefix:"Użyj tokenów",fc_nav_body_template_hint_suffix:".",fc_nav_on_error:"W przypadku błędu",fc_nav_on_error_block:"Zablokuj — pozostań na tym kroku",fc_nav_on_error_continue:"Kontynuuj — oceń reguły mimo to",fc_nav_on_error_goto:"Przejdź do: {{step}}",fc_nav_on_error_summary:"Przejdź do: Podsumowanie",fc_nav_on_error_hint:"Co się dzieje, jeśli wywołanie się nie powiedzie lub sieć padnie.",fc_nav_continue_button:"Przycisk kontynuacji",fc_nav_continue_placeholder:"Kontynuuj",fc_nav_rules:"Reguły nawigacji",fc_nav_add_rule:"Dodaj regułę",fc_nav_rules_hint:'Reguły oceniane po kolei. Wygrywa pierwsza. Użyj "zawsze" jako ostatniej.',fc_nav_rule_n:"Reguła {{n}}",fc_nav_has_condition:"Ma warunek",fc_nav_go_to:"Przejdź do",fc_nav_submit_form:"— Wyślij formularz —",fc_nav_field_requires_value:'Pole "{{label}}" wymaga wartości.',fc_summary_panel:"Panel podsumowania",fc_summary_title_label:"Tytuł podsumowania",fc_summary_sections:"Sekcje",fc_summary_add_section:"Dodaj sekcję",fc_summary_section_title_placeholder:"Tytuł sekcji",fc_summary_visible_from:"Widoczna od kroku",fc_summary_until_step:"Do kroku (opcjonalne)",fc_summary_all_steps:"Wszystkie kroki",fc_summary_step_n:"Krok {{n}}",fc_summary_display_fields:"Pola do wyświetlenia",fc_summary_add:"Dodaj",fc_summary_no_display_fields:"Brak pól do wyświetlenia.",fc_summary_no_sections:"Brak sekcji.",fc_summary_confirm_delete_section:"Usunąć tę sekcję?",fc_summary_source:"Źródło",fc_summary_source_form_field:"Pole formularza",fc_summary_source_api_response:"Odpowiedź API",fc_summary_format:"Format",fc_summary_format_text:"Tekst",fc_summary_format_number:"Liczba",fc_summary_format_currency:"Waluta",fc_summary_format_date:"Data",fc_summary_format_datetime:"Data i godzina",fc_summary_display_label:"Etykieta",fc_summary_display_label_placeholder:"Etykieta do wyświetlenia",fc_summary_field:"Pole",fc_summary_select:"Wybierz…",fc_summary_from_step_api:"Z API kroku",fc_summary_response_path:"Ścieżka odpowiedzi (notacja z kropkami)",fc_fields_catalog:"Katalog pól",fc_fields_catalog_hint:"Wszystkie pola używane w formularzu. Edycja tutaj aktualizuje wszędzie.",fc_fields_add:"Dodaj pole",fc_fields_search:"Szukaj pól…",fc_fields_filter_all:"Wszystkie",fc_fields_filter_used:"Używane",fc_fields_filter_unused:"Nieużywane",fc_fields_unused_badge:"Nieużywane",fc_fields_used_in_one:"Używane w {{count}} kroku",fc_fields_used_in_many:"Używane w {{count}} krokach",fc_fields_go_to_step:'Przejdź do kroku "{{title}}"',fc_fields_no_fields:"Brak pól.",fc_fields_no_match:"Żadne pole nie pasuje do filtra.",fc_fields_confirm_delete:"Usunąć to pole?",fc_init_title:"Wartości początkowe",fc_init_subtitle:"Statyczne odpowiedzi wstępnie wczytane do runnera przed rozpoczęciem.",fc_init_static:"Wartości statyczne",fc_init_add:"Dodaj",fc_init_no_values:"Brak wartości początkowych.",fc_init_prefill:"Wstępne wypełnienie z API",fc_init_prefill_hint:"Pobierz odpowiedzi z endpointu przy montowaniu runnera.",fc_init_mapping:"Mapowanie (JSON: namespace → response_path)",fc_json_title:"JSON",fc_json_hint:"Surowy JourneySpec (form_config + theme). Edytuj i kliknij Zastosuj, aby zaktualizować konfigurator.",fc_json_refresh:"Wczytaj z konfiguratora",fc_json_refresh_hint:"Odrzuć zmiany w JSON i wczytaj ponownie aktualny stan konfiguratora",fc_json_copy:"Kopiuj",fc_json_download:"Pobierz",fc_json_import:"Zastosuj zmiany",fc_json_apply_hint:"Zastosuj zmiany JSON w konfiguratorze",fc_json_imported_ok:"Zaimportowano pomyślnie",fc_json_copied:"Skopiowano do schowka",fc_json_invalid:"Nieprawidłowy JSON",fc_json_upload:"Prześlij plik",fc_json_file_error:"Nie udało się odczytać pliku.",fc_create_field_title:"Dodaj pole",fc_create_field_subtitle:"Wybierz z katalogu lub utwórz pole niestandardowe.",fc_create_from_catalog:"Z katalogu ({{count}})",fc_create_custom:"Pole niestandardowe",fc_create_search_specs:"Szukaj specs…",fc_create_no_specs:"Brak pasujących specs.",fc_create_label_required:"Etykieta *",fc_create_label_placeholder:"np. Nazwa klienta",fc_create_namespace:"Namespace",fc_create_namespace_placeholder:"np. customer.name (automatycznie jeśli puste)",fc_create_schema:"Schema",fc_create_options:"Opcje",fc_create_option_value_placeholder:"wartość",fc_create_option_label_placeholder:"Etykieta",fc_create_cancel:"Anuluj",fc_create_create:"Utwórz",fc_field_props:"Właściwości pola",fc_field_no_selected:"Nie wybrano pola.",fc_field_label:"Etykieta *",fc_field_namespace:"Namespace",fc_field_placeholder:"Placeholder",fc_field_help:"Tekst pomocy",fc_field_required:"Wymagane",fc_field_required_hint:"Użytkownik musi wypełnić przed kontynuacją.",fc_field_actor:"Aktor",fc_field_actor_customer:"Klient",fc_field_actor_operator:"Operator",fc_field_widget:"Widget",fc_field_widget_auto:"Automatyczny",fc_field_widget_text:"Tekst",fc_field_widget_textarea:"Pole tekstowe",fc_field_widget_select:"Lista",fc_field_widget_radio:"Radio",fc_field_widget_date:"Data",fc_field_widget_time:"Godzina",fc_field_widget_datetime:"Data i godzina",fc_field_widget_currency:"Waluta",fc_field_widget_upload:"Załącznik",fc_field_widget_email:"Email",fc_field_widget_phone:"Telefon",fc_field_widget_location:"Lokalizacja",fc_field_widget_boolean:"Boolean (Tak/Nie)",fc_field_allow_future:"Zezwól na przyszłe daty",fc_field_allow_future_hint:"Zezwól na daty po dzisiejszej.",fc_field_display_style:"Styl wyświetlania",fc_field_display_auto:"Auto (radio ≤5, dropdown >5)",fc_field_display_radio:"Lista radio",fc_field_display_dropdown:"Dropdown",fc_field_display_segmented:"Przyciski segmentowane",fc_field_display_hint:"Kontroluje wygląd opcji w runtime.",fc_field_display_switch:"Switch (przełącznik)",fc_field_display_yesno:"Segmentowany (przyciski Tak / Nie)",fc_field_boolean_hint:"Nadpisz etykiety Tak/Nie dodając 2 opcje poniżej (pierwsza = true, druga = false).",fc_field_options:"Opcje",fc_field_no_options:"Brak opcji.",fc_field_upload_validation:"Walidacja załącznika",fc_field_upload_accept:"Akceptowane typy MIME/rozszerzenia",fc_field_upload_max:"Maksymalny rozmiar (MB)",fc_field_delete:"Usuń pole",fc_field_done:"Gotowe",fc_field_confirm_delete:"Usunąć to pole z katalogu (i ze wszystkich wierszy, które go używają)?",theme_button:"Motyw",theme_reset:"Resetuj",theme_colors:"Kolory",theme_primary:"Podstawowy",theme_background:"Tło",theme_card:"Karta",theme_foreground:"Tekst",theme_color_picker_aria:"Wybór koloru {{label}}",theme_color_placeholder:"np. 222 47% 11%",theme_color_hint:"Wybierz kolor lub wpisz triplet HSL",theme_typography:"Typografia",theme_heading_font:"Czcionka nagłówków",theme_body_font:"Czcionka treści",theme_font_default:"Domyślna",theme_font_size:"Bazowy rozmiar czcionki (px)",theme_shape_spacing:"Kształt i odstępy",theme_border_radius:"Promień zaokrąglenia (rem)",theme_spacing:"Odstępy",theme_spacing_cozy_default:"Komfortowe (domyślne)",theme_spacing_compact:"Kompaktowe",theme_spacing_cozy:"Komfortowe",theme_spacing_spacious:"Przestronne",theme_live_preview:"Podgląd na żywo",theme_heading_sample:"Przykładowy nagłówek",theme_body_sample:"Zażółć gęślą jaźń. Tekst treści używa wybranej czcionki, rozmiaru i odstępów.",theme_input_sample:"Przykładowe pole",theme_primary_action:"Akcja podstawowa",runner_toast_required_fields:"Wypełnij wymagane pola.",runner_toast_api_failed:"Wywołanie API nie powiodło się.",runner_toast_answers_copied:"Odpowiedzi skopiowane do schowka!",runner_toast_partial_saved:"Częściowe odpowiedzi zapisane (zalogowane).",runner_toast_file_uploaded:"Przesłano {{name}} dla {{key}}",runner_loading_preview:"Ładowanie podglądu…",runner_no_form:"Nie skonfigurowano formularza.",runner_back_to_builder:"Wróć do kreatora",runner_preset_full:"Pełny",runner_iframe_title:"Podgląd formularza",import_invalid_json:"Nieprawidłowy JSON: nie można przeanalizować danych.",import_success:"Journey zaimportowana pomyślnie",import_clipboard_failed:"Nie można odczytać schowka",shortcut_selected_nodes_one:"Zaznaczono {{count}} węzeł",shortcut_selected_nodes_other:"Zaznaczono {{count}} węzłów",shortcut_deleted:"Usunięto",shortcut_undo:"Cofnij",shortcut_redo:"Ponów",shortcut_copied:"Skopiowano do schowka",shortcut_pasted:"Wklejono",shortcut_duplicated:"Zduplikowano"},Yi={en:Va,es:xg,pt:bg,pl:wg},Ss="language",wr="en";function Ng(){try{return localStorage.getItem(Ss)||wr}catch{return wr}}let yr=[],Cs=Ng();function Sg(e){return yr.push(e),()=>{yr=yr.filter(t=>t!==e)}}function Cg(){return Cs}function pd(e){try{localStorage.setItem(Ss,e)}catch{}Cs=e,yr.forEach(t=>t())}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ss&&(Cs=e.newValue||wr,yr.forEach(t=>t()))});function je(){const e=v.useSyncExternalStore(Sg,Cg,()=>wr),t=Yi[e]||Yi[wr]||Va;return{t:v.useCallback((r,o)=>{let a=t[r]??Va[r]??r;if(o)for(const[s,i]of Object.entries(o))a=a.replace(new RegExp(`\\{\\{${s}\\}\\}`,"g"),String(i));return a},[t]),language:e,setLanguage:pd}}function kg(e,t=globalThis==null?void 0:globalThis.document){const n=Ue(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Pg="DismissableLayer",Ga="dismissableLayer.update",Eg="dismissableLayer.pointerDownOutside",Mg="dismissableLayer.focusOutside",qi,hd=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:i,...l}=e,d=h.useContext(hd),[u,f]=h.useState(null),m=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),g=he(t,C=>f(C)),_=Array.from(d.layers),[j]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=_.indexOf(j),x=u?_.indexOf(u):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,w=x>=y,S=Rg(C=>{const E=C.target,k=[...d.branches].some(M=>M.contains(E));!w||k||(o==null||o(C),s==null||s(C),C.defaultPrevented||i==null||i())},m),N=Og(C=>{const E=C.target;[...d.branches].some(M=>M.contains(E))||(a==null||a(C),s==null||s(C),C.defaultPrevented||i==null||i())},m);return kg(C=>{x===d.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&i&&(C.preventDefault(),i()))},m),h.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(qi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Vi(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=qi)}},[u,m,n,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Vi())},[u,d]),h.useEffect(()=>{const C=()=>p({});return document.addEventListener(Ga,C),()=>document.removeEventListener(Ga,C)},[]),c.jsx(se.div,{...l,ref:g,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,N.onFocusCapture),onBlurCapture:re(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,S.onPointerDownCapture)})});Wo.displayName=Pg;var Dg="DismissableLayerBranch",Tg=h.forwardRef((e,t)=>{const n=h.useContext(hd),r=h.useRef(null),o=he(t,r);return h.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),c.jsx(se.div,{...e,ref:o})});Tg.displayName=Dg;function Rg(e,t=globalThis==null?void 0:globalThis.document){const n=Ue(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const a=i=>{if(i.target&&!r.current){let l=function(){_d(Eg,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Og(e,t=globalThis==null?void 0:globalThis.document){const n=Ue(e),r=h.useRef(!1);return h.useEffect(()=>{const o=a=>{a.target&&!r.current&&_d(Mg,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vi(){const e=new CustomEvent(Ga);document.dispatchEvent(e)}function _d(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ih(o,a):o.dispatchEvent(a)}var wa="focusScope.autoFocusOnMount",Na="focusScope.autoFocusOnUnmount",Gi={bubbles:!1,cancelable:!0},Ag="FocusScope",$o=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,l]=h.useState(null),d=Ue(o),u=Ue(a),f=h.useRef(null),m=he(t,_=>l(_)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let _=function(b){if(p.paused||!i)return;const w=b.target;i.contains(w)?f.current=w:nn(f.current,{select:!0})},j=function(b){if(p.paused||!i)return;const w=b.relatedTarget;w!==null&&(i.contains(w)||nn(f.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&nn(i)};document.addEventListener("focusin",_),document.addEventListener("focusout",j);const x=new MutationObserver(y);return i&&x.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",j),x.disconnect()}}},[r,i,p.paused]),h.useEffect(()=>{if(i){Xi.add(p);const _=document.activeElement;if(!i.contains(_)){const y=new CustomEvent(wa,Gi);i.addEventListener(wa,d),i.dispatchEvent(y),y.defaultPrevented||(zg(Lg(gd(i)),{select:!0}),document.activeElement===_&&nn(i))}return()=>{i.removeEventListener(wa,d),setTimeout(()=>{const y=new CustomEvent(Na,Gi);i.addEventListener(Na,u),i.dispatchEvent(y),y.defaultPrevented||nn(_??document.body,{select:!0}),i.removeEventListener(Na,u),Xi.remove(p)},0)}}},[i,d,u,p]);const g=h.useCallback(_=>{if(!n&&!r||p.paused)return;const j=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,y=document.activeElement;if(j&&y){const x=_.currentTarget,[b,w]=Ig(x);b&&w?!_.shiftKey&&y===w?(_.preventDefault(),n&&nn(b,{select:!0})):_.shiftKey&&y===b&&(_.preventDefault(),n&&nn(w,{select:!0})):y===x&&_.preventDefault()}},[n,r,p.paused]);return c.jsx(se.div,{tabIndex:-1,...s,ref:m,onKeyDown:g})});$o.displayName=Ag;function zg(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nn(r,{select:t}),document.activeElement!==n)return}function Ig(e){const t=gd(e),n=Ui(t,e),r=Ui(t.reverse(),e);return[n,r]}function gd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ui(e,t){for(const n of e)if(!Wg(n,{upTo:t}))return n}function Wg(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $g(e){return e instanceof HTMLInputElement&&"select"in e}function nn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$g(e)&&t&&e.select()}}var Xi=Fg();function Fg(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ki(e,t),e.unshift(t)},remove(t){var n;e=Ki(e,t),(n=e[0])==null||n.resume()}}}function Ki(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Lg(e){return e.filter(t=>t.tagName!=="A")}var Bg="Portal",Fo=h.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,a]=h.useState(!1);Ye(()=>a(!0),[]);const s=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?fs.createPortal(c.jsx(se.div,{...r,ref:t}),s):null});Fo.displayName=Bg;var Sa=0;function ks(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ji()),document.body.insertAdjacentElement("beforeend",e[1]??Ji()),Sa++,()=>{Sa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Sa--}},[])}function Ji(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ct.apply(this,arguments)};function jd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Hg(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ro="right-scroll-bar-position",oo="width-before-scroll-bar",Yg="with-scroll-bars-hidden",qg="--removed-body-scroll-bar-size";function Ca(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Vg(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Gg=typeof window<"u"?h.useLayoutEffect:h.useEffect,Qi=new WeakMap;function Ug(e,t){var n=Vg(null,function(r){return e.forEach(function(o){return Ca(o,r)})});return Gg(function(){var r=Qi.get(n);if(r){var o=new Set(r),a=new Set(e),s=n.current;o.forEach(function(i){a.has(i)||Ca(i,null)}),a.forEach(function(i){o.has(i)||Ca(i,s)})}Qi.set(n,e)},[e]),n}function Xg(e){return e}function Kg(e,t){t===void 0&&(t=Xg);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(i){return a(i)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var i=n;n=[],i.forEach(a),s=n}var l=function(){var u=s;s=[],u.forEach(a)},d=function(){return Promise.resolve().then(l)};d(),n={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),n}}}};return o}function Jg(e){e===void 0&&(e={});var t=Kg(null);return t.options=Ct({async:!0,ssr:!1},e),t}var yd=function(e){var t=e.sideCar,n=jd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ct({},n))};yd.isSideCarExport=!0;function Qg(e,t){return e.useMedium(t),yd}var vd=Jg(),ka=function(){},Lo=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:ka,onWheelCapture:ka,onTouchMoveCapture:ka}),o=r[0],a=r[1],s=e.forwardProps,i=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,g=e.noIsolation,_=e.inert,j=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,b=e.gapMode,w=jd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,N=Ug([n,t]),C=Ct(Ct({},w),o);return h.createElement(h.Fragment,null,u&&h.createElement(S,{sideCar:vd,removeScrollBar:d,shards:f,noRelative:p,noIsolation:g,inert:_,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:b}),s?h.cloneElement(h.Children.only(i),Ct(Ct({},C),{ref:N})):h.createElement(x,Ct({},C,{className:l,ref:N}),i))});Lo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lo.classNames={fullWidth:oo,zeroRight:ro};var Zg=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ej(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zg();return t&&e.setAttribute("nonce",t),e}function tj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ej())&&(tj(t,n),nj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oj=function(){var e=rj();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xd=function(){var e=oj(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},aj={left:0,top:0,right:0,gap:0},Pa=function(e){return parseInt(e||"",10)||0},sj=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Pa(n),Pa(r),Pa(o)]},ij=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aj;var t=sj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},cj=xd(),Yn="data-scroll-locked",lj=function(e,t,n,r){var o=e.left,a=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),`
228
228
  .`.concat(Yg,` {
229
229
  overflow: hidden `).concat(r,`;
230
230
  padding-right: `).concat(i,"px ").concat(r,`;
@@ -261,10 +261,10 @@
261
261
  body[`).concat(Yn,`] {
262
262
  `).concat(qg,": ").concat(i,`px;
263
263
  }
264
- `)},Zi=function(){var e=parseInt(document.body.getAttribute(Yn)||"0",10);return isFinite(e)?e:0},dj=function(){h.useEffect(function(){return document.body.setAttribute(Yn,(Zi()+1).toString()),function(){var e=Zi()-1;e<=0?document.body.removeAttribute(Yn):document.body.setAttribute(Yn,e.toString())}},[])},uj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;dj();var a=h.useMemo(function(){return ij(o)},[o]);return h.createElement(cj,{styles:lj(a,!t,o,n?"":"!important")})},Ua=!1;if(typeof window<"u")try{var qr=Object.defineProperty({},"passive",{get:function(){return Ua=!0,!0}});window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{Ua=!1}var Rn=Ua?{passive:!1}:!1,fj=function(e){return e.tagName==="TEXTAREA"},bd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fj(e)&&n[t]==="visible")},mj=function(e){return bd(e,"overflowY")},pj=function(e){return bd(e,"overflowX")},ec=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=wd(e,r);if(o){var a=Nd(e,r),s=a[1],i=a[2];if(s>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hj=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_j=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wd=function(e,t){return e==="v"?mj(t):pj(t)},Nd=function(e,t){return e==="v"?hj(t):_j(t)},gj=function(e,t){return e==="h"&&t==="rtl"?-1:1},jj=function(e,t,n,r,o){var a=gj(e,window.getComputedStyle(t).direction),s=a*r,i=n.target,l=t.contains(i),d=!1,u=s>0,f=0,m=0;do{if(!i)break;var p=Nd(e,i),j=p[0],_=p[1],g=p[2],v=_-g-a*j;(j||v)&&wd(e,i)&&(f+=v,m+=j);var x=i.parentNode;i=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(u&&Math.abs(f)<1||!u&&Math.abs(m)<1)&&(d=!0),d},Vr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tc=function(e){return[e.deltaX,e.deltaY]},nc=function(e){return e&&"current"in e?e.current:e},yj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vj=function(e){return`
264
+ `)},Zi=function(){var e=parseInt(document.body.getAttribute(Yn)||"0",10);return isFinite(e)?e:0},dj=function(){h.useEffect(function(){return document.body.setAttribute(Yn,(Zi()+1).toString()),function(){var e=Zi()-1;e<=0?document.body.removeAttribute(Yn):document.body.setAttribute(Yn,e.toString())}},[])},uj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;dj();var a=h.useMemo(function(){return ij(o)},[o]);return h.createElement(cj,{styles:lj(a,!t,o,n?"":"!important")})},Ua=!1;if(typeof window<"u")try{var qr=Object.defineProperty({},"passive",{get:function(){return Ua=!0,!0}});window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{Ua=!1}var Rn=Ua?{passive:!1}:!1,fj=function(e){return e.tagName==="TEXTAREA"},bd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fj(e)&&n[t]==="visible")},mj=function(e){return bd(e,"overflowY")},pj=function(e){return bd(e,"overflowX")},ec=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=wd(e,r);if(o){var a=Nd(e,r),s=a[1],i=a[2];if(s>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hj=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_j=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wd=function(e,t){return e==="v"?mj(t):pj(t)},Nd=function(e,t){return e==="v"?hj(t):_j(t)},gj=function(e,t){return e==="h"&&t==="rtl"?-1:1},jj=function(e,t,n,r,o){var a=gj(e,window.getComputedStyle(t).direction),s=a*r,i=n.target,l=t.contains(i),d=!1,u=s>0,f=0,m=0;do{if(!i)break;var p=Nd(e,i),g=p[0],_=p[1],j=p[2],y=_-j-a*g;(g||y)&&wd(e,i)&&(f+=y,m+=g);var x=i.parentNode;i=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(u&&Math.abs(f)<1||!u&&Math.abs(m)<1)&&(d=!0),d},Vr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tc=function(e){return[e.deltaX,e.deltaY]},nc=function(e){return e&&"current"in e?e.current:e},yj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vj=function(e){return`
265
265
  .block-interactivity-`.concat(e,` {pointer-events: none;}
266
266
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
267
- `)},xj=0,On=[];function bj(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(xj++)[0],a=h.useState(xd)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var _=Hg([e.lockRef.current],(e.shards||[]).map(nc),!0).filter(Boolean);return _.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),_.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=h.useCallback(function(_,g){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!s.current.allowPinchZoom;var v=Vr(_),x=n.current,b="deltaX"in _?_.deltaX:x[0]-v[0],w="deltaY"in _?_.deltaY:x[1]-v[1],S,N=_.target,C=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in _&&C==="h"&&N.type==="range")return!1;var E=window.getSelection(),k=E&&E.anchorNode,M=k?k===N||k.contains(N):!1;if(M)return!1;var D=ec(C,N);if(!D)return!0;if(D?S=C:(S=C==="v"?"h":"v",D=ec(C,N)),!D)return!1;if(!r.current&&"changedTouches"in _&&(b||w)&&(r.current=S),!S)return!0;var T=r.current||S;return jj(T,g,_,T==="h"?b:w)},[]),l=h.useCallback(function(_){var g=_;if(!(!On.length||On[On.length-1]!==a)){var v="deltaY"in g?tc(g):Vr(g),x=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&yj(S.delta,v)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var b=(s.current.shards||[]).map(nc).filter(Boolean).filter(function(S){return S.contains(g.target)}),w=b.length>0?i(g,b[0]):!s.current.noIsolation;w&&g.cancelable&&g.preventDefault()}}},[]),d=h.useCallback(function(_,g,v,x){var b={name:_,delta:g,target:v,should:x,shadowParent:wj(v)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),u=h.useCallback(function(_){n.current=Vr(_),r.current=void 0},[]),f=h.useCallback(function(_){d(_.type,tc(_),_.target,i(_,e.lockRef.current))},[]),m=h.useCallback(function(_){d(_.type,Vr(_),_.target,i(_,e.lockRef.current))},[]);h.useEffect(function(){return On.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Rn),document.addEventListener("touchmove",l,Rn),document.addEventListener("touchstart",u,Rn),function(){On=On.filter(function(_){return _!==a}),document.removeEventListener("wheel",l,Rn),document.removeEventListener("touchmove",l,Rn),document.removeEventListener("touchstart",u,Rn)}},[]);var p=e.removeScrollBar,j=e.inert;return h.createElement(h.Fragment,null,j?h.createElement(a,{styles:vj(o)}):null,p?h.createElement(uj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nj=Qg(vd,bj);var Bo=h.forwardRef(function(e,t){return h.createElement(Lo,Ct({},e,{ref:t,sideCar:Nj}))});Bo.classNames=Lo.classNames;var Sj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},An=new WeakMap,Gr=new WeakMap,Ur={},Ea=0,Sd=function(e){return e&&(e.host||Sd(e.parentNode))},Cj=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sd(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kj=function(e,t,n,r){var o=Cj(t,Array.isArray(e)?e:[e]);Ur[n]||(Ur[n]=new WeakMap);var a=Ur[n],s=[],i=new Set,l=new Set(o),d=function(f){!f||i.has(f)||(i.add(f),d(f.parentNode))};o.forEach(d);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(m){if(i.has(m))u(m);else try{var p=m.getAttribute(r),j=p!==null&&p!=="false",_=(An.get(m)||0)+1,g=(a.get(m)||0)+1;An.set(m,_),a.set(m,g),s.push(m),_===1&&j&&Gr.set(m,!0),g===1&&m.setAttribute(n,"true"),j||m.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),i.clear(),Ea++,function(){s.forEach(function(f){var m=An.get(f)-1,p=a.get(f)-1;An.set(f,m),a.set(f,p),m||(Gr.has(f)||f.removeAttribute(r),Gr.delete(f)),p||f.removeAttribute(n)}),Ea--,Ea||(An=new WeakMap,An=new WeakMap,Gr=new WeakMap,Ur={})}},Ps=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Sj(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),kj(r,o,n,"aria-hidden")):function(){return null}};function Pj(e){const t=Ej(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Dj);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Ej(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=Rj(o),i=Tj(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mj=Symbol("radix.slottable");function Dj(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Mj}function Tj(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Rj(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ho="Dialog",[Cd,kd]=st(Ho),[Oj,Nt]=Cd(Ho),Pd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,i=h.useRef(null),l=h.useRef(null),[d,u]=Ht({prop:r,defaultProp:o??!1,onChange:a,caller:Ho});return c.jsx(Oj,{scope:t,triggerRef:i,contentRef:l,contentId:Dt(),titleId:Dt(),descriptionId:Dt(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};Pd.displayName=Ho;var Ed="DialogTrigger",Md=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Ed,n),a=he(t,o.triggerRef);return c.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ds(o.open),...r,ref:a,onClick:re(e.onClick,o.onOpenToggle)})});Md.displayName=Ed;var Es="DialogPortal",[Aj,Dd]=Cd(Es,{forceMount:void 0}),Td=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=Nt(Es,t);return c.jsx(Aj,{scope:t,forceMount:n,children:h.Children.map(r,s=>c.jsx(it,{present:n||a.open,children:c.jsx(Fo,{asChild:!0,container:o,children:s})}))})};Td.displayName=Es;var po="DialogOverlay",Rd=h.forwardRef((e,t)=>{const n=Dd(po,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Nt(po,e.__scopeDialog);return a.modal?c.jsx(it,{present:r||a.open,children:c.jsx(Ij,{...o,ref:t})}):null});Rd.displayName=po;var zj=Pj("DialogOverlay.RemoveScroll"),Ij=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(po,n);return c.jsx(Bo,{as:zj,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(se.div,{"data-state":Ds(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),bn="DialogContent",Od=h.forwardRef((e,t)=>{const n=Dd(bn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Nt(bn,e.__scopeDialog);return c.jsx(it,{present:r||a.open,children:a.modal?c.jsx(Wj,{...o,ref:t}):c.jsx($j,{...o,ref:t})})});Od.displayName=bn;var Wj=h.forwardRef((e,t)=>{const n=Nt(bn,e.__scopeDialog),r=h.useRef(null),o=he(t,n.contentRef,r);return h.useEffect(()=>{const a=r.current;if(a)return Ps(a)},[]),c.jsx(Ad,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&a.preventDefault()}),onFocusOutside:re(e.onFocusOutside,a=>a.preventDefault())})}),$j=h.forwardRef((e,t)=>{const n=Nt(bn,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return c.jsx(Ad,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Ad=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,i=Nt(bn,n),l=h.useRef(null),d=he(t,l);return ks(),c.jsxs(c.Fragment,{children:[c.jsx($o,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:c.jsx(Wo,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Ds(i.open),...s,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Lj,{titleId:i.titleId}),c.jsx(Hj,{contentRef:l,descriptionId:i.descriptionId})]})]})}),Ms="DialogTitle",zd=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Ms,n);return c.jsx(se.h2,{id:o.titleId,...r,ref:t})});zd.displayName=Ms;var Id="DialogDescription",Wd=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Id,n);return c.jsx(se.p,{id:o.descriptionId,...r,ref:t})});Wd.displayName=Id;var $d="DialogClose",Fd=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt($d,n);return c.jsx(se.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))})});Fd.displayName=$d;function Ds(e){return e?"open":"closed"}var Ld="DialogTitleWarning",[Fj,Bd]=xh(Ld,{contentName:bn,titleName:Ms,docsSlug:"dialog"}),Lj=({titleId:e})=>{const t=Bd(Ld),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
267
+ `)},xj=0,On=[];function bj(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(xj++)[0],a=h.useState(xd)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var _=Hg([e.lockRef.current],(e.shards||[]).map(nc),!0).filter(Boolean);return _.forEach(function(j){return j.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),_.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=h.useCallback(function(_,j){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!s.current.allowPinchZoom;var y=Vr(_),x=n.current,b="deltaX"in _?_.deltaX:x[0]-y[0],w="deltaY"in _?_.deltaY:x[1]-y[1],S,N=_.target,C=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in _&&C==="h"&&N.type==="range")return!1;var E=window.getSelection(),k=E&&E.anchorNode,M=k?k===N||k.contains(N):!1;if(M)return!1;var D=ec(C,N);if(!D)return!0;if(D?S=C:(S=C==="v"?"h":"v",D=ec(C,N)),!D)return!1;if(!r.current&&"changedTouches"in _&&(b||w)&&(r.current=S),!S)return!0;var T=r.current||S;return jj(T,j,_,T==="h"?b:w)},[]),l=h.useCallback(function(_){var j=_;if(!(!On.length||On[On.length-1]!==a)){var y="deltaY"in j?tc(j):Vr(j),x=t.current.filter(function(S){return S.name===j.type&&(S.target===j.target||j.target===S.shadowParent)&&yj(S.delta,y)})[0];if(x&&x.should){j.cancelable&&j.preventDefault();return}if(!x){var b=(s.current.shards||[]).map(nc).filter(Boolean).filter(function(S){return S.contains(j.target)}),w=b.length>0?i(j,b[0]):!s.current.noIsolation;w&&j.cancelable&&j.preventDefault()}}},[]),d=h.useCallback(function(_,j,y,x){var b={name:_,delta:j,target:y,should:x,shadowParent:wj(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),u=h.useCallback(function(_){n.current=Vr(_),r.current=void 0},[]),f=h.useCallback(function(_){d(_.type,tc(_),_.target,i(_,e.lockRef.current))},[]),m=h.useCallback(function(_){d(_.type,Vr(_),_.target,i(_,e.lockRef.current))},[]);h.useEffect(function(){return On.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Rn),document.addEventListener("touchmove",l,Rn),document.addEventListener("touchstart",u,Rn),function(){On=On.filter(function(_){return _!==a}),document.removeEventListener("wheel",l,Rn),document.removeEventListener("touchmove",l,Rn),document.removeEventListener("touchstart",u,Rn)}},[]);var p=e.removeScrollBar,g=e.inert;return h.createElement(h.Fragment,null,g?h.createElement(a,{styles:vj(o)}):null,p?h.createElement(uj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nj=Qg(vd,bj);var Bo=h.forwardRef(function(e,t){return h.createElement(Lo,Ct({},e,{ref:t,sideCar:Nj}))});Bo.classNames=Lo.classNames;var Sj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},An=new WeakMap,Gr=new WeakMap,Ur={},Ea=0,Sd=function(e){return e&&(e.host||Sd(e.parentNode))},Cj=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sd(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kj=function(e,t,n,r){var o=Cj(t,Array.isArray(e)?e:[e]);Ur[n]||(Ur[n]=new WeakMap);var a=Ur[n],s=[],i=new Set,l=new Set(o),d=function(f){!f||i.has(f)||(i.add(f),d(f.parentNode))};o.forEach(d);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(m){if(i.has(m))u(m);else try{var p=m.getAttribute(r),g=p!==null&&p!=="false",_=(An.get(m)||0)+1,j=(a.get(m)||0)+1;An.set(m,_),a.set(m,j),s.push(m),_===1&&g&&Gr.set(m,!0),j===1&&m.setAttribute(n,"true"),g||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return u(t),i.clear(),Ea++,function(){s.forEach(function(f){var m=An.get(f)-1,p=a.get(f)-1;An.set(f,m),a.set(f,p),m||(Gr.has(f)||f.removeAttribute(r),Gr.delete(f)),p||f.removeAttribute(n)}),Ea--,Ea||(An=new WeakMap,An=new WeakMap,Gr=new WeakMap,Ur={})}},Ps=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Sj(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),kj(r,o,n,"aria-hidden")):function(){return null}};function Pj(e){const t=Ej(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Dj);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Ej(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=Rj(o),i=Tj(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mj=Symbol("radix.slottable");function Dj(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Mj}function Tj(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Rj(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ho="Dialog",[Cd,kd]=st(Ho),[Oj,Nt]=Cd(Ho),Pd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,i=h.useRef(null),l=h.useRef(null),[d,u]=Ht({prop:r,defaultProp:o??!1,onChange:a,caller:Ho});return c.jsx(Oj,{scope:t,triggerRef:i,contentRef:l,contentId:Dt(),titleId:Dt(),descriptionId:Dt(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};Pd.displayName=Ho;var Ed="DialogTrigger",Md=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Ed,n),a=he(t,o.triggerRef);return c.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ds(o.open),...r,ref:a,onClick:re(e.onClick,o.onOpenToggle)})});Md.displayName=Ed;var Es="DialogPortal",[Aj,Dd]=Cd(Es,{forceMount:void 0}),Td=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=Nt(Es,t);return c.jsx(Aj,{scope:t,forceMount:n,children:h.Children.map(r,s=>c.jsx(it,{present:n||a.open,children:c.jsx(Fo,{asChild:!0,container:o,children:s})}))})};Td.displayName=Es;var po="DialogOverlay",Rd=h.forwardRef((e,t)=>{const n=Dd(po,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Nt(po,e.__scopeDialog);return a.modal?c.jsx(it,{present:r||a.open,children:c.jsx(Ij,{...o,ref:t})}):null});Rd.displayName=po;var zj=Pj("DialogOverlay.RemoveScroll"),Ij=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(po,n);return c.jsx(Bo,{as:zj,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(se.div,{"data-state":Ds(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),bn="DialogContent",Od=h.forwardRef((e,t)=>{const n=Dd(bn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Nt(bn,e.__scopeDialog);return c.jsx(it,{present:r||a.open,children:a.modal?c.jsx(Wj,{...o,ref:t}):c.jsx($j,{...o,ref:t})})});Od.displayName=bn;var Wj=h.forwardRef((e,t)=>{const n=Nt(bn,e.__scopeDialog),r=h.useRef(null),o=he(t,n.contentRef,r);return h.useEffect(()=>{const a=r.current;if(a)return Ps(a)},[]),c.jsx(Ad,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&a.preventDefault()}),onFocusOutside:re(e.onFocusOutside,a=>a.preventDefault())})}),$j=h.forwardRef((e,t)=>{const n=Nt(bn,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return c.jsx(Ad,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Ad=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,i=Nt(bn,n),l=h.useRef(null),d=he(t,l);return ks(),c.jsxs(c.Fragment,{children:[c.jsx($o,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:c.jsx(Wo,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Ds(i.open),...s,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Lj,{titleId:i.titleId}),c.jsx(Hj,{contentRef:l,descriptionId:i.descriptionId})]})]})}),Ms="DialogTitle",zd=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Ms,n);return c.jsx(se.h2,{id:o.titleId,...r,ref:t})});zd.displayName=Ms;var Id="DialogDescription",Wd=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Id,n);return c.jsx(se.p,{id:o.descriptionId,...r,ref:t})});Wd.displayName=Id;var $d="DialogClose",Fd=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt($d,n);return c.jsx(se.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))})});Fd.displayName=$d;function Ds(e){return e?"open":"closed"}var Ld="DialogTitleWarning",[Fj,Bd]=xh(Ld,{contentName:bn,titleName:Ms,docsSlug:"dialog"}),Lj=({titleId:e})=>{const t=Bd(Ld),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
268
268
 
269
269
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
270
270
 
@@ -274,14 +274,14 @@ You can add a description to the \`${qn}\` by passing a \`${Jd}\` component as a
274
274
 
275
275
  Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${qn}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
276
276
 
277
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},ny=qd,ry=Vd,nu=Gd,ru=Ud,ou=Zd,au=tu,su=Kd,iu=Qd;const oy=ny,ay=ry,cu=h.forwardRef(({className:e,...t},n)=>c.jsx(nu,{className:ne("cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t,ref:n}));cu.displayName=nu.displayName;const lu=h.forwardRef(({className:e,...t},n)=>c.jsxs(ay,{children:[c.jsx(cu,{}),c.jsx(ru,{ref:n,className:ne("cj-fixed cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[state=closed]:cj-slide-out-to-left-1/2 data-[state=closed]:cj-slide-out-to-top-[48%] data-[state=open]:cj-slide-in-from-left-1/2 data-[state=open]:cj-slide-in-from-top-[48%] sm:cj-rounded-lg",e),...t})]}));lu.displayName=ru.displayName;const du=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col cj-space-y-2 cj-text-center sm:cj-text-left",e),...t});du.displayName="AlertDialogHeader";const uu=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col-reverse sm:cj-flex-row sm:cj-justify-end sm:cj-space-x-2",e),...t});uu.displayName="AlertDialogFooter";const fu=h.forwardRef(({className:e,...t},n)=>c.jsx(su,{ref:n,className:ne("cj-text-lg cj-font-semibold",e),...t}));fu.displayName=su.displayName;const mu=h.forwardRef(({className:e,...t},n)=>c.jsx(iu,{ref:n,className:ne("cj-text-sm cj-text-muted-foreground",e),...t}));mu.displayName=iu.displayName;const pu=h.forwardRef(({className:e,...t},n)=>c.jsx(ou,{ref:n,className:ne(ps(),e),...t}));pu.displayName=ou.displayName;const hu=h.forwardRef(({className:e,...t},n)=>c.jsx(au,{ref:n,className:ne(ps({variant:"outline"}),"cj-mt-2 sm:cj-mt-0",e),...t}));hu.displayName=au.displayName;function Rr({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o,cancelLabel:a,destructive:s=!0,onConfirm:i}){const{t:l}=je();return c.jsx(oy,{open:e,onOpenChange:t,children:c.jsxs(lu,{children:[c.jsxs(du,{children:[c.jsx(fu,{children:n??l("fc_confirm_title")}),c.jsx(mu,{children:r})]}),c.jsxs(uu,{children:[c.jsx(hu,{children:a??l("cancel")}),c.jsx(pu,{onClick:i,className:s?"cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/90":void 0,children:o??l("delete")})]})]})})}function sy({readOnly:e=!1}){const{t}=je(),{formConfig:n,activeStepId:r,setActiveStep:o,addStep:a,deleteStep:s,moveStep:i}=wt(),[l,d]=y.useState(null);return c.jsxs("div",{className:"cj-flex cj-flex-col cj-h-full cj-bg-card",children:[c.jsxs("div",{className:"cj-p-4 cj-border-b cj-flex cj-items-center cj-justify-between",children:[c.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:t("fc_form_steps")}),!e&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>a(),children:[c.jsx(vt,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_add_step")]})]}),c.jsx(Rt,{className:"cj-flex-1 cj-min-w-0",children:c.jsxs("div",{className:"cj-p-3 cj-space-y-2 cj-min-w-0",children:[n.steps.map((u,f)=>{const m=u.step_id===r,p=u.rows.reduce((j,_)=>j+_.field_ids.length,0);return c.jsx("div",{onClick:()=>o(u.step_id),className:`cj-rounded-xl cj-border-2 cj-p-3 cj-cursor-pointer cj-transition-colors ${m?"cj-border-primary cj-bg-primary/5":"cj-border-border cj-bg-card hover:cj-border-primary/40"}`,children:c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx("div",{className:`cj-h-7 cj-w-7 cj-rounded-full cj-flex cj-items-center cj-justify-center cj-text-xs cj-font-bold cj-shrink-0 ${m?"cj-bg-primary cj-text-primary-foreground":"cj-bg-muted cj-text-muted-foreground"}`,children:f+1}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx("div",{className:"cj-text-sm cj-font-semibold cj-truncate",children:u.title||t("fc_step_untitled")}),c.jsx("div",{className:"cj-text-[11px] cj-text-muted-foreground",children:t("fc_step_meta",{rows:u.rows.length,fields:p})})]}),!e&&m&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-0.5",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:f===0,onClick:j=>{j.stopPropagation(),i(u.step_id,"up")},children:c.jsx(co,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:f===n.steps.length-1,onClick:j=>{j.stopPropagation(),i(u.step_id,"down")},children:c.jsx(on,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",onClick:j=>{j.stopPropagation(),d(u.step_id)},children:c.jsx(En,{className:"cj-h-3 cj-w-3 cj-text-destructive"})})]})]})},u.step_id)}),n.steps.length===0&&c.jsxs("div",{className:"cj-py-12 cj-text-center cj-text-xs cj-text-muted-foreground",children:[t("fc_no_steps"),!e&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),t("fc_no_steps_hint_click")," ",c.jsxs("strong",{children:["+ ",t("fc_add_step")]})," ",t("fc_no_steps_hint_to_begin")]})]})]})}),c.jsx(Rr,{open:l!==null,onOpenChange:u=>!u&&d(null),description:t("fc_confirm_delete_step"),onConfirm:()=>{l&&s(l),d(null)}})]})}const pe=h.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ne("cj-flex cj-h-12 cj-w-full cj-rounded-xl cj-border cj-border-border/40 cj-bg-muted/50 cj-px-3 cj-py-2 cj-text-base cj-shadow-none cj-ring-offset-background file:cj-border-0 file:cj-bg-transparent file:cj-text-sm file:cj-font-medium file:cj-text-foreground placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 md:cj-text-sm",e),ref:r,...n}));pe.displayName="Input";var iy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cy=iy.reduce((e,t)=>{const n=ko(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ly="Label",_u=h.forwardRef((e,t)=>c.jsx(cy.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));_u.displayName=ly;var gu=_u;const dy=Po("cj-text-sm cj-font-medium cj-leading-none peer-disabled:cj-cursor-not-allowed peer-disabled:cj-opacity-70"),X=h.forwardRef(({className:e,...t},n)=>c.jsx(gu,{ref:n,className:ne(dy(),e),...t}));X.displayName=gu.displayName;const uy=["top","right","bottom","left"],an=Math.min,rt=Math.max,ho=Math.round,Xr=Math.floor,Tt=e=>({x:e,y:e}),fy={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function Xa(e,t,n){return rt(e,an(t,n))}function Yt(e,t){return typeof e=="function"?e(t):e}function qt(e){return e.split("-")[0]}function Zn(e){return e.split("-")[1]}function Os(e){return e==="x"?"y":"x"}function As(e){return e==="y"?"height":"width"}const py=new Set(["top","bottom"]);function Et(e){return py.has(qt(e))?"y":"x"}function zs(e){return Os(Et(e))}function hy(e,t,n){n===void 0&&(n=!1);const r=Zn(e),o=zs(e),a=As(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=_o(s)),[s,_o(s)]}function _y(e){const t=_o(e);return[Ka(e),t,Ka(t)]}function Ka(e){return e.replace(/start|end/g,t=>my[t])}const rc=["left","right"],oc=["right","left"],gy=["top","bottom"],jy=["bottom","top"];function yy(e,t,n){switch(e){case"top":case"bottom":return n?t?oc:rc:t?rc:oc;case"left":case"right":return t?gy:jy;default:return[]}}function vy(e,t,n,r){const o=Zn(e);let a=yy(qt(e),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(Ka)))),a}function _o(e){return e.replace(/left|right|bottom|top/g,t=>fy[t])}function xy(e){return{top:0,right:0,bottom:0,left:0,...e}}function ju(e){return typeof e!="number"?xy(e):{top:e,right:e,bottom:e,left:e}}function go(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ac(e,t,n){let{reference:r,floating:o}=e;const a=Et(t),s=zs(t),i=As(s),l=qt(t),d=a==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,m=r[i]/2-o[i]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Zn(t)){case"start":p[s]-=m*(n&&d?-1:1);break;case"end":p[s]+=m*(n&&d?-1:1);break}return p}async function by(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:s,elements:i,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=Yt(t,e),j=ju(p),g=i[m?f==="floating"?"reference":"floating":f],v=go(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:d,rootBoundary:u,strategy:l})),x=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),w=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},S=go(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:b,strategy:l}):x);return{top:(v.top-S.top+j.top)/w.y,bottom:(S.bottom-v.bottom+j.bottom)/w.y,left:(v.left-S.left+j.left)/w.x,right:(S.right-v.right+j.right)/w.x}}const wy=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,i=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=ac(d,r,l),m=r,p={},j=0;for(let g=0;g<i.length;g++){var _;const{name:v,fn:x}=i[g],{x:b,y:w,data:S,reset:N}=await x({x:u,y:f,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:d,platform:{...s,detectOverflow:(_=s.detectOverflow)!=null?_:by},elements:{reference:e,floating:t}});u=b??u,f=w??f,p={...p,[v]:{...p[v],...S}},N&&j<=50&&(j++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:f}=ac(d,m,l)),g=-1)}return{x:u,y:f,placement:m,strategy:o,middlewareData:p}},Ny=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:s,elements:i,middlewareData:l}=t,{element:d,padding:u=0}=Yt(e,t)||{};if(d==null)return{};const f=ju(u),m={x:n,y:r},p=zs(o),j=As(p),_=await s.getDimensions(d),g=p==="y",v=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[j]+a.reference[p]-m[p]-a.floating[j],S=m[p]-a.reference[p],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=N?N[b]:0;(!C||!await(s.isElement==null?void 0:s.isElement(N)))&&(C=i.floating[b]||a.floating[j]);const E=w/2-S/2,k=C/2-_[j]/2-1,M=an(f[v],k),D=an(f[x],k),T=M,$=C-_[j]-D,A=C/2-_[j]/2+E,H=Xa(T,A,$),W=!l.arrow&&Zn(o)!=null&&A!==H&&a.reference[j]/2-(A<T?M:D)-_[j]/2<0,Q=W?A<T?A-T:A-$:0;return{[p]:m[p]+Q,data:{[p]:H,centerOffset:A-H-Q,...W&&{alignmentOffset:Q}},reset:W}}}),Sy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:_=!0,...g}=Yt(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=qt(o),x=Et(i),b=qt(i)===i,w=await(l.isRTL==null?void 0:l.isRTL(d.floating)),S=m||(b||!_?[_o(i)]:_y(i)),N=j!=="none";!m&&N&&S.push(...vy(i,_,j,w));const C=[i,...S],E=await l.detectOverflow(t,g),k=[];let M=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&k.push(E[v]),f){const A=hy(o,s,w);k.push(E[A[0]],E[A[1]])}if(M=[...M,{placement:o,overflows:k}],!k.every(A=>A<=0)){var D,T;const A=(((D=a.flip)==null?void 0:D.index)||0)+1,H=C[A];if(H&&(!(f==="alignment"?x!==Et(H):!1)||M.every(G=>Et(G.placement)===x?G.overflows[0]>0:!0)))return{data:{index:A,overflows:M},reset:{placement:H}};let W=(T=M.filter(Q=>Q.overflows[0]<=0).sort((Q,G)=>Q.overflows[1]-G.overflows[1])[0])==null?void 0:T.placement;if(!W)switch(p){case"bestFit":{var $;const Q=($=M.filter(G=>{if(N){const z=Et(G.placement);return z===x||z==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(z=>z>0).reduce((z,oe)=>z+oe,0)]).sort((G,z)=>G[1]-z[1])[0])==null?void 0:$[0];Q&&(W=Q);break}case"initialPlacement":W=i;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function sc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ic(e){return uy.some(t=>e[t]>=0)}const Cy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...a}=Yt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...a,elementContext:"reference"}),i=sc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ic(i)}}}case"escaped":{const s=await r.detectOverflow(t,{...a,altBoundary:!0}),i=sc(s,n.floating);return{data:{escapedOffsets:i,escaped:ic(i)}}}default:return{}}}}},yu=new Set(["left","top"]);async function ky(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=qt(n),i=Zn(n),l=Et(n)==="y",d=yu.has(s)?-1:1,u=a&&l?-1:1,f=Yt(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:j}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof j=="number"&&(p=i==="end"?j*-1:j),l?{x:p*u,y:m*d}:{x:m*d,y:p*u}}const Py=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:s,middlewareData:i}=t,l=await ky(t,e);return s===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:s}}}}},Ey=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:v=>{let{x,y:b}=v;return{x,y:b}}},...d}=Yt(e,t),u={x:n,y:r},f=await a.detectOverflow(t,d),m=Et(qt(o)),p=Os(m);let j=u[p],_=u[m];if(s){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",b=j+f[v],w=j-f[x];j=Xa(b,j,w)}if(i){const v=m==="y"?"top":"left",x=m==="y"?"bottom":"right",b=_+f[v],w=_-f[x];_=Xa(b,_,w)}const g=l.fn({...t,[p]:j,[m]:_});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:s,[m]:i}}}}}},My=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:d=!0}=Yt(e,t),u={x:n,y:r},f=Et(o),m=Os(f);let p=u[m],j=u[f];const _=Yt(i,t),g=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(l){const b=m==="y"?"height":"width",w=a.reference[m]-a.floating[b]+g.mainAxis,S=a.reference[m]+a.reference[b]-g.mainAxis;p<w?p=w:p>S&&(p=S)}if(d){var v,x;const b=m==="y"?"width":"height",w=yu.has(qt(o)),S=a.reference[f]-a.floating[b]+(w&&((v=s.offset)==null?void 0:v[f])||0)+(w?0:g.crossAxis),N=a.reference[f]+a.reference[b]+(w?0:((x=s.offset)==null?void 0:x[f])||0)-(w?g.crossAxis:0);j<S?j=S:j>N&&(j=N)}return{[m]:p,[f]:j}}}},Dy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:s,elements:i}=t,{apply:l=()=>{},...d}=Yt(e,t),u=await s.detectOverflow(t,d),f=qt(o),m=Zn(o),p=Et(o)==="y",{width:j,height:_}=a.floating;let g,v;f==="top"||f==="bottom"?(g=f,v=m===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(v=f,g=m==="end"?"top":"bottom");const x=_-u.top-u.bottom,b=j-u.left-u.right,w=an(_-u[g],x),S=an(j-u[v],b),N=!t.middlewareData.shift;let C=w,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=x),N&&!m){const M=rt(u.left,0),D=rt(u.right,0),T=rt(u.top,0),$=rt(u.bottom,0);p?E=j-2*(M!==0||D!==0?M+D:rt(u.left,u.right)):C=_-2*(T!==0||$!==0?T+$:rt(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:C});const k=await s.getDimensions(i.floating);return j!==k.width||_!==k.height?{reset:{rects:!0}}:{}}}};function qo(){return typeof window<"u"}function er(e){return vu(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zt(e){var t;return(t=(vu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vu(e){return qo()?e instanceof Node||e instanceof ot(e).Node:!1}function xt(e){return qo()?e instanceof Element||e instanceof ot(e).Element:!1}function Ot(e){return qo()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function cc(e){return!qo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}const Ty=new Set(["inline","contents"]);function Or(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ty.has(o)}const Ry=new Set(["table","td","th"]);function Oy(e){return Ry.has(er(e))}const Ay=[":popover-open",":modal"];function Vo(e){return Ay.some(t=>{try{return e.matches(t)}catch{return!1}})}const zy=["transform","translate","scale","rotate","perspective"],Iy=["transform","translate","scale","rotate","perspective","filter"],Wy=["paint","layout","strict","content"];function Is(e){const t=Ws(),n=xt(e)?bt(e):e;return zy.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Iy.some(r=>(n.willChange||"").includes(r))||Wy.some(r=>(n.contain||"").includes(r))}function $y(e){let t=sn(e);for(;Ot(t)&&!Un(t);){if(Is(t))return t;if(Vo(t))return null;t=sn(t)}return null}function Ws(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Fy=new Set(["html","body","#document"]);function Un(e){return Fy.has(er(e))}function bt(e){return ot(e).getComputedStyle(e)}function Go(e){return xt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sn(e){if(er(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cc(e)&&e.host||zt(e);return cc(t)?t.host:t}function xu(e){const t=sn(e);return Un(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ot(t)&&Or(t)?t:xu(t)}function Nr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xu(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),s=ot(o);if(a){const i=Ja(s);return t.concat(s,s.visualViewport||[],Or(o)?o:[],i&&n?Nr(i):[])}return t.concat(o,Nr(o,[],n))}function Ja(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bu(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ot(e),a=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=ho(n)!==a||ho(r)!==s;return i&&(n=a,r=s),{width:n,height:r,$:i}}function $s(e){return xt(e)?e:e.contextElement}function Vn(e){const t=$s(e);if(!Ot(t))return Tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=bu(t);let s=(a?ho(n.width):n.width)/r,i=(a?ho(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const Ly=Tt(0);function wu(e){const t=ot(e);return!Ws()||!t.visualViewport?Ly:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function By(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=$s(e);let s=Tt(1);t&&(r?xt(r)&&(s=Vn(r)):s=Vn(e));const i=By(a,n,r)?wu(a):Tt(0);let l=(o.left+i.x)/s.x,d=(o.top+i.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(a){const m=ot(a),p=r&&xt(r)?ot(r):r;let j=m,_=Ja(j);for(;_&&r&&p!==j;){const g=Vn(_),v=_.getBoundingClientRect(),x=bt(_),b=v.left+(_.clientLeft+parseFloat(x.paddingLeft))*g.x,w=v.top+(_.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,d*=g.y,u*=g.x,f*=g.y,l+=b,d+=w,j=ot(_),_=Ja(j)}}return go({width:u,height:f,x:l,y:d})}function Uo(e,t){const n=Go(e).scrollLeft;return t?t.left+n:wn(zt(e)).left+n}function Nu(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Uo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Hy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",s=zt(r),i=t?Vo(t.floating):!1;if(r===s||i&&a)return n;let l={scrollLeft:0,scrollTop:0},d=Tt(1);const u=Tt(0),f=Ot(r);if((f||!f&&!a)&&((er(r)!=="body"||Or(s))&&(l=Go(r)),Ot(r))){const p=wn(r);d=Vn(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const m=s&&!f&&!a?Nu(s,l):Tt(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x+m.x,y:n.y*d.y-l.scrollTop*d.y+u.y+m.y}}function Yy(e){return Array.from(e.getClientRects())}function qy(e){const t=zt(e),n=Go(e),r=e.ownerDocument.body,o=rt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=rt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Uo(e);const i=-n.scrollTop;return bt(r).direction==="rtl"&&(s+=rt(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:i}}const lc=25;function Vy(e,t){const n=ot(e),r=zt(e),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,i=0,l=0;if(o){a=o.width,s=o.height;const u=Ws();(!u||u&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}const d=Uo(r);if(d<=0){const u=r.ownerDocument,f=u.body,m=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,j=Math.abs(r.clientWidth-f.clientWidth-p);j<=lc&&(a-=j)}else d<=lc&&(a+=d);return{width:a,height:s,x:i,y:l}}const Gy=new Set(["absolute","fixed"]);function Uy(e,t){const n=wn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Ot(e)?Vn(e):Tt(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,l=o*a.x,d=r*a.y;return{width:s,height:i,x:l,y:d}}function dc(e,t,n){let r;if(t==="viewport")r=Vy(e,n);else if(t==="document")r=qy(zt(e));else if(xt(t))r=Uy(t,n);else{const o=wu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return go(r)}function Su(e,t){const n=sn(e);return n===t||!xt(n)||Un(n)?!1:bt(n).position==="fixed"||Su(n,t)}function Xy(e,t){const n=t.get(e);if(n)return n;let r=Nr(e,[],!1).filter(i=>xt(i)&&er(i)!=="body"),o=null;const a=bt(e).position==="fixed";let s=a?sn(e):e;for(;xt(s)&&!Un(s);){const i=bt(s),l=Is(s);!l&&i.position==="fixed"&&(o=null),(a?!l&&!o:!l&&i.position==="static"&&!!o&&Gy.has(o.position)||Or(s)&&!l&&Su(e,s))?r=r.filter(u=>u!==s):o=i,s=sn(s)}return t.set(e,r),r}function Ky(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Vo(t)?[]:Xy(t,this._c):[].concat(n),r],i=s[0],l=s.reduce((d,u)=>{const f=dc(t,u,o);return d.top=rt(f.top,d.top),d.right=an(f.right,d.right),d.bottom=an(f.bottom,d.bottom),d.left=rt(f.left,d.left),d},dc(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Jy(e){const{width:t,height:n}=bu(e);return{width:t,height:n}}function Qy(e,t,n){const r=Ot(t),o=zt(t),a=n==="fixed",s=wn(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const l=Tt(0);function d(){l.x=Uo(o)}if(r||!r&&!a)if((er(t)!=="body"||Or(o))&&(i=Go(t)),r){const p=wn(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&d();a&&!r&&o&&d();const u=o&&!r&&!a?Nu(o,i):Tt(0),f=s.left+i.scrollLeft-l.x-u.x,m=s.top+i.scrollTop-l.y-u.y;return{x:f,y:m,width:s.width,height:s.height}}function Ma(e){return bt(e).position==="static"}function uc(e,t){if(!Ot(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zt(e)===n&&(n=n.ownerDocument.body),n}function Cu(e,t){const n=ot(e);if(Vo(e))return n;if(!Ot(e)){let o=sn(e);for(;o&&!Un(o);){if(xt(o)&&!Ma(o))return o;o=sn(o)}return n}let r=uc(e,t);for(;r&&Oy(r)&&Ma(r);)r=uc(r,t);return r&&Un(r)&&Ma(r)&&!Is(r)?n:r||$y(e)||n}const Zy=async function(e){const t=this.getOffsetParent||Cu,n=this.getDimensions,r=await n(e.floating);return{reference:Qy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ev(e){return bt(e).direction==="rtl"}const tv={convertOffsetParentRelativeRectToViewportRelativeRect:Hy,getDocumentElement:zt,getClippingRect:Ky,getOffsetParent:Cu,getElementRects:Zy,getClientRects:Yy,getDimensions:Jy,getScale:Vn,isElement:xt,isRTL:ev};function ku(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nv(e,t){let n=null,r;const o=zt(e);function a(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),a();const d=e.getBoundingClientRect(),{left:u,top:f,width:m,height:p}=d;if(i||t(),!m||!p)return;const j=Xr(f),_=Xr(o.clientWidth-(u+m)),g=Xr(o.clientHeight-(f+p)),v=Xr(u),b={rootMargin:-j+"px "+-_+"px "+-g+"px "+-v+"px",threshold:rt(0,an(1,l))||1};let w=!0;function S(N){const C=N[0].intersectionRatio;if(C!==l){if(!w)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!ku(d,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(S,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(e)}return s(!0),a}function rv(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,d=$s(e),u=o||a?[...d?Nr(d):[],...Nr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const f=d&&i?nv(d,n):null;let m=-1,p=null;s&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),d&&!l&&p.observe(d),p.observe(t));let j,_=l?wn(e):null;l&&g();function g(){const v=wn(e);_&&!ku(_,v)&&n(),_=v,j=requestAnimationFrame(g)}return n(),()=>{var v;u.forEach(x=>{o&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),f==null||f(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(j)}}const ov=Py,av=Ey,sv=Sy,iv=Dy,cv=Cy,fc=Ny,lv=My,dv=(e,t,n)=>{const r=new Map,o={platform:tv,...n},a={...o.platform,_c:r};return wy(e,t,{...o,platform:a})};var uv=typeof document<"u",fv=function(){},ao=uv?y.useLayoutEffect:fv;function jo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!jo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!jo(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Pu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mc(e,t){const n=Pu(e);return Math.round(t*n)/n}function Da(e){const t=h.useRef(e);return ao(()=>{t.current=e}),t}function mv(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:l,open:d}=e,[u,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(r);jo(m,r)||p(r);const[j,_]=h.useState(null),[g,v]=h.useState(null),x=h.useCallback(G=>{G!==N.current&&(N.current=G,_(G))},[]),b=h.useCallback(G=>{G!==C.current&&(C.current=G,v(G))},[]),w=a||j,S=s||g,N=h.useRef(null),C=h.useRef(null),E=h.useRef(u),k=l!=null,M=Da(l),D=Da(o),T=Da(d),$=h.useCallback(()=>{if(!N.current||!C.current)return;const G={placement:t,strategy:n,middleware:m};D.current&&(G.platform=D.current),dv(N.current,C.current,G).then(z=>{const oe={...z,isPositioned:T.current!==!1};A.current&&!jo(E.current,oe)&&(E.current=oe,Co.flushSync(()=>{f(oe)}))})},[m,t,n,D,T]);ao(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[d]);const A=h.useRef(!1);ao(()=>(A.current=!0,()=>{A.current=!1}),[]),ao(()=>{if(w&&(N.current=w),S&&(C.current=S),w&&S){if(M.current)return M.current(w,S,$);$()}},[w,S,$,M,k]);const H=h.useMemo(()=>({reference:N,floating:C,setReference:x,setFloating:b}),[x,b]),W=h.useMemo(()=>({reference:w,floating:S}),[w,S]),Q=h.useMemo(()=>{const G={position:n,left:0,top:0};if(!W.floating)return G;const z=mc(W.floating,u.x),oe=mc(W.floating,u.y);return i?{...G,transform:"translate("+z+"px, "+oe+"px)",...Pu(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:oe}},[n,i,W.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:$,refs:H,elements:W,floatingStyles:Q}),[u,$,H,W,Q])}const pv=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fc({element:r.current,padding:o}).fn(n):{}:r?fc({element:r,padding:o}).fn(n):{}}}},hv=(e,t)=>({...ov(e),options:[e,t]}),_v=(e,t)=>({...av(e),options:[e,t]}),gv=(e,t)=>({...lv(e),options:[e,t]}),jv=(e,t)=>({...sv(e),options:[e,t]}),yv=(e,t)=>({...iv(e),options:[e,t]}),vv=(e,t)=>({...cv(e),options:[e,t]}),xv=(e,t)=>({...pv(e),options:[e,t]});var bv="Arrow",Eu=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return c.jsx(se.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Eu.displayName=bv;var wv=Eu;function Fs(e){const[t,n]=h.useState(void 0);return Ye(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const l=a.borderBoxSize,d=Array.isArray(l)?l[0]:l;s=d.inlineSize,i=d.blockSize}else s=e.offsetWidth,i=e.offsetHeight;n({width:s,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ls="Popper",[Mu,Xo]=st(Ls),[Nv,Du]=Mu(Ls),Tu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return c.jsx(Nv,{scope:t,anchor:r,onAnchorChange:o,children:n})};Tu.displayName=Ls;var Ru="PopperAnchor",Ou=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=Du(Ru,n),s=h.useRef(null),i=he(t,s),l=h.useRef(null);return h.useEffect(()=>{const d=l.current;l.current=(r==null?void 0:r.current)||s.current,d!==l.current&&a.onAnchorChange(l.current)}),r?null:c.jsx(se.div,{...o,ref:i})});Ou.displayName=Ru;var Bs="PopperContent",[Sv,Cv]=Mu(Bs),Au=h.forwardRef((e,t)=>{var P,O,B,L,V,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:j,..._}=e,g=Du(Bs,n),[v,x]=h.useState(null),b=he(t,ae=>x(ae)),[w,S]=h.useState(null),N=Fs(w),C=(N==null?void 0:N.width)??0,E=(N==null?void 0:N.height)??0,k=r+(a!=="center"?"-"+a:""),M=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(d)?d:[d],T=D.length>0,$={padding:M,boundary:D.filter(Pv),altBoundary:T},{refs:A,floatingStyles:H,placement:W,isPositioned:Q,middlewareData:G}=mv({strategy:"fixed",placement:k,whileElementsMounted:(...ae)=>rv(...ae,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[hv({mainAxis:o+E,alignmentAxis:s}),l&&_v({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?gv():void 0,...$}),l&&jv({...$}),yv({...$,apply:({elements:ae,rects:_e,availableWidth:Se,availableHeight:Me})=>{const{width:Be,height:ke}=_e.reference,ft=ae.floating.style;ft.setProperty("--radix-popper-available-width",`${Se}px`),ft.setProperty("--radix-popper-available-height",`${Me}px`),ft.setProperty("--radix-popper-anchor-width",`${Be}px`),ft.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),w&&xv({element:w,padding:i}),Ev({arrowWidth:C,arrowHeight:E}),m&&vv({strategy:"referenceHidden",...$})]}),[z,oe]=Wu(W),le=Ue(j);Ye(()=>{Q&&(le==null||le())},[Q,le]);const ie=(P=G.arrow)==null?void 0:P.x,R=(O=G.arrow)==null?void 0:O.y,I=((B=G.arrow)==null?void 0:B.centerOffset)!==0,[Y,U]=h.useState();return Ye(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]),c.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(L=G.transformOrigin)==null?void 0:L.x,(V=G.transformOrigin)==null?void 0:V.y].join(" "),...((ee=G.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Sv,{scope:n,placedSide:z,onArrowChange:S,arrowX:ie,arrowY:R,shouldHideArrow:I,children:c.jsx(se.div,{"data-side":z,"data-align":oe,..._,ref:b,style:{..._.style,animation:Q?void 0:"none"}})})})});Au.displayName=Bs;var zu="PopperArrow",kv={top:"bottom",right:"left",bottom:"top",left:"right"},Iu=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=Cv(zu,r),s=kv[a.placedSide];return c.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:c.jsx(wv,{...o,ref:n,style:{...o.style,display:"block"}})})});Iu.displayName=zu;function Pv(e){return e!==null}var Ev=e=>({name:"transformOrigin",options:e,fn(t){var g,v,x;const{placement:n,rects:r,middlewareData:o}=t,s=((g=o.arrow)==null?void 0:g.centerOffset)!==0,i=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[d,u]=Wu(n),f={start:"0%",center:"50%",end:"100%"}[u],m=(((v=o.arrow)==null?void 0:v.x)??0)+i/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let j="",_="";return d==="bottom"?(j=s?f:`${m}px`,_=`${-l}px`):d==="top"?(j=s?f:`${m}px`,_=`${r.floating.height+l}px`):d==="right"?(j=`${-l}px`,_=s?f:`${p}px`):d==="left"&&(j=`${r.floating.width+l}px`,_=s?f:`${p}px`),{data:{x:j,y:_}}}});function Wu(e){const[t,n="center"]=e.split("-");return[t,n]}var $u=Tu,Hs=Ou,Fu=Au,Lu=Iu;function Mv(e){const t=Dv(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Rv);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Dv(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=Av(o),i=Ov(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tv=Symbol("radix.slottable");function Rv(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tv}function Ov(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Av(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ys(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Bu=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),zv="VisuallyHidden",Iv=h.forwardRef((e,t)=>c.jsx(se.span,{...e,ref:t,style:{...Bu,...e.style}}));Iv.displayName=zv;var Wv=[" ","Enter","ArrowUp","ArrowDown"],$v=[" ","Enter"],Nn="Select",[Ko,Jo,Fv]=nl(Nn),[tr]=st(Nn,[Fv,Xo]),Qo=Xo(),[Lv,ln]=tr(Nn),[Bv,Hv]=tr(Nn),Hu=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:i,onValueChange:l,dir:d,name:u,autoComplete:f,disabled:m,required:p,form:j}=e,_=Qo(t),[g,v]=h.useState(null),[x,b]=h.useState(null),[w,S]=h.useState(!1),N=kr(d),[C,E]=Ht({prop:r,defaultProp:o??!1,onChange:a,caller:Nn}),[k,M]=Ht({prop:s,defaultProp:i,onChange:l,caller:Nn}),D=h.useRef(null),T=g?j||!!g.closest("form"):!0,[$,A]=h.useState(new Set),H=Array.from($).map(W=>W.props.value).join(";");return c.jsx($u,{..._,children:c.jsxs(Lv,{required:p,scope:t,trigger:g,onTriggerChange:v,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:Dt(),value:k,onValueChange:M,open:C,onOpenChange:E,dir:N,triggerPointerDownPosRef:D,disabled:m,children:[c.jsx(Ko.Provider,{scope:t,children:c.jsx(Bv,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(W=>{A(Q=>new Set(Q).add(W))},[]),onNativeOptionRemove:h.useCallback(W=>{A(Q=>{const G=new Set(Q);return G.delete(W),G})},[]),children:n})}),T?c.jsxs(pf,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:W=>M(W.target.value),disabled:m,form:j,children:[k===void 0?c.jsx("option",{value:""}):null,Array.from($)]},H):null]})})};Hu.displayName=Nn;var Yu="SelectTrigger",qu=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=Qo(n),s=ln(Yu,n),i=s.disabled||r,l=he(t,s.onTriggerChange),d=Jo(n),u=h.useRef("touch"),[f,m,p]=_f(_=>{const g=d().filter(b=>!b.disabled),v=g.find(b=>b.value===s.value),x=gf(g,_,v);x!==void 0&&s.onValueChange(x.value)}),j=_=>{i||(s.onOpenChange(!0),p()),_&&(s.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return c.jsx(Hs,{asChild:!0,...a,children:c.jsx(se.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":hf(s.value)?"":void 0,...o,ref:l,onClick:re(o.onClick,_=>{_.currentTarget.focus(),u.current!=="mouse"&&j(_)}),onPointerDown:re(o.onPointerDown,_=>{u.current=_.pointerType;const g=_.target;g.hasPointerCapture(_.pointerId)&&g.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(j(_),_.preventDefault())}),onKeyDown:re(o.onKeyDown,_=>{const g=f.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&m(_.key),!(g&&_.key===" ")&&Wv.includes(_.key)&&(j(),_.preventDefault())})})})});qu.displayName=Yu;var Vu="SelectValue",Gu=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...i}=e,l=ln(Vu,n),{onValueNodeHasChildrenChange:d}=l,u=a!==void 0,f=he(t,l.onValueNodeChange);return Ye(()=>{d(u)},[d,u]),c.jsx(se.span,{...i,ref:f,style:{pointerEvents:"none"},children:hf(l.value)?c.jsx(c.Fragment,{children:s}):a})});Gu.displayName=Vu;var Yv="SelectIcon",Uu=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(se.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Uu.displayName=Yv;var qv="SelectPortal",Xu=e=>c.jsx(Fo,{asChild:!0,...e});Xu.displayName=qv;var Sn="SelectContent",Ku=h.forwardRef((e,t)=>{const n=ln(Sn,e.__scopeSelect),[r,o]=h.useState();if(Ye(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?Co.createPortal(c.jsx(Ju,{scope:e.__scopeSelect,children:c.jsx(Ko.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),a):null}return c.jsx(Qu,{...e,ref:t})});Ku.displayName=Sn;var _t=10,[Ju,dn]=tr(Sn),Vv="SelectContentImpl",Gv=Mv("SelectContent.RemoveScroll"),Qu=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:i,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:j,hideWhenDetached:_,avoidCollisions:g,...v}=e,x=ln(Sn,n),[b,w]=h.useState(null),[S,N]=h.useState(null),C=he(t,P=>w(P)),[E,k]=h.useState(null),[M,D]=h.useState(null),T=Jo(n),[$,A]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(b)return Ps(b)},[b]),ks();const W=h.useCallback(P=>{const[O,...B]=T().map(ee=>ee.ref.current),[L]=B.slice(-1),V=document.activeElement;for(const ee of P)if(ee===V||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===O&&S&&(S.scrollTop=0),ee===L&&S&&(S.scrollTop=S.scrollHeight),ee==null||ee.focus(),document.activeElement!==V))return},[T,S]),Q=h.useCallback(()=>W([E,b]),[W,E,b]);h.useEffect(()=>{$&&Q()},[$,Q]);const{onOpenChange:G,triggerPointerDownPosRef:z}=x;h.useEffect(()=>{if(b){let P={x:0,y:0};const O=L=>{var V,ee;P={x:Math.abs(Math.round(L.pageX)-(((V=z.current)==null?void 0:V.x)??0)),y:Math.abs(Math.round(L.pageY)-(((ee=z.current)==null?void 0:ee.y)??0))}},B=L=>{P.x<=10&&P.y<=10?L.preventDefault():b.contains(L.target)||G(!1),document.removeEventListener("pointermove",O),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",B,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",B,{capture:!0})}}},[b,G,z]),h.useEffect(()=>{const P=()=>G(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[G]);const[oe,le]=_f(P=>{const O=T().filter(V=>!V.disabled),B=O.find(V=>V.ref.current===document.activeElement),L=gf(O,P,B);L&&setTimeout(()=>L.ref.current.focus())}),ie=h.useCallback((P,O,B)=>{const L=!H.current&&!B;(x.value!==void 0&&x.value===O||L)&&(k(P),L&&(H.current=!0))},[x.value]),R=h.useCallback(()=>b==null?void 0:b.focus(),[b]),I=h.useCallback((P,O,B)=>{const L=!H.current&&!B;(x.value!==void 0&&x.value===O||L)&&D(P)},[x.value]),Y=r==="popper"?Qa:Zu,U=Y===Qa?{side:i,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:j,hideWhenDetached:_,avoidCollisions:g}:{};return c.jsx(Ju,{scope:n,content:b,viewport:S,onViewportChange:N,itemRefCallback:ie,selectedItem:E,onItemLeave:R,itemTextRefCallback:I,focusSelectedItem:Q,selectedItemText:M,position:r,isPositioned:$,searchRef:oe,children:c.jsx(Bo,{as:Gv,allowPinchZoom:!0,children:c.jsx($o,{asChild:!0,trapped:x.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:re(o,P=>{var O;(O=x.trigger)==null||O.focus({preventScroll:!0}),P.preventDefault()}),children:c.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:c.jsx(Y,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:P=>P.preventDefault(),...v,...U,onPlaced:()=>A(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:re(v.onKeyDown,P=>{const O=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!O&&P.key.length===1&&le(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let L=T().filter(V=>!V.disabled).map(V=>V.ref.current);if(["ArrowUp","End"].includes(P.key)&&(L=L.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const V=P.target,ee=L.indexOf(V);L=L.slice(ee+1)}setTimeout(()=>W(L)),P.preventDefault()}})})})})})})});Qu.displayName=Vv;var Uv="SelectItemAlignedPosition",Zu=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=ln(Sn,n),s=dn(Sn,n),[i,l]=h.useState(null),[d,u]=h.useState(null),f=he(t,C=>u(C)),m=Jo(n),p=h.useRef(!1),j=h.useRef(!0),{viewport:_,selectedItem:g,selectedItemText:v,focusSelectedItem:x}=s,b=h.useCallback(()=>{if(a.trigger&&a.valueNode&&i&&d&&_&&g&&v){const C=a.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),M=v.getBoundingClientRect();if(a.dir!=="rtl"){const V=M.left-E.left,ee=k.left-V,ae=C.left-ee,_e=C.width+ae,Se=Math.max(_e,E.width),Me=window.innerWidth-_t,Be=qa(ee,[_t,Math.max(_t,Me-Se)]);i.style.minWidth=_e+"px",i.style.left=Be+"px"}else{const V=E.right-M.right,ee=window.innerWidth-k.right-V,ae=window.innerWidth-C.right-ee,_e=C.width+ae,Se=Math.max(_e,E.width),Me=window.innerWidth-_t,Be=qa(ee,[_t,Math.max(_t,Me-Se)]);i.style.minWidth=_e+"px",i.style.right=Be+"px"}const D=m(),T=window.innerHeight-_t*2,$=_.scrollHeight,A=window.getComputedStyle(d),H=parseInt(A.borderTopWidth,10),W=parseInt(A.paddingTop,10),Q=parseInt(A.borderBottomWidth,10),G=parseInt(A.paddingBottom,10),z=H+W+$+G+Q,oe=Math.min(g.offsetHeight*5,z),le=window.getComputedStyle(_),ie=parseInt(le.paddingTop,10),R=parseInt(le.paddingBottom,10),I=C.top+C.height/2-_t,Y=T-I,U=g.offsetHeight/2,P=g.offsetTop+U,O=H+W+P,B=z-O;if(O<=I){const V=D.length>0&&g===D[D.length-1].ref.current;i.style.bottom="0px";const ee=d.clientHeight-_.offsetTop-_.offsetHeight,ae=Math.max(Y,U+(V?R:0)+ee+Q),_e=O+ae;i.style.height=_e+"px"}else{const V=D.length>0&&g===D[0].ref.current;i.style.top="0px";const ae=Math.max(I,H+_.offsetTop+(V?ie:0)+U)+B;i.style.height=ae+"px",_.scrollTop=O-I+_.offsetTop}i.style.margin=`${_t}px 0`,i.style.minHeight=oe+"px",i.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[m,a.trigger,a.valueNode,i,d,_,g,v,a.dir,r]);Ye(()=>b(),[b]);const[w,S]=h.useState();Ye(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const N=h.useCallback(C=>{C&&j.current===!0&&(b(),x==null||x(),j.current=!1)},[b,x]);return c.jsx(Kv,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:c.jsx(se.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Zu.displayName=Uv;var Xv="SelectPopperPosition",Qa=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=_t,...a}=e,s=Qo(n);return c.jsx(Fu,{...s,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Qa.displayName=Xv;var[Kv,qs]=tr(Sn,{}),Za="SelectViewport",ef=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=dn(Za,n),s=qs(Za,n),i=he(t,a.onViewportChange),l=h.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(Ko.Slot,{scope:n,children:c.jsx(se.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:re(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&f){const p=Math.abs(l.current-u.scrollTop);if(p>0){const j=window.innerHeight-_t*2,_=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),v=Math.max(_,g);if(v<j){const x=v+p,b=Math.min(j,x),w=x-b;f.style.height=b+"px",f.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});ef.displayName=Za;var tf="SelectGroup",[Jv,Qv]=tr(tf),Zv=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Dt();return c.jsx(Jv,{scope:n,id:o,children:c.jsx(se.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Zv.displayName=tf;var nf="SelectLabel",rf=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qv(nf,n);return c.jsx(se.div,{id:o.id,...r,ref:t})});rf.displayName=nf;var yo="SelectItem",[ex,of]=tr(yo),af=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=e,i=ln(yo,n),l=dn(yo,n),d=i.value===r,[u,f]=h.useState(a??""),[m,p]=h.useState(!1),j=he(t,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,r,o)}),_=Dt(),g=h.useRef("touch"),v=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(ex,{scope:n,value:r,disabled:o,textId:_,isSelected:d,onItemTextChange:h.useCallback(x=>{f(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:c.jsx(Ko.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:c.jsx(se.div,{role:"option","aria-labelledby":_,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:j,onFocus:re(s.onFocus,()=>p(!0)),onBlur:re(s.onBlur,()=>p(!1)),onClick:re(s.onClick,()=>{g.current!=="mouse"&&v()}),onPointerUp:re(s.onPointerUp,()=>{g.current==="mouse"&&v()}),onPointerDown:re(s.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:re(s.onPointerMove,x=>{var b;g.current=x.pointerType,o?(b=l.onItemLeave)==null||b.call(l):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(s.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:re(s.onKeyDown,x=>{var w;((w=l.searchRef)==null?void 0:w.current)!==""&&x.key===" "||($v.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});af.displayName=yo;var _r="SelectItemText",sf=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,s=ln(_r,n),i=dn(_r,n),l=of(_r,n),d=Hv(_r,n),[u,f]=h.useState(null),m=he(t,v=>f(v),l.onItemTextChange,v=>{var x;return(x=i.itemTextRefCallback)==null?void 0:x.call(i,v,l.value,l.disabled)}),p=u==null?void 0:u.textContent,j=h.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:_,onNativeOptionRemove:g}=d;return Ye(()=>(_(j),()=>g(j)),[_,g,j]),c.jsxs(c.Fragment,{children:[c.jsx(se.span,{id:l.textId,...a,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Co.createPortal(a.children,s.valueNode):null]})});sf.displayName=_r;var cf="SelectItemIndicator",lf=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return of(cf,n).isSelected?c.jsx(se.span,{"aria-hidden":!0,...r,ref:t}):null});lf.displayName=cf;var es="SelectScrollUpButton",df=h.forwardRef((e,t)=>{const n=dn(es,e.__scopeSelect),r=qs(es,e.__scopeSelect),[o,a]=h.useState(!1),s=he(t,r.onScrollButtonChange);return Ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=l.scrollTop>0;a(d)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(ff,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});df.displayName=es;var ts="SelectScrollDownButton",uf=h.forwardRef((e,t)=>{const n=dn(ts,e.__scopeSelect),r=qs(ts,e.__scopeSelect),[o,a]=h.useState(!1),s=he(t,r.onScrollButtonChange);return Ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;a(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(ff,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});uf.displayName=ts;var ff=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=dn("SelectScrollButton",n),s=h.useRef(null),i=Jo(n),l=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>l(),[l]),Ye(()=>{var u;const d=i().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[i]),c.jsx(se.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:re(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:re(o.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:re(o.onPointerLeave,()=>{l()})})}),tx="SelectSeparator",mf=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(se.div,{"aria-hidden":!0,...r,ref:t})});mf.displayName=tx;var ns="SelectArrow",nx=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qo(n),a=ln(ns,n),s=dn(ns,n);return a.open&&s.position==="popper"?c.jsx(Lu,{...o,...r,ref:t}):null});nx.displayName=ns;var rx="SelectBubbleInput",pf=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),a=he(r,o),s=Ys(t);return h.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(f)}},[s,t]),c.jsx(se.select,{...n,style:{...Bu,...n.style},ref:a,defaultValue:t})});pf.displayName=rx;function hf(e){return e===""||e===void 0}function _f(e){const t=Ue(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const i=n.current+s;t(i),function l(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(i)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function gf(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=ox(e,Math.max(a,0));o.length===1&&(s=s.filter(d=>d!==n));const l=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function ox(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ax=Hu,jf=qu,sx=Gu,ix=Uu,cx=Xu,yf=Ku,lx=ef,vf=rf,xf=af,dx=sf,ux=lf,bf=df,wf=uf,Nf=mf;const Zo=y.createContext(null);function ea(){return y.useContext(Zo)}const Oe=ax,Ae=sx,Pe=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(jf,{ref:r,className:ne("cj-flex cj-h-10 cj-w-full cj-items-center cj-justify-between cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-sm cj-ring-offset-background placeholder:cj-text-muted-foreground focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 [&>span]:cj-line-clamp-1",e),...n,children:[t,c.jsx(ix,{asChild:!0,children:c.jsx(on,{className:"cj-h-4 cj-w-4 cj-opacity-50"})})]}));Pe.displayName=jf.displayName;const Sf=h.forwardRef(({className:e,...t},n)=>c.jsx(bf,{ref:n,className:ne("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:c.jsx(co,{className:"cj-h-4 cj-w-4"})}));Sf.displayName=bf.displayName;const Cf=h.forwardRef(({className:e,...t},n)=>c.jsx(wf,{ref:n,className:ne("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:c.jsx(on,{className:"cj-h-4 cj-w-4"})}));Cf.displayName=wf.displayName;const Ee=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>{const a=ea();return c.jsx(cx,{container:a??void 0,children:c.jsxs(yf,{ref:o,className:ne("cj-relative cj-z-50 cj-max-h-96 cj-min-w-[8rem] cj-overflow-hidden cj-rounded-md cj-border cj-bg-popover cj-text-popover-foreground cj-shadow-md data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:cj-translate-y-1 data-[side=left]:-cj-translate-x-1 data-[side=right]:cj-translate-x-1 data-[side=top]:-cj-translate-y-1",e),position:n,...r,children:[c.jsx(Sf,{}),c.jsx(lx,{className:ne("cj-p-1",n==="popper"&&"cj-h-[var(--radix-select-trigger-height)] cj-w-full cj-min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(Cf,{})]})})});Ee.displayName=yf.displayName;const fx=h.forwardRef(({className:e,...t},n)=>c.jsx(vf,{ref:n,className:ne("cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-font-semibold",e),...t}));fx.displayName=vf.displayName;const K=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(xf,{ref:r,className:ne("cj-relative cj-flex cj-w-full cj-cursor-default cj-select-none cj-items-center cj-rounded-sm cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-outline-none data-[disabled]:cj-pointer-events-none data-[disabled]:cj-opacity-50 focus:cj-bg-accent focus:cj-text-accent-foreground",e),...n,children:[c.jsx("span",{className:"cj-absolute cj-left-2 cj-flex cj-h-3.5 cj-w-3.5 cj-items-center cj-justify-center",children:c.jsx(ux,{children:c.jsx(l_,{className:"cj-h-4 cj-w-4"})})}),c.jsx(dx,{children:t})]}));K.displayName=xf.displayName;const mx=h.forwardRef(({className:e,...t},n)=>c.jsx(Nf,{ref:n,className:ne("-cj-mx-1 cj-my-1 cj-h-px cj-bg-muted",e),...t}));mx.displayName=Nf.displayName;const vr={v1_string:{label:"String",color:"cj-bg-blue-500"},"v2_single_option_select-1":{label:"Single Select",color:"cj-bg-purple-500"},"v2_date-1":{label:"Date",color:"cj-bg-green-500"},"v2_time-1":{label:"Time",color:"cj-bg-lime-500"},"v2_datetime-1":{label:"Date & Time",color:"cj-bg-cyan-500"},"v2_currency-1":{label:"Currency",color:"cj-bg-yellow-500"},v2_single_asset_upload:{label:"Upload",color:"cj-bg-orange-500"},"v2_phone-1":{label:"Phone",color:"cj-bg-teal-500"},"v2_email-1":{label:"Email",color:"cj-bg-rose-500"},v2_address_coordinates:{label:"Location",color:"cj-bg-emerald-500"},"v2_boolean-1":{label:"Boolean",color:"cj-bg-indigo-500"}};function ta(e){return vr[e]||{label:e,color:"cj-bg-muted"}}const rs=Ts,px=Rs,kf=h.forwardRef(({className:e,...t},n)=>{const r=ea();return c.jsx(Er,{ref:n,className:ne(r?"cj-absolute cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0":"cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t})});kf.displayName=Er.displayName;const vo=h.forwardRef(({className:e,children:t,...n},r)=>{const o=ea(),a=o?"cj-absolute cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 sm:cj-rounded-lg":"cj-fixed cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[state=closed]:cj-slide-out-to-left-1/2 data-[state=closed]:cj-slide-out-to-top-[48%] data-[state=open]:cj-slide-in-from-left-1/2 data-[state=open]:cj-slide-in-from-top-[48%] sm:cj-rounded-lg";return c.jsxs(px,{container:o??void 0,children:[c.jsx(kf,{}),c.jsxs(Mr,{ref:r,className:ne(a,e),...n,children:[t,c.jsxs(Yo,{className:"cj-absolute cj-right-4 cj-top-4 cj-rounded-sm cj-opacity-70 cj-ring-offset-background cj-transition-opacity data-[state=open]:cj-bg-accent data-[state=open]:cj-text-muted-foreground hover:cj-opacity-100 focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-pointer-events-none",children:[c.jsx(Vt,{className:"cj-h-4 cj-w-4"}),c.jsx("span",{className:"cj-sr-only",children:"Close"})]})]})]})});vo.displayName=Mr.displayName;const Vs=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col cj-space-y-1.5 cj-text-center sm:cj-text-left",e),...t});Vs.displayName="DialogHeader";const Gs=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col-reverse sm:cj-flex-row sm:cj-justify-end sm:cj-space-x-2",e),...t});Gs.displayName="DialogFooter";const Us=h.forwardRef(({className:e,...t},n)=>c.jsx(Dr,{ref:n,className:ne("cj-text-lg cj-font-semibold cj-leading-none cj-tracking-tight",e),...t}));Us.displayName=Dr.displayName;const Pf=h.forwardRef(({className:e,...t},n)=>c.jsx(Tr,{ref:n,className:ne("cj-text-sm cj-text-muted-foreground",e),...t}));Pf.displayName=Tr.displayName;var na="Switch",[hx]=st(na),[_x,gx]=hx(na),Ef=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:a,required:s,disabled:i,value:l="on",onCheckedChange:d,form:u,...f}=e,[m,p]=h.useState(null),j=he(t,b=>p(b)),_=h.useRef(!1),g=m?u||!!m.closest("form"):!0,[v,x]=Ht({prop:o,defaultProp:a??!1,onChange:d,caller:na});return c.jsxs(_x,{scope:n,checked:v,disabled:i,children:[c.jsx(se.button,{type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":Rf(v),"data-disabled":i?"":void 0,disabled:i,value:l,...f,ref:j,onClick:re(e.onClick,b=>{x(w=>!w),g&&(_.current=b.isPropagationStopped(),_.current||b.stopPropagation())})}),g&&c.jsx(Tf,{control:m,bubbles:!_.current,name:r,value:l,checked:v,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});Ef.displayName=na;var Mf="SwitchThumb",Df=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=gx(Mf,n);return c.jsx(se.span,{"data-state":Rf(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Df.displayName=Mf;var jx="SwitchBubbleInput",Tf=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=h.useRef(null),i=he(s,a),l=Ys(n),d=Fs(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&p){const j=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(j)}},[l,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Tf.displayName=jx;function Rf(e){return e?"checked":"unchecked"}var Of=Ef,yx=Df;const Cn=h.forwardRef(({className:e,...t},n)=>c.jsx(Of,{className:ne("cj-peer cj-inline-flex cj-h-6 cj-w-11 cj-shrink-0 cj-cursor-pointer cj-items-center cj-rounded-full cj-border-2 cj-border-transparent cj-transition-colors data-[state=checked]:cj-bg-primary data-[state=unchecked]:cj-bg-input focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 focus-visible:cj-ring-offset-background disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,ref:n,children:c.jsx(yx,{className:ne("cj-pointer-events-none cj-block cj-h-5 cj-w-5 cj-rounded-full cj-bg-background cj-shadow-lg cj-ring-0 cj-transition-transform data-[state=checked]:cj-translate-x-5 data-[state=unchecked]:cj-translate-x-0")})}));Cn.displayName=Of.displayName;var vx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xx=vx.reduce((e,t)=>{const n=ko(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),bx="Separator",pc="horizontal",wx=["horizontal","vertical"],Af=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=pc,...o}=e,a=Nx(r)?r:pc,i=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return c.jsx(xx.div,{"data-orientation":a,...i,...o,ref:t})});Af.displayName=bx;function Nx(e){return wx.includes(e)}var zf=Af;const so=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>c.jsx(zf,{ref:o,decorative:n,orientation:t,className:ne("cj-shrink-0 cj-bg-border",t==="horizontal"?"cj-h-[1px] cj-w-full":"cj-h-full cj-w-[1px]",e),...r}));so.displayName=zf.displayName;function If({fieldId:e,open:t,onOpenChange:n}){const{t:r}=je(),{formConfig:o,updateField:a,deleteField:s}=wt(),i=y.useMemo(()=>o.fields.find(w=>w.field_id===e)||null,[o.fields,e]),[l,d]=y.useState(i),[u,f]=y.useState(!1);if(y.useEffect(()=>{d(i)},[i]),!l||!i)return c.jsx(rs,{open:t,onOpenChange:n,children:c.jsx(vo,{children:c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:r("fc_field_no_selected")})})});const m=ta(l.schema),p=l.schema==="v2_single_option_select-1",j=l.schema==="v2_boolean-1"||l.widget==="boolean"||l.widget==="switch",_=l.schema==="v2_single_asset_upload"||l.widget==="upload",g=l.schema==="v2_date-1"||l.schema==="v2_datetime-1"||l.widget==="datepicker"||l.widget==="datetimepicker",v=w=>{d(S=>S&&{...S,...w}),a(i.field_id,w)},x=l.options||[],b=l.uploadConfig||{};return c.jsxs(rs,{open:t,onOpenChange:n,children:[c.jsxs(vo,{className:"cj-max-w-2xl cj-max-h-[85vh] cj-flex cj-flex-col",children:[c.jsx(Vs,{children:c.jsxs(Us,{className:"cj-flex cj-items-center cj-gap-2",children:[r("fc_field_props"),c.jsx(jt,{variant:"secondary",className:`${m.color} cj-text-white`,children:m.label})]})}),c.jsx(Rt,{className:"cj-flex-1 cj-min-h-0",children:c.jsxs("div",{className:"cj-space-y-4 cj-pr-3 cj-py-2",children:[c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_label")}),c.jsx(pe,{value:l.label,onChange:w=>v({label:w.target.value}),className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_namespace")}),c.jsx(pe,{value:l.namespace,onChange:w=>v({namespace:w.target.value}),className:"cj-mt-1 cj-font-mono cj-text-sm"})]})]}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_placeholder")}),c.jsx(pe,{value:l.placeholder||"",onChange:w=>v({placeholder:w.target.value||void 0}),className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_help")}),c.jsx(pe,{value:l.helpText||"",onChange:w=>v({helpText:w.target.value||void 0}),className:"cj-mt-1"})]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-rounded-lg cj-border cj-p-3",children:[c.jsxs("div",{children:[c.jsx(X,{children:r("fc_field_required")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r("fc_field_required_hint")})]}),c.jsx(Cn,{checked:!!l.required,onCheckedChange:w=>v({required:w})})]}),c.jsx(so,{}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_actor")}),c.jsxs(Oe,{value:l.actor||"customer",onValueChange:w=>v({actor:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"customer",children:r("fc_field_actor_customer")}),c.jsx(K,{value:"operator",children:r("fc_field_actor_operator")})]})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_widget")}),c.jsxs(Oe,{value:l.widget||"auto",onValueChange:w=>v({widget:w==="auto"?void 0:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"auto",children:r("fc_field_widget_auto")}),c.jsx(K,{value:"text",children:r("fc_field_widget_text")}),c.jsx(K,{value:"textarea",children:r("fc_field_widget_textarea")}),c.jsx(K,{value:"select",children:r("fc_field_widget_select")}),c.jsx(K,{value:"radio",children:r("fc_field_widget_radio")}),c.jsx(K,{value:"datepicker",children:r("fc_field_widget_date")}),c.jsx(K,{value:"timepicker",children:r("fc_field_widget_time")}),c.jsx(K,{value:"datetimepicker",children:r("fc_field_widget_datetime")}),c.jsx(K,{value:"currency",children:r("fc_field_widget_currency")}),c.jsx(K,{value:"upload",children:r("fc_field_widget_upload")}),c.jsx(K,{value:"email",children:r("fc_field_widget_email")}),c.jsx(K,{value:"phone",children:r("fc_field_widget_phone")}),c.jsx(K,{value:"location",children:r("fc_field_widget_location")}),c.jsx(K,{value:"boolean",children:r("fc_field_widget_boolean")})]})]})]})]}),g&&c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-rounded-lg cj-border cj-p-3",children:[c.jsxs("div",{children:[c.jsx(X,{children:r("fc_field_allow_future")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r("fc_field_allow_future_hint")})]}),c.jsx(Cn,{checked:l.allowFuture??l.schema==="v2_datetime-1",onCheckedChange:w=>v({allowFuture:w})})]}),p&&c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_display_style")}),c.jsxs(Oe,{value:l.ui_variant||"auto",onValueChange:w=>v({ui_variant:w==="auto"?void 0:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"auto",children:r("fc_field_display_auto")}),c.jsx(K,{value:"radio",children:r("fc_field_display_radio")}),c.jsx(K,{value:"dropdown",children:r("fc_field_display_dropdown")}),c.jsx(K,{value:"segmented",children:r("fc_field_display_segmented")})]})]}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:r("fc_field_display_hint")})]}),j&&c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_display_style")}),c.jsxs(Oe,{value:l.ui_variant||"switch",onValueChange:w=>v({ui_variant:w==="switch"?void 0:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"switch",children:r("fc_field_display_switch")}),c.jsx(K,{value:"segmented",children:r("fc_field_display_yesno")})]})]}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:r("fc_field_boolean_hint")})]}),p&&c.jsxs(c.Fragment,{children:[c.jsx(so,{}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[c.jsx(X,{children:r("fc_field_options")}),c.jsxs(Z,{variant:"ghost",size:"sm",onClick:()=>v({options:[...x,{data:"",label:""}]}),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),r("fc_summary_add")]})]}),c.jsxs("div",{className:"cj-space-y-2",children:[x.map((w,S)=>c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-rounded-lg cj-border cj-p-2",children:[c.jsxs("div",{className:"cj-flex-1 cj-space-y-1",children:[c.jsx(pe,{value:w.data,onChange:N=>v({options:x.map((C,E)=>E===S?{...C,data:N.target.value}:C)}),placeholder:r("fc_create_option_value_placeholder"),className:"cj-h-8 cj-font-mono cj-text-sm"}),c.jsx(pe,{value:w.label,onChange:N=>v({options:x.map((C,E)=>E===S?{...C,label:N.target.value}:C)}),placeholder:r("fc_create_option_label_placeholder"),className:"cj-h-8 cj-text-sm"})]}),c.jsx(Z,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>v({options:x.filter((N,C)=>C!==S)}),children:c.jsx(Vt,{className:"cj-h-3 cj-w-3"})})]},S)),x.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:r("fc_field_no_options")})]})]})]}),_&&c.jsxs(c.Fragment,{children:[c.jsx(so,{}),c.jsxs("div",{className:"cj-space-y-3",children:[c.jsx(X,{children:r("fc_field_upload_validation")}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_upload_accept")}),c.jsx(pe,{value:b.accept||"",onChange:w=>v({uploadConfig:{...b,accept:w.target.value||void 0}}),placeholder:"image/*,.pdf",className:"cj-mt-1 cj-font-mono cj-text-sm"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_upload_max")}),c.jsx(pe,{type:"number",min:0,step:.5,value:b.maxSizeMB??"",onChange:w=>v({uploadConfig:{...b,maxSizeMB:w.target.value?parseFloat(w.target.value):void 0}}),className:"cj-mt-1 cj-w-32"})]})]})]})]})}),c.jsxs(Gs,{className:"cj-flex cj-items-center cj-justify-between sm:cj-justify-between",children:[c.jsxs(Z,{variant:"destructive",size:"sm",onClick:()=>f(!0),children:[c.jsx(En,{className:"cj-h-4 cj-w-4 cj-mr-1"}),r("fc_field_delete")]}),c.jsx(Z,{onClick:()=>n(!1),children:r("fc_field_done")})]})]}),c.jsx(Rr,{open:u,onOpenChange:f,description:r("fc_field_confirm_delete"),onConfirm:()=>{s(i.field_id),f(!1),n(!1)}})]})}function Wf({specs:e=[],open:t,onOpenChange:n,onCreate:r}){const{t:o}=je(),[a,s]=y.useState("catalog"),[i,l]=y.useState(""),[d,u]=y.useState(""),[f,m]=y.useState(""),[p,j]=y.useState("v1_string"),[_,g]=y.useState([]),v=y.useMemo(()=>e.filter(S=>S.label.toLowerCase().includes(i.toLowerCase())||S.namespace.toLowerCase().includes(i.toLowerCase())),[e,i]),x=()=>{u(""),m(""),j("v1_string"),g([]),l("")},b=p==="v2_single_option_select-1",w=d.trim()!=="";return c.jsx(rs,{open:t,onOpenChange:S=>{S||x(),n(S)},children:c.jsxs(vo,{className:"cj-max-w-lg cj-max-h-[85vh] cj-flex cj-flex-col",children:[c.jsxs(Vs,{children:[c.jsx(Us,{children:o("fc_create_field_title")}),c.jsx(Pf,{children:o("fc_create_field_subtitle")})]}),c.jsxs("div",{className:"cj-flex cj-gap-1 cj-bg-muted cj-rounded-lg cj-p-1",children:[c.jsx("button",{onClick:()=>s("catalog"),className:`cj-flex-1 cj-h-8 cj-rounded-md cj-text-sm cj-font-medium ${a==="catalog"?"cj-bg-card cj-shadow-sm":"cj-text-muted-foreground"}`,children:o("fc_create_from_catalog",{count:e.length})}),c.jsx("button",{onClick:()=>s("custom"),className:`cj-flex-1 cj-h-8 cj-rounded-md cj-text-sm cj-font-medium ${a==="custom"?"cj-bg-card cj-shadow-sm":"cj-text-muted-foreground"}`,children:o("fc_create_custom")})]}),a==="catalog"?c.jsxs("div",{className:"cj-flex cj-flex-col cj-flex-1 cj-min-h-0 cj-space-y-2",children:[c.jsx(pe,{placeholder:o("fc_create_search_specs"),value:i,onChange:S=>l(S.target.value)}),c.jsx(Rt,{className:"cj-flex-1 cj-min-h-0 cj-border cj-rounded-lg",children:c.jsxs("div",{className:"cj-divide-y",children:[v.map(S=>{var N,C;return c.jsxs("button",{onClick:()=>{r(S),x(),n(!1)},className:"cj-w-full cj-text-left cj-px-3 cj-py-2 hover:cj-bg-accent cj-flex cj-items-center cj-gap-2",children:[c.jsx(jt,{variant:"secondary",className:`cj-text-[10px] ${((N=vr[S.schema])==null?void 0:N.color)||"cj-bg-muted"} cj-text-white`,children:((C=vr[S.schema])==null?void 0:C.label)||S.schema}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:S.label}),c.jsx("div",{className:"cj-text-[11px] cj-font-mono cj-text-muted-foreground cj-truncate",children:S.namespace})]})]},S.id)}),v.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-py-6 cj-text-center",children:o("fc_create_no_specs")})]})})]}):c.jsx(Rt,{className:"cj-flex-1 cj-min-h-0",children:c.jsxs("div",{className:"cj-space-y-3 cj-pr-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_label_required")}),c.jsx(pe,{value:d,onChange:S=>u(S.target.value),placeholder:o("fc_create_label_placeholder"),className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_namespace")}),c.jsx(pe,{value:f,onChange:S=>m(S.target.value),placeholder:o("fc_create_namespace_placeholder"),className:"cj-mt-1 cj-font-mono cj-text-sm"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_schema")}),c.jsxs(Oe,{value:p,onValueChange:j,children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsx(Ee,{children:Object.entries(vr).map(([S,N])=>c.jsx(K,{value:S,children:c.jsx("div",{className:"cj-flex cj-items-center cj-gap-2",children:c.jsx(jt,{className:`${N.color} cj-text-white cj-text-[10px]`,children:N.label})})},S))})]})]}),b&&c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-1",children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_options")}),c.jsxs(Z,{size:"sm",variant:"ghost",onClick:()=>g([..._,{data:"",label:""}]),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),o("fc_summary_add")]})]}),c.jsx("div",{className:"cj-space-y-2",children:_.map((S,N)=>c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsx(pe,{value:S.data,onChange:C=>g(_.map((E,k)=>k===N?{...E,data:C.target.value}:E)),placeholder:o("fc_create_option_value_placeholder"),className:"cj-flex-1 cj-h-8 cj-font-mono cj-text-sm"}),c.jsx(pe,{value:S.label,onChange:C=>g(_.map((E,k)=>k===N?{...E,label:C.target.value}:E)),placeholder:o("fc_create_option_label_placeholder"),className:"cj-flex-1 cj-h-8 cj-text-sm"}),c.jsx(Z,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>g(_.filter((C,E)=>E!==N)),children:c.jsx(Vt,{className:"cj-h-3 cj-w-3"})})]},N))})]})]})}),a==="custom"&&c.jsxs(Gs,{children:[c.jsx(Z,{variant:"outline",onClick:()=>n(!1),children:o("fc_create_cancel")}),c.jsx(Z,{disabled:!w,onClick:()=>{r({label:d.trim(),namespace:f.trim()||`custom_${Date.now()}`,schema:p,options:b?_:null,required:!1}),x(),n(!1)},children:o("fc_create_create")})]})]})})}const Ar=h.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ne("cj-flex cj-min-h-[120px] cj-w-full cj-rounded-xl cj-border cj-border-input cj-bg-background cj-px-3 cj-py-3 cj-text-base cj-ring-offset-background placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 md:cj-text-sm",e),ref:n,...t}));Ar.displayName="Textarea";var ra="Collapsible",[Sx]=st(ra),[Cx,Xs]=Sx(ra),$f=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:a,onOpenChange:s,...i}=e,[l,d]=Ht({prop:r,defaultProp:o??!1,onChange:s,caller:ra});return c.jsx(Cx,{scope:n,disabled:a,contentId:Dt(),open:l,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:c.jsx(se.div,{"data-state":Js(l),"data-disabled":a?"":void 0,...i,ref:t})})});$f.displayName=ra;var Ff="CollapsibleTrigger",Lf=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Xs(Ff,n);return c.jsx(se.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Js(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:re(e.onClick,o.onOpenToggle)})});Lf.displayName=Ff;var Ks="CollapsibleContent",Bf=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Xs(Ks,e.__scopeCollapsible);return c.jsx(it,{present:n||o.open,children:({present:a})=>c.jsx(kx,{...r,ref:t,present:a})})});Bf.displayName=Ks;var kx=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...a}=e,s=Xs(Ks,n),[i,l]=h.useState(r),d=h.useRef(null),u=he(t,d),f=h.useRef(0),m=f.current,p=h.useRef(0),j=p.current,_=s.open||i,g=h.useRef(_),v=h.useRef(void 0);return h.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),Ye(()=>{const x=d.current;if(x){v.current=v.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();f.current=b.height,p.current=b.width,g.current||(x.style.transitionDuration=v.current.transitionDuration,x.style.animationName=v.current.animationName),l(r)}},[s.open,r]),c.jsx(se.div,{"data-state":Js(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!_,...a,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:_&&o})});function Js(e){return e?"open":"closed"}var Px=$f;const Ex=Px,Mx=Lf,Dx=Bf,Hf=[{value:"==",label:"equals"},{value:"!=",label:"not equals"},{value:">",label:"greater than"},{value:"<",label:"less than"},{value:">=",label:"greater or equal"},{value:"<=",label:"less or equal"},{value:"in",label:"contains"},{value:"is_null",label:"is null"},{value:"is_not_null",label:"is not null"}],xo=["is_null","is_not_null"];function hc(e){const t=Object.keys(e)[0];if(t==="=="||t==="!="){const a=e[t];if(!Array.isArray(a)||a.length!==2)return null;const s=a[0];if(!(s!=null&&s.var))return null;const i=s.var.replace("answers.","");return a[1]===null?{field:i,operator:t==="=="?"is_null":"is_not_null",value:""}:{field:i,operator:t,value:String(a[1])}}if(!Hf.some(a=>a.value===t))return null;const n=e[t];if(!Array.isArray(n)||n.length!==2)return null;const r=n[0];return r!=null&&r.var?{field:r.var.replace("answers.",""),operator:t,value:String(n[1])}:null}function Ta(e){const t={mode:"and",rules:[{field:"",operator:"==",value:""}]};if(!e)return t;const n=Object.keys(e)[0];if(n==="and"||n==="or"){const o=e[n];if(Array.isArray(o)){const a=o.map(hc).filter(Boolean);if(a.length>0)return{mode:n,rules:a}}return t}const r=hc(e);return r?{mode:"and",rules:[r]}:t}function Tx(e){const t=e.rules.filter(r=>r.field&&(r.value||xo.includes(r.operator)));if(t.length===0)return null;const n=t.map(r=>r.operator==="is_null"?{"==":[{var:`answers.${r.field}`},null]}:r.operator==="is_not_null"?{"!=":[{var:`answers.${r.field}`},null]}:{[r.operator]:[{var:`answers.${r.field}`},r.value]});return n.length===1?n[0]:{[e.mode]:n}}function Rx(){return{field:"",operator:"==",value:""}}function Ox({rule:e,availableFields:t,canRemove:n,onChange:r,onRemove:o}){const a=xo.includes(e.operator),s=t.find(l=>l.namespace===e.field),i=s!=null&&s.options&&s.options.length>0?s.options:null;return c.jsxs("div",{className:"cj-flex cj-items-start cj-gap-1.5 cj-group",children:[c.jsxs("div",{className:"cj-flex-1 cj-space-y-1.5",children:[c.jsxs(Oe,{value:e.field,onValueChange:l=>r({field:l,value:""}),children:[c.jsx(Pe,{className:"cj-h-8 cj-text-xs",children:c.jsx(Ae,{placeholder:"Field"})}),c.jsx(Ee,{children:t.map(l=>c.jsx(K,{value:l.namespace,children:l.label},l.namespace))})]}),c.jsxs(Oe,{value:e.operator,onValueChange:l=>r({operator:l,...xo.includes(l)?{value:""}:{}}),children:[c.jsx(Pe,{className:"cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsx(Ee,{children:Hf.map(l=>c.jsx(K,{value:l.value,children:l.label},l.value))})]}),!a&&(i?c.jsxs(Oe,{value:e.value,onValueChange:l=>r({value:l}),children:[c.jsx(Pe,{className:"cj-h-8 cj-text-xs",children:c.jsx(Ae,{placeholder:"Select value"})}),c.jsx(Ee,{children:i.map(l=>c.jsx(K,{value:l.data,children:l.label},l.data))})]}):c.jsx(pe,{className:"cj-h-8 cj-text-xs",placeholder:"Value",value:e.value,onChange:l=>r({value:l.target.value})}))]}),n&&c.jsx(Z,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8 cj-opacity-0 group-hover:cj-opacity-100 cj-shrink-0 cj-mt-0",onClick:o,children:c.jsx(Vt,{className:"cj-h-3.5 cj-w-3.5"})})]})}function Ax({conditions:e,availableFields:t,onChange:n}){const r=()=>{n({...e,mode:e.mode==="and"?"or":"and"})},o=(i,l)=>{const d=e.rules.map((u,f)=>f===i?{...u,...l}:u);n({...e,rules:d})},a=()=>{n({...e,rules:[...e.rules,Rx()]})},s=i=>{n({...e,rules:e.rules.filter((l,d)=>d!==i)})};return c.jsxs("div",{className:"cj-space-y-3",children:[e.rules.length>1&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:"Combine with:"}),c.jsx(jt,{variant:e.mode==="and"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"AND"}),c.jsx(jt,{variant:e.mode==="or"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"OR"})]}),c.jsx("div",{className:"cj-space-y-3",children:e.rules.map((i,l)=>c.jsxs("div",{children:[l>0&&c.jsx("div",{className:"cj-text-center cj-text-[10px] cj-text-muted-foreground cj-font-medium cj-py-1 cj-uppercase",children:e.mode}),c.jsx(Ox,{rule:i,availableFields:t,canRemove:e.rules.length>1,onChange:d=>o(l,d),onRemove:()=>s(l)})]},l))}),c.jsxs(Z,{variant:"outline",size:"sm",className:"cj-w-full cj-h-7 cj-text-xs",onClick:a,children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add condition"]})]})}function zx({step:e,readOnly:t=!1}){const{t:n}=je(),{formConfig:r,updateStepNavigation:o,setStepApiCall:a,addNavRule:s,updateNavRule:i,deleteNavRule:l}=wt(),[d,u]=y.useState(!0),f=r.steps.filter(j=>j.step_id!==e.step_id),m=e.navigation.api_call,p=r.fields.map(j=>({namespace:j.namespace,label:j.label,options:j.options||null}));return c.jsx("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border cj-p-4",children:c.jsxs(Ex,{open:d,onOpenChange:u,children:[c.jsx(Mx,{asChild:!0,children:c.jsxs("button",{className:"cj-w-full cj-flex cj-items-center cj-justify-between cj-gap-2 cj-text-left",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(Tl,{className:"cj-h-4 cj-w-4 cj-text-primary"}),c.jsx("span",{className:"cj-text-sm cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:n("fc_nav_title")})]}),c.jsx(on,{className:`cj-h-4 cj-w-4 cj-transition-transform ${d?"cj-rotate-180":""}`})]})}),c.jsxs(Dx,{className:"cj-pt-4 cj-space-y-4",children:[c.jsxs("div",{className:"cj-rounded-xl cj-border cj-border-border/60 cj-p-3 cj-space-y-3",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs cj-font-semibold cj-uppercase",children:n("fc_nav_api_call")}),c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground",children:n("fc_nav_api_call_hint")})]}),c.jsx(Cn,{checked:!!(m!=null&&m.enabled),disabled:t,onCheckedChange:j=>a(e.step_id,j?m||{enabled:!0,method:"POST",url:"",headers:{},body_template:""}:void 0)})]}),(m==null?void 0:m.enabled)&&c.jsxs("div",{className:"cj-space-y-2",children:[c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsxs(Oe,{value:m.method,onValueChange:j=>a(e.step_id,{...m,method:j}),disabled:t,children:[c.jsx(Pe,{className:"cj-w-28",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"GET",children:"GET"}),c.jsx(K,{value:"POST",children:"POST"}),c.jsx(K,{value:"PUT",children:"PUT"}),c.jsx(K,{value:"PATCH",children:"PATCH"}),c.jsx(K,{value:"DELETE",children:"DELETE"})]})]}),c.jsx(pe,{value:m.url,onChange:j=>a(e.step_id,{...m,url:j.target.value}),placeholder:"https://api.example.com/endpoint",className:"cj-flex-1 cj-font-mono cj-text-xs",disabled:t})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[11px]",children:n("fc_nav_body_template")}),c.jsx(Ar,{value:m.body_template||"",onChange:j=>a(e.step_id,{...m,body_template:j.target.value}),placeholder:'{ "name": "{{answers.full_name}}" }',className:"cj-mt-1 cj-font-mono cj-text-xs",rows:4,disabled:t}),c.jsxs("p",{className:"cj-text-[10px] cj-text-muted-foreground cj-mt-1",children:[n("fc_nav_body_template_hint_prefix")," ",c.jsx("code",{children:"{{answers.namespace}}"})," ",n("fc_nav_body_template_hint_suffix")]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[11px]",children:n("fc_nav_on_error")}),c.jsxs(Oe,{value:m.on_error||"block",onValueChange:j=>{const _=j==="block"||j==="continue"?j:`goto:${j.slice(5)}`;a(e.step_id,{...m,on_error:_})},disabled:t,children:[c.jsx(Pe,{className:"cj-mt-1 cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"block",children:n("fc_nav_on_error_block")}),c.jsx(K,{value:"continue",children:n("fc_nav_on_error_continue")}),f.map(j=>c.jsx(K,{value:`goto:${j.step_id}`,children:n("fc_nav_on_error_goto",{step:j.title||j.step_id})},j.step_id)),c.jsx(K,{value:"goto:__submit__",children:n("fc_nav_on_error_summary")})]})]}),c.jsx("p",{className:"cj-text-[10px] cj-text-muted-foreground cj-mt-1",children:n("fc_nav_on_error_hint")})]})]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(X,{className:"cj-text-xs cj-w-32",children:n("fc_nav_continue_button")}),c.jsx(pe,{value:e.navigation.button_label||"",onChange:j=>o(e.step_id,{button_label:j.target.value||void 0}),placeholder:n("fc_nav_continue_placeholder"),className:"cj-flex-1 cj-h-8 cj-text-sm",disabled:t})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[c.jsx(X,{className:"cj-text-xs cj-font-semibold cj-uppercase",children:n("fc_nav_rules")}),!t&&c.jsxs(Z,{size:"sm",variant:"ghost",className:"cj-h-7",onClick:()=>s(e.step_id),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),n("fc_nav_add_rule")]})]}),c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground cj-mb-3",children:n("fc_nav_rules_hint")}),c.jsx("div",{className:"cj-space-y-2",children:e.navigation.rules.map((j,_)=>c.jsx(Ix,{rule:j,index:_,steps:f.map(g=>({id:g.step_id,title:g.title})),fields:p,readOnly:t,onUpdate:g=>i(e.step_id,j.rule_id,g),onDelete:()=>l(e.step_id,j.rule_id),canDelete:e.navigation.rules.length>1},j.rule_id))})]})]})]})})}function Ix({rule:e,index:t,steps:n,fields:r,readOnly:o,onUpdate:a,onDelete:s,canDelete:i}){const{t:l}=je(),[d,u]=y.useState(!!e.condition),[f,m]=y.useState(()=>Ta(e.condition)),[p,j]=y.useState(null),_=y.useRef(e.condition);y.useEffect(()=>{e.condition!==_.current&&(m(Ta(e.condition)),_.current=e.condition,j(null))},[e.condition]);const g=x=>{for(const b of x.rules){if(!b.field||xo.includes(b.operator))continue;const w=r.find(S=>S.namespace===b.field);if(w!=null&&w.options&&w.options.length>0&&!b.value)return l("fc_nav_field_requires_value",{label:w.label})}return null},v=x=>{m(x);const b=g(x);if(b){j(b);return}j(null);const w=Tx(x);_.current=w,a({condition:w})};return c.jsxs("div",{className:"cj-rounded-xl cj-border cj-border-border/60 cj-p-3 cj-bg-muted/20",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-2",children:[c.jsx("span",{className:"cj-text-[11px] cj-font-bold cj-text-muted-foreground cj-uppercase",children:l("fc_nav_rule_n",{n:t+1})}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-ml-auto",children:[c.jsx(X,{className:"cj-text-[11px]",children:l("fc_nav_has_condition")}),c.jsx(Cn,{checked:d,disabled:o,onCheckedChange:x=>{u(x),j(null),x||(m(Ta(null)),_.current=null,a({condition:null}))}}),i&&!o&&c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",onClick:s,children:c.jsx(En,{className:"cj-h-3 cj-w-3 cj-text-destructive"})})]})]}),d&&c.jsxs("div",{className:"cj-mb-3 cj-rounded-lg cj-bg-card cj-p-3",children:[c.jsx(Ax,{conditions:f,availableFields:r,onChange:v}),p&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1.5 cj-mt-2 cj-text-[11px] cj-text-destructive",children:[c.jsx(kl,{className:"cj-h-3.5 cj-w-3.5 cj-shrink-0"}),c.jsx("span",{children:p})]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(Do,{className:"cj-h-3.5 cj-w-3.5 cj-text-muted-foreground"}),c.jsx(X,{className:"cj-text-xs",children:l("fc_nav_go_to")}),c.jsxs(Oe,{value:e.next_step_id,onValueChange:x=>a({next_step_id:x}),disabled:o,children:[c.jsx(Pe,{className:"cj-flex-1 cj-h-8 cj-text-sm",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"__submit__",children:l("fc_nav_submit_form")}),n.map(x=>c.jsx(K,{value:x.id,children:x.title},x.id))]})]})]})]})}function Wx({specs:e=[],readOnly:t=!1}){const{t:n}=je(),{formConfig:r,activeStepId:o,updateStep:a,addRow:s,updateRow:i,deleteRow:l,moveRow:d,removeFieldFromRow:u,moveFieldInRow:f,addNewFieldToRow:m,setSelectedField:p,selectedFieldId:j}=wt(),_=r.steps.find(S=>S.step_id===o)||null,[g,v]=y.useState(!1),[x,b]=y.useState(null);if(!_)return c.jsx("div",{className:"cj-h-full cj-flex cj-items-center cj-justify-center cj-p-8 cj-text-center",children:c.jsx("div",{className:"cj-text-sm cj-text-muted-foreground",children:r.steps.length===0?n("fc_step_empty_create"):n("fc_step_empty_select")})});const w=r.steps.findIndex(S=>S.step_id===_.step_id)+1;return c.jsxs(Rt,{className:"cj-h-full",children:[c.jsxs("div",{className:"cj-p-6 cj-space-y-4 cj-max-w-3xl cj-mx-auto",children:[c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border cj-p-5 cj-space-y-4",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[c.jsx("div",{className:"cj-h-9 cj-w-9 cj-rounded-full cj-bg-primary cj-text-primary-foreground cj-flex cj-items-center cj-justify-center cj-font-bold",children:w}),c.jsx(pe,{value:_.title,onChange:S=>a(_.step_id,{title:S.target.value}),placeholder:n("fc_step_title_placeholder"),disabled:t,className:"cj-flex-1 cj-text-lg cj-font-semibold cj-border-none cj-shadow-none cj-px-1 cj-bg-transparent focus-visible:cj-ring-1"})]}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:n("fc_step_title_label")}),c.jsx(pe,{value:_.title,onChange:S=>a(_.step_id,{title:S.target.value}),disabled:t,className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:n("fc_step_description_label")}),c.jsx(pe,{value:_.description||"",onChange:S=>a(_.step_id,{description:S.target.value}),disabled:t,placeholder:n("fc_step_description_placeholder"),className:"cj-mt-1"})]})]})]}),_.rows.map((S,N)=>c.jsx($x,{row:S,index:N,isLast:N===_.rows.length-1,readOnly:t,onChangeLayout:C=>i(_.step_id,S.row_id,{layout:C}),onDelete:()=>l(_.step_id,S.row_id),onMoveUp:()=>d(_.step_id,S.row_id,"up"),onMoveDown:()=>d(_.step_id,S.row_id,"down"),onAddField:()=>b(S.row_id),onSelectField:C=>{p(C),v(!0)},onRemoveField:C=>u(_.step_id,S.row_id,C),onMoveField:(C,E)=>f(_.step_id,S.row_id,C,E),fieldLookup:C=>r.fields.find(E=>E.field_id===C)||null},S.row_id)),!t&&c.jsxs(Z,{variant:"outline",className:"cj-w-full cj-h-12 cj-rounded-xl cj-border-dashed",onClick:()=>s(_.step_id),children:[c.jsx(vt,{className:"cj-h-4 cj-w-4 cj-mr-2"}),n("fc_add_row")]}),c.jsx(zx,{step:_,readOnly:t})]}),c.jsx(If,{fieldId:j,open:g,onOpenChange:S=>{v(S),S||p(null)}}),c.jsx(Wf,{specs:e,open:!!x,onOpenChange:S=>{S||b(null)},onCreate:S=>{x&&m(_.step_id,x,S)}})]})}function $x({row:e,index:t,isLast:n,readOnly:r,onChangeLayout:o,onDelete:a,onMoveUp:s,onMoveDown:i,onAddField:l,onSelectField:d,onRemoveField:u,onMoveField:f,fieldLookup:m}){const{t:p}=je(),[j,_]=y.useState(!1);return c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border cj-p-4",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-3",children:[c.jsx(Pl,{className:"cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx("span",{className:"cj-text-sm cj-font-medium",children:p("fc_row_n",{n:t+1})}),c.jsxs(Oe,{value:e.layout,onValueChange:g=>o(g),disabled:r,children:[c.jsx(Pe,{className:"cj-h-7 cj-w-32 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"horizontal",children:p("fc_layout_horizontal")}),c.jsx(K,{value:"vertical",children:p("fc_layout_vertical")})]})]}),!r&&c.jsxs("div",{className:"cj-ml-auto cj-flex cj-items-center cj-gap-0.5",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:t===0,onClick:s,children:c.jsx(co,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:n,onClick:i,children:c.jsx(on,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",onClick:()=>_(!0),children:c.jsx(En,{className:"cj-h-3 cj-w-3 cj-text-destructive"})}),c.jsx(Rr,{open:j,onOpenChange:_,description:p("fc_confirm_delete_row"),onConfirm:a})]})]}),c.jsxs("div",{className:`cj-gap-3 ${e.layout==="horizontal"?"cj-flex cj-flex-wrap":"cj-flex cj-flex-col"}`,children:[e.field_ids.map((g,v)=>{const x=m(g);if(!x)return null;const b=ta(x.schema);return c.jsxs("div",{className:`cj-group cj-relative cj-rounded-xl cj-border cj-border-border cj-bg-muted/30 hover:cj-border-primary/60 cj-px-3 cj-py-2 cj-cursor-pointer ${e.layout==="horizontal"?"cj-flex-1 cj-min-w-[180px]":"cj-w-full"}`,onClick:()=>d(g),children:[c.jsxs("div",{className:"cj-flex cj-items-start cj-gap-2",children:[c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx(jt,{variant:"secondary",className:`cj-text-[9px] cj-mb-1 ${b.color} cj-text-white`,children:b.label}),c.jsxs("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:[x.label,x.required&&c.jsx("span",{className:"cj-text-destructive cj-ml-0.5",children:"*"})]}),c.jsx("div",{className:"cj-text-[10px] cj-font-mono cj-text-muted-foreground cj-truncate",children:x.namespace})]}),!r&&c.jsxs("div",{className:"cj-flex cj-flex-col cj-gap-0.5 cj-opacity-0 group-hover:cj-opacity-100 cj-transition-opacity",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",onClick:w=>{w.stopPropagation(),d(g)},title:p("fc_edit"),children:c.jsx(T_,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",onClick:w=>{w.stopPropagation(),u(g)},title:p("fc_remove_from_row"),children:c.jsx(Vt,{className:"cj-h-3 cj-w-3 cj-text-destructive"})})]})]}),!r&&e.field_ids.length>1&&c.jsxs("div",{className:"cj-absolute -cj-bottom-2 cj-left-1/2 -cj-translate-x-1/2 cj-flex cj-gap-0.5 cj-bg-card cj-rounded-full cj-shadow-sm cj-opacity-0 group-hover:cj-opacity-100",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",disabled:v===0,onClick:w=>{w.stopPropagation(),f(g,"left")},children:c.jsx(co,{className:"cj-h-3 cj-w-3 -cj-rotate-90"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",disabled:v===e.field_ids.length-1,onClick:w=>{w.stopPropagation(),f(g,"right")},children:c.jsx(on,{className:"cj-h-3 cj-w-3 -cj-rotate-90"})})]})]},g)}),!r&&c.jsxs("button",{onClick:l,className:`cj-rounded-xl cj-border-2 cj-border-dashed cj-border-border hover:cj-border-primary/60 cj-text-xs cj-text-muted-foreground hover:cj-text-foreground cj-px-3 cj-py-2 cj-flex cj-items-center cj-justify-center cj-gap-1 ${e.layout==="horizontal"?"cj-flex-1 cj-min-w-[140px]":"cj-w-full cj-py-3"}`,children:[c.jsx(vt,{className:"cj-h-3.5 cj-w-3.5"}),p("fc_add_field_btn")]}),e.field_ids.length===0&&r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:p("fc_no_fields")})]})]})}function Fx({readOnly:e=!1}){const{t}=je(),{formConfig:n,updateSummary:r,addSummarySection:o,updateSummarySection:a,deleteSummarySection:s,addDisplayField:i,updateDisplayField:l,deleteDisplayField:d}=wt(),[u,f]=y.useState(null),{summary:m,fields:p,steps:j}=n;return c.jsxs("div",{className:"cj-flex cj-flex-col cj-h-full cj-bg-card",children:[c.jsx("div",{className:"cj-p-4 cj-border-b",children:c.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:t("fc_summary_panel")})}),c.jsx(Rt,{className:"cj-flex-1",children:c.jsxs("div",{className:"cj-p-4 cj-space-y-4",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:t("fc_summary_title_label")}),c.jsx(pe,{value:m.title,onChange:_=>r({title:_.target.value}),disabled:e,className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[c.jsx(X,{className:"cj-text-xs cj-font-semibold cj-uppercase",children:t("fc_summary_sections")}),!e&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>o(),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),t("fc_summary_add_section")]})]}),c.jsxs("div",{className:"cj-space-y-3",children:[m.sections.map(_=>c.jsxs("div",{className:"cj-rounded-xl cj-border cj-border-border cj-p-3 cj-space-y-3 cj-bg-muted/20",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(pe,{value:_.title,onChange:g=>a(_.section_id,{title:g.target.value}),placeholder:t("fc_summary_section_title_placeholder"),disabled:e,className:"cj-flex-1 cj-h-8 cj-font-semibold"}),!e&&c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-7 cj-w-7",onClick:()=>f(_.section_id),children:c.jsx(En,{className:"cj-h-3.5 cj-w-3.5 cj-text-destructive"})})]}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-2",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:t("fc_summary_visible_from")}),c.jsxs(Oe,{value:String(_.visible_from_step??1),onValueChange:g=>a(_.section_id,{visible_from_step:parseInt(g,10)||1}),disabled:e,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsx(Ee,{children:j.map((g,v)=>c.jsx(K,{value:String(v+1),children:t("fc_summary_step_n",{n:v+1})},v))})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:t("fc_summary_until_step")}),c.jsxs(Oe,{value:_.until_step?String(_.until_step):"all",onValueChange:g=>a(_.section_id,{until_step:g==="all"?void 0:parseInt(g,10)}),disabled:e,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"all",children:t("fc_summary_all_steps")}),j.map((g,v)=>c.jsx(K,{value:String(v+1),children:t("fc_summary_step_n",{n:v+1})},v))]})]})]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-1",children:[c.jsx(X,{className:"cj-text-[10px] cj-uppercase cj-font-semibold",children:t("fc_summary_display_fields")}),!e&&c.jsxs(Z,{size:"sm",variant:"ghost",className:"cj-h-6 cj-text-[11px]",onClick:()=>i(_.section_id),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),t("fc_summary_add")]})]}),c.jsxs("div",{className:"cj-space-y-2",children:[_.display_fields.map(g=>c.jsx(Lx,{field:g,steps:j.map(v=>({id:v.step_id,title:v.title})),fields:p.map(v=>({id:v.field_id,label:v.label,namespace:v.namespace})),readOnly:e,onChange:v=>l(_.section_id,g.display_id,v),onDelete:()=>d(_.section_id,g.display_id)},g.display_id)),_.display_fields.length===0&&c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground cj-italic",children:t("fc_summary_no_display_fields")})]})]})]},_.section_id)),m.sections.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-text-center cj-py-4",children:t("fc_summary_no_sections")})]})]})]})}),c.jsx(Rr,{open:u!==null,onOpenChange:_=>!_&&f(null),description:t("fc_summary_confirm_delete_section"),onConfirm:()=>{u&&s(u),f(null)}})]})}function Lx({field:e,steps:t,fields:n,readOnly:r,onChange:o,onDelete:a}){const{t:s}=je();return c.jsxs("div",{className:"cj-relative cj-rounded-lg cj-border cj-bg-card cj-p-2 cj-space-y-1.5",children:[!r&&c.jsx("button",{onClick:a,className:"cj-absolute cj-top-1 cj-right-1 cj-text-destructive hover:cj-bg-destructive/10 cj-rounded cj-p-0.5",children:c.jsx(Vt,{className:"cj-h-3 cj-w-3"})}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-1.5",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_source")}),c.jsxs(Oe,{value:e.source,onValueChange:i=>o({source:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"form_field",children:s("fc_summary_source_form_field")}),c.jsx(K,{value:"api_response",children:s("fc_summary_source_api_response")})]})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_format")}),c.jsxs(Oe,{value:e.format||"text",onValueChange:i=>o({format:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"text",children:s("fc_summary_format_text")}),c.jsx(K,{value:"number",children:s("fc_summary_format_number")}),c.jsx(K,{value:"currency",children:s("fc_summary_format_currency")}),c.jsx(K,{value:"date",children:s("fc_summary_format_date")}),c.jsx(K,{value:"datetime",children:s("fc_summary_format_datetime")})]})]})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_display_label")}),c.jsx(pe,{value:e.label,onChange:i=>o({label:i.target.value}),placeholder:s("fc_summary_display_label_placeholder"),disabled:r,className:"cj-mt-0.5 cj-h-7 cj-text-xs"})]}),e.source==="form_field"?c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_field")}),c.jsxs(Oe,{value:e.field_id||"",onValueChange:i=>o({field_id:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{placeholder:s("fc_summary_select")})}),c.jsx(Ee,{children:n.map(i=>c.jsxs(K,{value:i.id,children:[i.label," ",c.jsxs("span",{className:"cj-text-muted-foreground",children:["(",i.namespace,")"]})]},i.id))})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_from_step_api")}),c.jsxs(Oe,{value:e.step_id||"",onValueChange:i=>o({step_id:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{placeholder:s("fc_summary_select")})}),c.jsx(Ee,{children:t.map(i=>c.jsx(K,{value:i.id,children:i.title},i.id))})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_response_path")}),c.jsx(pe,{value:e.response_path||"",onChange:i=>o({response_path:i.target.value}),placeholder:"data.quote.premium",disabled:r,className:"cj-mt-0.5 cj-h-7 cj-text-xs cj-font-mono"})]})]})]})}function Bx({specs:e=[],readOnly:t=!1}){const{t:n}=je(),{formConfig:r,createField:o,createFieldFromSpec:a,deleteField:s,setSelectedField:i,setActiveStep:l,setActiveTab:d}=wt(),[u,f]=y.useState(""),[m,p]=y.useState("all"),[j,_]=y.useState(!1),[g,v]=y.useState(null),[x,b]=y.useState(null),w=y.useMemo(()=>{const k=new Map;for(const M of r.steps){const D=new Set;for(const T of M.rows)for(const $ of T.field_ids)D.add($);for(const T of D){const $=k.get(T)??[];$.push({step_id:M.step_id,title:M.title}),k.set(T,$)}}return k},[r.steps]),S=y.useMemo(()=>{var D;let k=0,M=0;for(const T of r.fields)(((D=w.get(T.field_id))==null?void 0:D.length)??0)>0?k++:M++;return{all:r.fields.length,used:k,unused:M}},[r.fields,w]),N=r.fields.filter(k=>{var $;const M=u.toLowerCase();if(!(k.label.toLowerCase().includes(M)||k.namespace.toLowerCase().includes(M)))return!1;const T=(($=w.get(k.field_id))==null?void 0:$.length)??0;return m==="used"?T>0:m==="unused"?T===0:!0}),C=k=>{l(k),d("steps")},E=k=>`cj-h-8 cj-px-3 cj-text-xs cj-rounded-lg cj-border cj-transition-colors ${k?"cj-bg-primary cj-text-primary-foreground cj-border-primary":"cj-bg-background cj-text-foreground cj-border-border hover:cj-bg-accent/40"}`;return c.jsx("div",{className:"cj-h-full cj-overflow-hidden cj-p-6",children:c.jsxs("div",{className:"cj-h-full cj-flex cj-flex-col cj-max-w-4xl cj-mx-auto cj-w-full cj-bg-card cj-border cj-border-border cj-rounded-2xl cj-p-6",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold",children:n("fc_fields_catalog")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:n("fc_fields_catalog_hint")})]}),!t&&c.jsxs(Z,{onClick:()=>_(!0),children:[c.jsx(vt,{className:"cj-h-4 cj-w-4 cj-mr-1"}),n("fc_fields_add")]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-3",children:[c.jsxs("div",{className:"cj-relative cj-flex-1",children:[c.jsx(Ml,{className:"cj-absolute cj-left-2.5 cj-top-2.5 cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx(pe,{placeholder:n("fc_fields_search"),value:u,onChange:k=>f(k.target.value),className:"cj-pl-8"})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1",children:[c.jsxs("button",{type:"button",className:E(m==="all"),onClick:()=>p("all"),children:[n("fc_fields_filter_all")," ",c.jsx("span",{className:"cj-opacity-70 cj-ml-1",children:S.all})]}),c.jsxs("button",{type:"button",className:E(m==="used"),onClick:()=>p("used"),children:[n("fc_fields_filter_used")," ",c.jsx("span",{className:"cj-opacity-70 cj-ml-1",children:S.used})]}),c.jsxs("button",{type:"button",className:E(m==="unused"),onClick:()=>p("unused"),children:[n("fc_fields_filter_unused")," ",c.jsx("span",{className:"cj-opacity-70 cj-ml-1",children:S.unused})]})]})]}),c.jsx(Rt,{className:"cj-flex-1 cj-rounded-xl cj-border",children:c.jsxs("div",{className:"cj-divide-y",children:[N.map(k=>{const M=ta(k.schema),D=w.get(k.field_id)??[],T=D.length===0;return c.jsxs("div",{className:`cj-p-3 cj-flex cj-items-start cj-gap-3 hover:cj-bg-accent/40 ${T?"cj-bg-muted/30":""}`,children:[c.jsx(jt,{variant:"secondary",className:`cj-text-[10px] ${M.color} cj-text-white cj-mt-0.5`,children:M.label}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsxs("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:[k.label,k.required&&c.jsx("span",{className:"cj-text-destructive cj-ml-1",children:"*"})]}),T?c.jsx(jt,{variant:"outline",className:"cj-text-[10px] cj-border-destructive/40 cj-text-destructive",children:n("fc_fields_unused_badge")}):c.jsx(jt,{variant:"outline",className:"cj-text-[10px] cj-border-primary/40 cj-text-primary",children:D.length===1?n("fc_fields_used_in_one",{count:D.length}):n("fc_fields_used_in_many",{count:D.length})})]}),c.jsx("div",{className:"cj-text-[11px] cj-font-mono cj-text-muted-foreground cj-truncate",children:k.namespace}),D.length>0&&c.jsx("div",{className:"cj-mt-2 cj-flex cj-flex-wrap cj-gap-1",children:D.map($=>c.jsxs("button",{type:"button",onClick:()=>C($.step_id),title:n("fc_fields_go_to_step",{title:$.title}),className:"cj-inline-flex cj-items-center cj-gap-1 cj-text-[11px] cj-px-2 cj-py-0.5 cj-rounded-md cj-border cj-border-border cj-bg-background hover:cj-bg-accent/60 cj-transition-colors",children:[c.jsx("span",{className:"cj-truncate cj-max-w-[160px]",children:$.title}),c.jsx(Do,{className:"cj-h-3 cj-w-3 cj-opacity-60"})]},$.step_id))})]}),!t&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-7 cj-w-7",onClick:()=>{i(k.field_id),v(k.field_id)},children:c.jsx(P_,{className:"cj-h-3.5 cj-w-3.5"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-7 cj-w-7",onClick:()=>b(k.field_id),children:c.jsx(En,{className:"cj-h-3.5 cj-w-3.5 cj-text-destructive"})})]})]},k.field_id)}),N.length===0&&c.jsx("p",{className:"cj-py-8 cj-text-center cj-text-xs cj-text-muted-foreground",children:r.fields.length===0?n("fc_fields_no_fields"):n("fc_fields_no_match")})]})}),c.jsx(Wf,{specs:e,open:j,onOpenChange:_,onCreate:k=>{"claimspec_id"in k?a(k):o(k)}}),c.jsx(If,{fieldId:g,open:!!g,onOpenChange:k=>!k&&v(null)}),c.jsx(Rr,{open:x!==null,onOpenChange:k=>!k&&b(null),description:n("fc_fields_confirm_delete"),onConfirm:()=>{x&&s(x),b(null)}})]})})}function Hx({readOnly:e=!1}){var u,f;const{t}=je(),{formConfig:n,updateInit:r}=wt(),o=n.init,a=Object.entries(o.values||{}),s=()=>{let m="namespace",p=1;for(;o.values[m]!==void 0;)m=`namespace_${p++}`;r({values:{...o.values,[m]:""}})},i=(m,p)=>{if(p===m)return;const j={...o.values};j[p]=j[m],delete j[m],r({values:j})},l=(m,p)=>{r({values:{...o.values,[m]:p}})},d=m=>{const p={...o.values};delete p[m],r({values:p})};return c.jsx(Rt,{className:"cj-h-full",children:c.jsx("div",{className:"cj-p-6",children:c.jsxs("div",{className:"cj-max-w-3xl cj-mx-auto cj-w-full cj-bg-card cj-border cj-border-border cj-rounded-2xl cj-p-6 cj-space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold",children:t("fc_init_title")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:t("fc_init_subtitle")})]}),c.jsxs("div",{className:"cj-rounded-xl cj-border cj-p-4 cj-space-y-3",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsx(X,{className:"cj-text-sm cj-font-semibold",children:t("fc_init_static")}),!e&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:s,children:[c.jsx(vt,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_init_add")]})]}),c.jsxs("div",{className:"cj-space-y-2",children:[a.map(([m,p])=>c.jsxs("div",{className:"cj-flex cj-gap-2 cj-items-center",children:[c.jsx(pe,{value:m,onChange:j=>i(m,j.target.value),className:"cj-flex-1 cj-font-mono cj-text-sm cj-h-9",disabled:e}),c.jsx(pe,{value:String(p??""),onChange:j=>l(m,j.target.value),className:"cj-flex-1 cj-h-9",disabled:e}),!e&&c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-8 cj-w-8",onClick:()=>d(m),children:c.jsx(En,{className:"cj-h-3.5 cj-w-3.5 cj-text-destructive"})})]},m)),a.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic cj-py-2",children:t("fc_init_no_values")})]})]}),c.jsxs("div",{className:"cj-rounded-xl cj-border cj-p-4 cj-space-y-3",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-sm cj-font-semibold",children:t("fc_init_prefill")}),c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground",children:t("fc_init_prefill_hint")})]}),c.jsx(Cn,{checked:!!((u=o.api)!=null&&u.enabled),disabled:e,onCheckedChange:m=>r({api:m?o.api||{enabled:!0,method:"GET",url:"",mapping:{}}:void 0})})]}),((f=o.api)==null?void 0:f.enabled)&&c.jsxs("div",{className:"cj-space-y-2",children:[c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsxs(Oe,{value:o.api.method,onValueChange:m=>r({api:{...o.api,method:m}}),disabled:e,children:[c.jsx(Pe,{className:"cj-w-28",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"GET",children:"GET"}),c.jsx(K,{value:"POST",children:"POST"})]})]}),c.jsx(pe,{value:o.api.url,onChange:m=>r({api:{...o.api,url:m.target.value}}),placeholder:"https://api.example.com/prefill",className:"cj-flex-1 cj-font-mono cj-text-xs",disabled:e})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:t("fc_init_mapping")}),c.jsx(Ar,{value:JSON.stringify(o.api.mapping||{},null,2),onChange:m=>{try{const p=JSON.parse(m.target.value);r({api:{...o.api,mapping:p}})}catch{}},className:"cj-mt-1 cj-font-mono cj-text-xs",rows:5,disabled:e})]})]})]})]})})})}var Yx=e=>{switch(e){case"success":return Gx;case"info":return Xx;case"warning":return Ux;case"error":return Kx;default:return null}},qx=Array(12).fill(0),Vx=({visible:e,className:t})=>y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},y.createElement("div",{className:"sonner-spinner"},qx.map((n,r)=>y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Gx=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},y.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ux=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},y.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Xx=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},y.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Kx=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},y.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Jx=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Qx=()=>{let[e,t]=y.useState(document.hidden);return y.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},os=1,Zx=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:os++,a=this.toasts.find(i=>i.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(i=>i.id===o?(this.publish({...i,...e,id:o,title:n}),{...i,...e,id:o,dismissible:s,title:n}):i):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,a,s=r.then(async l=>{if(a=["resolve",l],y.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(tb(l)&&!l.ok){o=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){o=!1;let d=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async l=>{if(a=["reject",l],t.error!==void 0){o=!1;let d=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),i=()=>new Promise((l,d)=>s.then(()=>a[0]==="reject"?d(a[1]):l(a[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:i}:Object.assign(n,{unwrap:i})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||os++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Qe=new Zx,eb=(e,t)=>{let n=(t==null?void 0:t.id)||os++;return Qe.addToast({title:e,...t,id:n}),n},tb=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",nb=eb,rb=()=>Qe.toasts,ob=()=>Qe.getActiveToasts(),jn=Object.assign(nb,{success:Qe.success,info:Qe.info,warning:Qe.warning,error:Qe.error,custom:Qe.custom,message:Qe.message,promise:Qe.promise,dismiss:Qe.dismiss,loading:Qe.loading},{getHistory:rb,getToasts:ob});function ab(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}ab(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
278
- `);function Kr(e){return e.label!==void 0}var sb=3,ib="32px",cb="16px",_c=4e3,lb=356,db=14,ub=20,fb=200;function pt(...e){return e.filter(Boolean).join(" ")}function mb(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var pb=e=>{var t,n,r,o,a,s,i,l,d,u,f;let{invert:m,toast:p,unstyled:j,interacting:_,setHeights:g,visibleToasts:v,heights:x,index:b,toasts:w,expanded:S,removeToast:N,defaultRichColors:C,closeButton:E,style:k,cancelButtonStyle:M,actionButtonStyle:D,className:T="",descriptionClassName:$="",duration:A,position:H,gap:W,loadingIcon:Q,expandByDefault:G,classNames:z,icons:oe,closeButtonAriaLabel:le="Close toast",pauseWhenPageIsHidden:ie}=e,[R,I]=y.useState(null),[Y,U]=y.useState(null),[P,O]=y.useState(!1),[B,L]=y.useState(!1),[V,ee]=y.useState(!1),[ae,_e]=y.useState(!1),[Se,Me]=y.useState(!1),[Be,ke]=y.useState(0),[ft,Mn]=y.useState(0),Ze=y.useRef(p.duration||A||_c),fn=y.useRef(null),ct=y.useRef(null),or=b===0,ar=b+1<=v,Je=p.type,Ut=p.dismissible!==!1,da=p.className||"",ua=p.descriptionClassName||"",Dn=y.useMemo(()=>x.findIndex(F=>F.toastId===p.id)||0,[x,p.id]),fa=y.useMemo(()=>{var F;return(F=p.closeButton)!=null?F:E},[p.closeButton,E]),Fr=y.useMemo(()=>p.duration||A||_c,[p.duration,A]),sr=y.useRef(0),Xt=y.useRef(0),Lr=y.useRef(0),Kt=y.useRef(null),[Br,ma]=H.split("-"),ir=y.useMemo(()=>x.reduce((F,ve,Ne)=>Ne>=Dn?F:F+ve.height,0),[x,Dn]),ce=Qx(),ge=p.invert||m,te=Je==="loading";Xt.current=y.useMemo(()=>Dn*W+ir,[Dn,ir]),y.useEffect(()=>{Ze.current=Fr},[Fr]),y.useEffect(()=>{O(!0)},[]),y.useEffect(()=>{let F=ct.current;if(F){let ve=F.getBoundingClientRect().height;return Mn(ve),g(Ne=>[{toastId:p.id,height:ve,position:p.position},...Ne]),()=>g(Ne=>Ne.filter(et=>et.toastId!==p.id))}},[g,p.id]),y.useLayoutEffect(()=>{if(!P)return;let F=ct.current,ve=F.style.height;F.style.height="auto";let Ne=F.getBoundingClientRect().height;F.style.height=ve,Mn(Ne),g(et=>et.find(Ge=>Ge.toastId===p.id)?et.map(Ge=>Ge.toastId===p.id?{...Ge,height:Ne}:Ge):[{toastId:p.id,height:Ne,position:p.position},...et])},[P,p.title,p.description,g,p.id]);let fe=y.useCallback(()=>{L(!0),ke(Xt.current),g(F=>F.filter(ve=>ve.toastId!==p.id)),setTimeout(()=>{N(p)},fb)},[p,N,g,Xt]);y.useEffect(()=>{if(p.promise&&Je==="loading"||p.duration===1/0||p.type==="loading")return;let F;return S||_||ie&&ce?(()=>{if(Lr.current<sr.current){let ve=new Date().getTime()-sr.current;Ze.current=Ze.current-ve}Lr.current=new Date().getTime()})():Ze.current!==1/0&&(sr.current=new Date().getTime(),F=setTimeout(()=>{var ve;(ve=p.onAutoClose)==null||ve.call(p,p),fe()},Ze.current)),()=>clearTimeout(F)},[S,_,p,Je,ie,ce,fe]),y.useEffect(()=>{p.delete&&fe()},[fe,p.delete]);function Ve(){var F,ve,Ne;return oe!=null&&oe.loading?y.createElement("div",{className:pt(z==null?void 0:z.loader,(F=p==null?void 0:p.classNames)==null?void 0:F.loader,"sonner-loader"),"data-visible":Je==="loading"},oe.loading):Q?y.createElement("div",{className:pt(z==null?void 0:z.loader,(ve=p==null?void 0:p.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":Je==="loading"},Q):y.createElement(Vx,{className:pt(z==null?void 0:z.loader,(Ne=p==null?void 0:p.classNames)==null?void 0:Ne.loader),visible:Je==="loading"})}return y.createElement("li",{tabIndex:0,ref:ct,className:pt(T,da,z==null?void 0:z.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[Je],(n=p==null?void 0:p.classNames)==null?void 0:n[Je]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:C,"data-styled":!(p.jsx||p.unstyled||j),"data-mounted":P,"data-promise":!!p.promise,"data-swiped":Se,"data-removed":B,"data-visible":ar,"data-y-position":Br,"data-x-position":ma,"data-index":b,"data-front":or,"data-swiping":V,"data-dismissible":Ut,"data-type":Je,"data-invert":ge,"data-swipe-out":ae,"data-swipe-direction":Y,"data-expanded":!!(S||G&&P),style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${B?Be:Xt.current}px`,"--initial-height":G?"auto":`${ft}px`,...k,...p.style},onDragEnd:()=>{ee(!1),I(null),Kt.current=null},onPointerDown:F=>{te||!Ut||(fn.current=new Date,ke(Xt.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(ee(!0),Kt.current={x:F.clientX,y:F.clientY}))},onPointerUp:()=>{var F,ve,Ne,et;if(ae||!Ut)return;Kt.current=null;let Ge=Number(((F=ct.current)==null?void 0:F.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),lt=Number(((ve=ct.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mn=new Date().getTime()-((Ne=fn.current)==null?void 0:Ne.getTime()),mt=R==="x"?Ge:lt,Jt=Math.abs(mt)/mn;if(Math.abs(mt)>=ub||Jt>.11){ke(Xt.current),(et=p.onDismiss)==null||et.call(p,p),U(R==="x"?Ge>0?"right":"left":lt>0?"down":"up"),fe(),_e(!0),Me(!1);return}ee(!1),I(null)},onPointerMove:F=>{var ve,Ne,et,Ge;if(!Kt.current||!Ut||((ve=window.getSelection())==null?void 0:ve.toString().length)>0)return;let lt=F.clientY-Kt.current.y,mn=F.clientX-Kt.current.x,mt=(Ne=e.swipeDirections)!=null?Ne:mb(H);!R&&(Math.abs(mn)>1||Math.abs(lt)>1)&&I(Math.abs(mn)>Math.abs(lt)?"x":"y");let Jt={x:0,y:0};R==="y"?(mt.includes("top")||mt.includes("bottom"))&&(mt.includes("top")&&lt<0||mt.includes("bottom")&&lt>0)&&(Jt.y=lt):R==="x"&&(mt.includes("left")||mt.includes("right"))&&(mt.includes("left")&&mn<0||mt.includes("right")&&mn>0)&&(Jt.x=mn),(Math.abs(Jt.x)>0||Math.abs(Jt.y)>0)&&Me(!0),(et=ct.current)==null||et.style.setProperty("--swipe-amount-x",`${Jt.x}px`),(Ge=ct.current)==null||Ge.style.setProperty("--swipe-amount-y",`${Jt.y}px`)}},fa&&!p.jsx?y.createElement("button",{"aria-label":le,"data-disabled":te,"data-close-button":!0,onClick:te||!Ut?()=>{}:()=>{var F;fe(),(F=p.onDismiss)==null||F.call(p,p)},className:pt(z==null?void 0:z.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(a=oe==null?void 0:oe.close)!=null?a:Jx):null,p.jsx||y.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:y.createElement(y.Fragment,null,Je||p.icon||p.promise?y.createElement("div",{"data-icon":"",className:pt(z==null?void 0:z.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ve():null,p.type!=="loading"?p.icon||(oe==null?void 0:oe[Je])||Yx(Je):null):null,y.createElement("div",{"data-content":"",className:pt(z==null?void 0:z.content,(i=p==null?void 0:p.classNames)==null?void 0:i.content)},y.createElement("div",{"data-title":"",className:pt(z==null?void 0:z.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?y.createElement("div",{"data-description":"",className:pt($,ua,z==null?void 0:z.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),y.isValidElement(p.cancel)?p.cancel:p.cancel&&Kr(p.cancel)?y.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||M,onClick:F=>{var ve,Ne;Kr(p.cancel)&&Ut&&((Ne=(ve=p.cancel).onClick)==null||Ne.call(ve,F),fe())},className:pt(z==null?void 0:z.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,y.isValidElement(p.action)?p.action:p.action&&Kr(p.action)?y.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||D,onClick:F=>{var ve,Ne;Kr(p.action)&&((Ne=(ve=p.action).onClick)==null||Ne.call(ve,F),!F.defaultPrevented&&fe())},className:pt(z==null?void 0:z.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function gc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function hb(e,t){let n={};return[e,t].forEach((r,o)=>{let a=o===1,s=a?"--mobile-offset":"--offset",i=a?cb:ib;function l(d){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=i:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):l(i)}),n}y.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:s,className:i,offset:l,mobileOffset:d,theme:u="light",richColors:f,duration:m,style:p,visibleToasts:j=sb,toastOptions:_,dir:g=gc(),gap:v=db,loadingIcon:x,icons:b,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:S}=e,[N,C]=y.useState([]),E=y.useMemo(()=>Array.from(new Set([r].concat(N.filter(ie=>ie.position).map(ie=>ie.position)))),[N,r]),[k,M]=y.useState([]),[D,T]=y.useState(!1),[$,A]=y.useState(!1),[H,W]=y.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=y.useRef(null),G=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=y.useRef(null),oe=y.useRef(!1),le=y.useCallback(ie=>{C(R=>{var I;return(I=R.find(Y=>Y.id===ie.id))!=null&&I.delete||Qe.dismiss(ie.id),R.filter(({id:Y})=>Y!==ie.id)})},[]);return y.useEffect(()=>Qe.subscribe(ie=>{if(ie.dismiss){C(R=>R.map(I=>I.id===ie.id?{...I,delete:!0}:I));return}setTimeout(()=>{fs.flushSync(()=>{C(R=>{let I=R.findIndex(Y=>Y.id===ie.id);return I!==-1?[...R.slice(0,I),{...R[I],...ie},...R.slice(I+1)]:[ie,...R]})})})}),[]),y.useEffect(()=>{if(u!=="system"){W(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let ie=window.matchMedia("(prefers-color-scheme: dark)");try{ie.addEventListener("change",({matches:R})=>{W(R?"dark":"light")})}catch{ie.addListener(({matches:I})=>{try{W(I?"dark":"light")}catch(Y){console.error(Y)}})}},[u]),y.useEffect(()=>{N.length<=1&&T(!1)},[N]),y.useEffect(()=>{let ie=R=>{var I,Y;o.every(U=>R[U]||R.code===U)&&(T(!0),(I=Q.current)==null||I.focus()),R.code==="Escape"&&(document.activeElement===Q.current||(Y=Q.current)!=null&&Y.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[o]),y.useEffect(()=>{if(Q.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,oe.current=!1)}},[Q.current]),y.createElement("section",{ref:t,"aria-label":`${w} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((ie,R)=>{var I;let[Y,U]=ie.split("-");return N.length?y.createElement("ol",{key:ie,dir:g==="auto"?gc():g,tabIndex:-1,ref:Q,className:i,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":Y,"data-lifted":D&&N.length>1&&!a,"data-x-position":U,style:{"--front-toast-height":`${((I=k[0])==null?void 0:I.height)||0}px`,"--width":`${lb}px`,"--gap":`${v}px`,...p,...hb(l,d)},onBlur:P=>{oe.current&&!P.currentTarget.contains(P.relatedTarget)&&(oe.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,z.current=P.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{$||T(!1)},onDragEnd:()=>T(!1),onPointerDown:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},N.filter(P=>!P.position&&R===0||P.position===ie).map((P,O)=>{var B,L;return y.createElement(pb,{key:P.id,icons:b,index:O,toast:P,defaultRichColors:f,duration:(B=_==null?void 0:_.duration)!=null?B:m,className:_==null?void 0:_.className,descriptionClassName:_==null?void 0:_.descriptionClassName,invert:n,visibleToasts:j,closeButton:(L=_==null?void 0:_.closeButton)!=null?L:s,interacting:$,position:ie,style:_==null?void 0:_.style,unstyled:_==null?void 0:_.unstyled,classNames:_==null?void 0:_.classNames,cancelButtonStyle:_==null?void 0:_.cancelButtonStyle,actionButtonStyle:_==null?void 0:_.actionButtonStyle,removeToast:le,toasts:N.filter(V=>V.position==P.position),heights:k.filter(V=>V.position==P.position),setHeights:M,expandByDefault:a,gap:v,loadingIcon:x,expanded:D,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});function _b({readOnly:e=!1}){const{t}=je(),{exportJourneySpec:n,importJourneySpec:r}=wt(),o=n(),a=JSON.stringify(o,null,2),[s,i]=y.useState(a),[l,d]=y.useState(null),u=y.useRef(null),f=s!==a,m=()=>{i(JSON.stringify(n(),null,2)),d(null)},p=x=>{try{const b=JSON.parse(x);r(b),i(JSON.stringify(b,null,2)),d(null),jn.success(t("fc_json_imported_ok"))}catch(b){d(b instanceof Error?b.message:t("fc_json_invalid")),jn.error(t("fc_json_invalid"))}},j=()=>{p(s)},_=x=>{var S;const b=(S=x.target.files)==null?void 0:S[0];if(!b)return;const w=new FileReader;w.onload=N=>{var E;const C=(E=N.target)==null?void 0:E.result;p(C)},w.onerror=()=>{jn.error(t("fc_json_file_error"))},w.readAsText(b),x.target.value=""},g=()=>{navigator.clipboard.writeText(s),jn.success(t("fc_json_copied"))},v=()=>{const x=new Blob([s],{type:"application/json"}),b=URL.createObjectURL(x),w=document.createElement("a");w.href=b,w.download=`${o.journey_id}.json`,w.click(),URL.revokeObjectURL(b)};return c.jsx("div",{className:"cj-h-full cj-overflow-auto cj-p-6",children:c.jsxs("div",{className:"cj-max-w-4xl cj-mx-auto cj-w-full cj-bg-card cj-border cj-border-border cj-rounded-2xl cj-p-6 cj-flex cj-flex-col cj-gap-2 cj-min-h-full",children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold",children:t("fc_json_title")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:t("fc_json_hint")}),c.jsxs("div",{className:"cj-flex cj-flex-wrap cj-gap-2",children:[c.jsx(Z,{size:"sm",variant:"outline",onClick:m,title:t("fc_json_refresh_hint"),children:t("fc_json_refresh")}),c.jsxs(Z,{size:"sm",variant:"outline",onClick:g,children:[c.jsx(p_,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_copy")]}),c.jsxs(Z,{size:"sm",variant:"outline",onClick:v,children:[c.jsx(__,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_download")]}),!e&&c.jsxs(c.Fragment,{children:[c.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>{var x;return(x=u.current)==null?void 0:x.click()},children:[c.jsx(x_,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_upload")]}),c.jsxs(Z,{size:"sm",onClick:j,disabled:!f,title:t("fc_json_apply_hint"),children:[c.jsx(Dl,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_import")]}),c.jsx("input",{ref:u,type:"file",accept:".json,application/json",hidden:!0,onChange:_})]})]}),l&&c.jsx("div",{className:"cj-rounded-lg cj-border cj-border-destructive/40 cj-bg-destructive/10 cj-text-destructive cj-text-xs cj-p-2 cj-font-mono",children:l}),c.jsx(Ar,{value:s,onChange:x=>i(x.target.value),className:"cj-flex-1 cj-font-mono cj-text-xs",readOnly:e})]})})}const gb=Ts,jb=Hd,yb=Rs,Yf=h.forwardRef(({className:e,...t},n)=>c.jsx(Er,{className:ne("cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t,ref:n}));Yf.displayName=Er.displayName;const vb=Po("cj-fixed cj-z-50 cj-gap-4 cj-bg-background cj-p-6 cj-shadow-lg cj-transition cj-ease-in-out data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-duration-300 data-[state=open]:cj-duration-500",{variants:{side:{top:"cj-inset-x-0 cj-top-0 cj-border-b data-[state=closed]:cj-slide-out-to-top data-[state=open]:cj-slide-in-from-top",bottom:"cj-inset-x-0 cj-bottom-0 cj-border-t data-[state=closed]:cj-slide-out-to-bottom data-[state=open]:cj-slide-in-from-bottom",left:"cj-inset-y-0 cj-left-0 cj-h-full cj-w-3/4 cj-border-r data-[state=closed]:cj-slide-out-to-left data-[state=open]:cj-slide-in-from-left sm:cj-max-w-sm",right:"cj-inset-y-0 cj-right-0 cj-h-full cj-w-3/4 cj-border-l data-[state=closed]:cj-slide-out-to-right data-[state=open]:cj-slide-in-from-right sm:cj-max-w-sm"}},defaultVariants:{side:"right"}}),qf=h.forwardRef(({side:e="right",className:t,children:n,...r},o)=>c.jsxs(yb,{children:[c.jsx(Yf,{}),c.jsxs(Mr,{ref:o,className:ne(vb({side:e}),t),...r,children:[n,c.jsxs(Yo,{className:"cj-absolute cj-right-4 cj-top-4 cj-rounded-sm cj-opacity-70 cj-ring-offset-background cj-transition-opacity data-[state=open]:cj-bg-secondary hover:cj-opacity-100 focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-pointer-events-none",children:[c.jsx(Vt,{className:"cj-h-4 cj-w-4"}),c.jsx("span",{className:"cj-sr-only",children:"Close"})]})]})]}));qf.displayName=Mr.displayName;const Vf=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col cj-space-y-2 cj-text-center sm:cj-text-left",e),...t});Vf.displayName="SheetHeader";const Gf=h.forwardRef(({className:e,...t},n)=>c.jsx(Dr,{ref:n,className:ne("cj-text-lg cj-font-semibold cj-text-foreground",e),...t}));Gf.displayName=Dr.displayName;const xb=h.forwardRef(({className:e,...t},n)=>c.jsx(Tr,{ref:n,className:ne("cj-text-sm cj-text-muted-foreground",e),...t}));xb.displayName=Tr.displayName;const Uf={compact:"8px",cozy:"16px",spacious:"24px"};function Xf(e){if(!e)return[];const t=[];return e.primaryColor&&t.push(`--claims-journey-primary: ${e.primaryColor};`),e.backgroundColor&&t.push(`--claims-journey-background: ${e.backgroundColor};`),e.cardColor&&t.push(`--claims-journey-card: ${e.cardColor};`),e.foregroundColor&&t.push(`--claims-journey-foreground: ${e.foregroundColor};`),e.fontFamilyHeading&&t.push(`--claims-journey-font-heading: ${e.fontFamilyHeading};`),e.fontFamilyBody&&t.push(`--claims-journey-font-body: ${e.fontFamilyBody};`),e.borderRadius!==void 0&&t.push(`--claims-journey-radius: ${e.borderRadius}rem;`),e.spacing&&t.push(`--claims-journey-spacing: ${Uf[e.spacing]};`),e.fontSizeBase!==void 0&&t.push(`font-size: ${e.fontSizeBase}px;`),t}function bb(e,t){const n=Xf(e);return n.length?`${t} { ${n.join(" ")} }`:null}function Kf(e){const t={};return e&&(e.primaryColor&&(t["--claims-journey-primary"]=e.primaryColor),e.backgroundColor&&(t["--claims-journey-background"]=e.backgroundColor),e.cardColor&&(t["--claims-journey-card"]=e.cardColor),e.foregroundColor&&(t["--claims-journey-foreground"]=e.foregroundColor),e.fontFamilyHeading&&(t["--claims-journey-font-heading"]=e.fontFamilyHeading),e.fontFamilyBody&&(t["--claims-journey-font-body"]=e.fontFamilyBody),e.borderRadius!==void 0&&(t["--claims-journey-radius"]=`${e.borderRadius}rem`),e.spacing&&(t["--claims-journey-spacing"]=Uf[e.spacing]),e.fontSizeBase!==void 0&&(t.fontSize=`${e.fontSizeBase}px`)),t}const jc=[{label:"Poppins (default)",value:"'Poppins', sans-serif"},{label:"Roboto (default)",value:"'Roboto', sans-serif"},{label:"Inter",value:"'Inter', sans-serif"},{label:"System UI",value:"system-ui, sans-serif"},{label:"Georgia",value:"Georgia, serif"}];function wb(e){if(!e)return"#000000";const t=e.trim().match(/^(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%$/);if(!t)return"#000000";const n=parseFloat(t[1])/360,r=parseFloat(t[2])/100,o=parseFloat(t[3])/100,a=(u,f,m)=>(m<0&&(m+=1),m>1&&(m-=1),m<1/6?u+(f-u)*6*m:m<1/2?f:m<2/3?u+(f-u)*(2/3-m)*6:u);let s,i,l;if(r===0)s=i=l=o;else{const u=o<.5?o*(1+r):o+r-o*r,f=2*o-u;s=a(f,u,n+1/3),i=a(f,u,n),l=a(f,u,n-1/3)}const d=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${d(s)}${d(i)}${d(l)}`}function Nb(e){const t=e.replace("#","").match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!t)return"0 0% 0%";const n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,o=parseInt(t[3],16)/255,a=Math.max(n,r,o),s=Math.min(n,r,o);let i=0,l=0;const d=(a+s)/2;if(a!==s){const u=a-s;switch(l=d>.5?u/(2-a-s):u/(a+s),a){case n:i=(r-o)/u+(r<o?6:0);break;case r:i=(o-n)/u+2;break;case o:i=(n-r)/u+4;break}i/=6}return`${Math.round(i*360)} ${Math.round(l*100)}% ${Math.round(d*100)}%`}function Jr({label:e,value:t,onChange:n}){const{t:r}=je(),o=wb(t);return c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e}),c.jsxs("div",{className:"cj-flex cj-gap-2 cj-items-center",children:[c.jsx("input",{type:"color",value:o,onChange:a=>n(Nb(a.target.value)),className:"cj-h-9 cj-w-12 cj-rounded-md cj-border cj-border-input cj-bg-background cj-cursor-pointer cj-p-1","aria-label":r("theme_color_picker_aria",{label:e})}),c.jsx(pe,{value:t||"",onChange:a=>n(a.target.value),placeholder:r("theme_color_placeholder"),className:"cj-h-9 cj-text-xs cj-font-mono cj-flex-1"})]}),c.jsx("p",{className:"cj-text-[10px] cj-text-muted-foreground",children:r("theme_color_hint")})]})}function Sb(){const{t:e}=je(),{theme:t,updateTheme:n,resetTheme:r}=wt(),[o,a]=y.useState(null),s=l=>n(l),i=Kf(t);return c.jsxs(gb,{children:[c.jsx(jb,{asChild:!0,children:c.jsxs(Z,{size:"sm",variant:"outline",children:[c.jsx(k_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),e("theme_button")]})}),c.jsx(qf,{className:"cj-w-[360px] sm:cj-w-[420px] cj-overflow-y-auto",ref:a,children:c.jsxs(Zo.Provider,{value:o,children:[c.jsx(Vf,{children:c.jsxs(Gf,{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsx("span",{children:e("theme_button")}),c.jsxs(Z,{size:"sm",variant:"ghost",onClick:()=>r(),children:[c.jsx(El,{className:"cj-h-3 cj-w-3 cj-mr-1"}),e("theme_reset")]})]})}),c.jsxs("div",{className:"cj-space-y-4 cj-mt-4",children:[c.jsxs("section",{className:"cj-space-y-3",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_colors")}),c.jsx(Jr,{label:e("theme_primary"),value:t.primaryColor,onChange:l=>s({primaryColor:l})}),c.jsx(Jr,{label:e("theme_background"),value:t.backgroundColor,onChange:l=>s({backgroundColor:l})}),c.jsx(Jr,{label:e("theme_card"),value:t.cardColor,onChange:l=>s({cardColor:l})}),c.jsx(Jr,{label:e("theme_foreground"),value:t.foregroundColor,onChange:l=>s({foregroundColor:l})})]}),c.jsxs("section",{className:"cj-space-y-3",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_typography")}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_heading_font")}),c.jsxs(Oe,{value:t.fontFamilyHeading||void 0,onValueChange:l=>s({fontFamilyHeading:l}),children:[c.jsx(Pe,{className:"cj-h-9 cj-text-xs",children:c.jsx(Ae,{placeholder:e("theme_font_default")})}),c.jsx(Ee,{children:jc.map(l=>c.jsx(K,{value:l.value,children:l.label},l.value))})]})]}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_body_font")}),c.jsxs(Oe,{value:t.fontFamilyBody||void 0,onValueChange:l=>s({fontFamilyBody:l}),children:[c.jsx(Pe,{className:"cj-h-9 cj-text-xs",children:c.jsx(Ae,{placeholder:e("theme_font_default")})}),c.jsx(Ee,{children:jc.map(l=>c.jsx(K,{value:l.value,children:l.label},l.value))})]})]}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_font_size")}),c.jsx(pe,{type:"number",min:12,max:24,value:t.fontSizeBase??"",onChange:l=>s({fontSizeBase:l.target.value?Number(l.target.value):void 0}),placeholder:"16",className:"cj-h-9 cj-text-xs"})]})]}),c.jsxs("section",{className:"cj-space-y-3",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_shape_spacing")}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_border_radius")}),c.jsx(pe,{type:"number",step:"0.125",min:0,max:2,value:t.borderRadius??"",onChange:l=>s({borderRadius:l.target.value?Number(l.target.value):void 0}),placeholder:"0.75",className:"cj-h-9 cj-text-xs"})]}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_spacing")}),c.jsxs(Oe,{value:t.spacing||void 0,onValueChange:l=>s({spacing:l}),children:[c.jsx(Pe,{className:"cj-h-9 cj-text-xs",children:c.jsx(Ae,{placeholder:e("theme_spacing_cozy_default")})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"compact",children:e("theme_spacing_compact")}),c.jsx(K,{value:"cozy",children:e("theme_spacing_cozy")}),c.jsx(K,{value:"spacious",children:e("theme_spacing_spacious")})]})]})]})]}),c.jsxs("section",{className:"cj-space-y-2",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_live_preview")}),c.jsx("div",{className:"jb-widget-root jb-themed cj-rounded-lg cj-border cj-border-border cj-bg-background cj-text-foreground",style:{...i,padding:"var(--claims-journey-spacing, 16px)"},children:c.jsxs("div",{className:"cj-rounded-lg cj-border cj-border-border cj-bg-card cj-text-foreground",style:{padding:"var(--claims-journey-spacing, 16px)",display:"flex",flexDirection:"column",gap:"calc(var(--claims-journey-spacing, 16px) / 2)"},children:[c.jsx("h3",{className:"cj-m-0 cj-text-lg cj-font-semibold",style:{fontFamily:"var(--claims-journey-font-heading)"},children:e("theme_heading_sample")}),c.jsx("p",{className:"cj-m-0 cj-text-sm cj-text-muted-foreground",style:{fontFamily:"var(--claims-journey-font-body)"},children:e("theme_body_sample")}),c.jsx("input",{className:"cj-w-full cj-border cj-border-input cj-bg-background cj-text-foreground cj-text-sm cj-px-3 cj-rounded-md",style:{fontFamily:"var(--claims-journey-font-body)",borderRadius:"var(--claims-journey-radius)",minHeight:"calc(var(--claims-journey-spacing, 16px) * 2 + 16px)"},placeholder:e("theme_input_sample"),readOnly:!0}),c.jsx("button",{type:"button",className:"cj-bg-primary cj-text-primary-foreground cj-text-sm cj-font-medium cj-self-start cj-cursor-default",style:{fontFamily:"var(--claims-journey-font-body)",borderRadius:"var(--claims-journey-radius)",padding:"calc(var(--claims-journey-spacing, 16px) / 2) var(--claims-journey-spacing, 16px)",border:"none"},children:e("theme_primary_action")})]})})]})]})]})})]})}const as="cj-theme-portal-vars",ss="data-cj-themed-portals";let Qr=0;const Cb=["[data-radix-popper-content-wrapper]","[data-radix-popper-content-wrapper] *",'[role="dialog"]','[role="alertdialog"]',"[data-vaul-drawer]","[data-sonner-toaster]"].map(e=>`html[${ss}="true"] ${e}`).join(`,
277
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},ny=qd,ry=Vd,nu=Gd,ru=Ud,ou=Zd,au=tu,su=Kd,iu=Qd;const oy=ny,ay=ry,cu=h.forwardRef(({className:e,...t},n)=>c.jsx(nu,{className:ne("cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t,ref:n}));cu.displayName=nu.displayName;const lu=h.forwardRef(({className:e,...t},n)=>c.jsxs(ay,{children:[c.jsx(cu,{}),c.jsx(ru,{ref:n,className:ne("cj-fixed cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[state=closed]:cj-slide-out-to-left-1/2 data-[state=closed]:cj-slide-out-to-top-[48%] data-[state=open]:cj-slide-in-from-left-1/2 data-[state=open]:cj-slide-in-from-top-[48%] sm:cj-rounded-lg",e),...t})]}));lu.displayName=ru.displayName;const du=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col cj-space-y-2 cj-text-center sm:cj-text-left",e),...t});du.displayName="AlertDialogHeader";const uu=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col-reverse sm:cj-flex-row sm:cj-justify-end sm:cj-space-x-2",e),...t});uu.displayName="AlertDialogFooter";const fu=h.forwardRef(({className:e,...t},n)=>c.jsx(su,{ref:n,className:ne("cj-text-lg cj-font-semibold",e),...t}));fu.displayName=su.displayName;const mu=h.forwardRef(({className:e,...t},n)=>c.jsx(iu,{ref:n,className:ne("cj-text-sm cj-text-muted-foreground",e),...t}));mu.displayName=iu.displayName;const pu=h.forwardRef(({className:e,...t},n)=>c.jsx(ou,{ref:n,className:ne(ps(),e),...t}));pu.displayName=ou.displayName;const hu=h.forwardRef(({className:e,...t},n)=>c.jsx(au,{ref:n,className:ne(ps({variant:"outline"}),"cj-mt-2 sm:cj-mt-0",e),...t}));hu.displayName=au.displayName;function Rr({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o,cancelLabel:a,destructive:s=!0,onConfirm:i}){const{t:l}=je();return c.jsx(oy,{open:e,onOpenChange:t,children:c.jsxs(lu,{children:[c.jsxs(du,{children:[c.jsx(fu,{children:n??l("fc_confirm_title")}),c.jsx(mu,{children:r})]}),c.jsxs(uu,{children:[c.jsx(hu,{children:a??l("cancel")}),c.jsx(pu,{onClick:i,className:s?"cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/90":void 0,children:o??l("delete")})]})]})})}function sy({readOnly:e=!1}){const{t}=je(),{formConfig:n,activeStepId:r,setActiveStep:o,addStep:a,deleteStep:s,moveStep:i}=wt(),[l,d]=v.useState(null);return c.jsxs("div",{className:"cj-flex cj-flex-col cj-h-full cj-bg-card",children:[c.jsxs("div",{className:"cj-p-4 cj-border-b cj-flex cj-items-center cj-justify-between",children:[c.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:t("fc_form_steps")}),!e&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>a(),children:[c.jsx(vt,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_add_step")]})]}),c.jsx(Rt,{className:"cj-flex-1 cj-min-w-0",children:c.jsxs("div",{className:"cj-p-3 cj-space-y-2 cj-min-w-0",children:[n.steps.map((u,f)=>{const m=u.step_id===r,p=u.rows.reduce((g,_)=>g+_.field_ids.length,0);return c.jsx("div",{onClick:()=>o(u.step_id),className:`cj-rounded-xl cj-border-2 cj-p-3 cj-cursor-pointer cj-transition-colors ${m?"cj-border-primary cj-bg-primary/5":"cj-border-border cj-bg-card hover:cj-border-primary/40"}`,children:c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx("div",{className:`cj-h-7 cj-w-7 cj-rounded-full cj-flex cj-items-center cj-justify-center cj-text-xs cj-font-bold cj-shrink-0 ${m?"cj-bg-primary cj-text-primary-foreground":"cj-bg-muted cj-text-muted-foreground"}`,children:f+1}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx("div",{className:"cj-text-sm cj-font-semibold cj-truncate",children:u.title||t("fc_step_untitled")}),c.jsx("div",{className:"cj-text-[11px] cj-text-muted-foreground",children:t("fc_step_meta",{rows:u.rows.length,fields:p})})]}),!e&&m&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-0.5",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:f===0,onClick:g=>{g.stopPropagation(),i(u.step_id,"up")},children:c.jsx(co,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:f===n.steps.length-1,onClick:g=>{g.stopPropagation(),i(u.step_id,"down")},children:c.jsx(on,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",onClick:g=>{g.stopPropagation(),d(u.step_id)},children:c.jsx(En,{className:"cj-h-3 cj-w-3 cj-text-destructive"})})]})]})},u.step_id)}),n.steps.length===0&&c.jsxs("div",{className:"cj-py-12 cj-text-center cj-text-xs cj-text-muted-foreground",children:[t("fc_no_steps"),!e&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),t("fc_no_steps_hint_click")," ",c.jsxs("strong",{children:["+ ",t("fc_add_step")]})," ",t("fc_no_steps_hint_to_begin")]})]})]})}),c.jsx(Rr,{open:l!==null,onOpenChange:u=>!u&&d(null),description:t("fc_confirm_delete_step"),onConfirm:()=>{l&&s(l),d(null)}})]})}const pe=h.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ne("cj-flex cj-h-12 cj-w-full cj-rounded-xl cj-border cj-border-border/40 cj-bg-muted/50 cj-px-3 cj-py-2 cj-text-base cj-shadow-none cj-ring-offset-background file:cj-border-0 file:cj-bg-transparent file:cj-text-sm file:cj-font-medium file:cj-text-foreground placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 md:cj-text-sm",e),ref:r,...n}));pe.displayName="Input";var iy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cy=iy.reduce((e,t)=>{const n=ko(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ly="Label",_u=h.forwardRef((e,t)=>c.jsx(cy.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));_u.displayName=ly;var gu=_u;const dy=Po("cj-text-sm cj-font-medium cj-leading-none peer-disabled:cj-cursor-not-allowed peer-disabled:cj-opacity-70"),X=h.forwardRef(({className:e,...t},n)=>c.jsx(gu,{ref:n,className:ne(dy(),e),...t}));X.displayName=gu.displayName;const uy=["top","right","bottom","left"],an=Math.min,rt=Math.max,ho=Math.round,Xr=Math.floor,Tt=e=>({x:e,y:e}),fy={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function Xa(e,t,n){return rt(e,an(t,n))}function Yt(e,t){return typeof e=="function"?e(t):e}function qt(e){return e.split("-")[0]}function Zn(e){return e.split("-")[1]}function Os(e){return e==="x"?"y":"x"}function As(e){return e==="y"?"height":"width"}const py=new Set(["top","bottom"]);function Et(e){return py.has(qt(e))?"y":"x"}function zs(e){return Os(Et(e))}function hy(e,t,n){n===void 0&&(n=!1);const r=Zn(e),o=zs(e),a=As(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=_o(s)),[s,_o(s)]}function _y(e){const t=_o(e);return[Ka(e),t,Ka(t)]}function Ka(e){return e.replace(/start|end/g,t=>my[t])}const rc=["left","right"],oc=["right","left"],gy=["top","bottom"],jy=["bottom","top"];function yy(e,t,n){switch(e){case"top":case"bottom":return n?t?oc:rc:t?rc:oc;case"left":case"right":return t?gy:jy;default:return[]}}function vy(e,t,n,r){const o=Zn(e);let a=yy(qt(e),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(Ka)))),a}function _o(e){return e.replace(/left|right|bottom|top/g,t=>fy[t])}function xy(e){return{top:0,right:0,bottom:0,left:0,...e}}function ju(e){return typeof e!="number"?xy(e):{top:e,right:e,bottom:e,left:e}}function go(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ac(e,t,n){let{reference:r,floating:o}=e;const a=Et(t),s=zs(t),i=As(s),l=qt(t),d=a==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,m=r[i]/2-o[i]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Zn(t)){case"start":p[s]-=m*(n&&d?-1:1);break;case"end":p[s]+=m*(n&&d?-1:1);break}return p}async function by(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:s,elements:i,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=Yt(t,e),g=ju(p),j=i[m?f==="floating"?"reference":"floating":f],y=go(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(j)))==null||n?j:j.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:d,rootBoundary:u,strategy:l})),x=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),w=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},S=go(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:b,strategy:l}):x);return{top:(y.top-S.top+g.top)/w.y,bottom:(S.bottom-y.bottom+g.bottom)/w.y,left:(y.left-S.left+g.left)/w.x,right:(S.right-y.right+g.right)/w.x}}const wy=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,i=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=ac(d,r,l),m=r,p={},g=0;for(let j=0;j<i.length;j++){var _;const{name:y,fn:x}=i[j],{x:b,y:w,data:S,reset:N}=await x({x:u,y:f,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:d,platform:{...s,detectOverflow:(_=s.detectOverflow)!=null?_:by},elements:{reference:e,floating:t}});u=b??u,f=w??f,p={...p,[y]:{...p[y],...S}},N&&g<=50&&(g++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:f}=ac(d,m,l)),j=-1)}return{x:u,y:f,placement:m,strategy:o,middlewareData:p}},Ny=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:s,elements:i,middlewareData:l}=t,{element:d,padding:u=0}=Yt(e,t)||{};if(d==null)return{};const f=ju(u),m={x:n,y:r},p=zs(o),g=As(p),_=await s.getDimensions(d),j=p==="y",y=j?"top":"left",x=j?"bottom":"right",b=j?"clientHeight":"clientWidth",w=a.reference[g]+a.reference[p]-m[p]-a.floating[g],S=m[p]-a.reference[p],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=N?N[b]:0;(!C||!await(s.isElement==null?void 0:s.isElement(N)))&&(C=i.floating[b]||a.floating[g]);const E=w/2-S/2,k=C/2-_[g]/2-1,M=an(f[y],k),D=an(f[x],k),T=M,$=C-_[g]-D,A=C/2-_[g]/2+E,H=Xa(T,A,$),W=!l.arrow&&Zn(o)!=null&&A!==H&&a.reference[g]/2-(A<T?M:D)-_[g]/2<0,Q=W?A<T?A-T:A-$:0;return{[p]:m[p]+Q,data:{[p]:H,centerOffset:A-H-Q,...W&&{alignmentOffset:Q}},reset:W}}}),Sy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:_=!0,...j}=Yt(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const y=qt(o),x=Et(i),b=qt(i)===i,w=await(l.isRTL==null?void 0:l.isRTL(d.floating)),S=m||(b||!_?[_o(i)]:_y(i)),N=g!=="none";!m&&N&&S.push(...vy(i,_,g,w));const C=[i,...S],E=await l.detectOverflow(t,j),k=[];let M=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&k.push(E[y]),f){const A=hy(o,s,w);k.push(E[A[0]],E[A[1]])}if(M=[...M,{placement:o,overflows:k}],!k.every(A=>A<=0)){var D,T;const A=(((D=a.flip)==null?void 0:D.index)||0)+1,H=C[A];if(H&&(!(f==="alignment"?x!==Et(H):!1)||M.every(G=>Et(G.placement)===x?G.overflows[0]>0:!0)))return{data:{index:A,overflows:M},reset:{placement:H}};let W=(T=M.filter(Q=>Q.overflows[0]<=0).sort((Q,G)=>Q.overflows[1]-G.overflows[1])[0])==null?void 0:T.placement;if(!W)switch(p){case"bestFit":{var $;const Q=($=M.filter(G=>{if(N){const z=Et(G.placement);return z===x||z==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(z=>z>0).reduce((z,oe)=>z+oe,0)]).sort((G,z)=>G[1]-z[1])[0])==null?void 0:$[0];Q&&(W=Q);break}case"initialPlacement":W=i;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function sc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ic(e){return uy.some(t=>e[t]>=0)}const Cy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...a}=Yt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...a,elementContext:"reference"}),i=sc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ic(i)}}}case"escaped":{const s=await r.detectOverflow(t,{...a,altBoundary:!0}),i=sc(s,n.floating);return{data:{escapedOffsets:i,escaped:ic(i)}}}default:return{}}}}},yu=new Set(["left","top"]);async function ky(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=qt(n),i=Zn(n),l=Et(n)==="y",d=yu.has(s)?-1:1,u=a&&l?-1:1,f=Yt(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof g=="number"&&(p=i==="end"?g*-1:g),l?{x:p*u,y:m*d}:{x:m*d,y:p*u}}const Py=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:s,middlewareData:i}=t,l=await ky(t,e);return s===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:s}}}}},Ey=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...d}=Yt(e,t),u={x:n,y:r},f=await a.detectOverflow(t,d),m=Et(qt(o)),p=Os(m);let g=u[p],_=u[m];if(s){const y=p==="y"?"top":"left",x=p==="y"?"bottom":"right",b=g+f[y],w=g-f[x];g=Xa(b,g,w)}if(i){const y=m==="y"?"top":"left",x=m==="y"?"bottom":"right",b=_+f[y],w=_-f[x];_=Xa(b,_,w)}const j=l.fn({...t,[p]:g,[m]:_});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[p]:s,[m]:i}}}}}},My=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:d=!0}=Yt(e,t),u={x:n,y:r},f=Et(o),m=Os(f);let p=u[m],g=u[f];const _=Yt(i,t),j=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(l){const b=m==="y"?"height":"width",w=a.reference[m]-a.floating[b]+j.mainAxis,S=a.reference[m]+a.reference[b]-j.mainAxis;p<w?p=w:p>S&&(p=S)}if(d){var y,x;const b=m==="y"?"width":"height",w=yu.has(qt(o)),S=a.reference[f]-a.floating[b]+(w&&((y=s.offset)==null?void 0:y[f])||0)+(w?0:j.crossAxis),N=a.reference[f]+a.reference[b]+(w?0:((x=s.offset)==null?void 0:x[f])||0)-(w?j.crossAxis:0);g<S?g=S:g>N&&(g=N)}return{[m]:p,[f]:g}}}},Dy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:s,elements:i}=t,{apply:l=()=>{},...d}=Yt(e,t),u=await s.detectOverflow(t,d),f=qt(o),m=Zn(o),p=Et(o)==="y",{width:g,height:_}=a.floating;let j,y;f==="top"||f==="bottom"?(j=f,y=m===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=f,j=m==="end"?"top":"bottom");const x=_-u.top-u.bottom,b=g-u.left-u.right,w=an(_-u[j],x),S=an(g-u[y],b),N=!t.middlewareData.shift;let C=w,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=x),N&&!m){const M=rt(u.left,0),D=rt(u.right,0),T=rt(u.top,0),$=rt(u.bottom,0);p?E=g-2*(M!==0||D!==0?M+D:rt(u.left,u.right)):C=_-2*(T!==0||$!==0?T+$:rt(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:C});const k=await s.getDimensions(i.floating);return g!==k.width||_!==k.height?{reset:{rects:!0}}:{}}}};function qo(){return typeof window<"u"}function er(e){return vu(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zt(e){var t;return(t=(vu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vu(e){return qo()?e instanceof Node||e instanceof ot(e).Node:!1}function xt(e){return qo()?e instanceof Element||e instanceof ot(e).Element:!1}function Ot(e){return qo()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function cc(e){return!qo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}const Ty=new Set(["inline","contents"]);function Or(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ty.has(o)}const Ry=new Set(["table","td","th"]);function Oy(e){return Ry.has(er(e))}const Ay=[":popover-open",":modal"];function Vo(e){return Ay.some(t=>{try{return e.matches(t)}catch{return!1}})}const zy=["transform","translate","scale","rotate","perspective"],Iy=["transform","translate","scale","rotate","perspective","filter"],Wy=["paint","layout","strict","content"];function Is(e){const t=Ws(),n=xt(e)?bt(e):e;return zy.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Iy.some(r=>(n.willChange||"").includes(r))||Wy.some(r=>(n.contain||"").includes(r))}function $y(e){let t=sn(e);for(;Ot(t)&&!Un(t);){if(Is(t))return t;if(Vo(t))return null;t=sn(t)}return null}function Ws(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Fy=new Set(["html","body","#document"]);function Un(e){return Fy.has(er(e))}function bt(e){return ot(e).getComputedStyle(e)}function Go(e){return xt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sn(e){if(er(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cc(e)&&e.host||zt(e);return cc(t)?t.host:t}function xu(e){const t=sn(e);return Un(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ot(t)&&Or(t)?t:xu(t)}function Nr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xu(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),s=ot(o);if(a){const i=Ja(s);return t.concat(s,s.visualViewport||[],Or(o)?o:[],i&&n?Nr(i):[])}return t.concat(o,Nr(o,[],n))}function Ja(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bu(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ot(e),a=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=ho(n)!==a||ho(r)!==s;return i&&(n=a,r=s),{width:n,height:r,$:i}}function $s(e){return xt(e)?e:e.contextElement}function Vn(e){const t=$s(e);if(!Ot(t))return Tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=bu(t);let s=(a?ho(n.width):n.width)/r,i=(a?ho(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const Ly=Tt(0);function wu(e){const t=ot(e);return!Ws()||!t.visualViewport?Ly:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function By(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=$s(e);let s=Tt(1);t&&(r?xt(r)&&(s=Vn(r)):s=Vn(e));const i=By(a,n,r)?wu(a):Tt(0);let l=(o.left+i.x)/s.x,d=(o.top+i.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(a){const m=ot(a),p=r&&xt(r)?ot(r):r;let g=m,_=Ja(g);for(;_&&r&&p!==g;){const j=Vn(_),y=_.getBoundingClientRect(),x=bt(_),b=y.left+(_.clientLeft+parseFloat(x.paddingLeft))*j.x,w=y.top+(_.clientTop+parseFloat(x.paddingTop))*j.y;l*=j.x,d*=j.y,u*=j.x,f*=j.y,l+=b,d+=w,g=ot(_),_=Ja(g)}}return go({width:u,height:f,x:l,y:d})}function Uo(e,t){const n=Go(e).scrollLeft;return t?t.left+n:wn(zt(e)).left+n}function Nu(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Uo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Hy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",s=zt(r),i=t?Vo(t.floating):!1;if(r===s||i&&a)return n;let l={scrollLeft:0,scrollTop:0},d=Tt(1);const u=Tt(0),f=Ot(r);if((f||!f&&!a)&&((er(r)!=="body"||Or(s))&&(l=Go(r)),Ot(r))){const p=wn(r);d=Vn(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const m=s&&!f&&!a?Nu(s,l):Tt(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x+m.x,y:n.y*d.y-l.scrollTop*d.y+u.y+m.y}}function Yy(e){return Array.from(e.getClientRects())}function qy(e){const t=zt(e),n=Go(e),r=e.ownerDocument.body,o=rt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=rt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Uo(e);const i=-n.scrollTop;return bt(r).direction==="rtl"&&(s+=rt(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:i}}const lc=25;function Vy(e,t){const n=ot(e),r=zt(e),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,i=0,l=0;if(o){a=o.width,s=o.height;const u=Ws();(!u||u&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}const d=Uo(r);if(d<=0){const u=r.ownerDocument,f=u.body,m=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-p);g<=lc&&(a-=g)}else d<=lc&&(a+=d);return{width:a,height:s,x:i,y:l}}const Gy=new Set(["absolute","fixed"]);function Uy(e,t){const n=wn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Ot(e)?Vn(e):Tt(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,l=o*a.x,d=r*a.y;return{width:s,height:i,x:l,y:d}}function dc(e,t,n){let r;if(t==="viewport")r=Vy(e,n);else if(t==="document")r=qy(zt(e));else if(xt(t))r=Uy(t,n);else{const o=wu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return go(r)}function Su(e,t){const n=sn(e);return n===t||!xt(n)||Un(n)?!1:bt(n).position==="fixed"||Su(n,t)}function Xy(e,t){const n=t.get(e);if(n)return n;let r=Nr(e,[],!1).filter(i=>xt(i)&&er(i)!=="body"),o=null;const a=bt(e).position==="fixed";let s=a?sn(e):e;for(;xt(s)&&!Un(s);){const i=bt(s),l=Is(s);!l&&i.position==="fixed"&&(o=null),(a?!l&&!o:!l&&i.position==="static"&&!!o&&Gy.has(o.position)||Or(s)&&!l&&Su(e,s))?r=r.filter(u=>u!==s):o=i,s=sn(s)}return t.set(e,r),r}function Ky(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Vo(t)?[]:Xy(t,this._c):[].concat(n),r],i=s[0],l=s.reduce((d,u)=>{const f=dc(t,u,o);return d.top=rt(f.top,d.top),d.right=an(f.right,d.right),d.bottom=an(f.bottom,d.bottom),d.left=rt(f.left,d.left),d},dc(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Jy(e){const{width:t,height:n}=bu(e);return{width:t,height:n}}function Qy(e,t,n){const r=Ot(t),o=zt(t),a=n==="fixed",s=wn(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const l=Tt(0);function d(){l.x=Uo(o)}if(r||!r&&!a)if((er(t)!=="body"||Or(o))&&(i=Go(t)),r){const p=wn(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&d();a&&!r&&o&&d();const u=o&&!r&&!a?Nu(o,i):Tt(0),f=s.left+i.scrollLeft-l.x-u.x,m=s.top+i.scrollTop-l.y-u.y;return{x:f,y:m,width:s.width,height:s.height}}function Ma(e){return bt(e).position==="static"}function uc(e,t){if(!Ot(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zt(e)===n&&(n=n.ownerDocument.body),n}function Cu(e,t){const n=ot(e);if(Vo(e))return n;if(!Ot(e)){let o=sn(e);for(;o&&!Un(o);){if(xt(o)&&!Ma(o))return o;o=sn(o)}return n}let r=uc(e,t);for(;r&&Oy(r)&&Ma(r);)r=uc(r,t);return r&&Un(r)&&Ma(r)&&!Is(r)?n:r||$y(e)||n}const Zy=async function(e){const t=this.getOffsetParent||Cu,n=this.getDimensions,r=await n(e.floating);return{reference:Qy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ev(e){return bt(e).direction==="rtl"}const tv={convertOffsetParentRelativeRectToViewportRelativeRect:Hy,getDocumentElement:zt,getClippingRect:Ky,getOffsetParent:Cu,getElementRects:Zy,getClientRects:Yy,getDimensions:Jy,getScale:Vn,isElement:xt,isRTL:ev};function ku(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nv(e,t){let n=null,r;const o=zt(e);function a(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),a();const d=e.getBoundingClientRect(),{left:u,top:f,width:m,height:p}=d;if(i||t(),!m||!p)return;const g=Xr(f),_=Xr(o.clientWidth-(u+m)),j=Xr(o.clientHeight-(f+p)),y=Xr(u),b={rootMargin:-g+"px "+-_+"px "+-j+"px "+-y+"px",threshold:rt(0,an(1,l))||1};let w=!0;function S(N){const C=N[0].intersectionRatio;if(C!==l){if(!w)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!ku(d,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(S,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(e)}return s(!0),a}function rv(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,d=$s(e),u=o||a?[...d?Nr(d):[],...Nr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),a&&y.addEventListener("resize",n)});const f=d&&i?nv(d,n):null;let m=-1,p=null;s&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),d&&!l&&p.observe(d),p.observe(t));let g,_=l?wn(e):null;l&&j();function j(){const y=wn(e);_&&!ku(_,y)&&n(),_=y,g=requestAnimationFrame(j)}return n(),()=>{var y;u.forEach(x=>{o&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const ov=Py,av=Ey,sv=Sy,iv=Dy,cv=Cy,fc=Ny,lv=My,dv=(e,t,n)=>{const r=new Map,o={platform:tv,...n},a={...o.platform,_c:r};return wy(e,t,{...o,platform:a})};var uv=typeof document<"u",fv=function(){},ao=uv?v.useLayoutEffect:fv;function jo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!jo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!jo(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Pu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mc(e,t){const n=Pu(e);return Math.round(t*n)/n}function Da(e){const t=h.useRef(e);return ao(()=>{t.current=e}),t}function mv(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:l,open:d}=e,[u,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(r);jo(m,r)||p(r);const[g,_]=h.useState(null),[j,y]=h.useState(null),x=h.useCallback(G=>{G!==N.current&&(N.current=G,_(G))},[]),b=h.useCallback(G=>{G!==C.current&&(C.current=G,y(G))},[]),w=a||g,S=s||j,N=h.useRef(null),C=h.useRef(null),E=h.useRef(u),k=l!=null,M=Da(l),D=Da(o),T=Da(d),$=h.useCallback(()=>{if(!N.current||!C.current)return;const G={placement:t,strategy:n,middleware:m};D.current&&(G.platform=D.current),dv(N.current,C.current,G).then(z=>{const oe={...z,isPositioned:T.current!==!1};A.current&&!jo(E.current,oe)&&(E.current=oe,Co.flushSync(()=>{f(oe)}))})},[m,t,n,D,T]);ao(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[d]);const A=h.useRef(!1);ao(()=>(A.current=!0,()=>{A.current=!1}),[]),ao(()=>{if(w&&(N.current=w),S&&(C.current=S),w&&S){if(M.current)return M.current(w,S,$);$()}},[w,S,$,M,k]);const H=h.useMemo(()=>({reference:N,floating:C,setReference:x,setFloating:b}),[x,b]),W=h.useMemo(()=>({reference:w,floating:S}),[w,S]),Q=h.useMemo(()=>{const G={position:n,left:0,top:0};if(!W.floating)return G;const z=mc(W.floating,u.x),oe=mc(W.floating,u.y);return i?{...G,transform:"translate("+z+"px, "+oe+"px)",...Pu(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:oe}},[n,i,W.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:$,refs:H,elements:W,floatingStyles:Q}),[u,$,H,W,Q])}const pv=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fc({element:r.current,padding:o}).fn(n):{}:r?fc({element:r,padding:o}).fn(n):{}}}},hv=(e,t)=>({...ov(e),options:[e,t]}),_v=(e,t)=>({...av(e),options:[e,t]}),gv=(e,t)=>({...lv(e),options:[e,t]}),jv=(e,t)=>({...sv(e),options:[e,t]}),yv=(e,t)=>({...iv(e),options:[e,t]}),vv=(e,t)=>({...cv(e),options:[e,t]}),xv=(e,t)=>({...pv(e),options:[e,t]});var bv="Arrow",Eu=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return c.jsx(se.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Eu.displayName=bv;var wv=Eu;function Fs(e){const[t,n]=h.useState(void 0);return Ye(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const l=a.borderBoxSize,d=Array.isArray(l)?l[0]:l;s=d.inlineSize,i=d.blockSize}else s=e.offsetWidth,i=e.offsetHeight;n({width:s,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ls="Popper",[Mu,Xo]=st(Ls),[Nv,Du]=Mu(Ls),Tu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return c.jsx(Nv,{scope:t,anchor:r,onAnchorChange:o,children:n})};Tu.displayName=Ls;var Ru="PopperAnchor",Ou=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=Du(Ru,n),s=h.useRef(null),i=he(t,s),l=h.useRef(null);return h.useEffect(()=>{const d=l.current;l.current=(r==null?void 0:r.current)||s.current,d!==l.current&&a.onAnchorChange(l.current)}),r?null:c.jsx(se.div,{...o,ref:i})});Ou.displayName=Ru;var Bs="PopperContent",[Sv,Cv]=Mu(Bs),Au=h.forwardRef((e,t)=>{var P,O,B,L,V,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:g,..._}=e,j=Du(Bs,n),[y,x]=h.useState(null),b=he(t,ae=>x(ae)),[w,S]=h.useState(null),N=Fs(w),C=(N==null?void 0:N.width)??0,E=(N==null?void 0:N.height)??0,k=r+(a!=="center"?"-"+a:""),M=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(d)?d:[d],T=D.length>0,$={padding:M,boundary:D.filter(Pv),altBoundary:T},{refs:A,floatingStyles:H,placement:W,isPositioned:Q,middlewareData:G}=mv({strategy:"fixed",placement:k,whileElementsMounted:(...ae)=>rv(...ae,{animationFrame:p==="always"}),elements:{reference:j.anchor},middleware:[hv({mainAxis:o+E,alignmentAxis:s}),l&&_v({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?gv():void 0,...$}),l&&jv({...$}),yv({...$,apply:({elements:ae,rects:_e,availableWidth:Se,availableHeight:Me})=>{const{width:Be,height:ke}=_e.reference,ft=ae.floating.style;ft.setProperty("--radix-popper-available-width",`${Se}px`),ft.setProperty("--radix-popper-available-height",`${Me}px`),ft.setProperty("--radix-popper-anchor-width",`${Be}px`),ft.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),w&&xv({element:w,padding:i}),Ev({arrowWidth:C,arrowHeight:E}),m&&vv({strategy:"referenceHidden",...$})]}),[z,oe]=Wu(W),le=Ue(g);Ye(()=>{Q&&(le==null||le())},[Q,le]);const ie=(P=G.arrow)==null?void 0:P.x,R=(O=G.arrow)==null?void 0:O.y,I=((B=G.arrow)==null?void 0:B.centerOffset)!==0,[Y,U]=h.useState();return Ye(()=>{y&&U(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(L=G.transformOrigin)==null?void 0:L.x,(V=G.transformOrigin)==null?void 0:V.y].join(" "),...((ee=G.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Sv,{scope:n,placedSide:z,onArrowChange:S,arrowX:ie,arrowY:R,shouldHideArrow:I,children:c.jsx(se.div,{"data-side":z,"data-align":oe,..._,ref:b,style:{..._.style,animation:Q?void 0:"none"}})})})});Au.displayName=Bs;var zu="PopperArrow",kv={top:"bottom",right:"left",bottom:"top",left:"right"},Iu=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=Cv(zu,r),s=kv[a.placedSide];return c.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:c.jsx(wv,{...o,ref:n,style:{...o.style,display:"block"}})})});Iu.displayName=zu;function Pv(e){return e!==null}var Ev=e=>({name:"transformOrigin",options:e,fn(t){var j,y,x;const{placement:n,rects:r,middlewareData:o}=t,s=((j=o.arrow)==null?void 0:j.centerOffset)!==0,i=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[d,u]=Wu(n),f={start:"0%",center:"50%",end:"100%"}[u],m=(((y=o.arrow)==null?void 0:y.x)??0)+i/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let g="",_="";return d==="bottom"?(g=s?f:`${m}px`,_=`${-l}px`):d==="top"?(g=s?f:`${m}px`,_=`${r.floating.height+l}px`):d==="right"?(g=`${-l}px`,_=s?f:`${p}px`):d==="left"&&(g=`${r.floating.width+l}px`,_=s?f:`${p}px`),{data:{x:g,y:_}}}});function Wu(e){const[t,n="center"]=e.split("-");return[t,n]}var $u=Tu,Hs=Ou,Fu=Au,Lu=Iu;function Mv(e){const t=Dv(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(Rv);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Dv(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=Av(o),i=Ov(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tv=Symbol("radix.slottable");function Rv(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tv}function Ov(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Av(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ys(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Bu=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),zv="VisuallyHidden",Iv=h.forwardRef((e,t)=>c.jsx(se.span,{...e,ref:t,style:{...Bu,...e.style}}));Iv.displayName=zv;var Wv=[" ","Enter","ArrowUp","ArrowDown"],$v=[" ","Enter"],Nn="Select",[Ko,Jo,Fv]=nl(Nn),[tr]=st(Nn,[Fv,Xo]),Qo=Xo(),[Lv,ln]=tr(Nn),[Bv,Hv]=tr(Nn),Hu=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:i,onValueChange:l,dir:d,name:u,autoComplete:f,disabled:m,required:p,form:g}=e,_=Qo(t),[j,y]=h.useState(null),[x,b]=h.useState(null),[w,S]=h.useState(!1),N=kr(d),[C,E]=Ht({prop:r,defaultProp:o??!1,onChange:a,caller:Nn}),[k,M]=Ht({prop:s,defaultProp:i,onChange:l,caller:Nn}),D=h.useRef(null),T=j?g||!!j.closest("form"):!0,[$,A]=h.useState(new Set),H=Array.from($).map(W=>W.props.value).join(";");return c.jsx($u,{..._,children:c.jsxs(Lv,{required:p,scope:t,trigger:j,onTriggerChange:y,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:Dt(),value:k,onValueChange:M,open:C,onOpenChange:E,dir:N,triggerPointerDownPosRef:D,disabled:m,children:[c.jsx(Ko.Provider,{scope:t,children:c.jsx(Bv,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(W=>{A(Q=>new Set(Q).add(W))},[]),onNativeOptionRemove:h.useCallback(W=>{A(Q=>{const G=new Set(Q);return G.delete(W),G})},[]),children:n})}),T?c.jsxs(pf,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:W=>M(W.target.value),disabled:m,form:g,children:[k===void 0?c.jsx("option",{value:""}):null,Array.from($)]},H):null]})})};Hu.displayName=Nn;var Yu="SelectTrigger",qu=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=Qo(n),s=ln(Yu,n),i=s.disabled||r,l=he(t,s.onTriggerChange),d=Jo(n),u=h.useRef("touch"),[f,m,p]=_f(_=>{const j=d().filter(b=>!b.disabled),y=j.find(b=>b.value===s.value),x=gf(j,_,y);x!==void 0&&s.onValueChange(x.value)}),g=_=>{i||(s.onOpenChange(!0),p()),_&&(s.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return c.jsx(Hs,{asChild:!0,...a,children:c.jsx(se.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":hf(s.value)?"":void 0,...o,ref:l,onClick:re(o.onClick,_=>{_.currentTarget.focus(),u.current!=="mouse"&&g(_)}),onPointerDown:re(o.onPointerDown,_=>{u.current=_.pointerType;const j=_.target;j.hasPointerCapture(_.pointerId)&&j.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(g(_),_.preventDefault())}),onKeyDown:re(o.onKeyDown,_=>{const j=f.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&m(_.key),!(j&&_.key===" ")&&Wv.includes(_.key)&&(g(),_.preventDefault())})})})});qu.displayName=Yu;var Vu="SelectValue",Gu=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...i}=e,l=ln(Vu,n),{onValueNodeHasChildrenChange:d}=l,u=a!==void 0,f=he(t,l.onValueNodeChange);return Ye(()=>{d(u)},[d,u]),c.jsx(se.span,{...i,ref:f,style:{pointerEvents:"none"},children:hf(l.value)?c.jsx(c.Fragment,{children:s}):a})});Gu.displayName=Vu;var Yv="SelectIcon",Uu=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(se.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Uu.displayName=Yv;var qv="SelectPortal",Xu=e=>c.jsx(Fo,{asChild:!0,...e});Xu.displayName=qv;var Sn="SelectContent",Ku=h.forwardRef((e,t)=>{const n=ln(Sn,e.__scopeSelect),[r,o]=h.useState();if(Ye(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?Co.createPortal(c.jsx(Ju,{scope:e.__scopeSelect,children:c.jsx(Ko.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),a):null}return c.jsx(Qu,{...e,ref:t})});Ku.displayName=Sn;var _t=10,[Ju,dn]=tr(Sn),Vv="SelectContentImpl",Gv=Mv("SelectContent.RemoveScroll"),Qu=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:i,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:g,hideWhenDetached:_,avoidCollisions:j,...y}=e,x=ln(Sn,n),[b,w]=h.useState(null),[S,N]=h.useState(null),C=he(t,P=>w(P)),[E,k]=h.useState(null),[M,D]=h.useState(null),T=Jo(n),[$,A]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(b)return Ps(b)},[b]),ks();const W=h.useCallback(P=>{const[O,...B]=T().map(ee=>ee.ref.current),[L]=B.slice(-1),V=document.activeElement;for(const ee of P)if(ee===V||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===O&&S&&(S.scrollTop=0),ee===L&&S&&(S.scrollTop=S.scrollHeight),ee==null||ee.focus(),document.activeElement!==V))return},[T,S]),Q=h.useCallback(()=>W([E,b]),[W,E,b]);h.useEffect(()=>{$&&Q()},[$,Q]);const{onOpenChange:G,triggerPointerDownPosRef:z}=x;h.useEffect(()=>{if(b){let P={x:0,y:0};const O=L=>{var V,ee;P={x:Math.abs(Math.round(L.pageX)-(((V=z.current)==null?void 0:V.x)??0)),y:Math.abs(Math.round(L.pageY)-(((ee=z.current)==null?void 0:ee.y)??0))}},B=L=>{P.x<=10&&P.y<=10?L.preventDefault():b.contains(L.target)||G(!1),document.removeEventListener("pointermove",O),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",B,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",B,{capture:!0})}}},[b,G,z]),h.useEffect(()=>{const P=()=>G(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[G]);const[oe,le]=_f(P=>{const O=T().filter(V=>!V.disabled),B=O.find(V=>V.ref.current===document.activeElement),L=gf(O,P,B);L&&setTimeout(()=>L.ref.current.focus())}),ie=h.useCallback((P,O,B)=>{const L=!H.current&&!B;(x.value!==void 0&&x.value===O||L)&&(k(P),L&&(H.current=!0))},[x.value]),R=h.useCallback(()=>b==null?void 0:b.focus(),[b]),I=h.useCallback((P,O,B)=>{const L=!H.current&&!B;(x.value!==void 0&&x.value===O||L)&&D(P)},[x.value]),Y=r==="popper"?Qa:Zu,U=Y===Qa?{side:i,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:g,hideWhenDetached:_,avoidCollisions:j}:{};return c.jsx(Ju,{scope:n,content:b,viewport:S,onViewportChange:N,itemRefCallback:ie,selectedItem:E,onItemLeave:R,itemTextRefCallback:I,focusSelectedItem:Q,selectedItemText:M,position:r,isPositioned:$,searchRef:oe,children:c.jsx(Bo,{as:Gv,allowPinchZoom:!0,children:c.jsx($o,{asChild:!0,trapped:x.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:re(o,P=>{var O;(O=x.trigger)==null||O.focus({preventScroll:!0}),P.preventDefault()}),children:c.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:c.jsx(Y,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:P=>P.preventDefault(),...y,...U,onPlaced:()=>A(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:re(y.onKeyDown,P=>{const O=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!O&&P.key.length===1&&le(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let L=T().filter(V=>!V.disabled).map(V=>V.ref.current);if(["ArrowUp","End"].includes(P.key)&&(L=L.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const V=P.target,ee=L.indexOf(V);L=L.slice(ee+1)}setTimeout(()=>W(L)),P.preventDefault()}})})})})})})});Qu.displayName=Vv;var Uv="SelectItemAlignedPosition",Zu=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=ln(Sn,n),s=dn(Sn,n),[i,l]=h.useState(null),[d,u]=h.useState(null),f=he(t,C=>u(C)),m=Jo(n),p=h.useRef(!1),g=h.useRef(!0),{viewport:_,selectedItem:j,selectedItemText:y,focusSelectedItem:x}=s,b=h.useCallback(()=>{if(a.trigger&&a.valueNode&&i&&d&&_&&j&&y){const C=a.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(a.dir!=="rtl"){const V=M.left-E.left,ee=k.left-V,ae=C.left-ee,_e=C.width+ae,Se=Math.max(_e,E.width),Me=window.innerWidth-_t,Be=qa(ee,[_t,Math.max(_t,Me-Se)]);i.style.minWidth=_e+"px",i.style.left=Be+"px"}else{const V=E.right-M.right,ee=window.innerWidth-k.right-V,ae=window.innerWidth-C.right-ee,_e=C.width+ae,Se=Math.max(_e,E.width),Me=window.innerWidth-_t,Be=qa(ee,[_t,Math.max(_t,Me-Se)]);i.style.minWidth=_e+"px",i.style.right=Be+"px"}const D=m(),T=window.innerHeight-_t*2,$=_.scrollHeight,A=window.getComputedStyle(d),H=parseInt(A.borderTopWidth,10),W=parseInt(A.paddingTop,10),Q=parseInt(A.borderBottomWidth,10),G=parseInt(A.paddingBottom,10),z=H+W+$+G+Q,oe=Math.min(j.offsetHeight*5,z),le=window.getComputedStyle(_),ie=parseInt(le.paddingTop,10),R=parseInt(le.paddingBottom,10),I=C.top+C.height/2-_t,Y=T-I,U=j.offsetHeight/2,P=j.offsetTop+U,O=H+W+P,B=z-O;if(O<=I){const V=D.length>0&&j===D[D.length-1].ref.current;i.style.bottom="0px";const ee=d.clientHeight-_.offsetTop-_.offsetHeight,ae=Math.max(Y,U+(V?R:0)+ee+Q),_e=O+ae;i.style.height=_e+"px"}else{const V=D.length>0&&j===D[0].ref.current;i.style.top="0px";const ae=Math.max(I,H+_.offsetTop+(V?ie:0)+U)+B;i.style.height=ae+"px",_.scrollTop=O-I+_.offsetTop}i.style.margin=`${_t}px 0`,i.style.minHeight=oe+"px",i.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[m,a.trigger,a.valueNode,i,d,_,j,y,a.dir,r]);Ye(()=>b(),[b]);const[w,S]=h.useState();Ye(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const N=h.useCallback(C=>{C&&g.current===!0&&(b(),x==null||x(),g.current=!1)},[b,x]);return c.jsx(Kv,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:c.jsx(se.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Zu.displayName=Uv;var Xv="SelectPopperPosition",Qa=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=_t,...a}=e,s=Qo(n);return c.jsx(Fu,{...s,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Qa.displayName=Xv;var[Kv,qs]=tr(Sn,{}),Za="SelectViewport",ef=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=dn(Za,n),s=qs(Za,n),i=he(t,a.onViewportChange),l=h.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(Ko.Slot,{scope:n,children:c.jsx(se.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:re(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&f){const p=Math.abs(l.current-u.scrollTop);if(p>0){const g=window.innerHeight-_t*2,_=parseFloat(f.style.minHeight),j=parseFloat(f.style.height),y=Math.max(_,j);if(y<g){const x=y+p,b=Math.min(g,x),w=x-b;f.style.height=b+"px",f.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});ef.displayName=Za;var tf="SelectGroup",[Jv,Qv]=tr(tf),Zv=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Dt();return c.jsx(Jv,{scope:n,id:o,children:c.jsx(se.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Zv.displayName=tf;var nf="SelectLabel",rf=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qv(nf,n);return c.jsx(se.div,{id:o.id,...r,ref:t})});rf.displayName=nf;var yo="SelectItem",[ex,of]=tr(yo),af=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=e,i=ln(yo,n),l=dn(yo,n),d=i.value===r,[u,f]=h.useState(a??""),[m,p]=h.useState(!1),g=he(t,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,r,o)}),_=Dt(),j=h.useRef("touch"),y=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(ex,{scope:n,value:r,disabled:o,textId:_,isSelected:d,onItemTextChange:h.useCallback(x=>{f(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:c.jsx(Ko.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:c.jsx(se.div,{role:"option","aria-labelledby":_,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:re(s.onFocus,()=>p(!0)),onBlur:re(s.onBlur,()=>p(!1)),onClick:re(s.onClick,()=>{j.current!=="mouse"&&y()}),onPointerUp:re(s.onPointerUp,()=>{j.current==="mouse"&&y()}),onPointerDown:re(s.onPointerDown,x=>{j.current=x.pointerType}),onPointerMove:re(s.onPointerMove,x=>{var b;j.current=x.pointerType,o?(b=l.onItemLeave)==null||b.call(l):j.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(s.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:re(s.onKeyDown,x=>{var w;((w=l.searchRef)==null?void 0:w.current)!==""&&x.key===" "||($v.includes(x.key)&&y(),x.key===" "&&x.preventDefault())})})})})});af.displayName=yo;var _r="SelectItemText",sf=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,s=ln(_r,n),i=dn(_r,n),l=of(_r,n),d=Hv(_r,n),[u,f]=h.useState(null),m=he(t,y=>f(y),l.onItemTextChange,y=>{var x;return(x=i.itemTextRefCallback)==null?void 0:x.call(i,y,l.value,l.disabled)}),p=u==null?void 0:u.textContent,g=h.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:_,onNativeOptionRemove:j}=d;return Ye(()=>(_(g),()=>j(g)),[_,j,g]),c.jsxs(c.Fragment,{children:[c.jsx(se.span,{id:l.textId,...a,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Co.createPortal(a.children,s.valueNode):null]})});sf.displayName=_r;var cf="SelectItemIndicator",lf=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return of(cf,n).isSelected?c.jsx(se.span,{"aria-hidden":!0,...r,ref:t}):null});lf.displayName=cf;var es="SelectScrollUpButton",df=h.forwardRef((e,t)=>{const n=dn(es,e.__scopeSelect),r=qs(es,e.__scopeSelect),[o,a]=h.useState(!1),s=he(t,r.onScrollButtonChange);return Ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=l.scrollTop>0;a(d)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(ff,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});df.displayName=es;var ts="SelectScrollDownButton",uf=h.forwardRef((e,t)=>{const n=dn(ts,e.__scopeSelect),r=qs(ts,e.__scopeSelect),[o,a]=h.useState(!1),s=he(t,r.onScrollButtonChange);return Ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;a(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(ff,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});uf.displayName=ts;var ff=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=dn("SelectScrollButton",n),s=h.useRef(null),i=Jo(n),l=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>l(),[l]),Ye(()=>{var u;const d=i().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[i]),c.jsx(se.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:re(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:re(o.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:re(o.onPointerLeave,()=>{l()})})}),tx="SelectSeparator",mf=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(se.div,{"aria-hidden":!0,...r,ref:t})});mf.displayName=tx;var ns="SelectArrow",nx=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qo(n),a=ln(ns,n),s=dn(ns,n);return a.open&&s.position==="popper"?c.jsx(Lu,{...o,...r,ref:t}):null});nx.displayName=ns;var rx="SelectBubbleInput",pf=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),a=he(r,o),s=Ys(t);return h.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(f)}},[s,t]),c.jsx(se.select,{...n,style:{...Bu,...n.style},ref:a,defaultValue:t})});pf.displayName=rx;function hf(e){return e===""||e===void 0}function _f(e){const t=Ue(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const i=n.current+s;t(i),function l(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(i)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function gf(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=ox(e,Math.max(a,0));o.length===1&&(s=s.filter(d=>d!==n));const l=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function ox(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ax=Hu,jf=qu,sx=Gu,ix=Uu,cx=Xu,yf=Ku,lx=ef,vf=rf,xf=af,dx=sf,ux=lf,bf=df,wf=uf,Nf=mf;const Zo=v.createContext(null);function ea(){return v.useContext(Zo)}const Oe=ax,Ae=sx,Pe=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(jf,{ref:r,className:ne("cj-flex cj-h-10 cj-w-full cj-items-center cj-justify-between cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-sm cj-ring-offset-background placeholder:cj-text-muted-foreground focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 [&>span]:cj-line-clamp-1",e),...n,children:[t,c.jsx(ix,{asChild:!0,children:c.jsx(on,{className:"cj-h-4 cj-w-4 cj-opacity-50"})})]}));Pe.displayName=jf.displayName;const Sf=h.forwardRef(({className:e,...t},n)=>c.jsx(bf,{ref:n,className:ne("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:c.jsx(co,{className:"cj-h-4 cj-w-4"})}));Sf.displayName=bf.displayName;const Cf=h.forwardRef(({className:e,...t},n)=>c.jsx(wf,{ref:n,className:ne("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:c.jsx(on,{className:"cj-h-4 cj-w-4"})}));Cf.displayName=wf.displayName;const Ee=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>{const a=ea();return c.jsx(cx,{container:a??void 0,children:c.jsxs(yf,{ref:o,className:ne("cj-relative cj-z-50 cj-max-h-96 cj-min-w-[8rem] cj-overflow-hidden cj-rounded-md cj-border cj-bg-popover cj-text-popover-foreground cj-shadow-md data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:cj-translate-y-1 data-[side=left]:-cj-translate-x-1 data-[side=right]:cj-translate-x-1 data-[side=top]:-cj-translate-y-1",e),position:n,...r,children:[c.jsx(Sf,{}),c.jsx(lx,{className:ne("cj-p-1",n==="popper"&&"cj-h-[var(--radix-select-trigger-height)] cj-w-full cj-min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(Cf,{})]})})});Ee.displayName=yf.displayName;const fx=h.forwardRef(({className:e,...t},n)=>c.jsx(vf,{ref:n,className:ne("cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-font-semibold",e),...t}));fx.displayName=vf.displayName;const K=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(xf,{ref:r,className:ne("cj-relative cj-flex cj-w-full cj-cursor-default cj-select-none cj-items-center cj-rounded-sm cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-outline-none data-[disabled]:cj-pointer-events-none data-[disabled]:cj-opacity-50 focus:cj-bg-accent focus:cj-text-accent-foreground",e),...n,children:[c.jsx("span",{className:"cj-absolute cj-left-2 cj-flex cj-h-3.5 cj-w-3.5 cj-items-center cj-justify-center",children:c.jsx(ux,{children:c.jsx(l_,{className:"cj-h-4 cj-w-4"})})}),c.jsx(dx,{children:t})]}));K.displayName=xf.displayName;const mx=h.forwardRef(({className:e,...t},n)=>c.jsx(Nf,{ref:n,className:ne("-cj-mx-1 cj-my-1 cj-h-px cj-bg-muted",e),...t}));mx.displayName=Nf.displayName;const vr={v1_string:{label:"String",color:"cj-bg-blue-500"},"v2_single_option_select-1":{label:"Single Select",color:"cj-bg-purple-500"},"v2_date-1":{label:"Date",color:"cj-bg-green-500"},"v2_time-1":{label:"Time",color:"cj-bg-lime-500"},"v2_datetime-1":{label:"Date & Time",color:"cj-bg-cyan-500"},"v2_currency-1":{label:"Currency",color:"cj-bg-yellow-500"},v2_single_asset_upload:{label:"Upload",color:"cj-bg-orange-500"},"v2_phone-1":{label:"Phone",color:"cj-bg-teal-500"},"v2_email-1":{label:"Email",color:"cj-bg-rose-500"},v2_address_coordinates:{label:"Location",color:"cj-bg-emerald-500"},"v2_boolean-1":{label:"Boolean",color:"cj-bg-indigo-500"}};function ta(e){return vr[e]||{label:e,color:"cj-bg-muted"}}const rs=Ts,px=Rs,kf=h.forwardRef(({className:e,...t},n)=>{const r=ea();return c.jsx(Er,{ref:n,className:ne(r?"cj-absolute cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0":"cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t})});kf.displayName=Er.displayName;const vo=h.forwardRef(({className:e,children:t,...n},r)=>{const o=ea(),a=o?"cj-absolute cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 sm:cj-rounded-lg":"cj-fixed cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[state=closed]:cj-slide-out-to-left-1/2 data-[state=closed]:cj-slide-out-to-top-[48%] data-[state=open]:cj-slide-in-from-left-1/2 data-[state=open]:cj-slide-in-from-top-[48%] sm:cj-rounded-lg";return c.jsxs(px,{container:o??void 0,children:[c.jsx(kf,{}),c.jsxs(Mr,{ref:r,className:ne(a,e),...n,children:[t,c.jsxs(Yo,{className:"cj-absolute cj-right-4 cj-top-4 cj-rounded-sm cj-opacity-70 cj-ring-offset-background cj-transition-opacity data-[state=open]:cj-bg-accent data-[state=open]:cj-text-muted-foreground hover:cj-opacity-100 focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-pointer-events-none",children:[c.jsx(Vt,{className:"cj-h-4 cj-w-4"}),c.jsx("span",{className:"cj-sr-only",children:"Close"})]})]})]})});vo.displayName=Mr.displayName;const Vs=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col cj-space-y-1.5 cj-text-center sm:cj-text-left",e),...t});Vs.displayName="DialogHeader";const Gs=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col-reverse sm:cj-flex-row sm:cj-justify-end sm:cj-space-x-2",e),...t});Gs.displayName="DialogFooter";const Us=h.forwardRef(({className:e,...t},n)=>c.jsx(Dr,{ref:n,className:ne("cj-text-lg cj-font-semibold cj-leading-none cj-tracking-tight",e),...t}));Us.displayName=Dr.displayName;const Pf=h.forwardRef(({className:e,...t},n)=>c.jsx(Tr,{ref:n,className:ne("cj-text-sm cj-text-muted-foreground",e),...t}));Pf.displayName=Tr.displayName;var na="Switch",[hx]=st(na),[_x,gx]=hx(na),Ef=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:a,required:s,disabled:i,value:l="on",onCheckedChange:d,form:u,...f}=e,[m,p]=h.useState(null),g=he(t,b=>p(b)),_=h.useRef(!1),j=m?u||!!m.closest("form"):!0,[y,x]=Ht({prop:o,defaultProp:a??!1,onChange:d,caller:na});return c.jsxs(_x,{scope:n,checked:y,disabled:i,children:[c.jsx(se.button,{type:"button",role:"switch","aria-checked":y,"aria-required":s,"data-state":Rf(y),"data-disabled":i?"":void 0,disabled:i,value:l,...f,ref:g,onClick:re(e.onClick,b=>{x(w=>!w),j&&(_.current=b.isPropagationStopped(),_.current||b.stopPropagation())})}),j&&c.jsx(Tf,{control:m,bubbles:!_.current,name:r,value:l,checked:y,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});Ef.displayName=na;var Mf="SwitchThumb",Df=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=gx(Mf,n);return c.jsx(se.span,{"data-state":Rf(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Df.displayName=Mf;var jx="SwitchBubbleInput",Tf=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=h.useRef(null),i=he(s,a),l=Ys(n),d=Fs(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&p){const g=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(g)}},[l,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Tf.displayName=jx;function Rf(e){return e?"checked":"unchecked"}var Of=Ef,yx=Df;const Cn=h.forwardRef(({className:e,...t},n)=>c.jsx(Of,{className:ne("cj-peer cj-inline-flex cj-h-6 cj-w-11 cj-shrink-0 cj-cursor-pointer cj-items-center cj-rounded-full cj-border-2 cj-border-transparent cj-transition-colors data-[state=checked]:cj-bg-primary data-[state=unchecked]:cj-bg-input focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 focus-visible:cj-ring-offset-background disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,ref:n,children:c.jsx(yx,{className:ne("cj-pointer-events-none cj-block cj-h-5 cj-w-5 cj-rounded-full cj-bg-background cj-shadow-lg cj-ring-0 cj-transition-transform data-[state=checked]:cj-translate-x-5 data-[state=unchecked]:cj-translate-x-0")})}));Cn.displayName=Of.displayName;var vx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xx=vx.reduce((e,t)=>{const n=ko(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),bx="Separator",pc="horizontal",wx=["horizontal","vertical"],Af=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=pc,...o}=e,a=Nx(r)?r:pc,i=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return c.jsx(xx.div,{"data-orientation":a,...i,...o,ref:t})});Af.displayName=bx;function Nx(e){return wx.includes(e)}var zf=Af;const so=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>c.jsx(zf,{ref:o,decorative:n,orientation:t,className:ne("cj-shrink-0 cj-bg-border",t==="horizontal"?"cj-h-[1px] cj-w-full":"cj-h-full cj-w-[1px]",e),...r}));so.displayName=zf.displayName;function If({fieldId:e,open:t,onOpenChange:n}){const{t:r}=je(),{formConfig:o,updateField:a,deleteField:s}=wt(),i=v.useMemo(()=>o.fields.find(w=>w.field_id===e)||null,[o.fields,e]),[l,d]=v.useState(i),[u,f]=v.useState(!1);if(v.useEffect(()=>{d(i)},[i]),!l||!i)return c.jsx(rs,{open:t,onOpenChange:n,children:c.jsx(vo,{children:c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:r("fc_field_no_selected")})})});const m=ta(l.schema),p=l.schema==="v2_single_option_select-1",g=l.schema==="v2_boolean-1"||l.widget==="boolean"||l.widget==="switch",_=l.schema==="v2_single_asset_upload"||l.widget==="upload",j=l.schema==="v2_date-1"||l.schema==="v2_datetime-1"||l.widget==="datepicker"||l.widget==="datetimepicker",y=w=>{d(S=>S&&{...S,...w}),a(i.field_id,w)},x=l.options||[],b=l.uploadConfig||{};return c.jsxs(rs,{open:t,onOpenChange:n,children:[c.jsxs(vo,{className:"cj-max-w-2xl cj-max-h-[85vh] cj-flex cj-flex-col",children:[c.jsx(Vs,{children:c.jsxs(Us,{className:"cj-flex cj-items-center cj-gap-2",children:[r("fc_field_props"),c.jsx(jt,{variant:"secondary",className:`${m.color} cj-text-white`,children:m.label})]})}),c.jsx(Rt,{className:"cj-flex-1 cj-min-h-0",children:c.jsxs("div",{className:"cj-space-y-4 cj-pr-3 cj-py-2",children:[c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_label")}),c.jsx(pe,{value:l.label,onChange:w=>y({label:w.target.value}),className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_namespace")}),c.jsx(pe,{value:l.namespace,onChange:w=>y({namespace:w.target.value}),className:"cj-mt-1 cj-font-mono cj-text-sm"})]})]}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_placeholder")}),c.jsx(pe,{value:l.placeholder||"",onChange:w=>y({placeholder:w.target.value||void 0}),className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_help")}),c.jsx(pe,{value:l.helpText||"",onChange:w=>y({helpText:w.target.value||void 0}),className:"cj-mt-1"})]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-rounded-lg cj-border cj-p-3",children:[c.jsxs("div",{children:[c.jsx(X,{children:r("fc_field_required")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r("fc_field_required_hint")})]}),c.jsx(Cn,{checked:!!l.required,onCheckedChange:w=>y({required:w})})]}),c.jsx(so,{}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_actor")}),c.jsxs(Oe,{value:l.actor||"customer",onValueChange:w=>y({actor:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"customer",children:r("fc_field_actor_customer")}),c.jsx(K,{value:"operator",children:r("fc_field_actor_operator")})]})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_widget")}),c.jsxs(Oe,{value:l.widget||"auto",onValueChange:w=>y({widget:w==="auto"?void 0:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"auto",children:r("fc_field_widget_auto")}),c.jsx(K,{value:"text",children:r("fc_field_widget_text")}),c.jsx(K,{value:"textarea",children:r("fc_field_widget_textarea")}),c.jsx(K,{value:"select",children:r("fc_field_widget_select")}),c.jsx(K,{value:"radio",children:r("fc_field_widget_radio")}),c.jsx(K,{value:"datepicker",children:r("fc_field_widget_date")}),c.jsx(K,{value:"timepicker",children:r("fc_field_widget_time")}),c.jsx(K,{value:"datetimepicker",children:r("fc_field_widget_datetime")}),c.jsx(K,{value:"currency",children:r("fc_field_widget_currency")}),c.jsx(K,{value:"upload",children:r("fc_field_widget_upload")}),c.jsx(K,{value:"email",children:r("fc_field_widget_email")}),c.jsx(K,{value:"phone",children:r("fc_field_widget_phone")}),c.jsx(K,{value:"location",children:r("fc_field_widget_location")}),c.jsx(K,{value:"boolean",children:r("fc_field_widget_boolean")})]})]})]})]}),j&&c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-rounded-lg cj-border cj-p-3",children:[c.jsxs("div",{children:[c.jsx(X,{children:r("fc_field_allow_future")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r("fc_field_allow_future_hint")})]}),c.jsx(Cn,{checked:l.allowFuture??l.schema==="v2_datetime-1",onCheckedChange:w=>y({allowFuture:w})})]}),p&&c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_display_style")}),c.jsxs(Oe,{value:l.ui_variant||"auto",onValueChange:w=>y({ui_variant:w==="auto"?void 0:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"auto",children:r("fc_field_display_auto")}),c.jsx(K,{value:"radio",children:r("fc_field_display_radio")}),c.jsx(K,{value:"dropdown",children:r("fc_field_display_dropdown")}),c.jsx(K,{value:"segmented",children:r("fc_field_display_segmented")})]})]}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:r("fc_field_display_hint")})]}),g&&c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_display_style")}),c.jsxs(Oe,{value:l.ui_variant||"switch",onValueChange:w=>y({ui_variant:w==="switch"?void 0:w}),children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"switch",children:r("fc_field_display_switch")}),c.jsx(K,{value:"segmented",children:r("fc_field_display_yesno")})]})]}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:r("fc_field_boolean_hint")})]}),p&&c.jsxs(c.Fragment,{children:[c.jsx(so,{}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[c.jsx(X,{children:r("fc_field_options")}),c.jsxs(Z,{variant:"ghost",size:"sm",onClick:()=>y({options:[...x,{data:"",label:""}]}),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),r("fc_summary_add")]})]}),c.jsxs("div",{className:"cj-space-y-2",children:[x.map((w,S)=>c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-rounded-lg cj-border cj-p-2",children:[c.jsxs("div",{className:"cj-flex-1 cj-space-y-1",children:[c.jsx(pe,{value:w.data,onChange:N=>y({options:x.map((C,E)=>E===S?{...C,data:N.target.value}:C)}),placeholder:r("fc_create_option_value_placeholder"),className:"cj-h-8 cj-font-mono cj-text-sm"}),c.jsx(pe,{value:w.label,onChange:N=>y({options:x.map((C,E)=>E===S?{...C,label:N.target.value}:C)}),placeholder:r("fc_create_option_label_placeholder"),className:"cj-h-8 cj-text-sm"})]}),c.jsx(Z,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>y({options:x.filter((N,C)=>C!==S)}),children:c.jsx(Vt,{className:"cj-h-3 cj-w-3"})})]},S)),x.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:r("fc_field_no_options")})]})]})]}),_&&c.jsxs(c.Fragment,{children:[c.jsx(so,{}),c.jsxs("div",{className:"cj-space-y-3",children:[c.jsx(X,{children:r("fc_field_upload_validation")}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_upload_accept")}),c.jsx(pe,{value:b.accept||"",onChange:w=>y({uploadConfig:{...b,accept:w.target.value||void 0}}),placeholder:"image/*,.pdf",className:"cj-mt-1 cj-font-mono cj-text-sm"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:r("fc_field_upload_max")}),c.jsx(pe,{type:"number",min:0,step:.5,value:b.maxSizeMB??"",onChange:w=>y({uploadConfig:{...b,maxSizeMB:w.target.value?parseFloat(w.target.value):void 0}}),className:"cj-mt-1 cj-w-32"})]})]})]})]})}),c.jsxs(Gs,{className:"cj-flex cj-items-center cj-justify-between sm:cj-justify-between",children:[c.jsxs(Z,{variant:"destructive",size:"sm",onClick:()=>f(!0),children:[c.jsx(En,{className:"cj-h-4 cj-w-4 cj-mr-1"}),r("fc_field_delete")]}),c.jsx(Z,{onClick:()=>n(!1),children:r("fc_field_done")})]})]}),c.jsx(Rr,{open:u,onOpenChange:f,description:r("fc_field_confirm_delete"),onConfirm:()=>{s(i.field_id),f(!1),n(!1)}})]})}function Wf({specs:e=[],open:t,onOpenChange:n,onCreate:r}){const{t:o}=je(),[a,s]=v.useState("catalog"),[i,l]=v.useState(""),[d,u]=v.useState(""),[f,m]=v.useState(""),[p,g]=v.useState("v1_string"),[_,j]=v.useState([]),y=v.useMemo(()=>e.filter(S=>S.label.toLowerCase().includes(i.toLowerCase())||S.namespace.toLowerCase().includes(i.toLowerCase())),[e,i]),x=()=>{u(""),m(""),g("v1_string"),j([]),l("")},b=p==="v2_single_option_select-1",w=d.trim()!=="";return c.jsx(rs,{open:t,onOpenChange:S=>{S||x(),n(S)},children:c.jsxs(vo,{className:"cj-max-w-lg cj-max-h-[85vh] cj-flex cj-flex-col",children:[c.jsxs(Vs,{children:[c.jsx(Us,{children:o("fc_create_field_title")}),c.jsx(Pf,{children:o("fc_create_field_subtitle")})]}),c.jsxs("div",{className:"cj-flex cj-gap-1 cj-bg-muted cj-rounded-lg cj-p-1",children:[c.jsx("button",{onClick:()=>s("catalog"),className:`cj-flex-1 cj-h-8 cj-rounded-md cj-text-sm cj-font-medium ${a==="catalog"?"cj-bg-card cj-shadow-sm":"cj-text-muted-foreground"}`,children:o("fc_create_from_catalog",{count:e.length})}),c.jsx("button",{onClick:()=>s("custom"),className:`cj-flex-1 cj-h-8 cj-rounded-md cj-text-sm cj-font-medium ${a==="custom"?"cj-bg-card cj-shadow-sm":"cj-text-muted-foreground"}`,children:o("fc_create_custom")})]}),a==="catalog"?c.jsxs("div",{className:"cj-flex cj-flex-col cj-flex-1 cj-min-h-0 cj-space-y-2",children:[c.jsx(pe,{placeholder:o("fc_create_search_specs"),value:i,onChange:S=>l(S.target.value)}),c.jsx(Rt,{className:"cj-flex-1 cj-min-h-0 cj-border cj-rounded-lg",children:c.jsxs("div",{className:"cj-divide-y",children:[y.map(S=>{var N,C;return c.jsxs("button",{onClick:()=>{r(S),x(),n(!1)},className:"cj-w-full cj-text-left cj-px-3 cj-py-2 hover:cj-bg-accent cj-flex cj-items-center cj-gap-2",children:[c.jsx(jt,{variant:"secondary",className:`cj-text-[10px] ${((N=vr[S.schema])==null?void 0:N.color)||"cj-bg-muted"} cj-text-white`,children:((C=vr[S.schema])==null?void 0:C.label)||S.schema}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:S.label}),c.jsx("div",{className:"cj-text-[11px] cj-font-mono cj-text-muted-foreground cj-truncate",children:S.namespace})]})]},S.id)}),y.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-py-6 cj-text-center",children:o("fc_create_no_specs")})]})})]}):c.jsx(Rt,{className:"cj-flex-1 cj-min-h-0",children:c.jsxs("div",{className:"cj-space-y-3 cj-pr-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_label_required")}),c.jsx(pe,{value:d,onChange:S=>u(S.target.value),placeholder:o("fc_create_label_placeholder"),className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_namespace")}),c.jsx(pe,{value:f,onChange:S=>m(S.target.value),placeholder:o("fc_create_namespace_placeholder"),className:"cj-mt-1 cj-font-mono cj-text-sm"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_schema")}),c.jsxs(Oe,{value:p,onValueChange:g,children:[c.jsx(Pe,{className:"cj-mt-1",children:c.jsx(Ae,{})}),c.jsx(Ee,{children:Object.entries(vr).map(([S,N])=>c.jsx(K,{value:S,children:c.jsx("div",{className:"cj-flex cj-items-center cj-gap-2",children:c.jsx(jt,{className:`${N.color} cj-text-white cj-text-[10px]`,children:N.label})})},S))})]})]}),b&&c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-1",children:[c.jsx(X,{className:"cj-text-xs",children:o("fc_create_options")}),c.jsxs(Z,{size:"sm",variant:"ghost",onClick:()=>j([..._,{data:"",label:""}]),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),o("fc_summary_add")]})]}),c.jsx("div",{className:"cj-space-y-2",children:_.map((S,N)=>c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsx(pe,{value:S.data,onChange:C=>j(_.map((E,k)=>k===N?{...E,data:C.target.value}:E)),placeholder:o("fc_create_option_value_placeholder"),className:"cj-flex-1 cj-h-8 cj-font-mono cj-text-sm"}),c.jsx(pe,{value:S.label,onChange:C=>j(_.map((E,k)=>k===N?{...E,label:C.target.value}:E)),placeholder:o("fc_create_option_label_placeholder"),className:"cj-flex-1 cj-h-8 cj-text-sm"}),c.jsx(Z,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>j(_.filter((C,E)=>E!==N)),children:c.jsx(Vt,{className:"cj-h-3 cj-w-3"})})]},N))})]})]})}),a==="custom"&&c.jsxs(Gs,{children:[c.jsx(Z,{variant:"outline",onClick:()=>n(!1),children:o("fc_create_cancel")}),c.jsx(Z,{disabled:!w,onClick:()=>{r({label:d.trim(),namespace:f.trim()||`custom_${Date.now()}`,schema:p,options:b?_:null,required:!1}),x(),n(!1)},children:o("fc_create_create")})]})]})})}const Ar=h.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ne("cj-flex cj-min-h-[120px] cj-w-full cj-rounded-xl cj-border cj-border-input cj-bg-background cj-px-3 cj-py-3 cj-text-base cj-ring-offset-background placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 md:cj-text-sm",e),ref:n,...t}));Ar.displayName="Textarea";var ra="Collapsible",[Sx]=st(ra),[Cx,Xs]=Sx(ra),$f=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:a,onOpenChange:s,...i}=e,[l,d]=Ht({prop:r,defaultProp:o??!1,onChange:s,caller:ra});return c.jsx(Cx,{scope:n,disabled:a,contentId:Dt(),open:l,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:c.jsx(se.div,{"data-state":Js(l),"data-disabled":a?"":void 0,...i,ref:t})})});$f.displayName=ra;var Ff="CollapsibleTrigger",Lf=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Xs(Ff,n);return c.jsx(se.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Js(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:re(e.onClick,o.onOpenToggle)})});Lf.displayName=Ff;var Ks="CollapsibleContent",Bf=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Xs(Ks,e.__scopeCollapsible);return c.jsx(it,{present:n||o.open,children:({present:a})=>c.jsx(kx,{...r,ref:t,present:a})})});Bf.displayName=Ks;var kx=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...a}=e,s=Xs(Ks,n),[i,l]=h.useState(r),d=h.useRef(null),u=he(t,d),f=h.useRef(0),m=f.current,p=h.useRef(0),g=p.current,_=s.open||i,j=h.useRef(_),y=h.useRef(void 0);return h.useEffect(()=>{const x=requestAnimationFrame(()=>j.current=!1);return()=>cancelAnimationFrame(x)},[]),Ye(()=>{const x=d.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();f.current=b.height,p.current=b.width,j.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),l(r)}},[s.open,r]),c.jsx(se.div,{"data-state":Js(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!_,...a,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&o})});function Js(e){return e?"open":"closed"}var Px=$f;const Ex=Px,Mx=Lf,Dx=Bf,Hf=[{value:"==",label:"equals"},{value:"!=",label:"not equals"},{value:">",label:"greater than"},{value:"<",label:"less than"},{value:">=",label:"greater or equal"},{value:"<=",label:"less or equal"},{value:"in",label:"contains"},{value:"is_null",label:"is null"},{value:"is_not_null",label:"is not null"}],xo=["is_null","is_not_null"];function hc(e){const t=Object.keys(e)[0];if(t==="=="||t==="!="){const a=e[t];if(!Array.isArray(a)||a.length!==2)return null;const s=a[0];if(!(s!=null&&s.var))return null;const i=s.var.replace("answers.","");return a[1]===null?{field:i,operator:t==="=="?"is_null":"is_not_null",value:""}:{field:i,operator:t,value:String(a[1])}}if(!Hf.some(a=>a.value===t))return null;const n=e[t];if(!Array.isArray(n)||n.length!==2)return null;const r=n[0];return r!=null&&r.var?{field:r.var.replace("answers.",""),operator:t,value:String(n[1])}:null}function Ta(e){const t={mode:"and",rules:[{field:"",operator:"==",value:""}]};if(!e)return t;const n=Object.keys(e)[0];if(n==="and"||n==="or"){const o=e[n];if(Array.isArray(o)){const a=o.map(hc).filter(Boolean);if(a.length>0)return{mode:n,rules:a}}return t}const r=hc(e);return r?{mode:"and",rules:[r]}:t}function Tx(e){const t=e.rules.filter(r=>r.field&&(r.value||xo.includes(r.operator)));if(t.length===0)return null;const n=t.map(r=>r.operator==="is_null"?{"==":[{var:`answers.${r.field}`},null]}:r.operator==="is_not_null"?{"!=":[{var:`answers.${r.field}`},null]}:{[r.operator]:[{var:`answers.${r.field}`},r.value]});return n.length===1?n[0]:{[e.mode]:n}}function Rx(){return{field:"",operator:"==",value:""}}function Ox({rule:e,availableFields:t,canRemove:n,onChange:r,onRemove:o}){const a=xo.includes(e.operator),s=t.find(l=>l.namespace===e.field),i=s!=null&&s.options&&s.options.length>0?s.options:null;return c.jsxs("div",{className:"cj-flex cj-items-start cj-gap-1.5 cj-group",children:[c.jsxs("div",{className:"cj-flex-1 cj-space-y-1.5",children:[c.jsxs(Oe,{value:e.field,onValueChange:l=>r({field:l,value:""}),children:[c.jsx(Pe,{className:"cj-h-8 cj-text-xs",children:c.jsx(Ae,{placeholder:"Field"})}),c.jsx(Ee,{children:t.map(l=>c.jsx(K,{value:l.namespace,children:l.label},l.namespace))})]}),c.jsxs(Oe,{value:e.operator,onValueChange:l=>r({operator:l,...xo.includes(l)?{value:""}:{}}),children:[c.jsx(Pe,{className:"cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsx(Ee,{children:Hf.map(l=>c.jsx(K,{value:l.value,children:l.label},l.value))})]}),!a&&(i?c.jsxs(Oe,{value:e.value,onValueChange:l=>r({value:l}),children:[c.jsx(Pe,{className:"cj-h-8 cj-text-xs",children:c.jsx(Ae,{placeholder:"Select value"})}),c.jsx(Ee,{children:i.map(l=>c.jsx(K,{value:l.data,children:l.label},l.data))})]}):c.jsx(pe,{className:"cj-h-8 cj-text-xs",placeholder:"Value",value:e.value,onChange:l=>r({value:l.target.value})}))]}),n&&c.jsx(Z,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8 cj-opacity-0 group-hover:cj-opacity-100 cj-shrink-0 cj-mt-0",onClick:o,children:c.jsx(Vt,{className:"cj-h-3.5 cj-w-3.5"})})]})}function Ax({conditions:e,availableFields:t,onChange:n}){const r=()=>{n({...e,mode:e.mode==="and"?"or":"and"})},o=(i,l)=>{const d=e.rules.map((u,f)=>f===i?{...u,...l}:u);n({...e,rules:d})},a=()=>{n({...e,rules:[...e.rules,Rx()]})},s=i=>{n({...e,rules:e.rules.filter((l,d)=>d!==i)})};return c.jsxs("div",{className:"cj-space-y-3",children:[e.rules.length>1&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:"Combine with:"}),c.jsx(jt,{variant:e.mode==="and"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"AND"}),c.jsx(jt,{variant:e.mode==="or"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"OR"})]}),c.jsx("div",{className:"cj-space-y-3",children:e.rules.map((i,l)=>c.jsxs("div",{children:[l>0&&c.jsx("div",{className:"cj-text-center cj-text-[10px] cj-text-muted-foreground cj-font-medium cj-py-1 cj-uppercase",children:e.mode}),c.jsx(Ox,{rule:i,availableFields:t,canRemove:e.rules.length>1,onChange:d=>o(l,d),onRemove:()=>s(l)})]},l))}),c.jsxs(Z,{variant:"outline",size:"sm",className:"cj-w-full cj-h-7 cj-text-xs",onClick:a,children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add condition"]})]})}function zx({step:e,readOnly:t=!1}){const{t:n}=je(),{formConfig:r,updateStepNavigation:o,setStepApiCall:a,addNavRule:s,updateNavRule:i,deleteNavRule:l}=wt(),[d,u]=v.useState(!0),f=r.steps.filter(g=>g.step_id!==e.step_id),m=e.navigation.api_call,p=r.fields.map(g=>({namespace:g.namespace,label:g.label,options:g.options||null}));return c.jsx("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border cj-p-4",children:c.jsxs(Ex,{open:d,onOpenChange:u,children:[c.jsx(Mx,{asChild:!0,children:c.jsxs("button",{className:"cj-w-full cj-flex cj-items-center cj-justify-between cj-gap-2 cj-text-left",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(Tl,{className:"cj-h-4 cj-w-4 cj-text-primary"}),c.jsx("span",{className:"cj-text-sm cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:n("fc_nav_title")})]}),c.jsx(on,{className:`cj-h-4 cj-w-4 cj-transition-transform ${d?"cj-rotate-180":""}`})]})}),c.jsxs(Dx,{className:"cj-pt-4 cj-space-y-4",children:[c.jsxs("div",{className:"cj-rounded-xl cj-border cj-border-border/60 cj-p-3 cj-space-y-3",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs cj-font-semibold cj-uppercase",children:n("fc_nav_api_call")}),c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground",children:n("fc_nav_api_call_hint")})]}),c.jsx(Cn,{checked:!!(m!=null&&m.enabled),disabled:t,onCheckedChange:g=>a(e.step_id,g?m||{enabled:!0,method:"POST",url:"",headers:{},body_template:""}:void 0)})]}),(m==null?void 0:m.enabled)&&c.jsxs("div",{className:"cj-space-y-2",children:[c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsxs(Oe,{value:m.method,onValueChange:g=>a(e.step_id,{...m,method:g}),disabled:t,children:[c.jsx(Pe,{className:"cj-w-28",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"GET",children:"GET"}),c.jsx(K,{value:"POST",children:"POST"}),c.jsx(K,{value:"PUT",children:"PUT"}),c.jsx(K,{value:"PATCH",children:"PATCH"}),c.jsx(K,{value:"DELETE",children:"DELETE"})]})]}),c.jsx(pe,{value:m.url,onChange:g=>a(e.step_id,{...m,url:g.target.value}),placeholder:"https://api.example.com/endpoint",className:"cj-flex-1 cj-font-mono cj-text-xs",disabled:t})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[11px]",children:n("fc_nav_body_template")}),c.jsx(Ar,{value:m.body_template||"",onChange:g=>a(e.step_id,{...m,body_template:g.target.value}),placeholder:'{ "name": "{{answers.full_name}}" }',className:"cj-mt-1 cj-font-mono cj-text-xs",rows:4,disabled:t}),c.jsxs("p",{className:"cj-text-[10px] cj-text-muted-foreground cj-mt-1",children:[n("fc_nav_body_template_hint_prefix")," ",c.jsx("code",{children:"{{answers.namespace}}"})," ",n("fc_nav_body_template_hint_suffix")]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[11px]",children:n("fc_nav_on_error")}),c.jsxs(Oe,{value:m.on_error||"block",onValueChange:g=>{const _=g==="block"||g==="continue"?g:`goto:${g.slice(5)}`;a(e.step_id,{...m,on_error:_})},disabled:t,children:[c.jsx(Pe,{className:"cj-mt-1 cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"block",children:n("fc_nav_on_error_block")}),c.jsx(K,{value:"continue",children:n("fc_nav_on_error_continue")}),f.map(g=>c.jsx(K,{value:`goto:${g.step_id}`,children:n("fc_nav_on_error_goto",{step:g.title||g.step_id})},g.step_id)),c.jsx(K,{value:"goto:__submit__",children:n("fc_nav_on_error_summary")})]})]}),c.jsx("p",{className:"cj-text-[10px] cj-text-muted-foreground cj-mt-1",children:n("fc_nav_on_error_hint")})]})]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(X,{className:"cj-text-xs cj-w-32",children:n("fc_nav_continue_button")}),c.jsx(pe,{value:e.navigation.button_label||"",onChange:g=>o(e.step_id,{button_label:g.target.value||void 0}),placeholder:n("fc_nav_continue_placeholder"),className:"cj-flex-1 cj-h-8 cj-text-sm",disabled:t})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[c.jsx(X,{className:"cj-text-xs cj-font-semibold cj-uppercase",children:n("fc_nav_rules")}),!t&&c.jsxs(Z,{size:"sm",variant:"ghost",className:"cj-h-7",onClick:()=>s(e.step_id),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),n("fc_nav_add_rule")]})]}),c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground cj-mb-3",children:n("fc_nav_rules_hint")}),c.jsx("div",{className:"cj-space-y-2",children:e.navigation.rules.map((g,_)=>c.jsx(Ix,{rule:g,index:_,steps:f.map(j=>({id:j.step_id,title:j.title})),fields:p,readOnly:t,onUpdate:j=>i(e.step_id,g.rule_id,j),onDelete:()=>l(e.step_id,g.rule_id),canDelete:e.navigation.rules.length>1},g.rule_id))})]})]})]})})}function Ix({rule:e,index:t,steps:n,fields:r,readOnly:o,onUpdate:a,onDelete:s,canDelete:i}){const{t:l}=je(),[d,u]=v.useState(!!e.condition),[f,m]=v.useState(()=>Ta(e.condition)),[p,g]=v.useState(null),_=v.useRef(e.condition);v.useEffect(()=>{e.condition!==_.current&&(m(Ta(e.condition)),_.current=e.condition,g(null))},[e.condition]);const j=x=>{for(const b of x.rules){if(!b.field||xo.includes(b.operator))continue;const w=r.find(S=>S.namespace===b.field);if(w!=null&&w.options&&w.options.length>0&&!b.value)return l("fc_nav_field_requires_value",{label:w.label})}return null},y=x=>{m(x);const b=j(x);if(b){g(b);return}g(null);const w=Tx(x);_.current=w,a({condition:w})};return c.jsxs("div",{className:"cj-rounded-xl cj-border cj-border-border/60 cj-p-3 cj-bg-muted/20",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-2",children:[c.jsx("span",{className:"cj-text-[11px] cj-font-bold cj-text-muted-foreground cj-uppercase",children:l("fc_nav_rule_n",{n:t+1})}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-ml-auto",children:[c.jsx(X,{className:"cj-text-[11px]",children:l("fc_nav_has_condition")}),c.jsx(Cn,{checked:d,disabled:o,onCheckedChange:x=>{u(x),g(null),x||(m(Ta(null)),_.current=null,a({condition:null}))}}),i&&!o&&c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",onClick:s,children:c.jsx(En,{className:"cj-h-3 cj-w-3 cj-text-destructive"})})]})]}),d&&c.jsxs("div",{className:"cj-mb-3 cj-rounded-lg cj-bg-card cj-p-3",children:[c.jsx(Ax,{conditions:f,availableFields:r,onChange:y}),p&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1.5 cj-mt-2 cj-text-[11px] cj-text-destructive",children:[c.jsx(kl,{className:"cj-h-3.5 cj-w-3.5 cj-shrink-0"}),c.jsx("span",{children:p})]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(Do,{className:"cj-h-3.5 cj-w-3.5 cj-text-muted-foreground"}),c.jsx(X,{className:"cj-text-xs",children:l("fc_nav_go_to")}),c.jsxs(Oe,{value:e.next_step_id,onValueChange:x=>a({next_step_id:x}),disabled:o,children:[c.jsx(Pe,{className:"cj-flex-1 cj-h-8 cj-text-sm",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"__submit__",children:l("fc_nav_submit_form")}),n.map(x=>c.jsx(K,{value:x.id,children:x.title},x.id))]})]})]})]})}function Wx({specs:e=[],readOnly:t=!1}){const{t:n}=je(),{formConfig:r,activeStepId:o,updateStep:a,addRow:s,updateRow:i,deleteRow:l,moveRow:d,removeFieldFromRow:u,moveFieldInRow:f,addNewFieldToRow:m,setSelectedField:p,selectedFieldId:g}=wt(),_=r.steps.find(S=>S.step_id===o)||null,[j,y]=v.useState(!1),[x,b]=v.useState(null);if(!_)return c.jsx("div",{className:"cj-h-full cj-flex cj-items-center cj-justify-center cj-p-8 cj-text-center",children:c.jsx("div",{className:"cj-text-sm cj-text-muted-foreground",children:r.steps.length===0?n("fc_step_empty_create"):n("fc_step_empty_select")})});const w=r.steps.findIndex(S=>S.step_id===_.step_id)+1;return c.jsxs(Rt,{className:"cj-h-full",children:[c.jsxs("div",{className:"cj-p-6 cj-space-y-4 cj-max-w-3xl cj-mx-auto",children:[c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border cj-p-5 cj-space-y-4",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[c.jsx("div",{className:"cj-h-9 cj-w-9 cj-rounded-full cj-bg-primary cj-text-primary-foreground cj-flex cj-items-center cj-justify-center cj-font-bold",children:w}),c.jsx(pe,{value:_.title,onChange:S=>a(_.step_id,{title:S.target.value}),placeholder:n("fc_step_title_placeholder"),disabled:t,className:"cj-flex-1 cj-text-lg cj-font-semibold cj-border-none cj-shadow-none cj-px-1 cj-bg-transparent focus-visible:cj-ring-1"})]}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-3",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:n("fc_step_title_label")}),c.jsx(pe,{value:_.title,onChange:S=>a(_.step_id,{title:S.target.value}),disabled:t,className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:n("fc_step_description_label")}),c.jsx(pe,{value:_.description||"",onChange:S=>a(_.step_id,{description:S.target.value}),disabled:t,placeholder:n("fc_step_description_placeholder"),className:"cj-mt-1"})]})]})]}),_.rows.map((S,N)=>c.jsx($x,{row:S,index:N,isLast:N===_.rows.length-1,readOnly:t,onChangeLayout:C=>i(_.step_id,S.row_id,{layout:C}),onDelete:()=>l(_.step_id,S.row_id),onMoveUp:()=>d(_.step_id,S.row_id,"up"),onMoveDown:()=>d(_.step_id,S.row_id,"down"),onAddField:()=>b(S.row_id),onSelectField:C=>{p(C),y(!0)},onRemoveField:C=>u(_.step_id,S.row_id,C),onMoveField:(C,E)=>f(_.step_id,S.row_id,C,E),fieldLookup:C=>r.fields.find(E=>E.field_id===C)||null},S.row_id)),!t&&c.jsxs(Z,{variant:"outline",className:"cj-w-full cj-h-12 cj-rounded-xl cj-border-dashed",onClick:()=>s(_.step_id),children:[c.jsx(vt,{className:"cj-h-4 cj-w-4 cj-mr-2"}),n("fc_add_row")]}),c.jsx(zx,{step:_,readOnly:t})]}),c.jsx(If,{fieldId:g,open:j,onOpenChange:S=>{y(S),S||p(null)}}),c.jsx(Wf,{specs:e,open:!!x,onOpenChange:S=>{S||b(null)},onCreate:S=>{x&&m(_.step_id,x,S)}})]})}function $x({row:e,index:t,isLast:n,readOnly:r,onChangeLayout:o,onDelete:a,onMoveUp:s,onMoveDown:i,onAddField:l,onSelectField:d,onRemoveField:u,onMoveField:f,fieldLookup:m}){const{t:p}=je(),[g,_]=v.useState(!1);return c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border cj-p-4",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-3",children:[c.jsx(Pl,{className:"cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx("span",{className:"cj-text-sm cj-font-medium",children:p("fc_row_n",{n:t+1})}),c.jsxs(Oe,{value:e.layout,onValueChange:j=>o(j),disabled:r,children:[c.jsx(Pe,{className:"cj-h-7 cj-w-32 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"horizontal",children:p("fc_layout_horizontal")}),c.jsx(K,{value:"vertical",children:p("fc_layout_vertical")})]})]}),!r&&c.jsxs("div",{className:"cj-ml-auto cj-flex cj-items-center cj-gap-0.5",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:t===0,onClick:s,children:c.jsx(co,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",disabled:n,onClick:i,children:c.jsx(on,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-6 cj-w-6",onClick:()=>_(!0),children:c.jsx(En,{className:"cj-h-3 cj-w-3 cj-text-destructive"})}),c.jsx(Rr,{open:g,onOpenChange:_,description:p("fc_confirm_delete_row"),onConfirm:a})]})]}),c.jsxs("div",{className:`cj-gap-3 ${e.layout==="horizontal"?"cj-flex cj-flex-wrap":"cj-flex cj-flex-col"}`,children:[e.field_ids.map((j,y)=>{const x=m(j);if(!x)return null;const b=ta(x.schema);return c.jsxs("div",{className:`cj-group cj-relative cj-rounded-xl cj-border cj-border-border cj-bg-muted/30 hover:cj-border-primary/60 cj-px-3 cj-py-2 cj-cursor-pointer ${e.layout==="horizontal"?"cj-flex-1 cj-min-w-[180px]":"cj-w-full"}`,onClick:()=>d(j),children:[c.jsxs("div",{className:"cj-flex cj-items-start cj-gap-2",children:[c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx(jt,{variant:"secondary",className:`cj-text-[9px] cj-mb-1 ${b.color} cj-text-white`,children:b.label}),c.jsxs("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:[x.label,x.required&&c.jsx("span",{className:"cj-text-destructive cj-ml-0.5",children:"*"})]}),c.jsx("div",{className:"cj-text-[10px] cj-font-mono cj-text-muted-foreground cj-truncate",children:x.namespace})]}),!r&&c.jsxs("div",{className:"cj-flex cj-flex-col cj-gap-0.5 cj-opacity-0 group-hover:cj-opacity-100 cj-transition-opacity",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",onClick:w=>{w.stopPropagation(),d(j)},title:p("fc_edit"),children:c.jsx(T_,{className:"cj-h-3 cj-w-3"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",onClick:w=>{w.stopPropagation(),u(j)},title:p("fc_remove_from_row"),children:c.jsx(Vt,{className:"cj-h-3 cj-w-3 cj-text-destructive"})})]})]}),!r&&e.field_ids.length>1&&c.jsxs("div",{className:"cj-absolute -cj-bottom-2 cj-left-1/2 -cj-translate-x-1/2 cj-flex cj-gap-0.5 cj-bg-card cj-rounded-full cj-shadow-sm cj-opacity-0 group-hover:cj-opacity-100",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",disabled:y===0,onClick:w=>{w.stopPropagation(),f(j,"left")},children:c.jsx(co,{className:"cj-h-3 cj-w-3 -cj-rotate-90"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-5 cj-w-5",disabled:y===e.field_ids.length-1,onClick:w=>{w.stopPropagation(),f(j,"right")},children:c.jsx(on,{className:"cj-h-3 cj-w-3 -cj-rotate-90"})})]})]},j)}),!r&&c.jsxs("button",{onClick:l,className:`cj-rounded-xl cj-border-2 cj-border-dashed cj-border-border hover:cj-border-primary/60 cj-text-xs cj-text-muted-foreground hover:cj-text-foreground cj-px-3 cj-py-2 cj-flex cj-items-center cj-justify-center cj-gap-1 ${e.layout==="horizontal"?"cj-flex-1 cj-min-w-[140px]":"cj-w-full cj-py-3"}`,children:[c.jsx(vt,{className:"cj-h-3.5 cj-w-3.5"}),p("fc_add_field_btn")]}),e.field_ids.length===0&&r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:p("fc_no_fields")})]})]})}function Fx({readOnly:e=!1}){const{t}=je(),{formConfig:n,updateSummary:r,addSummarySection:o,updateSummarySection:a,deleteSummarySection:s,addDisplayField:i,updateDisplayField:l,deleteDisplayField:d}=wt(),[u,f]=v.useState(null),{summary:m,fields:p,steps:g}=n;return c.jsxs("div",{className:"cj-flex cj-flex-col cj-h-full cj-bg-card",children:[c.jsx("div",{className:"cj-p-4 cj-border-b",children:c.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:t("fc_summary_panel")})}),c.jsx(Rt,{className:"cj-flex-1",children:c.jsxs("div",{className:"cj-p-4 cj-space-y-4",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:t("fc_summary_title_label")}),c.jsx(pe,{value:m.title,onChange:_=>r({title:_.target.value}),disabled:e,className:"cj-mt-1"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[c.jsx(X,{className:"cj-text-xs cj-font-semibold cj-uppercase",children:t("fc_summary_sections")}),!e&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>o(),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),t("fc_summary_add_section")]})]}),c.jsxs("div",{className:"cj-space-y-3",children:[m.sections.map(_=>c.jsxs("div",{className:"cj-rounded-xl cj-border cj-border-border cj-p-3 cj-space-y-3 cj-bg-muted/20",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx(pe,{value:_.title,onChange:j=>a(_.section_id,{title:j.target.value}),placeholder:t("fc_summary_section_title_placeholder"),disabled:e,className:"cj-flex-1 cj-h-8 cj-font-semibold"}),!e&&c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-7 cj-w-7",onClick:()=>f(_.section_id),children:c.jsx(En,{className:"cj-h-3.5 cj-w-3.5 cj-text-destructive"})})]}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-2",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:t("fc_summary_visible_from")}),c.jsxs(Oe,{value:String(_.visible_from_step??1),onValueChange:j=>a(_.section_id,{visible_from_step:parseInt(j,10)||1}),disabled:e,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsx(Ee,{children:g.map((j,y)=>c.jsx(K,{value:String(y+1),children:t("fc_summary_step_n",{n:y+1})},y))})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:t("fc_summary_until_step")}),c.jsxs(Oe,{value:_.until_step?String(_.until_step):"all",onValueChange:j=>a(_.section_id,{until_step:j==="all"?void 0:parseInt(j,10)}),disabled:e,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-8 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"all",children:t("fc_summary_all_steps")}),g.map((j,y)=>c.jsx(K,{value:String(y+1),children:t("fc_summary_step_n",{n:y+1})},y))]})]})]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-1",children:[c.jsx(X,{className:"cj-text-[10px] cj-uppercase cj-font-semibold",children:t("fc_summary_display_fields")}),!e&&c.jsxs(Z,{size:"sm",variant:"ghost",className:"cj-h-6 cj-text-[11px]",onClick:()=>i(_.section_id),children:[c.jsx(vt,{className:"cj-h-3 cj-w-3 cj-mr-1"}),t("fc_summary_add")]})]}),c.jsxs("div",{className:"cj-space-y-2",children:[_.display_fields.map(j=>c.jsx(Lx,{field:j,steps:g.map(y=>({id:y.step_id,title:y.title})),fields:p.map(y=>({id:y.field_id,label:y.label,namespace:y.namespace})),readOnly:e,onChange:y=>l(_.section_id,j.display_id,y),onDelete:()=>d(_.section_id,j.display_id)},j.display_id)),_.display_fields.length===0&&c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground cj-italic",children:t("fc_summary_no_display_fields")})]})]})]},_.section_id)),m.sections.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-text-center cj-py-4",children:t("fc_summary_no_sections")})]})]})]})}),c.jsx(Rr,{open:u!==null,onOpenChange:_=>!_&&f(null),description:t("fc_summary_confirm_delete_section"),onConfirm:()=>{u&&s(u),f(null)}})]})}function Lx({field:e,steps:t,fields:n,readOnly:r,onChange:o,onDelete:a}){const{t:s}=je();return c.jsxs("div",{className:"cj-relative cj-rounded-lg cj-border cj-bg-card cj-p-2 cj-space-y-1.5",children:[!r&&c.jsx("button",{onClick:a,className:"cj-absolute cj-top-1 cj-right-1 cj-text-destructive hover:cj-bg-destructive/10 cj-rounded cj-p-0.5",children:c.jsx(Vt,{className:"cj-h-3 cj-w-3"})}),c.jsxs("div",{className:"cj-grid cj-grid-cols-2 cj-gap-1.5",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_source")}),c.jsxs(Oe,{value:e.source,onValueChange:i=>o({source:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"form_field",children:s("fc_summary_source_form_field")}),c.jsx(K,{value:"api_response",children:s("fc_summary_source_api_response")})]})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_format")}),c.jsxs(Oe,{value:e.format||"text",onValueChange:i=>o({format:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"text",children:s("fc_summary_format_text")}),c.jsx(K,{value:"number",children:s("fc_summary_format_number")}),c.jsx(K,{value:"currency",children:s("fc_summary_format_currency")}),c.jsx(K,{value:"date",children:s("fc_summary_format_date")}),c.jsx(K,{value:"datetime",children:s("fc_summary_format_datetime")})]})]})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_display_label")}),c.jsx(pe,{value:e.label,onChange:i=>o({label:i.target.value}),placeholder:s("fc_summary_display_label_placeholder"),disabled:r,className:"cj-mt-0.5 cj-h-7 cj-text-xs"})]}),e.source==="form_field"?c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_field")}),c.jsxs(Oe,{value:e.field_id||"",onValueChange:i=>o({field_id:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{placeholder:s("fc_summary_select")})}),c.jsx(Ee,{children:n.map(i=>c.jsxs(K,{value:i.id,children:[i.label," ",c.jsxs("span",{className:"cj-text-muted-foreground",children:["(",i.namespace,")"]})]},i.id))})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_from_step_api")}),c.jsxs(Oe,{value:e.step_id||"",onValueChange:i=>o({step_id:i}),disabled:r,children:[c.jsx(Pe,{className:"cj-mt-0.5 cj-h-7 cj-text-xs",children:c.jsx(Ae,{placeholder:s("fc_summary_select")})}),c.jsx(Ee,{children:t.map(i=>c.jsx(K,{value:i.id,children:i.title},i.id))})]})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-[10px]",children:s("fc_summary_response_path")}),c.jsx(pe,{value:e.response_path||"",onChange:i=>o({response_path:i.target.value}),placeholder:"data.quote.premium",disabled:r,className:"cj-mt-0.5 cj-h-7 cj-text-xs cj-font-mono"})]})]})]})}function Bx({specs:e=[],readOnly:t=!1}){const{t:n}=je(),{formConfig:r,createField:o,createFieldFromSpec:a,deleteField:s,setSelectedField:i,setActiveStep:l,setActiveTab:d}=wt(),[u,f]=v.useState(""),[m,p]=v.useState("all"),[g,_]=v.useState(!1),[j,y]=v.useState(null),[x,b]=v.useState(null),w=v.useMemo(()=>{const k=new Map;for(const M of r.steps){const D=new Set;for(const T of M.rows)for(const $ of T.field_ids)D.add($);for(const T of D){const $=k.get(T)??[];$.push({step_id:M.step_id,title:M.title}),k.set(T,$)}}return k},[r.steps]),S=v.useMemo(()=>{var D;let k=0,M=0;for(const T of r.fields)(((D=w.get(T.field_id))==null?void 0:D.length)??0)>0?k++:M++;return{all:r.fields.length,used:k,unused:M}},[r.fields,w]),N=r.fields.filter(k=>{var $;const M=u.toLowerCase();if(!(k.label.toLowerCase().includes(M)||k.namespace.toLowerCase().includes(M)))return!1;const T=(($=w.get(k.field_id))==null?void 0:$.length)??0;return m==="used"?T>0:m==="unused"?T===0:!0}),C=k=>{l(k),d("steps")},E=k=>`cj-h-8 cj-px-3 cj-text-xs cj-rounded-lg cj-border cj-transition-colors ${k?"cj-bg-primary cj-text-primary-foreground cj-border-primary":"cj-bg-background cj-text-foreground cj-border-border hover:cj-bg-accent/40"}`;return c.jsx("div",{className:"cj-h-full cj-overflow-hidden cj-p-6",children:c.jsxs("div",{className:"cj-h-full cj-flex cj-flex-col cj-max-w-4xl cj-mx-auto cj-w-full cj-bg-card cj-border cj-border-border cj-rounded-2xl cj-p-6",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold",children:n("fc_fields_catalog")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:n("fc_fields_catalog_hint")})]}),!t&&c.jsxs(Z,{onClick:()=>_(!0),children:[c.jsx(vt,{className:"cj-h-4 cj-w-4 cj-mr-1"}),n("fc_fields_add")]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-3",children:[c.jsxs("div",{className:"cj-relative cj-flex-1",children:[c.jsx(Ml,{className:"cj-absolute cj-left-2.5 cj-top-2.5 cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx(pe,{placeholder:n("fc_fields_search"),value:u,onChange:k=>f(k.target.value),className:"cj-pl-8"})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1",children:[c.jsxs("button",{type:"button",className:E(m==="all"),onClick:()=>p("all"),children:[n("fc_fields_filter_all")," ",c.jsx("span",{className:"cj-opacity-70 cj-ml-1",children:S.all})]}),c.jsxs("button",{type:"button",className:E(m==="used"),onClick:()=>p("used"),children:[n("fc_fields_filter_used")," ",c.jsx("span",{className:"cj-opacity-70 cj-ml-1",children:S.used})]}),c.jsxs("button",{type:"button",className:E(m==="unused"),onClick:()=>p("unused"),children:[n("fc_fields_filter_unused")," ",c.jsx("span",{className:"cj-opacity-70 cj-ml-1",children:S.unused})]})]})]}),c.jsx(Rt,{className:"cj-flex-1 cj-rounded-xl cj-border",children:c.jsxs("div",{className:"cj-divide-y",children:[N.map(k=>{const M=ta(k.schema),D=w.get(k.field_id)??[],T=D.length===0;return c.jsxs("div",{className:`cj-p-3 cj-flex cj-items-start cj-gap-3 hover:cj-bg-accent/40 ${T?"cj-bg-muted/30":""}`,children:[c.jsx(jt,{variant:"secondary",className:`cj-text-[10px] ${M.color} cj-text-white cj-mt-0.5`,children:M.label}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsxs("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:[k.label,k.required&&c.jsx("span",{className:"cj-text-destructive cj-ml-1",children:"*"})]}),T?c.jsx(jt,{variant:"outline",className:"cj-text-[10px] cj-border-destructive/40 cj-text-destructive",children:n("fc_fields_unused_badge")}):c.jsx(jt,{variant:"outline",className:"cj-text-[10px] cj-border-primary/40 cj-text-primary",children:D.length===1?n("fc_fields_used_in_one",{count:D.length}):n("fc_fields_used_in_many",{count:D.length})})]}),c.jsx("div",{className:"cj-text-[11px] cj-font-mono cj-text-muted-foreground cj-truncate",children:k.namespace}),D.length>0&&c.jsx("div",{className:"cj-mt-2 cj-flex cj-flex-wrap cj-gap-1",children:D.map($=>c.jsxs("button",{type:"button",onClick:()=>C($.step_id),title:n("fc_fields_go_to_step",{title:$.title}),className:"cj-inline-flex cj-items-center cj-gap-1 cj-text-[11px] cj-px-2 cj-py-0.5 cj-rounded-md cj-border cj-border-border cj-bg-background hover:cj-bg-accent/60 cj-transition-colors",children:[c.jsx("span",{className:"cj-truncate cj-max-w-[160px]",children:$.title}),c.jsx(Do,{className:"cj-h-3 cj-w-3 cj-opacity-60"})]},$.step_id))})]}),!t&&c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1",children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-7 cj-w-7",onClick:()=>{i(k.field_id),y(k.field_id)},children:c.jsx(P_,{className:"cj-h-3.5 cj-w-3.5"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-7 cj-w-7",onClick:()=>b(k.field_id),children:c.jsx(En,{className:"cj-h-3.5 cj-w-3.5 cj-text-destructive"})})]})]},k.field_id)}),N.length===0&&c.jsx("p",{className:"cj-py-8 cj-text-center cj-text-xs cj-text-muted-foreground",children:r.fields.length===0?n("fc_fields_no_fields"):n("fc_fields_no_match")})]})}),c.jsx(Wf,{specs:e,open:g,onOpenChange:_,onCreate:k=>{"claimspec_id"in k?a(k):o(k)}}),c.jsx(If,{fieldId:j,open:!!j,onOpenChange:k=>!k&&y(null)}),c.jsx(Rr,{open:x!==null,onOpenChange:k=>!k&&b(null),description:n("fc_fields_confirm_delete"),onConfirm:()=>{x&&s(x),b(null)}})]})})}function Hx({readOnly:e=!1}){var u,f;const{t}=je(),{formConfig:n,updateInit:r}=wt(),o=n.init,a=Object.entries(o.values||{}),s=()=>{let m="namespace",p=1;for(;o.values[m]!==void 0;)m=`namespace_${p++}`;r({values:{...o.values,[m]:""}})},i=(m,p)=>{if(p===m)return;const g={...o.values};g[p]=g[m],delete g[m],r({values:g})},l=(m,p)=>{r({values:{...o.values,[m]:p}})},d=m=>{const p={...o.values};delete p[m],r({values:p})};return c.jsx(Rt,{className:"cj-h-full",children:c.jsx("div",{className:"cj-p-6",children:c.jsxs("div",{className:"cj-max-w-3xl cj-mx-auto cj-w-full cj-bg-card cj-border cj-border-border cj-rounded-2xl cj-p-6 cj-space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold",children:t("fc_init_title")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:t("fc_init_subtitle")})]}),c.jsxs("div",{className:"cj-rounded-xl cj-border cj-p-4 cj-space-y-3",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsx(X,{className:"cj-text-sm cj-font-semibold",children:t("fc_init_static")}),!e&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:s,children:[c.jsx(vt,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_init_add")]})]}),c.jsxs("div",{className:"cj-space-y-2",children:[a.map(([m,p])=>c.jsxs("div",{className:"cj-flex cj-gap-2 cj-items-center",children:[c.jsx(pe,{value:m,onChange:g=>i(m,g.target.value),className:"cj-flex-1 cj-font-mono cj-text-sm cj-h-9",disabled:e}),c.jsx(pe,{value:String(p??""),onChange:g=>l(m,g.target.value),className:"cj-flex-1 cj-h-9",disabled:e}),!e&&c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-8 cj-w-8",onClick:()=>d(m),children:c.jsx(En,{className:"cj-h-3.5 cj-w-3.5 cj-text-destructive"})})]},m)),a.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic cj-py-2",children:t("fc_init_no_values")})]})]}),c.jsxs("div",{className:"cj-rounded-xl cj-border cj-p-4 cj-space-y-3",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-sm cj-font-semibold",children:t("fc_init_prefill")}),c.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground",children:t("fc_init_prefill_hint")})]}),c.jsx(Cn,{checked:!!((u=o.api)!=null&&u.enabled),disabled:e,onCheckedChange:m=>r({api:m?o.api||{enabled:!0,method:"GET",url:"",mapping:{}}:void 0})})]}),((f=o.api)==null?void 0:f.enabled)&&c.jsxs("div",{className:"cj-space-y-2",children:[c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsxs(Oe,{value:o.api.method,onValueChange:m=>r({api:{...o.api,method:m}}),disabled:e,children:[c.jsx(Pe,{className:"cj-w-28",children:c.jsx(Ae,{})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"GET",children:"GET"}),c.jsx(K,{value:"POST",children:"POST"})]})]}),c.jsx(pe,{value:o.api.url,onChange:m=>r({api:{...o.api,url:m.target.value}}),placeholder:"https://api.example.com/prefill",className:"cj-flex-1 cj-font-mono cj-text-xs",disabled:e})]}),c.jsxs("div",{children:[c.jsx(X,{className:"cj-text-xs",children:t("fc_init_mapping")}),c.jsx(Ar,{value:JSON.stringify(o.api.mapping||{},null,2),onChange:m=>{try{const p=JSON.parse(m.target.value);r({api:{...o.api,mapping:p}})}catch{}},className:"cj-mt-1 cj-font-mono cj-text-xs",rows:5,disabled:e})]})]})]})]})})})}var Yx=e=>{switch(e){case"success":return Gx;case"info":return Xx;case"warning":return Ux;case"error":return Kx;default:return null}},qx=Array(12).fill(0),Vx=({visible:e,className:t})=>v.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},v.createElement("div",{className:"sonner-spinner"},qx.map((n,r)=>v.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Gx=v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},v.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ux=v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},v.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Xx=v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},v.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Kx=v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},v.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Jx=v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},v.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),v.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Qx=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},os=1,Zx=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:os++,a=this.toasts.find(i=>i.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(i=>i.id===o?(this.publish({...i,...e,id:o,title:n}),{...i,...e,id:o,dismissible:s,title:n}):i):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,a,s=r.then(async l=>{if(a=["resolve",l],v.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(tb(l)&&!l.ok){o=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){o=!1;let d=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async l=>{if(a=["reject",l],t.error!==void 0){o=!1;let d=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),i=()=>new Promise((l,d)=>s.then(()=>a[0]==="reject"?d(a[1]):l(a[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:i}:Object.assign(n,{unwrap:i})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||os++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Qe=new Zx,eb=(e,t)=>{let n=(t==null?void 0:t.id)||os++;return Qe.addToast({title:e,...t,id:n}),n},tb=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",nb=eb,rb=()=>Qe.toasts,ob=()=>Qe.getActiveToasts(),jn=Object.assign(nb,{success:Qe.success,info:Qe.info,warning:Qe.warning,error:Qe.error,custom:Qe.custom,message:Qe.message,promise:Qe.promise,dismiss:Qe.dismiss,loading:Qe.loading},{getHistory:rb,getToasts:ob});function ab(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}ab(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
278
+ `);function Kr(e){return e.label!==void 0}var sb=3,ib="32px",cb="16px",_c=4e3,lb=356,db=14,ub=20,fb=200;function pt(...e){return e.filter(Boolean).join(" ")}function mb(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var pb=e=>{var t,n,r,o,a,s,i,l,d,u,f;let{invert:m,toast:p,unstyled:g,interacting:_,setHeights:j,visibleToasts:y,heights:x,index:b,toasts:w,expanded:S,removeToast:N,defaultRichColors:C,closeButton:E,style:k,cancelButtonStyle:M,actionButtonStyle:D,className:T="",descriptionClassName:$="",duration:A,position:H,gap:W,loadingIcon:Q,expandByDefault:G,classNames:z,icons:oe,closeButtonAriaLabel:le="Close toast",pauseWhenPageIsHidden:ie}=e,[R,I]=v.useState(null),[Y,U]=v.useState(null),[P,O]=v.useState(!1),[B,L]=v.useState(!1),[V,ee]=v.useState(!1),[ae,_e]=v.useState(!1),[Se,Me]=v.useState(!1),[Be,ke]=v.useState(0),[ft,Mn]=v.useState(0),Ze=v.useRef(p.duration||A||_c),fn=v.useRef(null),ct=v.useRef(null),or=b===0,ar=b+1<=y,Je=p.type,Ut=p.dismissible!==!1,da=p.className||"",ua=p.descriptionClassName||"",Dn=v.useMemo(()=>x.findIndex(F=>F.toastId===p.id)||0,[x,p.id]),fa=v.useMemo(()=>{var F;return(F=p.closeButton)!=null?F:E},[p.closeButton,E]),Fr=v.useMemo(()=>p.duration||A||_c,[p.duration,A]),sr=v.useRef(0),Xt=v.useRef(0),Lr=v.useRef(0),Kt=v.useRef(null),[Br,ma]=H.split("-"),ir=v.useMemo(()=>x.reduce((F,ve,Ne)=>Ne>=Dn?F:F+ve.height,0),[x,Dn]),ce=Qx(),ge=p.invert||m,te=Je==="loading";Xt.current=v.useMemo(()=>Dn*W+ir,[Dn,ir]),v.useEffect(()=>{Ze.current=Fr},[Fr]),v.useEffect(()=>{O(!0)},[]),v.useEffect(()=>{let F=ct.current;if(F){let ve=F.getBoundingClientRect().height;return Mn(ve),j(Ne=>[{toastId:p.id,height:ve,position:p.position},...Ne]),()=>j(Ne=>Ne.filter(et=>et.toastId!==p.id))}},[j,p.id]),v.useLayoutEffect(()=>{if(!P)return;let F=ct.current,ve=F.style.height;F.style.height="auto";let Ne=F.getBoundingClientRect().height;F.style.height=ve,Mn(Ne),j(et=>et.find(Ge=>Ge.toastId===p.id)?et.map(Ge=>Ge.toastId===p.id?{...Ge,height:Ne}:Ge):[{toastId:p.id,height:Ne,position:p.position},...et])},[P,p.title,p.description,j,p.id]);let fe=v.useCallback(()=>{L(!0),ke(Xt.current),j(F=>F.filter(ve=>ve.toastId!==p.id)),setTimeout(()=>{N(p)},fb)},[p,N,j,Xt]);v.useEffect(()=>{if(p.promise&&Je==="loading"||p.duration===1/0||p.type==="loading")return;let F;return S||_||ie&&ce?(()=>{if(Lr.current<sr.current){let ve=new Date().getTime()-sr.current;Ze.current=Ze.current-ve}Lr.current=new Date().getTime()})():Ze.current!==1/0&&(sr.current=new Date().getTime(),F=setTimeout(()=>{var ve;(ve=p.onAutoClose)==null||ve.call(p,p),fe()},Ze.current)),()=>clearTimeout(F)},[S,_,p,Je,ie,ce,fe]),v.useEffect(()=>{p.delete&&fe()},[fe,p.delete]);function Ve(){var F,ve,Ne;return oe!=null&&oe.loading?v.createElement("div",{className:pt(z==null?void 0:z.loader,(F=p==null?void 0:p.classNames)==null?void 0:F.loader,"sonner-loader"),"data-visible":Je==="loading"},oe.loading):Q?v.createElement("div",{className:pt(z==null?void 0:z.loader,(ve=p==null?void 0:p.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":Je==="loading"},Q):v.createElement(Vx,{className:pt(z==null?void 0:z.loader,(Ne=p==null?void 0:p.classNames)==null?void 0:Ne.loader),visible:Je==="loading"})}return v.createElement("li",{tabIndex:0,ref:ct,className:pt(T,da,z==null?void 0:z.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[Je],(n=p==null?void 0:p.classNames)==null?void 0:n[Je]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:C,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":P,"data-promise":!!p.promise,"data-swiped":Se,"data-removed":B,"data-visible":ar,"data-y-position":Br,"data-x-position":ma,"data-index":b,"data-front":or,"data-swiping":V,"data-dismissible":Ut,"data-type":Je,"data-invert":ge,"data-swipe-out":ae,"data-swipe-direction":Y,"data-expanded":!!(S||G&&P),style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${B?Be:Xt.current}px`,"--initial-height":G?"auto":`${ft}px`,...k,...p.style},onDragEnd:()=>{ee(!1),I(null),Kt.current=null},onPointerDown:F=>{te||!Ut||(fn.current=new Date,ke(Xt.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(ee(!0),Kt.current={x:F.clientX,y:F.clientY}))},onPointerUp:()=>{var F,ve,Ne,et;if(ae||!Ut)return;Kt.current=null;let Ge=Number(((F=ct.current)==null?void 0:F.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),lt=Number(((ve=ct.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mn=new Date().getTime()-((Ne=fn.current)==null?void 0:Ne.getTime()),mt=R==="x"?Ge:lt,Jt=Math.abs(mt)/mn;if(Math.abs(mt)>=ub||Jt>.11){ke(Xt.current),(et=p.onDismiss)==null||et.call(p,p),U(R==="x"?Ge>0?"right":"left":lt>0?"down":"up"),fe(),_e(!0),Me(!1);return}ee(!1),I(null)},onPointerMove:F=>{var ve,Ne,et,Ge;if(!Kt.current||!Ut||((ve=window.getSelection())==null?void 0:ve.toString().length)>0)return;let lt=F.clientY-Kt.current.y,mn=F.clientX-Kt.current.x,mt=(Ne=e.swipeDirections)!=null?Ne:mb(H);!R&&(Math.abs(mn)>1||Math.abs(lt)>1)&&I(Math.abs(mn)>Math.abs(lt)?"x":"y");let Jt={x:0,y:0};R==="y"?(mt.includes("top")||mt.includes("bottom"))&&(mt.includes("top")&&lt<0||mt.includes("bottom")&&lt>0)&&(Jt.y=lt):R==="x"&&(mt.includes("left")||mt.includes("right"))&&(mt.includes("left")&&mn<0||mt.includes("right")&&mn>0)&&(Jt.x=mn),(Math.abs(Jt.x)>0||Math.abs(Jt.y)>0)&&Me(!0),(et=ct.current)==null||et.style.setProperty("--swipe-amount-x",`${Jt.x}px`),(Ge=ct.current)==null||Ge.style.setProperty("--swipe-amount-y",`${Jt.y}px`)}},fa&&!p.jsx?v.createElement("button",{"aria-label":le,"data-disabled":te,"data-close-button":!0,onClick:te||!Ut?()=>{}:()=>{var F;fe(),(F=p.onDismiss)==null||F.call(p,p)},className:pt(z==null?void 0:z.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(a=oe==null?void 0:oe.close)!=null?a:Jx):null,p.jsx||v.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:v.createElement(v.Fragment,null,Je||p.icon||p.promise?v.createElement("div",{"data-icon":"",className:pt(z==null?void 0:z.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ve():null,p.type!=="loading"?p.icon||(oe==null?void 0:oe[Je])||Yx(Je):null):null,v.createElement("div",{"data-content":"",className:pt(z==null?void 0:z.content,(i=p==null?void 0:p.classNames)==null?void 0:i.content)},v.createElement("div",{"data-title":"",className:pt(z==null?void 0:z.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?v.createElement("div",{"data-description":"",className:pt($,ua,z==null?void 0:z.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),v.isValidElement(p.cancel)?p.cancel:p.cancel&&Kr(p.cancel)?v.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||M,onClick:F=>{var ve,Ne;Kr(p.cancel)&&Ut&&((Ne=(ve=p.cancel).onClick)==null||Ne.call(ve,F),fe())},className:pt(z==null?void 0:z.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,v.isValidElement(p.action)?p.action:p.action&&Kr(p.action)?v.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||D,onClick:F=>{var ve,Ne;Kr(p.action)&&((Ne=(ve=p.action).onClick)==null||Ne.call(ve,F),!F.defaultPrevented&&fe())},className:pt(z==null?void 0:z.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function gc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function hb(e,t){let n={};return[e,t].forEach((r,o)=>{let a=o===1,s=a?"--mobile-offset":"--offset",i=a?cb:ib;function l(d){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=i:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):l(i)}),n}v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:s,className:i,offset:l,mobileOffset:d,theme:u="light",richColors:f,duration:m,style:p,visibleToasts:g=sb,toastOptions:_,dir:j=gc(),gap:y=db,loadingIcon:x,icons:b,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:S}=e,[N,C]=v.useState([]),E=v.useMemo(()=>Array.from(new Set([r].concat(N.filter(ie=>ie.position).map(ie=>ie.position)))),[N,r]),[k,M]=v.useState([]),[D,T]=v.useState(!1),[$,A]=v.useState(!1),[H,W]=v.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=v.useRef(null),G=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=v.useRef(null),oe=v.useRef(!1),le=v.useCallback(ie=>{C(R=>{var I;return(I=R.find(Y=>Y.id===ie.id))!=null&&I.delete||Qe.dismiss(ie.id),R.filter(({id:Y})=>Y!==ie.id)})},[]);return v.useEffect(()=>Qe.subscribe(ie=>{if(ie.dismiss){C(R=>R.map(I=>I.id===ie.id?{...I,delete:!0}:I));return}setTimeout(()=>{fs.flushSync(()=>{C(R=>{let I=R.findIndex(Y=>Y.id===ie.id);return I!==-1?[...R.slice(0,I),{...R[I],...ie},...R.slice(I+1)]:[ie,...R]})})})}),[]),v.useEffect(()=>{if(u!=="system"){W(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let ie=window.matchMedia("(prefers-color-scheme: dark)");try{ie.addEventListener("change",({matches:R})=>{W(R?"dark":"light")})}catch{ie.addListener(({matches:I})=>{try{W(I?"dark":"light")}catch(Y){console.error(Y)}})}},[u]),v.useEffect(()=>{N.length<=1&&T(!1)},[N]),v.useEffect(()=>{let ie=R=>{var I,Y;o.every(U=>R[U]||R.code===U)&&(T(!0),(I=Q.current)==null||I.focus()),R.code==="Escape"&&(document.activeElement===Q.current||(Y=Q.current)!=null&&Y.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[o]),v.useEffect(()=>{if(Q.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,oe.current=!1)}},[Q.current]),v.createElement("section",{ref:t,"aria-label":`${w} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((ie,R)=>{var I;let[Y,U]=ie.split("-");return N.length?v.createElement("ol",{key:ie,dir:j==="auto"?gc():j,tabIndex:-1,ref:Q,className:i,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":Y,"data-lifted":D&&N.length>1&&!a,"data-x-position":U,style:{"--front-toast-height":`${((I=k[0])==null?void 0:I.height)||0}px`,"--width":`${lb}px`,"--gap":`${y}px`,...p,...hb(l,d)},onBlur:P=>{oe.current&&!P.currentTarget.contains(P.relatedTarget)&&(oe.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,z.current=P.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{$||T(!1)},onDragEnd:()=>T(!1),onPointerDown:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},N.filter(P=>!P.position&&R===0||P.position===ie).map((P,O)=>{var B,L;return v.createElement(pb,{key:P.id,icons:b,index:O,toast:P,defaultRichColors:f,duration:(B=_==null?void 0:_.duration)!=null?B:m,className:_==null?void 0:_.className,descriptionClassName:_==null?void 0:_.descriptionClassName,invert:n,visibleToasts:g,closeButton:(L=_==null?void 0:_.closeButton)!=null?L:s,interacting:$,position:ie,style:_==null?void 0:_.style,unstyled:_==null?void 0:_.unstyled,classNames:_==null?void 0:_.classNames,cancelButtonStyle:_==null?void 0:_.cancelButtonStyle,actionButtonStyle:_==null?void 0:_.actionButtonStyle,removeToast:le,toasts:N.filter(V=>V.position==P.position),heights:k.filter(V=>V.position==P.position),setHeights:M,expandByDefault:a,gap:y,loadingIcon:x,expanded:D,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});function _b({readOnly:e=!1}){const{t}=je(),{exportJourneySpec:n,importJourneySpec:r}=wt(),o=n(),a=JSON.stringify(o,null,2),[s,i]=v.useState(a),[l,d]=v.useState(null),u=v.useRef(null),f=s!==a,m=()=>{i(JSON.stringify(n(),null,2)),d(null)},p=x=>{try{const b=JSON.parse(x);r(b),i(JSON.stringify(b,null,2)),d(null),jn.success(t("fc_json_imported_ok"))}catch(b){d(b instanceof Error?b.message:t("fc_json_invalid")),jn.error(t("fc_json_invalid"))}},g=()=>{p(s)},_=x=>{var S;const b=(S=x.target.files)==null?void 0:S[0];if(!b)return;const w=new FileReader;w.onload=N=>{var E;const C=(E=N.target)==null?void 0:E.result;p(C)},w.onerror=()=>{jn.error(t("fc_json_file_error"))},w.readAsText(b),x.target.value=""},j=()=>{navigator.clipboard.writeText(s),jn.success(t("fc_json_copied"))},y=()=>{const x=new Blob([s],{type:"application/json"}),b=URL.createObjectURL(x),w=document.createElement("a");w.href=b,w.download=`${o.journey_id}.json`,w.click(),URL.revokeObjectURL(b)};return c.jsx("div",{className:"cj-h-full cj-overflow-auto cj-p-6",children:c.jsxs("div",{className:"cj-max-w-4xl cj-mx-auto cj-w-full cj-bg-card cj-border cj-border-border cj-rounded-2xl cj-p-6 cj-flex cj-flex-col cj-gap-2 cj-min-h-full",children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold",children:t("fc_json_title")}),c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:t("fc_json_hint")}),c.jsxs("div",{className:"cj-flex cj-flex-wrap cj-gap-2",children:[c.jsx(Z,{size:"sm",variant:"outline",onClick:m,title:t("fc_json_refresh_hint"),children:t("fc_json_refresh")}),c.jsxs(Z,{size:"sm",variant:"outline",onClick:j,children:[c.jsx(p_,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_copy")]}),c.jsxs(Z,{size:"sm",variant:"outline",onClick:y,children:[c.jsx(__,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_download")]}),!e&&c.jsxs(c.Fragment,{children:[c.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>{var x;return(x=u.current)==null?void 0:x.click()},children:[c.jsx(x_,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_upload")]}),c.jsxs(Z,{size:"sm",onClick:g,disabled:!f,title:t("fc_json_apply_hint"),children:[c.jsx(Dl,{className:"cj-h-3.5 cj-w-3.5 cj-mr-1"}),t("fc_json_import")]}),c.jsx("input",{ref:u,type:"file",accept:".json,application/json",hidden:!0,onChange:_})]})]}),l&&c.jsx("div",{className:"cj-rounded-lg cj-border cj-border-destructive/40 cj-bg-destructive/10 cj-text-destructive cj-text-xs cj-p-2 cj-font-mono",children:l}),c.jsx(Ar,{value:s,onChange:x=>i(x.target.value),className:"cj-flex-1 cj-font-mono cj-text-xs",readOnly:e})]})})}const gb=Ts,jb=Hd,yb=Rs,Yf=h.forwardRef(({className:e,...t},n)=>c.jsx(Er,{className:ne("cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t,ref:n}));Yf.displayName=Er.displayName;const vb=Po("cj-fixed cj-z-50 cj-gap-4 cj-bg-background cj-p-6 cj-shadow-lg cj-transition cj-ease-in-out data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-duration-300 data-[state=open]:cj-duration-500",{variants:{side:{top:"cj-inset-x-0 cj-top-0 cj-border-b data-[state=closed]:cj-slide-out-to-top data-[state=open]:cj-slide-in-from-top",bottom:"cj-inset-x-0 cj-bottom-0 cj-border-t data-[state=closed]:cj-slide-out-to-bottom data-[state=open]:cj-slide-in-from-bottom",left:"cj-inset-y-0 cj-left-0 cj-h-full cj-w-3/4 cj-border-r data-[state=closed]:cj-slide-out-to-left data-[state=open]:cj-slide-in-from-left sm:cj-max-w-sm",right:"cj-inset-y-0 cj-right-0 cj-h-full cj-w-3/4 cj-border-l data-[state=closed]:cj-slide-out-to-right data-[state=open]:cj-slide-in-from-right sm:cj-max-w-sm"}},defaultVariants:{side:"right"}}),qf=h.forwardRef(({side:e="right",className:t,children:n,...r},o)=>c.jsxs(yb,{children:[c.jsx(Yf,{}),c.jsxs(Mr,{ref:o,className:ne(vb({side:e}),t),...r,children:[n,c.jsxs(Yo,{className:"cj-absolute cj-right-4 cj-top-4 cj-rounded-sm cj-opacity-70 cj-ring-offset-background cj-transition-opacity data-[state=open]:cj-bg-secondary hover:cj-opacity-100 focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-pointer-events-none",children:[c.jsx(Vt,{className:"cj-h-4 cj-w-4"}),c.jsx("span",{className:"cj-sr-only",children:"Close"})]})]})]}));qf.displayName=Mr.displayName;const Vf=({className:e,...t})=>c.jsx("div",{className:ne("cj-flex cj-flex-col cj-space-y-2 cj-text-center sm:cj-text-left",e),...t});Vf.displayName="SheetHeader";const Gf=h.forwardRef(({className:e,...t},n)=>c.jsx(Dr,{ref:n,className:ne("cj-text-lg cj-font-semibold cj-text-foreground",e),...t}));Gf.displayName=Dr.displayName;const xb=h.forwardRef(({className:e,...t},n)=>c.jsx(Tr,{ref:n,className:ne("cj-text-sm cj-text-muted-foreground",e),...t}));xb.displayName=Tr.displayName;const Uf={compact:"8px",cozy:"16px",spacious:"24px"};function Xf(e){if(!e)return[];const t=[];return e.primaryColor&&t.push(`--claims-journey-primary: ${e.primaryColor};`),e.backgroundColor&&t.push(`--claims-journey-background: ${e.backgroundColor};`),e.cardColor&&t.push(`--claims-journey-card: ${e.cardColor};`),e.foregroundColor&&t.push(`--claims-journey-foreground: ${e.foregroundColor};`),e.fontFamilyHeading&&t.push(`--claims-journey-font-heading: ${e.fontFamilyHeading};`),e.fontFamilyBody&&t.push(`--claims-journey-font-body: ${e.fontFamilyBody};`),e.borderRadius!==void 0&&t.push(`--claims-journey-radius: ${e.borderRadius}rem;`),e.spacing&&t.push(`--claims-journey-spacing: ${Uf[e.spacing]};`),e.fontSizeBase!==void 0&&t.push(`font-size: ${e.fontSizeBase}px;`),t}function bb(e,t){const n=Xf(e);return n.length?`${t} { ${n.join(" ")} }`:null}function Kf(e){const t={};return e&&(e.primaryColor&&(t["--claims-journey-primary"]=e.primaryColor),e.backgroundColor&&(t["--claims-journey-background"]=e.backgroundColor),e.cardColor&&(t["--claims-journey-card"]=e.cardColor),e.foregroundColor&&(t["--claims-journey-foreground"]=e.foregroundColor),e.fontFamilyHeading&&(t["--claims-journey-font-heading"]=e.fontFamilyHeading),e.fontFamilyBody&&(t["--claims-journey-font-body"]=e.fontFamilyBody),e.borderRadius!==void 0&&(t["--claims-journey-radius"]=`${e.borderRadius}rem`),e.spacing&&(t["--claims-journey-spacing"]=Uf[e.spacing]),e.fontSizeBase!==void 0&&(t.fontSize=`${e.fontSizeBase}px`)),t}const jc=[{label:"Poppins (default)",value:"'Poppins', sans-serif"},{label:"Roboto (default)",value:"'Roboto', sans-serif"},{label:"Inter",value:"'Inter', sans-serif"},{label:"System UI",value:"system-ui, sans-serif"},{label:"Georgia",value:"Georgia, serif"}];function wb(e){if(!e)return"#000000";const t=e.trim().match(/^(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%$/);if(!t)return"#000000";const n=parseFloat(t[1])/360,r=parseFloat(t[2])/100,o=parseFloat(t[3])/100,a=(u,f,m)=>(m<0&&(m+=1),m>1&&(m-=1),m<1/6?u+(f-u)*6*m:m<1/2?f:m<2/3?u+(f-u)*(2/3-m)*6:u);let s,i,l;if(r===0)s=i=l=o;else{const u=o<.5?o*(1+r):o+r-o*r,f=2*o-u;s=a(f,u,n+1/3),i=a(f,u,n),l=a(f,u,n-1/3)}const d=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${d(s)}${d(i)}${d(l)}`}function Nb(e){const t=e.replace("#","").match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!t)return"0 0% 0%";const n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,o=parseInt(t[3],16)/255,a=Math.max(n,r,o),s=Math.min(n,r,o);let i=0,l=0;const d=(a+s)/2;if(a!==s){const u=a-s;switch(l=d>.5?u/(2-a-s):u/(a+s),a){case n:i=(r-o)/u+(r<o?6:0);break;case r:i=(o-n)/u+2;break;case o:i=(n-r)/u+4;break}i/=6}return`${Math.round(i*360)} ${Math.round(l*100)}% ${Math.round(d*100)}%`}function Jr({label:e,value:t,onChange:n}){const{t:r}=je(),o=wb(t);return c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e}),c.jsxs("div",{className:"cj-flex cj-gap-2 cj-items-center",children:[c.jsx("input",{type:"color",value:o,onChange:a=>n(Nb(a.target.value)),className:"cj-h-9 cj-w-12 cj-rounded-md cj-border cj-border-input cj-bg-background cj-cursor-pointer cj-p-1","aria-label":r("theme_color_picker_aria",{label:e})}),c.jsx(pe,{value:t||"",onChange:a=>n(a.target.value),placeholder:r("theme_color_placeholder"),className:"cj-h-9 cj-text-xs cj-font-mono cj-flex-1"})]}),c.jsx("p",{className:"cj-text-[10px] cj-text-muted-foreground",children:r("theme_color_hint")})]})}function Sb(){const{t:e}=je(),{theme:t,updateTheme:n,resetTheme:r}=wt(),[o,a]=v.useState(null),s=l=>n(l),i=Kf(t);return c.jsxs(gb,{children:[c.jsx(jb,{asChild:!0,children:c.jsxs(Z,{size:"sm",variant:"outline",children:[c.jsx(k_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),e("theme_button")]})}),c.jsx(qf,{className:"cj-w-[360px] sm:cj-w-[420px] cj-overflow-y-auto",ref:a,children:c.jsxs(Zo.Provider,{value:o,children:[c.jsx(Vf,{children:c.jsxs(Gf,{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsx("span",{children:e("theme_button")}),c.jsxs(Z,{size:"sm",variant:"ghost",onClick:()=>r(),children:[c.jsx(El,{className:"cj-h-3 cj-w-3 cj-mr-1"}),e("theme_reset")]})]})}),c.jsxs("div",{className:"cj-space-y-4 cj-mt-4",children:[c.jsxs("section",{className:"cj-space-y-3",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_colors")}),c.jsx(Jr,{label:e("theme_primary"),value:t.primaryColor,onChange:l=>s({primaryColor:l})}),c.jsx(Jr,{label:e("theme_background"),value:t.backgroundColor,onChange:l=>s({backgroundColor:l})}),c.jsx(Jr,{label:e("theme_card"),value:t.cardColor,onChange:l=>s({cardColor:l})}),c.jsx(Jr,{label:e("theme_foreground"),value:t.foregroundColor,onChange:l=>s({foregroundColor:l})})]}),c.jsxs("section",{className:"cj-space-y-3",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_typography")}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_heading_font")}),c.jsxs(Oe,{value:t.fontFamilyHeading||void 0,onValueChange:l=>s({fontFamilyHeading:l}),children:[c.jsx(Pe,{className:"cj-h-9 cj-text-xs",children:c.jsx(Ae,{placeholder:e("theme_font_default")})}),c.jsx(Ee,{children:jc.map(l=>c.jsx(K,{value:l.value,children:l.label},l.value))})]})]}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_body_font")}),c.jsxs(Oe,{value:t.fontFamilyBody||void 0,onValueChange:l=>s({fontFamilyBody:l}),children:[c.jsx(Pe,{className:"cj-h-9 cj-text-xs",children:c.jsx(Ae,{placeholder:e("theme_font_default")})}),c.jsx(Ee,{children:jc.map(l=>c.jsx(K,{value:l.value,children:l.label},l.value))})]})]}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_font_size")}),c.jsx(pe,{type:"number",min:12,max:24,value:t.fontSizeBase??"",onChange:l=>s({fontSizeBase:l.target.value?Number(l.target.value):void 0}),placeholder:"16",className:"cj-h-9 cj-text-xs"})]})]}),c.jsxs("section",{className:"cj-space-y-3",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_shape_spacing")}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_border_radius")}),c.jsx(pe,{type:"number",step:"0.125",min:0,max:2,value:t.borderRadius??"",onChange:l=>s({borderRadius:l.target.value?Number(l.target.value):void 0}),placeholder:"0.75",className:"cj-h-9 cj-text-xs"})]}),c.jsxs("div",{className:"cj-space-y-1",children:[c.jsx(X,{className:"cj-text-xs",children:e("theme_spacing")}),c.jsxs(Oe,{value:t.spacing||void 0,onValueChange:l=>s({spacing:l}),children:[c.jsx(Pe,{className:"cj-h-9 cj-text-xs",children:c.jsx(Ae,{placeholder:e("theme_spacing_cozy_default")})}),c.jsxs(Ee,{children:[c.jsx(K,{value:"compact",children:e("theme_spacing_compact")}),c.jsx(K,{value:"cozy",children:e("theme_spacing_cozy")}),c.jsx(K,{value:"spacious",children:e("theme_spacing_spacious")})]})]})]})]}),c.jsxs("section",{className:"cj-space-y-2",children:[c.jsx("h4",{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide cj-text-muted-foreground",children:e("theme_live_preview")}),c.jsx("div",{className:"jb-widget-root jb-themed cj-rounded-lg cj-border cj-border-border cj-bg-background cj-text-foreground",style:{...i,padding:"var(--claims-journey-spacing, 16px)"},children:c.jsxs("div",{className:"cj-rounded-lg cj-border cj-border-border cj-bg-card cj-text-foreground",style:{padding:"var(--claims-journey-spacing, 16px)",display:"flex",flexDirection:"column",gap:"calc(var(--claims-journey-spacing, 16px) / 2)"},children:[c.jsx("h3",{className:"cj-m-0 cj-text-lg cj-font-semibold",style:{fontFamily:"var(--claims-journey-font-heading)"},children:e("theme_heading_sample")}),c.jsx("p",{className:"cj-m-0 cj-text-sm cj-text-muted-foreground",style:{fontFamily:"var(--claims-journey-font-body)"},children:e("theme_body_sample")}),c.jsx("input",{className:"cj-w-full cj-border cj-border-input cj-bg-background cj-text-foreground cj-text-sm cj-px-3 cj-rounded-md",style:{fontFamily:"var(--claims-journey-font-body)",borderRadius:"var(--claims-journey-radius)",minHeight:"calc(var(--claims-journey-spacing, 16px) * 2 + 16px)"},placeholder:e("theme_input_sample"),readOnly:!0}),c.jsx("button",{type:"button",className:"cj-bg-primary cj-text-primary-foreground cj-text-sm cj-font-medium cj-self-start cj-cursor-default",style:{fontFamily:"var(--claims-journey-font-body)",borderRadius:"var(--claims-journey-radius)",padding:"calc(var(--claims-journey-spacing, 16px) / 2) var(--claims-journey-spacing, 16px)",border:"none"},children:e("theme_primary_action")})]})})]})]})]})})]})}const as="cj-theme-portal-vars",ss="data-cj-themed-portals";let Qr=0;const Cb=["[data-radix-popper-content-wrapper]","[data-radix-popper-content-wrapper] *",'[role="dialog"]','[role="alertdialog"]',"[data-vaul-drawer]","[data-sonner-toaster]"].map(e=>`html[${ss}="true"] ${e}`).join(`,
279
279
  `);function kb(e){const t=Xf(e);return t.length?`${Cb} {
280
280
  ${t.join(`
281
281
  `)}
282
- }`:""}function yc(){let e=document.getElementById(as);return e||(e=document.createElement("style"),e.id=as,document.head.appendChild(e)),e}function Pb(e){y.useEffect(()=>(Qr+=1,document.documentElement.setAttribute(ss,"true"),yc(),()=>{var t;Qr=Math.max(0,Qr-1),Qr===0&&(document.documentElement.removeAttribute(ss),(t=document.getElementById(as))==null||t.remove())}),[]),y.useEffect(()=>{const t=yc();t.innerHTML=kb(e)},[e])}function Eb({specs:e=[],readOnly:t=!1,onSave:n,onPublish:r,onUnlockEdit:o,onOpenRunner:a}){const{t:s}=je(),{activeTab:i,setActiveTab:l,isDirty:d,undo:u,redo:f,canUndo:m,canRedo:p,formConfig:j,theme:_}=wt(),g=Kf(_);return Pb(_),c.jsxs("div",{className:"cj-h-full cj-w-full cj-flex cj-flex-col cj-bg-muted/20",style:g,children:[c.jsxs("header",{className:"cj-h-14 cj-border-b cj-bg-card cj-px-4 cj-flex cj-items-center cj-justify-between cj-shrink-0",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[c.jsx("h1",{className:"cj-text-lg cj-font-semibold",children:s("fc_title")}),c.jsx(jt,{variant:"secondary",className:"cj-text-[10px]",children:"v2.0"}),t&&c.jsxs(jt,{variant:"secondary",className:"cj-gap-1",children:[c.jsx(S_,{className:"cj-h-3 cj-w-3"}),s("fc_read_only")]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[!t&&c.jsxs(c.Fragment,{children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-8 cj-w-8",onClick:u,disabled:!m(),title:s("fc_undo"),children:c.jsx(R_,{className:"cj-h-4 cj-w-4"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-8 cj-w-8",onClick:f,disabled:!p(),title:s("fc_redo"),children:c.jsx(E_,{className:"cj-h-4 cj-w-4"})}),c.jsx(Sb,{})]}),a&&j.steps.length>0&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:a,children:[c.jsx(g_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_preview_form")]}),!t&&n&&c.jsxs(Z,{size:"sm",onClick:n,disabled:!d,className:"cj-relative",children:[c.jsx(M_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_save"),d&&c.jsx("span",{className:"cj-absolute -cj-top-1 -cj-right-1 cj-h-2.5 cj-w-2.5 cj-rounded-full cj-bg-destructive cj-border-2 cj-border-card"})]}),!t&&r&&c.jsxs(Z,{size:"sm",variant:"default",onClick:r,children:[c.jsx(b_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_publish")]}),t&&o&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:o,children:[c.jsx(N_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_unlock_edit")]})]})]}),c.jsx("div",{className:"cj-border-b cj-bg-card cj-px-4",children:c.jsx(o_,{value:i,onValueChange:v=>l(v),children:c.jsxs(wl,{className:"cj-h-10 cj-bg-transparent cj-p-0 cj-gap-1",children:[c.jsxs(mr,{value:"steps",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(w_,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_steps")]}),c.jsxs(mr,{value:"fields",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(h_,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_fields")]}),c.jsxs(mr,{value:"init",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(Tl,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_init")]}),c.jsxs(mr,{value:"json",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(j_,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_json")]})]})})}),c.jsxs("div",{className:"cj-flex-1 cj-min-h-0 cj-overflow-hidden",children:[i==="steps"&&c.jsxs(ig,{direction:"horizontal",children:[c.jsx(ba,{defaultSize:22,minSize:18,maxSize:32,children:c.jsx(sy,{readOnly:t})}),c.jsx(Bi,{withHandle:!0}),c.jsx(ba,{defaultSize:52,minSize:40,children:c.jsx(Wx,{specs:e,readOnly:t})}),c.jsx(Bi,{withHandle:!0}),c.jsx(ba,{defaultSize:26,minSize:22,maxSize:40,children:c.jsx(Fx,{readOnly:t})})]}),i==="fields"&&c.jsx(Bx,{specs:e,readOnly:t}),i==="init"&&c.jsx(Hx,{readOnly:t}),i==="json"&&c.jsx(_b,{readOnly:t})]})]})}const Mb=y.createContext([]);function Db({specs:e=[],journey:t,onSave:n,onPublish:r,onUnlockEdit:o,onChange:a,onOpenRunner:s,readOnly:i=!1}){const{importJourneySpec:l,exportJourneySpec:d,markClean:u,formConfig:f}=wt(),m=y.useRef(null),[p,j]=y.useState(null);y.useEffect(()=>{m.current&&j(m.current)},[]),y.useEffect(()=>{t&&l(t)},[]),y.useEffect(()=>{a&&(f.steps.length>0||f.fields.length>0)&&a(d())},[f]);const _=y.useCallback(()=>{const v=d();n==null||n(v),u()},[d,n,u]),g=y.useCallback(()=>{r==null||r(d())},[d,r]);return c.jsx("div",{ref:m,className:"jb-widget-root cj-h-full cj-w-full cj-relative cj-overflow-hidden",children:c.jsx(Zo.Provider,{value:p,children:c.jsx(Mb.Provider,{value:e,children:c.jsx(Eb,{specs:e,readOnly:i,onSave:!i&&n?_:void 0,onPublish:!i&&r?g:void 0,onUnlockEdit:i?o:void 0,onOpenRunner:s})})})})}function Tb(e,t=[]){let n=[];function r(a,s){const i=h.createContext(s);i.displayName=a+"Context";const l=n.length;n=[...n,s];const d=f=>{var v;const{scope:m,children:p,...j}=f,_=((v=m==null?void 0:m[e])==null?void 0:v[l])||i,g=h.useMemo(()=>j,Object.values(j));return c.jsx(_.Provider,{value:g,children:p})};d.displayName=a+"Provider";function u(f,m){var _;const p=((_=m==null?void 0:m[e])==null?void 0:_[l])||i,j=h.useContext(p);if(j)return j;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[d,u]}const o=()=>{const a=n.map(s=>h.createContext(s));return function(i){const l=(i==null?void 0:i[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Rb(o,...t)]}function Rb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((i,{useScope:l,scopeName:d})=>{const f=l(a)[`__scope${d}`];return{...i,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Ob=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jf=Ob.reduce((e,t)=>{const n=ko(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qs="Progress",Zs=100,[Ab]=Tb(Qs),[zb,Ib]=Ab(Qs),Qf=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:a=Wb,...s}=e;(o||o===0)&&!vc(o)&&console.error($b(`${o}`,"Progress"));const i=vc(o)?o:Zs;r!==null&&!xc(r,i)&&console.error(Fb(`${r}`,"Progress"));const l=xc(r,i)?r:null,d=bo(l)?a(l,i):void 0;return c.jsx(zb,{scope:n,value:l,max:i,children:c.jsx(Jf.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":bo(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":tm(l,i),"data-value":l??void 0,"data-max":i,...s,ref:t})})});Qf.displayName=Qs;var Zf="ProgressIndicator",em=h.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=Ib(Zf,n);return c.jsx(Jf.div,{"data-state":tm(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});em.displayName=Zf;function Wb(e,t){return`${Math.round(e/t*100)}%`}function tm(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function bo(e){return typeof e=="number"}function vc(e){return bo(e)&&!isNaN(e)&&e>0}function xc(e,t){return bo(e)&&!isNaN(e)&&e<=t&&e>=0}function $b(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Zs}\`.`}function Fb(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
282
+ }`:""}function yc(){let e=document.getElementById(as);return e||(e=document.createElement("style"),e.id=as,document.head.appendChild(e)),e}function Pb(e){v.useEffect(()=>(Qr+=1,document.documentElement.setAttribute(ss,"true"),yc(),()=>{var t;Qr=Math.max(0,Qr-1),Qr===0&&(document.documentElement.removeAttribute(ss),(t=document.getElementById(as))==null||t.remove())}),[]),v.useEffect(()=>{const t=yc();t.innerHTML=kb(e)},[e])}function Eb({specs:e=[],readOnly:t=!1,onSave:n,onPublish:r,onUnlockEdit:o,onOpenRunner:a}){const{t:s}=je(),{activeTab:i,setActiveTab:l,isDirty:d,undo:u,redo:f,canUndo:m,canRedo:p,formConfig:g,theme:_}=wt(),j=Kf(_);return Pb(_),c.jsxs("div",{className:"cj-h-full cj-w-full cj-flex cj-flex-col cj-bg-muted/20",style:j,children:[c.jsxs("header",{className:"cj-h-14 cj-border-b cj-bg-card cj-px-4 cj-flex cj-items-center cj-justify-between cj-shrink-0",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[c.jsx("h1",{className:"cj-text-lg cj-font-semibold",children:s("fc_title")}),c.jsx(jt,{variant:"secondary",className:"cj-text-[10px]",children:"v2.0"}),t&&c.jsxs(jt,{variant:"secondary",className:"cj-gap-1",children:[c.jsx(S_,{className:"cj-h-3 cj-w-3"}),s("fc_read_only")]})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[!t&&c.jsxs(c.Fragment,{children:[c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-8 cj-w-8",onClick:u,disabled:!m(),title:s("fc_undo"),children:c.jsx(R_,{className:"cj-h-4 cj-w-4"})}),c.jsx(Z,{size:"icon",variant:"ghost",className:"cj-h-8 cj-w-8",onClick:f,disabled:!p(),title:s("fc_redo"),children:c.jsx(E_,{className:"cj-h-4 cj-w-4"})}),c.jsx(Sb,{})]}),a&&g.steps.length>0&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:a,children:[c.jsx(g_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_preview_form")]}),!t&&n&&c.jsxs(Z,{size:"sm",onClick:n,disabled:!d,className:"cj-relative",children:[c.jsx(M_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_save"),d&&c.jsx("span",{className:"cj-absolute -cj-top-1 -cj-right-1 cj-h-2.5 cj-w-2.5 cj-rounded-full cj-bg-destructive cj-border-2 cj-border-card"})]}),!t&&r&&c.jsxs(Z,{size:"sm",variant:"default",onClick:r,children:[c.jsx(b_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_publish")]}),t&&o&&c.jsxs(Z,{size:"sm",variant:"outline",onClick:o,children:[c.jsx(N_,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("fc_unlock_edit")]})]})]}),c.jsx("div",{className:"cj-border-b cj-bg-card cj-px-4",children:c.jsx(o_,{value:i,onValueChange:y=>l(y),children:c.jsxs(wl,{className:"cj-h-10 cj-bg-transparent cj-p-0 cj-gap-1",children:[c.jsxs(mr,{value:"steps",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(w_,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_steps")]}),c.jsxs(mr,{value:"fields",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(h_,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_fields")]}),c.jsxs(mr,{value:"init",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(Tl,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_init")]}),c.jsxs(mr,{value:"json",className:"cj-h-10 cj-rounded-none cj-border-b-2 cj-border-transparent data-[state=active]:cj-border-primary data-[state=active]:cj-bg-transparent data-[state=active]:cj-shadow-none cj-px-3 cj-gap-1.5",children:[c.jsx(j_,{className:"cj-h-3.5 cj-w-3.5"}),s("fc_tab_json")]})]})})}),c.jsxs("div",{className:"cj-flex-1 cj-min-h-0 cj-overflow-hidden",children:[i==="steps"&&c.jsxs(ig,{direction:"horizontal",children:[c.jsx(ba,{defaultSize:22,minSize:18,maxSize:32,children:c.jsx(sy,{readOnly:t})}),c.jsx(Bi,{withHandle:!0}),c.jsx(ba,{defaultSize:52,minSize:40,children:c.jsx(Wx,{specs:e,readOnly:t})}),c.jsx(Bi,{withHandle:!0}),c.jsx(ba,{defaultSize:26,minSize:22,maxSize:40,children:c.jsx(Fx,{readOnly:t})})]}),i==="fields"&&c.jsx(Bx,{specs:e,readOnly:t}),i==="init"&&c.jsx(Hx,{readOnly:t}),i==="json"&&c.jsx(_b,{readOnly:t})]})]})}const Mb=v.createContext([]);function Db({specs:e=[],journey:t,onSave:n,onPublish:r,onUnlockEdit:o,onChange:a,onOpenRunner:s,readOnly:i=!1}){const{importJourneySpec:l,exportJourneySpec:d,markClean:u,formConfig:f}=wt(),m=v.useRef(null),[p,g]=v.useState(null);v.useEffect(()=>{m.current&&g(m.current)},[]),v.useEffect(()=>{t&&l(t)},[]),v.useEffect(()=>{a&&(f.steps.length>0||f.fields.length>0)&&a(d())},[f]);const _=v.useCallback(()=>{const y=d();n==null||n(y),u()},[d,n,u]),j=v.useCallback(()=>{r==null||r(d())},[d,r]);return c.jsx("div",{ref:m,className:"jb-widget-root cj-h-full cj-w-full cj-relative cj-overflow-hidden",children:c.jsx(Zo.Provider,{value:p,children:c.jsx(Mb.Provider,{value:e,children:c.jsx(Eb,{specs:e,readOnly:i,onSave:!i&&n?_:void 0,onPublish:!i&&r?j:void 0,onUnlockEdit:i?o:void 0,onOpenRunner:s})})})})}function Tb(e,t=[]){let n=[];function r(a,s){const i=h.createContext(s);i.displayName=a+"Context";const l=n.length;n=[...n,s];const d=f=>{var y;const{scope:m,children:p,...g}=f,_=((y=m==null?void 0:m[e])==null?void 0:y[l])||i,j=h.useMemo(()=>g,Object.values(g));return c.jsx(_.Provider,{value:j,children:p})};d.displayName=a+"Provider";function u(f,m){var _;const p=((_=m==null?void 0:m[e])==null?void 0:_[l])||i,g=h.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[d,u]}const o=()=>{const a=n.map(s=>h.createContext(s));return function(i){const l=(i==null?void 0:i[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Rb(o,...t)]}function Rb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((i,{useScope:l,scopeName:d})=>{const f=l(a)[`__scope${d}`];return{...i,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Ob=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jf=Ob.reduce((e,t)=>{const n=ko(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:s,...i}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qs="Progress",Zs=100,[Ab]=Tb(Qs),[zb,Ib]=Ab(Qs),Qf=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:a=Wb,...s}=e;(o||o===0)&&!vc(o)&&console.error($b(`${o}`,"Progress"));const i=vc(o)?o:Zs;r!==null&&!xc(r,i)&&console.error(Fb(`${r}`,"Progress"));const l=xc(r,i)?r:null,d=bo(l)?a(l,i):void 0;return c.jsx(zb,{scope:n,value:l,max:i,children:c.jsx(Jf.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":bo(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":tm(l,i),"data-value":l??void 0,"data-max":i,...s,ref:t})})});Qf.displayName=Qs;var Zf="ProgressIndicator",em=h.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=Ib(Zf,n);return c.jsx(Jf.div,{"data-state":tm(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});em.displayName=Zf;function Wb(e,t){return`${Math.round(e/t*100)}%`}function tm(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function bo(e){return typeof e=="number"}function vc(e){return bo(e)&&!isNaN(e)&&e>0}function xc(e,t){return bo(e)&&!isNaN(e)&&e<=t&&e>=0}function $b(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Zs}\`.`}function Fb(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
283
283
  - a positive number
284
284
  - less than the value passed to \`max\` (or ${Zs} if no \`max\` prop is set)
285
285
  - \`null\` or \`undefined\` if the progress is indeterminate.
286
286
 
287
- Defaulting to \`null\`.`}var nm=Qf,Lb=em;const rm=h.forwardRef(({className:e,value:t,...n},r)=>c.jsx(nm,{ref:r,className:ne("cj-relative cj-h-4 cj-w-full cj-overflow-hidden cj-rounded-full cj-bg-secondary",e),...n,children:c.jsx(Lb,{className:"cj-h-full cj-w-full cj-flex-1 cj-bg-primary cj-transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));rm.displayName=nm.displayName;function Bb({label:e,value:t,onChange:n,placeholder:r,helpText:o,multiline:a=!1}){const{t:s}=je();return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),a?c.jsx(Ar,{value:t,onChange:i=>n(i.target.value),placeholder:r||s("placeholder_text"),className:"cj-min-h-[100px]"}):c.jsx(pe,{type:"text",value:t,onChange:i=>n(i.target.value),placeholder:r||s("placeholder_text")}),o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}var ei="Radio",[Hb,om]=st(ei),[Yb,qb]=Hb(ei),am=h.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:a,disabled:s,value:i="on",onCheck:l,form:d,...u}=e,[f,m]=h.useState(null),p=he(t,g=>m(g)),j=h.useRef(!1),_=f?d||!!f.closest("form"):!0;return c.jsxs(Yb,{scope:n,checked:o,disabled:s,children:[c.jsx(se.button,{type:"button",role:"radio","aria-checked":o,"data-state":lm(o),"data-disabled":s?"":void 0,disabled:s,value:i,...u,ref:p,onClick:re(e.onClick,g=>{o||l==null||l(),_&&(j.current=g.isPropagationStopped(),j.current||g.stopPropagation())})}),_&&c.jsx(cm,{control:f,bubbles:!j.current,name:r,value:i,checked:o,required:a,disabled:s,form:d,style:{transform:"translateX(-100%)"}})]})});am.displayName=ei;var sm="RadioIndicator",im=h.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,a=qb(sm,n);return c.jsx(it,{present:r||a.checked,children:c.jsx(se.span,{"data-state":lm(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})});im.displayName=sm;var Vb="RadioBubbleInput",cm=h.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=h.useRef(null),i=he(s,a),l=Ys(n),d=Fs(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&p){const j=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(j)}},[l,n,r]),c.jsx(se.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});cm.displayName=Vb;function lm(e){return e?"checked":"unchecked"}var Gb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],oa="RadioGroup",[Ub]=st(oa,[Eo,om]),dm=Eo(),um=om(),[Xb,Kb]=Ub(oa),fm=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:a,required:s=!1,disabled:i=!1,orientation:l,dir:d,loop:u=!0,onValueChange:f,...m}=e,p=dm(n),j=kr(d),[_,g]=Ht({prop:a,defaultProp:o??null,onChange:f,caller:oa});return c.jsx(Xb,{scope:n,name:r,required:s,disabled:i,value:_,onValueChange:g,children:c.jsx(cl,{asChild:!0,...p,orientation:l,dir:j,loop:u,children:c.jsx(se.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":i?"":void 0,dir:j,...m,ref:t})})})});fm.displayName=oa;var mm="RadioGroupItem",pm=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,a=Kb(mm,n),s=a.disabled||r,i=dm(n),l=um(n),d=h.useRef(null),u=he(t,d),f=a.value===o.value,m=h.useRef(!1);return h.useEffect(()=>{const p=_=>{Gb.includes(_.key)&&(m.current=!0)},j=()=>m.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",j),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",j)}},[]),c.jsx(ll,{asChild:!0,...i,focusable:!s,active:f,children:c.jsx(am,{disabled:s,required:a.required,checked:f,...l,...o,name:a.name,ref:u,onCheck:()=>a.onValueChange(o.value),onKeyDown:re(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:re(o.onFocus,()=>{var p;m.current&&((p=d.current)==null||p.click())})})})});pm.displayName=mm;var Jb="RadioGroupIndicator",hm=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=um(n);return c.jsx(im,{...o,...r,ref:t})});hm.displayName=Jb;var _m=fm,gm=pm,Qb=hm;const jm=h.forwardRef(({className:e,...t},n)=>c.jsx(_m,{className:ne("cj-grid cj-gap-2",e),...t,ref:n}));jm.displayName=_m.displayName;const ym=h.forwardRef(({className:e,...t},n)=>c.jsx(gm,{ref:n,className:ne("cj-aspect-square cj-h-5 cj-w-5 cj-rounded-full cj-border cj-border-primary cj-text-primary cj-ring-offset-background focus:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 cj-shrink-0",e),...t,children:c.jsx(Qb,{className:"cj-flex cj-items-center cj-justify-center",children:c.jsx(m_,{className:"cj-h-3 cj-w-3 cj-fill-current cj-text-current"})})}));ym.displayName=gm.displayName;function Zb({label:e,value:t,onChange:n,options:r,helpText:o,variant:a="auto"}){const{t:s}=je(),i=a==="auto"?r.length<=5?"radio":"dropdown":a;return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),i==="radio"&&c.jsx(jm,{value:t,onValueChange:n,className:"cj-space-y-1",children:r.map(l=>c.jsxs("label",{htmlFor:l.data,className:"cj-flex cj-items-center cj-gap-3 cj-rounded-xl cj-border cj-border-border/40 cj-bg-card cj-px-4 cj-py-3.5 cj-cursor-pointer cj-transition-colors hover:cj-bg-accent/50 data-[state=checked]:cj-border-primary/40 data-[state=checked]:cj-bg-primary/5",children:[c.jsx(ym,{value:l.data,id:l.data}),c.jsx("span",{className:"cj-text-sm cj-font-normal cj-text-foreground cj-select-none",children:l.label})]},l.data))}),i==="dropdown"&&c.jsxs(Oe,{value:t,onValueChange:n,children:[c.jsx(Pe,{className:"cj-w-full cj-h-12",children:c.jsx(Ae,{placeholder:s("placeholder_select")})}),c.jsx(Ee,{className:"cj-bg-popover cj-z-50",children:r.map(l=>c.jsx(K,{value:l.data,className:"cj-py-3",children:l.label},l.data))})]}),i==="segmented"&&c.jsx("div",{role:"radiogroup",className:"cj-grid cj-gap-2",style:{gridTemplateColumns:`repeat(${Math.min(r.length,4)}, minmax(0, 1fr))`},children:r.map(l=>{const d=t===l.data;return c.jsx("button",{type:"button",role:"radio","aria-checked":d,onClick:()=>n(l.data),className:["cj-flex cj-items-center cj-justify-center cj-text-center","cj-min-h-12 cj-px-4 cj-py-3 cj-rounded-xl cj-border cj-text-sm cj-font-medium","cj-transition-colors",d?"cj-border-primary cj-bg-primary/10 cj-text-primary":"cj-border-border/40 cj-bg-card cj-text-foreground hover:cj-bg-accent/50"].join(" "),children:l.label},l.data)})}),o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function He(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ie(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function vm(e,t){const n=He(e);return isNaN(t)?Ie(e,NaN):(t&&n.setDate(n.getDate()+t),n)}const xm=6048e5,ew=864e5,tw=6e4,nw=36e5,rw=1e3;let ow={};function nr(){return ow}function cn(e,t){var i,l,d,u;const n=nr(),r=(t==null?void 0:t.weekStartsOn)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,o=He(e),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Xn(e){return cn(e,{weekStartsOn:1})}function bm(e){const t=He(e),n=t.getFullYear(),r=Ie(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Xn(r),a=Ie(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=Xn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function bc(e){const t=He(e);return t.setHours(0,0,0,0),t}function wo(e){const t=He(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function aw(e,t){const n=bc(e),r=bc(t),o=+n-wo(n),a=+r-wo(r);return Math.round((o-a)/ew)}function sw(e){const t=bm(e),n=Ie(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Xn(n)}function iw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ti(e){if(!iw(e)&&typeof e!="number")return!1;const t=He(e);return!isNaN(Number(t))}function cw(e){const t=He(e),n=Ie(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const lw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dw=(e,t,n)=>{let r;const o=lw[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Bt(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pw={date:Bt({formats:uw,defaultWidth:"full"}),time:Bt({formats:fw,defaultWidth:"full"}),dateTime:Bt({formats:mw,defaultWidth:"full"})},hw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_w=(e,t,n,r)=>hw[e];function Xe(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):s;o=e.formattingValues[i]||e.formattingValues[s]}else{const s=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const gw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yw={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vw={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},bw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ww=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Nw={ordinalNumber:ww,era:Xe({values:gw,defaultWidth:"wide"}),quarter:Xe({values:jw,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xe({values:yw,defaultWidth:"wide"}),day:Xe({values:vw,defaultWidth:"wide"}),dayPeriod:Xe({values:xw,defaultWidth:"wide",formattingValues:bw,defaultFormattingWidth:"wide"})};function Ke(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?Cw(i,f=>f.test(s)):Sw(i,f=>f.test(s));let d;d=e.valueCallback?e.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(s.length);return{value:d,rest:u}}}function Sw(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Cw(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ni(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const i=t.slice(o.length);return{value:s,rest:i}}}const kw=/^(\d+)(th|st|nd|rd)?/i,Pw=/\d+/i,Ew={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Mw={any:[/^b/i,/^(a|c)/i]},Dw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tw={any:[/1/i,/2/i,/3/i,/4/i]},Rw={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ow={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Aw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},zw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Iw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ww={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$w={ordinalNumber:ni({matchPattern:kw,parsePattern:Pw,valueCallback:e=>parseInt(e,10)}),era:Ke({matchPatterns:Ew,defaultMatchWidth:"wide",parsePatterns:Mw,defaultParseWidth:"any"}),quarter:Ke({matchPatterns:Dw,defaultMatchWidth:"wide",parsePatterns:Tw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ke({matchPatterns:Rw,defaultMatchWidth:"wide",parsePatterns:Ow,defaultParseWidth:"any"}),day:Ke({matchPatterns:Aw,defaultMatchWidth:"wide",parsePatterns:zw,defaultParseWidth:"any"}),dayPeriod:Ke({matchPatterns:Iw,defaultMatchWidth:"any",parsePatterns:Ww,defaultParseWidth:"any"})},aa={code:"en-US",formatDistance:dw,formatLong:pw,formatRelative:_w,localize:Nw,match:$w,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Fw(e){const t=He(e);return aw(t,cw(t))+1}function wm(e){const t=He(e),n=+Xn(t)-+sw(t);return Math.round(n/xm)+1}function ri(e,t){var u,f,m,p;const n=He(e),r=n.getFullYear(),o=nr(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(m=o.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ie(e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const i=cn(s,t),l=Ie(e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const d=cn(l,t);return n.getTime()>=i.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lw(e,t){var i,l,d,u;const n=nr(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,o=ri(e,t),a=Ie(e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),cn(a,t)}function Nm(e,t){const n=He(e),r=+cn(n,t)-+Lw(n,t);return Math.round(r/xm)+1}function xe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const en={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return xe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):xe(n+1,2)},d(e,t){return xe(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return xe(e.getHours()%12||12,t.length)},H(e,t){return xe(e.getHours(),t.length)},m(e,t){return xe(e.getMinutes(),t.length)},s(e,t){return xe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return xe(o,t.length)}},zn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wc={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return en.y(e,t)},Y:function(e,t,n,r){const o=ri(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return xe(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):xe(a,t.length)},R:function(e,t){const n=bm(e);return xe(n,t.length)},u:function(e,t){const n=e.getFullYear();return xe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return xe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return xe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return en.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return xe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Nm(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):xe(o,t.length)},I:function(e,t,n){const r=wm(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):xe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):en.d(e,t)},D:function(e,t,n){const r=Fw(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):xe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return xe(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return xe(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return xe(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=zn.noon:r===0?o=zn.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=zn.evening:r>=12?o=zn.afternoon:r>=4?o=zn.morning:o=zn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return en.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):en.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):xe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):xe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):en.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):en.s(e,t)},S:function(e,t){return en.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Sc(r);case"XXXX":case"XX":return hn(r);case"XXXXX":case"XXX":default:return hn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Sc(r);case"xxxx":case"xx":return hn(r);case"xxxxx":case"xxx":default:return hn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nc(r,":");case"OOOO":default:return"GMT"+hn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nc(r,":");case"zzzz":default:return"GMT"+hn(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return xe(r,t.length)},T:function(e,t,n){const r=e.getTime();return xe(r,t.length)}};function Nc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+xe(a,2)}function Sc(e,t){return e%60===0?(e>0?"-":"+")+xe(Math.abs(e)/60,2):hn(e,t)}function hn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=xe(Math.trunc(r/60),2),a=xe(r%60,2);return n+o+t+a}const Cc=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Sm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Bw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Cc(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Cc(r,t)).replace("{{time}}",Sm(o,t))},is={p:Sm,P:Bw},Hw=/^D+$/,Yw=/^Y+$/,qw=["D","DD","YY","YYYY"];function Cm(e){return Hw.test(e)}function km(e){return Yw.test(e)}function cs(e,t,n){const r=Vw(e,t,n);if(console.warn(r),qw.includes(e))throw new RangeError(r)}function Vw(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Uw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xw=/^'([^]*?)'?$/,Kw=/''/g,Jw=/[a-zA-Z]/;function No(e,t,n){var u,f,m,p;const r=nr(),o=r.locale??aa,a=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=r.weekStartsOn??((p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,i=He(e);if(!ti(i))throw new RangeError("Invalid time value");let l=t.match(Uw).map(j=>{const _=j[0];if(_==="p"||_==="P"){const g=is[_];return g(j,o.formatLong)}return j}).join("").match(Gw).map(j=>{if(j==="''")return{isToken:!1,value:"'"};const _=j[0];if(_==="'")return{isToken:!1,value:Qw(j)};if(wc[_])return{isToken:!0,value:j};if(_.match(Jw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:j}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const d={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return l.map(j=>{if(!j.isToken)return j.value;const _=j.value;(km(_)||Cm(_))&&cs(_,t,String(e));const g=wc[_[0]];return g(i,_,o.localize,d)}).join("")}function Qw(e){const t=e.match(Xw);return t?t[1].replace(Kw,"'"):e}function Zw(){return Object.assign({},nr())}function e0(e){let n=He(e).getDay();return n===0&&(n=7),n}function t0(e,t){const n=t instanceof Date?Ie(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const n0=10;class Pm{constructor(){q(this,"subPriority",0)}validate(t,n){return!0}}class r0 extends Pm{constructor(t,n,r,o,a){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,a&&(this.subPriority=a)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class o0 extends Pm{constructor(){super(...arguments);q(this,"priority",n0);q(this,"subPriority",-1)}set(n,r){return r.timestampIsSet?n:Ie(n,t0(n,Date))}}class ye{run(t,n,r,o){const a=this.parse(t,n,r,o);return a?{setter:new r0(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,n,r){return!0}}class a0 extends ye{constructor(){super(...arguments);q(this,"priority",140);q(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}const $e={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},kt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Fe(e,t){return e&&{value:t(e.value),rest:e.rest}}function Re(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Pt(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,s=n[5]?parseInt(n[5],10):0;return{value:r*(o*nw+a*tw+s*rw),rest:t.slice(n[0].length)}}function Em(e){return Re($e.anyDigitsSigned,e)}function We(e,t){switch(e){case 1:return Re($e.singleDigit,t);case 2:return Re($e.twoDigits,t);case 3:return Re($e.threeDigits,t);case 4:return Re($e.fourDigits,t);default:return Re(new RegExp("^\\d{1,"+e+"}"),t)}}function So(e,t){switch(e){case 1:return Re($e.singleDigitSigned,t);case 2:return Re($e.twoDigitsSigned,t);case 3:return Re($e.threeDigitsSigned,t);case 4:return Re($e.fourDigitsSigned,t);default:return Re(new RegExp("^-?\\d{1,"+e+"}"),t)}}function oi(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Mm(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const a=r+50,s=Math.trunc(a/100)*100,i=e>=a%100;o=e+s-(i?100:0)}return n?o:1-o}function Dm(e){return e%400===0||e%4===0&&e%100!==0}class s0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const a=s=>({year:s,isTwoDigitYear:r==="yy"});switch(r){case"y":return Fe(We(4,n),a);case"yo":return Fe(o.ordinalNumber(n,{unit:"year"}),a);default:return Fe(We(r.length,n),a)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o){const a=n.getFullYear();if(o.isTwoDigitYear){const i=Mm(o.year,a);return n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}const s=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}class i0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const a=s=>({year:s,isTwoDigitYear:r==="YY"});switch(r){case"Y":return Fe(We(4,n),a);case"Yo":return Fe(o.ordinalNumber(n,{unit:"year"}),a);default:return Fe(We(r.length,n),a)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o,a){const s=ri(n,a);if(o.isTwoDigitYear){const l=Mm(o.year,s);return n.setFullYear(l,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),cn(n,a)}const i=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(i,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),cn(n,a)}}class c0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return So(r==="R"?4:r.length,n)}set(n,r,o){const a=Ie(n,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Xn(a)}}class l0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return So(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class d0 extends ye{constructor(){super(...arguments);q(this,"priority",120);q(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return We(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class u0 extends ye{constructor(){super(...arguments);q(this,"priority",120);q(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return We(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class f0 extends ye{constructor(){super(...arguments);q(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);q(this,"priority",110)}parse(n,r,o){const a=s=>s-1;switch(r){case"M":return Fe(Re($e.month,n),a);case"MM":return Fe(We(2,n),a);case"Mo":return Fe(o.ordinalNumber(n,{unit:"month"}),a);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class m0 extends ye{constructor(){super(...arguments);q(this,"priority",110);q(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){const a=s=>s-1;switch(r){case"L":return Fe(Re($e.month,n),a);case"LL":return Fe(We(2,n),a);case"Lo":return Fe(o.ordinalNumber(n,{unit:"month"}),a);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function p0(e,t,n){const r=He(e),o=Nm(r,n)-t;return r.setDate(r.getDate()-o*7),r}class h0 extends ye{constructor(){super(...arguments);q(this,"priority",100);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return Re($e.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,a){return cn(p0(n,o,a),a)}}function _0(e,t){const n=He(e),r=wm(n)-t;return n.setDate(n.getDate()-r*7),n}class g0 extends ye{constructor(){super(...arguments);q(this,"priority",100);q(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return Re($e.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return Xn(_0(n,o))}}const j0=[31,28,31,30,31,30,31,31,30,31,30,31],y0=[31,29,31,30,31,30,31,31,30,31,30,31];class v0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"subPriority",1);q(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return Re($e.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return We(r.length,n)}}validate(n,r){const o=n.getFullYear(),a=Dm(o),s=n.getMonth();return a?r>=1&&r<=y0[s]:r>=1&&r<=j0[s]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class x0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"subpriority",1);q(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return Re($e.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return We(r.length,n)}}validate(n,r){const o=n.getFullYear();return Dm(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function ai(e,t,n){var f,m,p,j;const r=nr(),o=(n==null?void 0:n.weekStartsOn)??((m=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((j=(p=r.locale)==null?void 0:p.options)==null?void 0:j.weekStartsOn)??0,a=He(e),s=a.getDay(),l=(t%7+7)%7,d=7-o,u=t<0||t>6?t-(s+d)%7:(l+d)%7-(s+d)%7;return vm(a,u)}class b0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,a){return n=ai(n,o,a),n.setHours(0,0,0,0),n}}class w0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,a){const s=i=>{const l=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+l};switch(r){case"e":case"ee":return Fe(We(r.length,n),s);case"eo":return Fe(o.ordinalNumber(n,{unit:"day"}),s);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,a){return n=ai(n,o,a),n.setHours(0,0,0,0),n}}class N0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,a){const s=i=>{const l=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+l};switch(r){case"c":case"cc":return Fe(We(r.length,n),s);case"co":return Fe(o.ordinalNumber(n,{unit:"day"}),s);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,a){return n=ai(n,o,a),n.setHours(0,0,0,0),n}}function S0(e,t){const n=He(e),r=e0(n),o=t-r;return vm(n,o)}class C0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const a=s=>s===0?7:s;switch(r){case"i":case"ii":return We(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return Fe(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiii":return Fe(o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Fe(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Fe(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=S0(n,o),n.setHours(0,0,0,0),n}}class k0 extends ye{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(oi(o),0,0,0),n}}class P0 extends ye{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(oi(o),0,0,0),n}}class E0 extends ye{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(oi(o),0,0,0),n}}class M0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return Re($e.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const a=n.getHours()>=12;return a&&o<12?n.setHours(o+12,0,0,0):!a&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class D0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return Re($e.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class T0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return Re($e.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class R0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return Re($e.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const a=o<=24?o%24:o;return n.setHours(a,0,0,0),n}}class O0 extends ye{constructor(){super(...arguments);q(this,"priority",60);q(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return Re($e.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class A0 extends ye{constructor(){super(...arguments);q(this,"priority",50);q(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return Re($e.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class z0 extends ye{constructor(){super(...arguments);q(this,"priority",30);q(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=a=>Math.trunc(a*Math.pow(10,-r.length+3));return Fe(We(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class I0 extends ye{constructor(){super(...arguments);q(this,"priority",10);q(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return Pt(kt.basicOptionalMinutes,n);case"XX":return Pt(kt.basic,n);case"XXXX":return Pt(kt.basicOptionalSeconds,n);case"XXXXX":return Pt(kt.extendedOptionalSeconds,n);case"XXX":default:return Pt(kt.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Ie(n,n.getTime()-wo(n)-o)}}class W0 extends ye{constructor(){super(...arguments);q(this,"priority",10);q(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return Pt(kt.basicOptionalMinutes,n);case"xx":return Pt(kt.basic,n);case"xxxx":return Pt(kt.basicOptionalSeconds,n);case"xxxxx":return Pt(kt.extendedOptionalSeconds,n);case"xxx":default:return Pt(kt.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Ie(n,n.getTime()-wo(n)-o)}}class $0 extends ye{constructor(){super(...arguments);q(this,"priority",40);q(this,"incompatibleTokens","*")}parse(n){return Em(n)}set(n,r,o){return[Ie(n,o*1e3),{timestampIsSet:!0}]}}class F0 extends ye{constructor(){super(...arguments);q(this,"priority",20);q(this,"incompatibleTokens","*")}parse(n){return Em(n)}set(n,r,o){return[Ie(n,o),{timestampIsSet:!0}]}}const L0={G:new a0,y:new s0,Y:new i0,R:new c0,u:new l0,Q:new d0,q:new u0,M:new f0,L:new m0,w:new h0,I:new g0,d:new v0,D:new x0,E:new b0,e:new w0,c:new N0,i:new C0,a:new k0,b:new P0,B:new E0,h:new M0,H:new D0,K:new T0,k:new R0,m:new O0,s:new A0,S:new z0,X:new I0,x:new W0,t:new $0,T:new F0},B0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,H0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Y0=/^'([^]*?)'?$/,q0=/''/g,V0=/\S/,G0=/[a-zA-Z]/;function Tm(e,t,n,r){var _,g,v,x;const o=Zw(),a=o.locale??aa,s=o.firstWeekContainsDate??((g=(_=o.locale)==null?void 0:_.options)==null?void 0:g.firstWeekContainsDate)??1,i=o.weekStartsOn??((x=(v=o.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0;if(t==="")return e===""?He(n):Ie(n,NaN);const l={firstWeekContainsDate:s,weekStartsOn:i,locale:a},d=[new o0],u=t.match(H0).map(b=>{const w=b[0];if(w in is){const S=is[w];return S(b,a.formatLong)}return b}).join("").match(B0),f=[];for(let b of u){km(b)&&cs(b,t,e),Cm(b)&&cs(b,t,e);const w=b[0],S=L0[w];if(S){const{incompatibleTokens:N}=S;if(Array.isArray(N)){const E=f.find(k=>N.includes(k.token)||k.token===w);if(E)throw new RangeError(`The format string mustn't contain \`${E.fullToken}\` and \`${b}\` at the same time`)}else if(S.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:w,fullToken:b});const C=S.run(e,b,a.match,l);if(!C)return Ie(n,NaN);d.push(C.setter),e=C.rest}else{if(w.match(G0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(b==="''"?b="'":w==="'"&&(b=U0(b)),e.indexOf(b)===0)e=e.slice(b.length);else return Ie(n,NaN)}}if(e.length>0&&V0.test(e))return Ie(n,NaN);const m=d.map(b=>b.priority).sort((b,w)=>w-b).filter((b,w,S)=>S.indexOf(b)===w).map(b=>d.filter(w=>w.priority===b).sort((w,S)=>S.subPriority-w.subPriority)).map(b=>b[0]);let p=He(n);if(isNaN(p.getTime()))return Ie(n,NaN);const j={};for(const b of m){if(!b.validate(p,l))return Ie(n,NaN);const w=b.set(p,j,l);Array.isArray(w)?(p=w[0],Object.assign(j,w[1])):p=w}return Ie(n,p)}function U0(e){return e.match(Y0)[1].replace(q0,"'")}const X0={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},K0=(e,t,n)=>{let r;const o=X0[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},J0={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},Q0={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Z0={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},e1={date:Bt({formats:J0,defaultWidth:"full"}),time:Bt({formats:Q0,defaultWidth:"full"}),dateTime:Bt({formats:Z0,defaultWidth:"full"})},t1={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},n1={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},r1=(e,t,n,r)=>t.getHours()!==1?n1[e]:t1[e],o1={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},a1={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},s1={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},i1={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},c1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},l1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},d1=(e,t)=>Number(e)+"º",u1={ordinalNumber:d1,era:Xe({values:o1,defaultWidth:"wide"}),quarter:Xe({values:a1,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:Xe({values:s1,defaultWidth:"wide"}),day:Xe({values:i1,defaultWidth:"wide"}),dayPeriod:Xe({values:c1,defaultWidth:"wide",formattingValues:l1,defaultFormattingWidth:"wide"})},f1=/^(\d+)(º)?/i,m1=/\d+/i,p1={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},h1={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},_1={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},g1={any:[/1/i,/2/i,/3/i,/4/i]},j1={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},y1={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},v1={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},x1={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},b1={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},w1={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},N1={ordinalNumber:ni({matchPattern:f1,parsePattern:m1,valueCallback:function(e){return parseInt(e,10)}}),era:Ke({matchPatterns:p1,defaultMatchWidth:"wide",parsePatterns:h1,defaultParseWidth:"any"}),quarter:Ke({matchPatterns:_1,defaultMatchWidth:"wide",parsePatterns:g1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ke({matchPatterns:j1,defaultMatchWidth:"wide",parsePatterns:y1,defaultParseWidth:"any"}),day:Ke({matchPatterns:v1,defaultMatchWidth:"wide",parsePatterns:x1,defaultParseWidth:"any"}),dayPeriod:Ke({matchPatterns:b1,defaultMatchWidth:"any",parsePatterns:w1,defaultParseWidth:"any"})},Rm={code:"es",formatDistance:K0,formatLong:e1,formatRelative:r1,localize:u1,match:N1,options:{weekStartsOn:1,firstWeekContainsDate:1}},S1={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},C1=(e,t,n)=>{let r;const o=S1[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"daqui a "+r:"há "+r:r},k1={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},P1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},E1={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},M1={date:Bt({formats:k1,defaultWidth:"full"}),time:Bt({formats:P1,defaultWidth:"full"}),dateTime:Bt({formats:E1,defaultWidth:"full"})},D1={lastWeek:e=>{const t=e.getDay();return"'"+(t===0||t===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},T1=(e,t,n,r)=>{const o=D1[e];return typeof o=="function"?o(t):o},R1={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},O1={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},A1={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},z1={narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},I1={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},W1={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},$1=(e,t)=>Number(e)+"º",F1={ordinalNumber:$1,era:Xe({values:R1,defaultWidth:"wide"}),quarter:Xe({values:O1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xe({values:A1,defaultWidth:"wide"}),day:Xe({values:z1,defaultWidth:"wide"}),dayPeriod:Xe({values:I1,defaultWidth:"wide",formattingValues:W1,defaultFormattingWidth:"wide"})},L1=/^(\d+)(º|ª)?/i,B1=/\d+/i,H1={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},Y1={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},q1={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},V1={any:[/1/i,/2/i,/3/i,/4/i]},G1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},U1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},X1={narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},K1={narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},J1={narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},Q1={any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},Z1={ordinalNumber:ni({matchPattern:L1,parsePattern:B1,valueCallback:e=>parseInt(e,10)}),era:Ke({matchPatterns:H1,defaultMatchWidth:"wide",parsePatterns:Y1,defaultParseWidth:"any"}),quarter:Ke({matchPatterns:q1,defaultMatchWidth:"wide",parsePatterns:V1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ke({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:U1,defaultParseWidth:"any"}),day:Ke({matchPatterns:X1,defaultMatchWidth:"wide",parsePatterns:K1,defaultParseWidth:"any"}),dayPeriod:Ke({matchPatterns:J1,defaultMatchWidth:"any",parsePatterns:Q1,defaultParseWidth:"any"})},Om={code:"pt",formatDistance:C1,formatLong:M1,formatRelative:T1,localize:F1,match:Z1,options:{weekStartsOn:1,firstWeekContainsDate:4}};function eN(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Ra={},gr={};function yn(e,t){try{const r=(Ra[e]||(Ra[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in gr?gr[r]:kc(r,r.split(":"))}catch{if(e in gr)return gr[e];const n=e==null?void 0:e.match(tN);return n?kc(e,n.slice(1)):NaN}}const tN=/([+-]\d\d):?(\d\d)?/;function kc(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return gr[e]=n*60+r>0?n*60+r+o:n*60-r-o}class Mt extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(yn(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Am(this),ls(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Mt(...n,t):new Mt(Date.now(),t)}withTimeZone(t){return new Mt(+this,t)}getTimezoneOffset(){const t=-yn(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),ls(this),+this}[Symbol.for("constructDateFrom")](t){return new Mt(+new Date(t),this.timeZone)}}const Pc=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Pc.test(e))return;const t=e.replace(Pc,"$1UTC");Mt.prototype[t]&&(e.startsWith("get")?Mt.prototype[e]=function(){return this.internal[t]()}:(Mt.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),nN(this),+this},Mt.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),ls(this),+this}))});function ls(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-yn(e.timeZone,e)*60))}function nN(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Am(e)}function Am(e){const t=yn(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),a=-new Date(+r).getTimezoneOffset(),s=o-a,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);const l=o-n;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);const d=new Date(+e);d.setUTCSeconds(0);const u=o>0?d.getSeconds():(d.getSeconds()-60)%60,f=Math.round(-(yn(e.timeZone,e)*60))%60;(f||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+u));const m=yn(e.timeZone,e),p=m>0?Math.floor(m):Math.ceil(m),_=-new Date(+e).getTimezoneOffset()-p,g=p!==n,v=_-l;if(g&&v){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);const x=yn(e.timeZone,e),b=x>0?Math.floor(x):Math.ceil(x),w=p-b;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class qe extends Mt{static tz(t,...n){return n.length?new qe(...n,t):new qe(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${eN(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new qe(+this,t)}[Symbol.for("constructDateFrom")](t){return new qe(+new Date(t),this.timeZone)}}const zm=6048e5,rN=864e5,Ec=Symbol.for("constructDateFrom");function Le(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ec in e?e[Ec](t):e instanceof Date?new e.constructor(t):new Date(t)}function we(e,t){return Le(t||e,e)}function Im(e,t,n){const r=we(e,n==null?void 0:n.in);return isNaN(t)?Le(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Wm(e,t,n){const r=we(e,n==null?void 0:n.in);if(isNaN(t))return Le(e,NaN);if(!t)return r;const o=r.getDate(),a=Le(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const s=a.getDate();return o>=s?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let oN={};function zr(){return oN}function Kn(e,t){var i,l,d,u;const n=zr(),r=(t==null?void 0:t.weekStartsOn)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,o=we(e,t==null?void 0:t.in),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Sr(e,t){return Kn(e,{...t,weekStartsOn:1})}function $m(e,t){const n=we(e,t==null?void 0:t.in),r=n.getFullYear(),o=Le(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=Sr(o),s=Le(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const i=Sr(s);return n.getTime()>=a.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Mc(e){const t=we(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function rr(e,...t){const n=Le.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Cr(e,t){const n=we(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function si(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t),a=Cr(r),s=Cr(o),i=+a-Mc(a),l=+s-Mc(s);return Math.round((i-l)/rN)}function aN(e,t){const n=$m(e,t),r=Le(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Sr(r)}function sN(e,t,n){return Im(e,t*7,n)}function iN(e,t,n){return Wm(e,t*12,n)}function cN(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Le.bind(null,o));const a=we(o,r);(!n||n<a||isNaN(+a))&&(n=a)}),Le(r,n||NaN)}function lN(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Le.bind(null,o));const a=we(o,r);(!n||n>a||isNaN(+a))&&(n=a)}),Le(r,n||NaN)}function dN(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t);return+Cr(r)==+Cr(o)}function Fm(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function uN(e){return!(!Fm(e)&&typeof e!="number"||isNaN(+we(e)))}function Lm(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t),a=r.getFullYear()-o.getFullYear(),s=r.getMonth()-o.getMonth();return a*12+s}function fN(e,t){const n=we(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Bm(e,t){const[n,r]=rr(e,t.start,t.end);return{start:n,end:r}}function mN(e,t){const{start:n,end:r}=Bm(t==null?void 0:t.in,e);let o=+n>+r;const a=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let i=1;const l=[];for(;+s<=a;)l.push(Le(n,s)),s.setMonth(s.getMonth()+i);return o?l.reverse():l}function pN(e,t){const n=we(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function hN(e,t){const n=we(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Hm(e,t){const n=we(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function _N(e,t){const{start:n,end:r}=Bm(t==null?void 0:t.in,e);let o=+n>+r;const a=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setMonth(0,1);let i=1;const l=[];for(;+s<=a;)l.push(Le(n,s)),s.setFullYear(s.getFullYear()+i);return o?l.reverse():l}function Ym(e,t){var i,l,d,u;const n=zr(),r=(t==null?void 0:t.weekStartsOn)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,o=we(e,t==null?void 0:t.in),a=o.getDay(),s=(a<r?-7:0)+6-(a-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function gN(e,t){return Ym(e,{...t,weekStartsOn:1})}const jN={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yN=(e,t,n)=>{let r;const o=jN[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Oa(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const vN={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xN={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bN={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wN={date:Oa({formats:vN,defaultWidth:"full"}),time:Oa({formats:xN,defaultWidth:"full"}),dateTime:Oa({formats:bN,defaultWidth:"full"})},NN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SN=(e,t,n,r)=>NN[e];function dr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):s;o=e.formattingValues[i]||e.formattingValues[s]}else{const s=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const CN={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kN={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},PN={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},EN={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},MN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},DN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},TN=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},RN={ordinalNumber:TN,era:dr({values:CN,defaultWidth:"wide"}),quarter:dr({values:kN,defaultWidth:"wide",argumentCallback:e=>e-1}),month:dr({values:PN,defaultWidth:"wide"}),day:dr({values:EN,defaultWidth:"wide"}),dayPeriod:dr({values:MN,defaultWidth:"wide",formattingValues:DN,defaultFormattingWidth:"wide"})};function ur(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?AN(i,f=>f.test(s)):ON(i,f=>f.test(s));let d;d=e.valueCallback?e.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(s.length);return{value:d,rest:u}}}function ON(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function AN(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function zN(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const i=t.slice(o.length);return{value:s,rest:i}}}const IN=/^(\d+)(th|st|nd|rd)?/i,WN=/\d+/i,$N={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},FN={any:[/^b/i,/^(a|c)/i]},LN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BN={any:[/1/i,/2/i,/3/i,/4/i]},HN={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},YN={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qN={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},VN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},GN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},UN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},XN={ordinalNumber:zN({matchPattern:IN,parsePattern:WN,valueCallback:e=>parseInt(e,10)}),era:ur({matchPatterns:$N,defaultMatchWidth:"wide",parsePatterns:FN,defaultParseWidth:"any"}),quarter:ur({matchPatterns:LN,defaultMatchWidth:"wide",parsePatterns:BN,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ur({matchPatterns:HN,defaultMatchWidth:"wide",parsePatterns:YN,defaultParseWidth:"any"}),day:ur({matchPatterns:qN,defaultMatchWidth:"wide",parsePatterns:VN,defaultParseWidth:"any"}),dayPeriod:ur({matchPatterns:GN,defaultMatchWidth:"any",parsePatterns:UN,defaultParseWidth:"any"})},Fn={code:"en-US",formatDistance:yN,formatLong:wN,formatRelative:SN,localize:RN,match:XN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function KN(e,t){const n=we(e,t==null?void 0:t.in);return si(n,Hm(n))+1}function ii(e,t){const n=we(e,t==null?void 0:t.in),r=+Sr(n)-+aN(n);return Math.round(r/zm)+1}function qm(e,t){var u,f,m,p;const n=we(e,t==null?void 0:t.in),r=n.getFullYear(),o=zr(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(m=o.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=Le((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const i=Kn(s,t),l=Le((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const d=Kn(l,t);return+n>=+i?r+1:+n>=+d?r:r-1}function JN(e,t){var i,l,d,u;const n=zr(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,o=qm(e,t),a=Le((t==null?void 0:t.in)||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Kn(a,t)}function ci(e,t){const n=we(e,t==null?void 0:t.in),r=+Kn(n,t)-+JN(n,t);return Math.round(r/zm)+1}function be(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const tn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return be(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):be(n+1,2)},d(e,t){return be(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return be(e.getHours()%12||12,t.length)},H(e,t){return be(e.getHours(),t.length)},m(e,t){return be(e.getMinutes(),t.length)},s(e,t){return be(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return be(o,t.length)}},In={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dc={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return tn.y(e,t)},Y:function(e,t,n,r){const o=qm(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return be(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):be(a,t.length)},R:function(e,t){const n=$m(e);return be(n,t.length)},u:function(e,t){const n=e.getFullYear();return be(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return be(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return be(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return tn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return be(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=ci(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):be(o,t.length)},I:function(e,t,n){const r=ii(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):be(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):tn.d(e,t)},D:function(e,t,n){const r=KN(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):be(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return be(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return be(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return be(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=In.noon:r===0?o=In.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=In.evening:r>=12?o=In.afternoon:r>=4?o=In.morning:o=In.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return tn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):tn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):be(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):be(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tn.s(e,t)},S:function(e,t){return tn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Rc(r);case"XXXX":case"XX":return _n(r);case"XXXXX":case"XXX":default:return _n(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Rc(r);case"xxxx":case"xx":return _n(r);case"xxxxx":case"xxx":default:return _n(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tc(r,":");case"OOOO":default:return"GMT"+_n(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tc(r,":");case"zzzz":default:return"GMT"+_n(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return be(r,t.length)},T:function(e,t,n){return be(+e,t.length)}};function Tc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+be(a,2)}function Rc(e,t){return e%60===0?(e>0?"-":"+")+be(Math.abs(e)/60,2):_n(e,t)}function _n(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=be(Math.trunc(r/60),2),a=be(r%60,2);return n+o+t+a}const Oc=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Vm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},QN=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Oc(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Oc(r,t)).replace("{{time}}",Vm(o,t))},ZN={p:Vm,P:QN},eS=/^D+$/,tS=/^Y+$/,nS=["D","DD","YY","YYYY"];function rS(e){return eS.test(e)}function oS(e){return tS.test(e)}function aS(e,t,n){const r=sS(e,t,n);if(console.warn(r),nS.includes(e))throw new RangeError(r)}function sS(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const iS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lS=/^'([^]*?)'?$/,dS=/''/g,uS=/[a-zA-Z]/;function jr(e,t,n){var u,f,m,p,j,_,g,v;const r=zr(),o=(n==null?void 0:n.locale)??r.locale??Fn,a=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((_=(j=n==null?void 0:n.locale)==null?void 0:j.options)==null?void 0:_.weekStartsOn)??r.weekStartsOn??((v=(g=r.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??0,i=we(e,n==null?void 0:n.in);if(!uN(i))throw new RangeError("Invalid time value");let l=t.match(cS).map(x=>{const b=x[0];if(b==="p"||b==="P"){const w=ZN[b];return w(x,o.formatLong)}return x}).join("").match(iS).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const b=x[0];if(b==="'")return{isToken:!1,value:fS(x)};if(Dc[b])return{isToken:!0,value:x};if(b.match(uS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:x}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const d={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return l.map(x=>{if(!x.isToken)return x.value;const b=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&oS(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&rS(b))&&aS(b,t,String(e));const w=Dc[b[0]];return w(i,b,o.localize,d)}).join("")}function fS(e){const t=e.match(lS);return t?t[1].replace(dS,"'"):e}function mS(e,t){const n=we(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),a=Le(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}function pS(e,t){return we(e,t==null?void 0:t.in).getMonth()}function hS(e,t){return we(e,t==null?void 0:t.in).getFullYear()}function _S(e,t){return+we(e)>+we(t)}function gS(e,t){return+we(e)<+we(t)}function jS(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function yS(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function vS(e,t,n){const r=we(e,n==null?void 0:n.in),o=r.getFullYear(),a=r.getDate(),s=Le(e,0);s.setFullYear(o,t,15),s.setHours(0,0,0,0);const i=mS(s);return r.setMonth(t,Math.min(a,i)),r}function xS(e,t,n){const r=we(e,n==null?void 0:n.in);return isNaN(+r)?Le(e,NaN):(r.setFullYear(t),r)}const Ac=5,bS=4;function wS(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),a=t.addDays(o,Ac*7-1);return t.getMonth(e)===t.getMonth(a)?Ac:bS}function Gm(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function NS(e,t){const n=Gm(e,t),r=wS(e,t);return t.addDays(n,r*7-1)}const Um={...Fn,labels:{labelDayButton:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(s,i)=>jr(s,i,{locale:Fn,...n});let a=o(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,a)=>jr(o,a,{locale:Fn,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(s,i)=>jr(s,i,{locale:Fn,...n});let a=o(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,a)=>jr(o,a,{locale:Fn,...t}),r(e,"cccc")}}};class at{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?qe.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,a)=>{var s;return(s=this.overrides)!=null&&s.newDate?this.overrides.newDate(r,o,a):this.options.timeZone?new qe(r,o,a,this.options.timeZone):new Date(r,o,a)},this.addDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addDays?this.overrides.addDays(r,o):Im(r,o)},this.addMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addMonths?this.overrides.addMonths(r,o):Wm(r,o)},this.addWeeks=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addWeeks?this.overrides.addWeeks(r,o):sN(r,o)},this.addYears=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addYears?this.overrides.addYears(r,o):iN(r,o)},this.differenceInCalendarDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):si(r,o)},this.differenceInCalendarMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Lm(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):mN(r)},this.eachYearOfInterval=r=>{var i;const o=(i=this.overrides)!=null&&i.eachYearOfInterval?this.overrides.eachYearOfInterval(r):_N(r),a=new Set(o.map(l=>this.getYear(l)));if(a.size===o.length)return o;const s=[];return a.forEach(l=>{s.push(new Date(l,0,1))}),s},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):NS(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):gN(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):fN(r)},this.endOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.endOfWeek?this.overrides.endOfWeek(r,o):Ym(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):hN(r)},this.format=(r,o,a)=>{var i;const s=(i=this.overrides)!=null&&i.format?this.overrides.format(r,o,this.options):jr(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(s):s},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):ii(r)},this.getMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getMonth?this.overrides.getMonth(r,this.options):pS(r,this.options)},this.getYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getYear?this.overrides.getYear(r,this.options):hS(r,this.options)},this.getWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getWeek?this.overrides.getWeek(r,this.options):ci(r,this.options)},this.isAfter=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isAfter?this.overrides.isAfter(r,o):_S(r,o)},this.isBefore=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isBefore?this.overrides.isBefore(r,o):gS(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Fm(r)},this.isSameDay=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameDay?this.overrides.isSameDay(r,o):dN(r,o)},this.isSameMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameMonth?this.overrides.isSameMonth(r,o):jS(r,o)},this.isSameYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameYear?this.overrides.isSameYear(r,o):yS(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):cN(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):lN(r)},this.setMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setMonth?this.overrides.setMonth(r,o):vS(r,o)},this.setYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setYear?this.overrides.setYear(r,o):xS(r,o)},this.startOfBroadcastWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Gm(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):Cr(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):Sr(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):pN(r)},this.startOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfWeek?this.overrides.startOfWeek(r,this.options):Kn(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):Hm(r)},this.options={locale:Um,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&at.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,a=n==null?void 0:n.code;if(a&&at.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const s=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,s)}}at.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const It=new at;class Xm{constructor(t,n,r=It){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class SS{constructor(t,n){this.date=t,this.weeks=n}}class CS{constructor(t,n){this.days=n,this.weekNumber=t}}function kS(e){return y.createElement("button",{...e})}function PS(e){return y.createElement("span",{...e})}function ES(e){const{size:t=24,orientation:n="left",className:r}=e;return y.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&y.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&y.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&y.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&y.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function MS(e){const{day:t,modifiers:n,...r}=e;return y.createElement("td",{...r})}function DS(e){const{day:t,modifiers:n,...r}=e,o=y.useRef(null);return y.useEffect(()=>{var a;n.focused&&((a=o.current)==null||a.focus())},[n.focused]),y.createElement("button",{ref:o,...r})}var J;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(J||(J={}));var De;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(De||(De={}));var gt;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(gt||(gt={}));var nt;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(nt||(nt={}));function TS(e){const{options:t,className:n,components:r,classNames:o,...a}=e,s=[o[J.Dropdown],n].join(" "),i=t==null?void 0:t.find(({value:l})=>l===a.value);return y.createElement("span",{"data-disabled":a.disabled,className:o[J.DropdownRoot]},y.createElement(r.Select,{className:s,...a},t==null?void 0:t.map(({value:l,label:d,disabled:u})=>y.createElement(r.Option,{key:l,value:l,disabled:u},d))),y.createElement("span",{className:o[J.CaptionLabel],"aria-hidden":!0},i==null?void 0:i.label,y.createElement(r.Chevron,{orientation:"down",size:18,className:o[J.Chevron]})))}function RS(e){return y.createElement("div",{...e})}function OS(e){return y.createElement("div",{...e})}function AS(e){const{calendarMonth:t,displayIndex:n,...r}=e;return y.createElement("div",{...r},e.children)}function zS(e){const{calendarMonth:t,displayIndex:n,...r}=e;return y.createElement("div",{...r})}function IS(e){return y.createElement("table",{...e})}function WS(e){return y.createElement("div",{...e})}const Km=y.createContext(void 0);function Ir(){const e=y.useContext(Km);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function $S(e){const{components:t}=Ir();return y.createElement(t.Dropdown,{...e})}function FS(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...a}=e,{components:s,classNames:i,labels:{labelPrevious:l,labelNext:d}}=Ir(),u=y.useCallback(m=>{o&&(n==null||n(m))},[o,n]),f=y.useCallback(m=>{r&&(t==null||t(m))},[r,t]);return y.createElement("nav",{...a},y.createElement(s.PreviousMonthButton,{type:"button",className:i[J.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":l(r),onClick:f},y.createElement(s.Chevron,{disabled:r?void 0:!0,className:i[J.Chevron],orientation:"left"})),y.createElement(s.NextMonthButton,{type:"button",className:i[J.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":d(o),onClick:u},y.createElement(s.Chevron,{disabled:o?void 0:!0,orientation:"right",className:i[J.Chevron]})))}function LS(e){const{components:t}=Ir();return y.createElement(t.Button,{...e})}function BS(e){return y.createElement("option",{...e})}function HS(e){const{components:t}=Ir();return y.createElement(t.Button,{...e})}function YS(e){const{rootRef:t,...n}=e;return y.createElement("div",{...n,ref:t})}function qS(e){return y.createElement("select",{...e})}function VS(e){const{week:t,...n}=e;return y.createElement("tr",{...n})}function GS(e){return y.createElement("th",{...e})}function US(e){return y.createElement("thead",{"aria-hidden":!0},y.createElement("tr",{...e}))}function XS(e){const{week:t,...n}=e;return y.createElement("th",{...n})}function KS(e){return y.createElement("th",{...e})}function JS(e){return y.createElement("tbody",{...e})}function QS(e){const{components:t}=Ir();return y.createElement(t.Dropdown,{...e})}const ZS=Object.freeze(Object.defineProperty({__proto__:null,Button:kS,CaptionLabel:PS,Chevron:ES,Day:MS,DayButton:DS,Dropdown:TS,DropdownNav:RS,Footer:OS,Month:AS,MonthCaption:zS,MonthGrid:IS,Months:WS,MonthsDropdown:$S,Nav:FS,NextMonthButton:LS,Option:BS,PreviousMonthButton:HS,Root:YS,Select:qS,Week:VS,WeekNumber:XS,WeekNumberHeader:KS,Weekday:GS,Weekdays:US,Weeks:JS,YearsDropdown:QS},Symbol.toStringTag,{value:"Module"}));function Ft(e,t,n=!1,r=It){let{from:o,to:a}=e;const{differenceInCalendarDays:s,isSameDay:i}=r;return o&&a?(s(a,o)<0&&([o,a]=[a,o]),s(t,o)>=(n?1:0)&&s(a,t)>=(n?1:0)):!n&&a?i(a,t):!n&&o?i(o,t):!1}function li(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function sa(e){return!!(e&&typeof e=="object"&&"from"in e)}function di(e){return!!(e&&typeof e=="object"&&"after"in e)}function ui(e){return!!(e&&typeof e=="object"&&"before"in e)}function Jm(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Qm(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Lt(e,t,n=It){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:s}=n;return r.some(i=>{if(typeof i=="boolean")return i;if(n.isDate(i))return o(e,i);if(Qm(i,n))return i.some(l=>o(e,l));if(sa(i))return Ft(i,e,!1,n);if(Jm(i))return Array.isArray(i.dayOfWeek)?i.dayOfWeek.includes(e.getDay()):i.dayOfWeek===e.getDay();if(li(i)){const l=a(i.before,e),d=a(i.after,e),u=l>0,f=d<0;return s(i.before,i.after)?f&&u:u||f}return di(i)?a(e,i.after)>0:ui(i)?a(i.before,e)>0:typeof i=="function"?i(e):!1})}function eC(e,t,n,r,o){const{disabled:a,hidden:s,modifiers:i,showOutsideDays:l,broadcastCalendar:d,today:u=o.today()}=t,{isSameDay:f,isSameMonth:m,startOfMonth:p,isBefore:j,endOfMonth:_,isAfter:g}=o,v=n&&p(n),x=r&&_(r),b={[De.focused]:[],[De.outside]:[],[De.disabled]:[],[De.hidden]:[],[De.today]:[]},w={};for(const S of e){const{date:N,displayMonth:C}=S,E=!!(C&&!m(N,C)),k=!!(v&&j(N,v)),M=!!(x&&g(N,x)),D=!!(a&&Lt(N,a,o)),T=!!(s&&Lt(N,s,o))||k||M||!d&&!l&&E||d&&l===!1&&E,$=f(N,u);E&&b.outside.push(S),D&&b.disabled.push(S),T&&b.hidden.push(S),$&&b.today.push(S),i&&Object.keys(i).forEach(A=>{const H=i==null?void 0:i[A];H&&Lt(N,H,o)&&(w[A]?w[A].push(S):w[A]=[S])})}return S=>{const N={[De.focused]:!1,[De.disabled]:!1,[De.hidden]:!1,[De.outside]:!1,[De.today]:!1},C={};for(const E in b){const k=b[E];N[E]=k.some(M=>M===S)}for(const E in w)C[E]=w[E].some(k=>k===S);return{...N,...C}}}function tC(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[a])=>(n[a]?o.push(n[a]):t[De[a]]?o.push(t[De[a]]):t[gt[a]]&&o.push(t[gt[a]]),o),[t[J.Day]])}function nC(e){return{...ZS,...e}}function rC(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function oC(){const e={};for(const t in J)e[J[t]]=`rdp-${J[t]}`;for(const t in De)e[De[t]]=`rdp-${De[t]}`;for(const t in gt)e[gt[t]]=`rdp-${gt[t]}`;for(const t in nt)e[nt[t]]=`rdp-${nt[t]}`;return e}function Zm(e,t,n){return(n??new at(t)).formatMonthYear(e)}const aC=Zm;function sC(e,t,n){return(n??new at(t)).format(e,"d")}function iC(e,t=It){return t.format(e,"LLLL")}function cC(e,t,n){return(n??new at(t)).format(e,"cccccc")}function lC(e,t=It){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function dC(){return""}function ep(e,t=It){return t.format(e,"yyyy")}const uC=ep,fC=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Zm,formatDay:sC,formatMonthCaption:aC,formatMonthDropdown:iC,formatWeekNumber:lC,formatWeekNumberHeader:dC,formatWeekdayName:cC,formatYearCaption:uC,formatYearDropdown:ep},Symbol.toStringTag,{value:"Module"}));function mC(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...fC,...e}}function fi(e,t,n,r){let o=(r??new at(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const pC=fi;function mi(e,t,n){return(n??new at(t)).formatMonthYear(e)}const hC=mi;function tp(e,t,n,r){let o=(r??new at(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function np(e){return"Choose the Month"}function rp(){return""}const _C="Go to the Next Month";function op(e,t){return _C}function ap(e){return"Go to the Previous Month"}function sp(e,t,n){return(n??new at(t)).format(e,"cccc")}function ip(e,t){return`Week ${e}`}function cp(e){return"Week Number"}function lp(e){return"Choose the Year"}const gC=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:hC,labelDay:pC,labelDayButton:fi,labelGrid:mi,labelGridcell:tp,labelMonthDropdown:np,labelNav:rp,labelNext:op,labelPrevious:ap,labelWeekNumber:ip,labelWeekNumberHeader:cp,labelWeekday:sp,labelYearDropdown:lp},Symbol.toStringTag,{value:"Module"})),ht=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function jC(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...gC,...e??{},labelDayButton:ht(fi,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:ht(np,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:ht(op,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:ht(ap,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:ht(ip,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:ht(lp,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:ht(mi,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:ht(tp,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:ht(rp,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:ht(cp,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:ht(sp,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function yC(e,t,n,r,o){const{startOfMonth:a,startOfYear:s,endOfYear:i,eachMonthOfInterval:l,getMonth:d}=o;return l({start:s(e),end:i(e)}).map(m=>{const p=r.formatMonthDropdown(m,o),j=d(m),_=t&&m<a(t)||n&&m>a(n)||!1;return{value:j,label:p,disabled:_}})}function vC(e,t={},n={}){let r={...t==null?void 0:t[J.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function xC(e,t,n,r){const o=r??e.today(),a=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),s=[];for(let i=0;i<7;i++){const l=e.addDays(a,i);s.push(l)}return s}function bC(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:a,endOfYear:s,eachYearOfInterval:i,getYear:l}=r,d=a(e),u=s(t),f=i({start:d,end:u});return o&&f.reverse(),f.map(m=>{const p=n.formatYearDropdown(m,r);return{value:l(m),label:p,disabled:!1}})}function wC(e,t={}){var i;const{weekStartsOn:n,locale:r}=t,o=n??((i=r==null?void 0:r.options)==null?void 0:i.weekStartsOn)??0,a=l=>{const d=typeof l=="number"||typeof l=="string"?new Date(l):l;return new qe(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,e)},s=l=>{const d=a(l);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>a(qe.tz(e)),newDate:(l,d,u)=>new qe(l,d,u,12,0,0,e),startOfDay:l=>a(l),startOfWeek:(l,d)=>{const u=a(l),f=(d==null?void 0:d.weekStartsOn)??o,m=(u.getDay()-f+7)%7;return u.setDate(u.getDate()-m),u},startOfISOWeek:l=>{const d=a(l),u=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-u),d},startOfMonth:l=>{const d=a(l);return d.setDate(1),d},startOfYear:l=>{const d=a(l);return d.setMonth(0,1),d},endOfWeek:(l,d)=>{const u=a(l),p=((((d==null?void 0:d.weekStartsOn)??o)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+p),u},endOfISOWeek:l=>{const d=a(l),u=(7-d.getDay())%7;return d.setDate(d.getDate()+u),d},endOfMonth:l=>{const d=a(l);return d.setMonth(d.getMonth()+1,0),d},endOfYear:l=>{const d=a(l);return d.setMonth(11,31),d},eachMonthOfInterval:l=>{const d=a(l.start),u=a(l.end),f=[],m=new qe(d.getFullYear(),d.getMonth(),1,12,0,0,e),p=u.getFullYear()*12+u.getMonth();for(;m.getFullYear()*12+m.getMonth()<=p;)f.push(new qe(m,e)),m.setMonth(m.getMonth()+1,1);return f},addDays:(l,d)=>{const u=a(l);return u.setDate(u.getDate()+d),u},addWeeks:(l,d)=>{const u=a(l);return u.setDate(u.getDate()+d*7),u},addMonths:(l,d)=>{const u=a(l);return u.setMonth(u.getMonth()+d),u},addYears:(l,d)=>{const u=a(l);return u.setFullYear(u.getFullYear()+d),u},eachYearOfInterval:l=>{const d=a(l.start),u=a(l.end),f=[],m=new qe(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new qe(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(l,d)=>{var f;const u=s(l);return ci(u,{weekStartsOn:(d==null?void 0:d.weekStartsOn)??o,firstWeekContainsDate:(d==null?void 0:d.firstWeekContainsDate)??((f=r==null?void 0:r.options)==null?void 0:f.firstWeekContainsDate)??1})},getISOWeek:l=>{const d=s(l);return ii(d)},differenceInCalendarDays:(l,d)=>{const u=s(l),f=s(d);return si(u,f)},differenceInCalendarMonths:(l,d)=>{const u=s(l),f=s(d);return Lm(u,f)}}}const Wr=e=>e instanceof HTMLElement?e:null,Aa=e=>[...e.querySelectorAll("[data-animated-month]")??[]],NC=e=>Wr(e.querySelector("[data-animated-month]")),za=e=>Wr(e.querySelector("[data-animated-caption]")),Ia=e=>Wr(e.querySelector("[data-animated-weeks]")),SC=e=>Wr(e.querySelector("[data-animated-nav]")),CC=e=>Wr(e.querySelector("[data-animated-weekdays]"));function kC(e,t,{classNames:n,months:r,focused:o,dateLib:a}){const s=y.useRef(null),i=y.useRef(r),l=y.useRef(!1);y.useLayoutEffect(()=>{const d=i.current;if(i.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const u=a.isSameMonth(r[0].date,d[0].date),f=a.isAfter(r[0].date,d[0].date),m=f?n[nt.caption_after_enter]:n[nt.caption_before_enter],p=f?n[nt.weeks_after_enter]:n[nt.weeks_before_enter],j=s.current,_=e.current.cloneNode(!0);if(_ instanceof HTMLElement?(Aa(_).forEach(b=>{if(!(b instanceof HTMLElement))return;const w=NC(b);w&&b.contains(w)&&b.removeChild(w);const S=za(b);S&&S.classList.remove(m);const N=Ia(b);N&&N.classList.remove(p)}),s.current=_):s.current=null,l.current||u||o)return;const g=j instanceof HTMLElement?Aa(j):[],v=Aa(e.current);if(v!=null&&v.every(x=>x instanceof HTMLElement)&&g&&g.every(x=>x instanceof HTMLElement)){l.current=!0,e.current.style.isolation="isolate";const x=SC(e.current);x&&(x.style.zIndex="1"),v.forEach((b,w)=>{const S=g[w];if(!S)return;b.style.position="relative",b.style.overflow="hidden";const N=za(b);N&&N.classList.add(m);const C=Ia(b);C&&C.classList.add(p);const E=()=>{l.current=!1,e.current&&(e.current.style.isolation=""),x&&(x.style.zIndex=""),N&&N.classList.remove(m),C&&C.classList.remove(p),b.style.position="",b.style.overflow="",b.contains(S)&&b.removeChild(S)};S.style.pointerEvents="none",S.style.position="absolute",S.style.overflow="hidden",S.setAttribute("aria-hidden","true");const k=CC(S);k&&(k.style.opacity="0");const M=za(S);M&&(M.classList.add(f?n[nt.caption_before_exit]:n[nt.caption_after_exit]),M.addEventListener("animationend",E));const D=Ia(S);D&&D.classList.add(f?n[nt.weeks_before_exit]:n[nt.weeks_after_exit]),b.insertBefore(S,b.firstChild)})}})}function PC(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:s,fixedWeeks:i,broadcastCalendar:l}=n??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:f,endOfBroadcastWeek:m,endOfISOWeek:p,endOfMonth:j,endOfWeek:_,isAfter:g,startOfBroadcastWeek:v,startOfISOWeek:x,startOfWeek:b}=r,w=l?v(o,r):s?x(o):b(o),S=l?m(a):s?p(j(a)):_(j(a)),N=t&&(l?m(t):s?p(t):_(t)),C=N&&g(S,N)?N:S,E=u(C,w),k=f(a,o)+1,M=[];for(let $=0;$<=E;$++){const A=d(w,$);M.push(A)}const T=(l?35:42)*k;if(i&&M.length<T){const $=T-M.length;for(let A=0;A<$;A++){const H=d(M[M.length-1],1);M.push(H)}}return M}function EC(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((a,s)=>a.concat(s.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function MC(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let s=0;s<o;s++){const i=r.addMonths(e,s);if(t&&i>t)break;a.push(i)}return a}function zc(e,t,n,r){const{month:o,defaultMonth:a,today:s=r.today(),numberOfMonths:i=1}=e;let l=o||a||s;const{differenceInCalendarMonths:d,addMonths:u,startOfMonth:f}=r;if(n&&d(n,l)<i-1){const m=-1*(i-1);l=u(n,m)}return t&&d(l,t)<0&&(l=t),f(l)}function DC(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:s,endOfMonth:i,endOfWeek:l,getISOWeek:d,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:m,startOfWeek:p}=r,j=e.reduce((_,g)=>{const v=n.broadcastCalendar?f(g,r):n.ISOWeek?m(g):p(g),x=n.broadcastCalendar?a(g):n.ISOWeek?s(i(g)):l(i(g)),b=t.filter(C=>C>=v&&C<=x),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&b.length<w){const C=t.filter(E=>{const k=w-b.length;return E>x&&E<=o(x,k)});b.push(...C)}const S=b.reduce((C,E)=>{const k=n.ISOWeek?d(E):u(E),M=C.find(T=>T.weekNumber===k),D=new Xm(E,g,r);return M?M.days.push(D):C.push(new CS(k,[D])),C},[]),N=new SS(g,S);return _.push(N),_},[]);return n.reverseMonths?j.reverse():j}function TC(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:s,endOfMonth:i,addYears:l,endOfYear:d,newDate:u,today:f}=t,{fromYear:m,toYear:p,fromMonth:j,toMonth:_}=e;!n&&j&&(n=j),!n&&m&&(n=t.newDate(m,0,1)),!r&&_&&(r=_),!r&&p&&(r=u(p,11,31));const g=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=s(n):m?n=u(m,0,1):!n&&g&&(n=o(l(e.today??f(),-100))),r?r=i(r):p?r=u(p,11,31):!r&&g&&(r=d(e.today??f())),[n&&a(n),r&&a(r)]}function RC(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:s,addMonths:i,differenceInCalendarMonths:l}=r,d=o?a:1,u=s(e);if(!t)return i(u,d);if(!(l(t,e)<a))return i(u,d)}function OC(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:s,addMonths:i,differenceInCalendarMonths:l}=r,d=o?a??1:1,u=s(e);if(!t)return i(u,-d);if(!(l(u,t)<=0))return i(u,-d)}function AC(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function ia(e,t){const[n,r]=y.useState(e);return[t===void 0?n:t,r]}function zC(e,t){var w;const[n,r]=TC(e,t),{startOfMonth:o,endOfMonth:a}=t,s=zc(e,n,r,t),[i,l]=ia(s,e.month?s:void 0);y.useEffect(()=>{const S=zc(e,n,r,t);l(S)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:p}=y.useMemo(()=>{const S=MC(i,r,{numberOfMonths:e.numberOfMonths},t),N=PC(S,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),C=DC(S,N,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),E=AC(C),k=EC(C),M=OC(i,n,e,t),D=RC(i,r,e,t);return{months:C,weeks:E,days:k,previousMonth:M,nextMonth:D}},[t,i.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(w=e.endMonth)==null?void 0:w.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:j,onMonthChange:_}=e,g=S=>u.some(N=>N.days.some(C=>C.isEqualTo(S))),v=S=>{if(j)return;let N=o(S);n&&N<o(n)&&(N=o(n)),r&&N>o(r)&&(N=o(r)),l(N),_==null||_(N)};return{months:d,weeks:u,days:f,navStart:n,navEnd:r,previousMonth:m,nextMonth:p,goToMonth:v,goToDay:S=>{g(S)||v(S.date)}}}var St;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(St||(St={}));function Ic(e){return!e[De.disabled]&&!e[De.hidden]&&!e[De.outside]}function IC(e,t,n,r){let o,a=-1;for(const s of e){const i=t(s);Ic(i)&&(i[De.focused]&&a<St.FocusedModifier?(o=s,a=St.FocusedModifier):r!=null&&r.isEqualTo(s)&&a<St.LastFocused?(o=s,a=St.LastFocused):n(s.date)&&a<St.Selected?(o=s,a=St.Selected):i[De.today]&&a<St.Today&&(o=s,a=St.Today))}return o||(o=e.find(s=>Ic(t(s)))),o}function WC(e,t,n,r,o,a,s){const{ISOWeek:i,broadcastCalendar:l}=a,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:p,endOfISOWeek:j,endOfWeek:_,max:g,min:v,startOfBroadcastWeek:x,startOfISOWeek:b,startOfWeek:w}=s;let N={day:d,week:f,month:u,year:m,startOfWeek:C=>l?x(C,s):i?b(C):w(C),endOfWeek:C=>l?p(C):i?j(C):_(C)}[e](n,t==="after"?1:-1);return t==="before"&&r?N=g([r,N]):t==="after"&&o&&(N=v([o,N])),N}function dp(e,t,n,r,o,a,s,i=0){if(i>365)return;const l=WC(e,t,n.date,r,o,a,s),d=!!(a.disabled&&Lt(l,a.disabled,s)),u=!!(a.hidden&&Lt(l,a.hidden,s)),f=l,m=new Xm(l,f,s);return!d&&!u?m:dp(e,t,m,r,o,a,s,i+1)}function $C(e,t,n,r,o){const{autoFocus:a}=e,[s,i]=y.useState(),l=IC(t.days,n,r||(()=>!1),s),[d,u]=y.useState(a?l:void 0);return{isFocusTarget:_=>!!(l!=null&&l.isEqualTo(_)),setFocused:u,focused:d,blur:()=>{i(d),u(void 0)},moveFocus:(_,g)=>{if(!d)return;const v=dp(_,g,d,t.navStart,t.navEnd,e,o);v&&(e.disableNavigation&&!t.days.some(b=>b.isEqualTo(v))||(t.goToDay(v),u(v)))}}}function FC(e,t){const{selected:n,required:r,onSelect:o}=e,[a,s]=ia(n,o?n:void 0),i=o?n:a,{isSameDay:l}=t,d=p=>(i==null?void 0:i.some(j=>l(j,p)))??!1,{min:u,max:f}=e;return{selected:i,select:(p,j,_)=>{let g=[...i??[]];if(d(p)){if((i==null?void 0:i.length)===u||r&&(i==null?void 0:i.length)===1)return;g=i==null?void 0:i.filter(v=>!l(v,p))}else(i==null?void 0:i.length)===f?g=[p]:g=[...g,p];return o||s(g),o==null||o(g,p,j,_),g},isSelected:d}}function LC(e,t,n=0,r=0,o=!1,a=It){const{from:s,to:i}=t||{},{isSameDay:l,isAfter:d,isBefore:u}=a;let f;if(!s&&!i)f={from:e,to:n>0?void 0:e};else if(s&&!i)l(s,e)?n===0?f={from:s,to:e}:o?f={from:s,to:void 0}:f=void 0:u(e,s)?f={from:e,to:s}:f={from:s,to:e};else if(s&&i)if(l(s,e)&&l(i,e))o?f={from:s,to:i}:f=void 0;else if(l(s,e))f={from:s,to:n>0?void 0:e};else if(l(i,e))f={from:e,to:n>0?void 0:e};else if(u(e,s))f={from:e,to:i};else if(d(e,s))f={from:s,to:e};else if(d(e,i))f={from:s,to:e};else throw new Error("Invalid range");if(f!=null&&f.from&&(f!=null&&f.to)){const m=a.differenceInCalendarDays(f.to,f.from);r>0&&m>r?f={from:e,to:void 0}:n>1&&m<n&&(f={from:e,to:void 0})}return f}function BC(e,t,n=It){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),s=Math.min(a,6);for(let i=0;i<=s;i++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function Wc(e,t,n=It){return Ft(e,t.from,!1,n)||Ft(e,t.to,!1,n)||Ft(t,e.from,!1,n)||Ft(t,e.to,!1,n)}function HC(e,t,n=It){const r=Array.isArray(t)?t:[t];if(r.filter(i=>typeof i!="function").some(i=>typeof i=="boolean"?i:n.isDate(i)?Ft(e,i,!1,n):Qm(i,n)?i.some(l=>Ft(e,l,!1,n)):sa(i)?i.from&&i.to?Wc(e,{from:i.from,to:i.to},n):!1:Jm(i)?BC(e,i.dayOfWeek,n):li(i)?n.isAfter(i.before,i.after)?Wc(e,{from:n.addDays(i.after,1),to:n.addDays(i.before,-1)},n):Lt(e.from,i,n)||Lt(e.to,i,n):di(i)||ui(i)?Lt(e.from,i,n)||Lt(e.to,i,n):!1))return!0;const s=r.filter(i=>typeof i=="function");if(s.length){let i=e.from;const l=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=l;d++){if(s.some(u=>u(i)))return!0;i=n.addDays(i,1)}}return!1}function YC(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:a,onSelect:s}=e,[i,l]=ia(o,s?o:void 0),d=s?o:i;return{selected:d,select:(m,p,j)=>{const{min:_,max:g}=e,v=m?LC(m,d,_,g,a,t):void 0;return r&&n&&(v!=null&&v.from)&&v.to&&HC({from:v.from,to:v.to},n,t)&&(v.from=m,v.to=void 0),s||l(v),s==null||s(v,m,p,j),v},isSelected:m=>d&&Ft(d,m,!1,t)}}function qC(e,t){const{selected:n,required:r,onSelect:o}=e,[a,s]=ia(n,o?n:void 0),i=o?n:a,{isSameDay:l}=t;return{selected:i,select:(f,m,p)=>{let j=f;return!r&&i&&i&&l(f,i)&&(j=void 0),o||s(j),o==null||o(j,f,m,p),j},isSelected:f=>i?l(i,f):!1}}function VC(e,t){const n=qC(e,t),r=FC(e,t),o=YC(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function dt(e,t){return e instanceof qe&&e.timeZone===t?e:new qe(e,t)}function Wn(e,t,n){return dt(e,t)}function $c(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Wn(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Wn(r,t):r):sa(e)?{...e,from:e.from?dt(e.from,t):e.from,to:e.to?dt(e.to,t):e.to}:li(e)?{before:Wn(e.before,t),after:Wn(e.after,t)}:di(e)?{after:Wn(e.after,t)}:ui(e)?{before:Wn(e.before,t)}:e}function Wa(e,t,n){return e&&(Array.isArray(e)?e.map(r=>$c(r,t)):$c(e,t))}function GC(e){var ir;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=dt(t.today,n)),t.month&&(t.month=dt(t.month,n)),t.defaultMonth&&(t.defaultMonth=dt(t.defaultMonth,n)),t.startMonth&&(t.startMonth=dt(t.startMonth,n)),t.endMonth&&(t.endMonth=dt(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=dt(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(ir=t.selected)==null?void 0:ir.map(ce=>dt(ce,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?dt(t.selected.from,n):t.selected.from,to:t.selected.to?dt(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Wa(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Wa(t.hidden,n)),t.modifiers)){const ce={};Object.keys(t.modifiers).forEach(ge=>{var te;ce[ge]=Wa((te=t.modifiers)==null?void 0:te[ge],n)}),t.modifiers=ce}const{components:r,formatters:o,labels:a,dateLib:s,locale:i,classNames:l}=y.useMemo(()=>{const ce={...Um,...t.locale},ge=t.broadcastCalendar?1:t.weekStartsOn,te=t.noonSafe&&t.timeZone?wC(t.timeZone,{weekStartsOn:ge,locale:ce}):void 0,fe=t.dateLib&&te?{...te,...t.dateLib}:t.dateLib??te,Ve=new at({locale:ce,weekStartsOn:ge,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},fe);return{dateLib:Ve,components:nC(t.components),formatters:mC(t.formatters),labels:jC(t.labels,Ve.options),locale:ce,classNames:{...oC(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:s.today()});const{captionLayout:d,mode:u,navLayout:f,numberOfMonths:m=1,onDayBlur:p,onDayClick:j,onDayFocus:_,onDayKeyDown:g,onDayMouseEnter:v,onDayMouseLeave:x,onNextClick:b,onPrevClick:w,showWeekNumber:S,styles:N}=t,{formatCaption:C,formatDay:E,formatMonthDropdown:k,formatWeekNumber:M,formatWeekNumberHeader:D,formatWeekdayName:T,formatYearDropdown:$}=o,A=zC(t,s),{days:H,months:W,navStart:Q,navEnd:G,previousMonth:z,nextMonth:oe,goToMonth:le}=A,ie=eC(H,t,Q,G,s),{isSelected:R,select:I,selected:Y}=VC(t,s)??{},{blur:U,focused:P,isFocusTarget:O,moveFocus:B,setFocused:L}=$C(t,A,ie,R??(()=>!1),s),{labelDayButton:V,labelGridcell:ee,labelGrid:ae,labelMonthDropdown:_e,labelNav:Se,labelPrevious:Me,labelNext:Be,labelWeekday:ke,labelWeekNumber:ft,labelWeekNumberHeader:Mn,labelYearDropdown:Ze}=a,fn=y.useMemo(()=>xC(s,t.ISOWeek,t.broadcastCalendar,t.today),[s,t.ISOWeek,t.broadcastCalendar,t.today]),ct=u!==void 0||j!==void 0,or=y.useCallback(()=>{z&&(le(z),w==null||w(z))},[z,le,w]),ar=y.useCallback(()=>{oe&&(le(oe),b==null||b(oe))},[le,oe,b]),Je=y.useCallback((ce,ge)=>te=>{te.preventDefault(),te.stopPropagation(),L(ce),!ge.disabled&&(I==null||I(ce.date,ge,te),j==null||j(ce.date,ge,te))},[I,j,L]),Ut=y.useCallback((ce,ge)=>te=>{L(ce),_==null||_(ce.date,ge,te)},[_,L]),da=y.useCallback((ce,ge)=>te=>{U(),p==null||p(ce.date,ge,te)},[U,p]),ua=y.useCallback((ce,ge)=>te=>{const fe={ArrowLeft:[te.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[te.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[te.shiftKey?"year":"week","after"],ArrowUp:[te.shiftKey?"year":"week","before"],PageUp:[te.shiftKey?"year":"month","before"],PageDown:[te.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(fe[te.key]){te.preventDefault(),te.stopPropagation();const[Ve,F]=fe[te.key];B(Ve,F)}g==null||g(ce.date,ge,te)},[B,g,t.dir]),Dn=y.useCallback((ce,ge)=>te=>{v==null||v(ce.date,ge,te)},[v]),fa=y.useCallback((ce,ge)=>te=>{x==null||x(ce.date,ge,te)},[x]),Fr=y.useCallback(ce=>ge=>{const te=Number(ge.target.value),fe=s.setMonth(s.startOfMonth(ce),te);le(fe)},[s,le]),sr=y.useCallback(ce=>ge=>{const te=Number(ge.target.value),fe=s.setYear(s.startOfMonth(ce),te);le(fe)},[s,le]),{className:Xt,style:Lr}=y.useMemo(()=>({className:[l[J.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[J.Root],...t.style}}),[l,t.className,t.style,N]),Kt=rC(t),Br=y.useRef(null);kC(Br,!!t.animate,{classNames:l,months:W,focused:P,dateLib:s});const ma={dayPickerProps:t,selected:Y,select:I,isSelected:R,months:W,nextMonth:oe,previousMonth:z,goToMonth:le,getModifiers:ie,components:r,classNames:l,styles:N,labels:a,formatters:o};return y.createElement(Km.Provider,{value:ma},y.createElement(r.Root,{rootRef:t.animate?Br:void 0,className:Xt,style:Lr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Kt},y.createElement(r.Months,{className:l[J.Months],style:N==null?void 0:N[J.Months]},!t.hideNavigation&&!f&&y.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[J.Nav],style:N==null?void 0:N[J.Nav],"aria-label":Se(),onPreviousClick:or,onNextClick:ar,previousMonth:z,nextMonth:oe}),W.map((ce,ge)=>y.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:l[J.Month],style:N==null?void 0:N[J.Month],key:ge,displayIndex:ge,calendarMonth:ce},f==="around"&&!t.hideNavigation&&ge===0&&y.createElement(r.PreviousMonthButton,{type:"button",className:l[J.PreviousMonthButton],tabIndex:z?void 0:-1,"aria-disabled":z?void 0:!0,"aria-label":Me(z),onClick:or,"data-animated-button":t.animate?"true":void 0},y.createElement(r.Chevron,{disabled:z?void 0:!0,className:l[J.Chevron],orientation:t.dir==="rtl"?"right":"left"})),y.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[J.MonthCaption],style:N==null?void 0:N[J.MonthCaption],calendarMonth:ce,displayIndex:ge},d!=null&&d.startsWith("dropdown")?y.createElement(r.DropdownNav,{className:l[J.Dropdowns],style:N==null?void 0:N[J.Dropdowns]},(()=>{const te=d==="dropdown"||d==="dropdown-months"?y.createElement(r.MonthsDropdown,{key:"month",className:l[J.MonthsDropdown],"aria-label":_e(),classNames:l,components:r,disabled:!!t.disableNavigation,onChange:Fr(ce.date),options:yC(ce.date,Q,G,o,s),style:N==null?void 0:N[J.Dropdown],value:s.getMonth(ce.date)}):y.createElement("span",{key:"month"},k(ce.date,s)),fe=d==="dropdown"||d==="dropdown-years"?y.createElement(r.YearsDropdown,{key:"year",className:l[J.YearsDropdown],"aria-label":Ze(s.options),classNames:l,components:r,disabled:!!t.disableNavigation,onChange:sr(ce.date),options:bC(Q,G,o,s,!!t.reverseYears),style:N==null?void 0:N[J.Dropdown],value:s.getYear(ce.date)}):y.createElement("span",{key:"year"},$(ce.date,s));return s.getMonthYearOrder()==="year-first"?[fe,te]:[te,fe]})(),y.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},C(ce.date,s.options,s))):y.createElement(r.CaptionLabel,{className:l[J.CaptionLabel],role:"status","aria-live":"polite"},C(ce.date,s.options,s))),f==="around"&&!t.hideNavigation&&ge===m-1&&y.createElement(r.NextMonthButton,{type:"button",className:l[J.NextMonthButton],tabIndex:oe?void 0:-1,"aria-disabled":oe?void 0:!0,"aria-label":Be(oe),onClick:ar,"data-animated-button":t.animate?"true":void 0},y.createElement(r.Chevron,{disabled:oe?void 0:!0,className:l[J.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ge===m-1&&f==="after"&&!t.hideNavigation&&y.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[J.Nav],style:N==null?void 0:N[J.Nav],"aria-label":Se(),onPreviousClick:or,onNextClick:ar,previousMonth:z,nextMonth:oe}),y.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ae(ce.date,s.options,s)||void 0,className:l[J.MonthGrid],style:N==null?void 0:N[J.MonthGrid]},!t.hideWeekdays&&y.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[J.Weekdays],style:N==null?void 0:N[J.Weekdays]},S&&y.createElement(r.WeekNumberHeader,{"aria-label":Mn(s.options),className:l[J.WeekNumberHeader],style:N==null?void 0:N[J.WeekNumberHeader],scope:"col"},D()),fn.map(te=>y.createElement(r.Weekday,{"aria-label":ke(te,s.options,s),className:l[J.Weekday],key:String(te),style:N==null?void 0:N[J.Weekday],scope:"col"},T(te,s.options,s)))),y.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[J.Weeks],style:N==null?void 0:N[J.Weeks]},ce.weeks.map(te=>y.createElement(r.Week,{className:l[J.Week],key:te.weekNumber,style:N==null?void 0:N[J.Week],week:te},S&&y.createElement(r.WeekNumber,{week:te,style:N==null?void 0:N[J.WeekNumber],"aria-label":ft(te.weekNumber,{locale:i}),className:l[J.WeekNumber],scope:"row",role:"rowheader"},M(te.weekNumber,s)),te.days.map(fe=>{const{date:Ve}=fe,F=ie(fe);if(F[De.focused]=!F.hidden&&!!(P!=null&&P.isEqualTo(fe)),F[gt.selected]=(R==null?void 0:R(Ve))||F.selected,sa(Y)){const{from:Ge,to:lt}=Y;F[gt.range_start]=!!(Ge&&lt&&s.isSameDay(Ve,Ge)),F[gt.range_end]=!!(Ge&&lt&&s.isSameDay(Ve,lt)),F[gt.range_middle]=Ft(Y,Ve,!0,s)}const ve=vC(F,N,t.modifiersStyles),Ne=tC(F,l,t.modifiersClassNames),et=!ct&&!F.hidden?ee(Ve,F,s.options,s):void 0;return y.createElement(r.Day,{key:`${fe.isoDate}_${fe.displayMonthId}`,day:fe,modifiers:F,className:Ne.join(" "),style:ve,role:"gridcell","aria-selected":F.selected||void 0,"aria-label":et,"data-day":fe.isoDate,"data-month":fe.outside?fe.dateMonthId:void 0,"data-selected":F.selected||void 0,"data-disabled":F.disabled||void 0,"data-hidden":F.hidden||void 0,"data-outside":fe.outside||void 0,"data-focused":F.focused||void 0,"data-today":F.today||void 0},!F.hidden&&ct?y.createElement(r.DayButton,{className:l[J.DayButton],style:N==null?void 0:N[J.DayButton],type:"button",day:fe,modifiers:F,disabled:!F.focused&&F.disabled||void 0,"aria-disabled":F.focused&&F.disabled||void 0,tabIndex:O(fe)?0:-1,"aria-label":V(Ve,F,s.options,s),onClick:Je(fe,F),onBlur:da(fe,F),onFocus:Ut(fe,F),onKeyDown:ua(fe,F),onMouseEnter:Dn(fe,F),onMouseLeave:fa(fe,F)},E(Ve,s.options,s)):!F.hidden&&E(fe.date,s.options,s))})))))))),t.footer&&y.createElement(r.Footer,{className:l[J.Footer],style:N==null?void 0:N[J.Footer],role:"status","aria-live":"polite"},t.footer)))}function pi({className:e,classNames:t,showOutsideDays:n=!0,...r}){return c.jsx(GC,{showOutsideDays:n,className:ne("cj-p-4",e),classNames:{months:"cj-flex cj-flex-col cj-space-y-4",month:"cj-space-y-4",month_caption:"cj-flex cj-justify-center cj-pt-1 cj-relative cj-items-center cj-pb-2",caption_label:"cj-hidden",nav:"cj-space-x-1 cj-flex cj-items-center",button_previous:ne("cj-inline-flex cj-items-center cj-justify-center cj-rounded-full cj-h-9 cj-w-9 cj-bg-transparent cj-border-none cj-p-0 cj-text-muted-foreground hover:cj-text-foreground hover:cj-bg-accent cj-transition-colors cj-cursor-pointer cj-absolute cj-left-1"),button_next:ne("cj-inline-flex cj-items-center cj-justify-center cj-rounded-full cj-h-9 cj-w-9 cj-bg-transparent cj-border-none cj-p-0 cj-text-muted-foreground hover:cj-text-foreground hover:cj-bg-accent cj-transition-colors cj-cursor-pointer cj-absolute cj-right-1"),month_grid:"cj-w-full cj-border-collapse",weekdays:"cj-flex",weekday:"cj-text-muted-foreground/70 cj-w-10 cj-font-medium cj-text-xs cj-uppercase cj-tracking-wider cj-pb-2",week:"cj-flex cj-w-full",day:"cj-h-10 cj-w-10 cj-text-center cj-text-sm cj-p-0 cj-relative [&:has([aria-selected].day-range-end)]:cj-rounded-r-full [&:has([aria-selected].day-outside)]:cj-bg-accent/50 [&:has([aria-selected])]:cj-bg-accent first:[&:has([aria-selected])]:cj-rounded-l-full last:[&:has([aria-selected])]:cj-rounded-r-full focus-within:cj-relative focus-within:cj-z-20",day_button:"cj-inline-flex cj-items-center cj-justify-center cj-h-10 cj-w-10 cj-rounded-full cj-bg-transparent cj-border-none cj-p-0 cj-font-normal cj-cursor-pointer cj-transition-colors hover:cj-bg-accent hover:cj-text-accent-foreground aria-selected:cj-opacity-100",range_end:"day-range-end",selected:"cj-bg-primary cj-text-primary-foreground cj-rounded-full hover:cj-bg-primary hover:cj-text-primary-foreground focus:cj-bg-primary focus:cj-text-primary-foreground",today:"cj-bg-primary cj-text-white cj-rounded-full cj-font-bold cj-ring-2 cj-ring-primary/50",outside:"day-outside cj-text-muted-foreground cj-opacity-40 aria-selected:cj-bg-accent/50 aria-selected:cj-text-muted-foreground aria-selected:cj-opacity-30",disabled:"cj-text-muted-foreground cj-opacity-50",range_middle:"aria-selected:cj-bg-accent aria-selected:cj-text-accent-foreground",hidden:"cj-invisible",dropdowns:"cj-flex cj-items-center cj-gap-1.5",dropdown_root:"cj-relative cj-inline-flex cj-items-center",dropdown:"cj-appearance-none cj-bg-muted/50 cj-border cj-border-border/40 cj-rounded-lg cj-h-8 cj-px-2 cj-pr-6 cj-text-sm cj-font-medium cj-text-foreground hover:cj-bg-accent focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring cj-cursor-pointer",years_dropdown:"cj-max-h-60",months_dropdown:"cj-max-h-60",...t},components:{Chevron:({orientation:o})=>o==="left"?c.jsx(d_,{className:"cj-h-4 cj-w-4"}):c.jsx(u_,{className:"cj-h-4 cj-w-4"})},...r})}pi.displayName="Calendar";function UC(e){const t=XC(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(JC);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function XC(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=ZC(o),i=QC(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KC=Symbol("radix.slottable");function JC(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KC}function QC(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ZC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ca="Popover",[up]=st(ca,[Xo]),$r=Xo(),[ek,un]=up(ca),fp=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:s=!1}=e,i=$r(t),l=h.useRef(null),[d,u]=h.useState(!1),[f,m]=Ht({prop:r,defaultProp:o??!1,onChange:a,caller:ca});return c.jsx($u,{...i,children:c.jsx(ek,{scope:t,contentId:Dt(),triggerRef:l,open:f,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:s,children:n})})};fp.displayName=ca;var mp="PopoverAnchor",tk=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=un(mp,n),a=$r(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:i}=o;return h.useEffect(()=>(s(),()=>i()),[s,i]),c.jsx(Hs,{...a,...r,ref:t})});tk.displayName=mp;var pp="PopoverTrigger",hp=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=un(pp,n),a=$r(n),s=he(t,o.triggerRef),i=c.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vp(o.open),...r,ref:s,onClick:re(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(Hs,{asChild:!0,...a,children:i})});hp.displayName=pp;var hi="PopoverPortal",[nk,rk]=up(hi,{forceMount:void 0}),_p=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=un(hi,t);return c.jsx(nk,{scope:t,forceMount:n,children:c.jsx(it,{present:n||a.open,children:c.jsx(Fo,{asChild:!0,container:o,children:r})})})};_p.displayName=hi;var Jn="PopoverContent",gp=h.forwardRef((e,t)=>{const n=rk(Jn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=un(Jn,e.__scopePopover);return c.jsx(it,{present:r||a.open,children:a.modal?c.jsx(ak,{...o,ref:t}):c.jsx(sk,{...o,ref:t})})});gp.displayName=Jn;var ok=UC("PopoverContent.RemoveScroll"),ak=h.forwardRef((e,t)=>{const n=un(Jn,e.__scopePopover),r=h.useRef(null),o=he(t,r),a=h.useRef(!1);return h.useEffect(()=>{const s=r.current;if(s)return Ps(s)},[]),c.jsx(Bo,{as:ok,allowPinchZoom:!0,children:c.jsx(jp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),a.current||(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,d=i.button===2||l;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),sk=h.forwardRef((e,t)=>{const n=un(Jn,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return c.jsx(jp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),jp=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=e,m=un(Jn,n),p=$r(n);return ks(),c.jsx($o,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:c.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:c.jsx(Fu,{"data-state":vp(m.open),role:"dialog",id:m.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),yp="PopoverClose",ik=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=un(yp,n);return c.jsx(se.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))})});ik.displayName=yp;var ck="PopoverArrow",lk=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=$r(n);return c.jsx(Lu,{...o,...r,ref:t})});lk.displayName=ck;function vp(e){return e?"open":"closed"}var dk=fp,uk=hp,fk=_p,xp=gp;const _i=dk,gi=uk,la=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>{const a=ea();return c.jsx(fk,{container:a??void 0,children:c.jsx(xp,{ref:o,align:t,sideOffset:n,className:ne("cj-z-50 cj-w-72 cj-rounded-md cj-border cj-bg-popover cj-p-4 cj-text-popover-foreground cj-shadow-md cj-outline-none data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",e),...r})})});la.displayName=xp.displayName;const Fc={en:aa,es:Rm,pt:Om},Lc={en:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/YYYY"},es:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pt:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pl:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/RRRR"}};function Bc(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function mk(e,t){const n=e.replace(/\D/g,"").slice(0,t.replace(/[^a-zA-Z]/g,"").length);if(!n)return"";let r="",o=0;for(const a of t){if(o>=n.length)break;/[a-zA-Z]/.test(a)?r+=n[o++]:r+=a}return r}function pk({label:e,value:t,onChange:n,helpText:r,allowFuture:o=!1}){const{t:a,language:s}=je(),[i,l]=y.useState(!1),d=y.useMemo(()=>{if(!t)return;const N=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(N)return new Date(Number(N[1]),Number(N[2])-1,Number(N[3]));const C=new Date(t);return Number.isNaN(C.getTime())?void 0:C},[t]),u=y.useMemo(()=>Fc[s]||Fc.en,[s]),{fmt:f,placeholder:m}=Lc[s]||Lc.en,[p,j]=y.useState(d?No(d,f):""),[_,g]=y.useState(!1);y.useEffect(()=>{j(d?No(d,f):""),g(!1)},[d,f]);const v=new Date,x=1900,b=o?v.getFullYear()+20:v.getFullYear(),w=N=>{const C=N.trim();if(!C){g(!1),n("");return}const E=Tm(C,f,new Date);if(!ti(E)){g(!0);return}if(!o&&E>v){g(!0);return}g(!1),n(Bc(E))},S=N=>{N&&(n(Bc(N)),l(!1))};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx(pe,{type:"text",inputMode:"numeric",value:p,placeholder:m,onChange:N=>{const C=mk(N.target.value,f);j(C),_&&g(!1)},onBlur:N=>w(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),w(N.target.value))},"aria-invalid":_||void 0,className:ne("cj-pr-12",_&&"cj-border-destructive focus-visible:cj-ring-destructive")}),c.jsxs(_i,{open:i,onOpenChange:l,children:[c.jsx(gi,{asChild:!0,children:c.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":a("widget_pick_date"),className:"cj-absolute cj-right-1 cj-top-1/2 -cj-translate-y-1/2 cj-h-10 cj-w-10 cj-rounded-lg cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Cl,{className:"cj-h-4 cj-w-4"})})}),c.jsx(la,{className:"cj-w-auto cj-p-0 cj-z-50 cj-rounded-2xl cj-shadow-lg cj-border-border/30",align:"end",sideOffset:8,children:c.jsx(pi,{mode:"single",selected:d,onSelect:S,defaultMonth:d??new Date,locale:u,autoFocus:!0,captionLayout:"dropdown",startMonth:new Date(x,0),endMonth:new Date(b,11),disabled:o?void 0:{after:v},className:ne("cj-p-4 cj-pointer-events-auto")})})]})]}),_&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:a("widget_invalid_date")}),r&&!_&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function hk({label:e,value:t,onChange:n,helpText:r}){const{t:o}=je(),a=y.useMemo(()=>{if(!t)return"";if(/^\d{2}:\d{2}/.test(t))return t.slice(0,5);const i=new Date(t);if(Number.isNaN(i.getTime()))return"";const l=String(i.getHours()).padStart(2,"0"),d=String(i.getMinutes()).padStart(2,"0");return`${l}:${d}`},[t]),s=i=>{n(i||"")};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsx(pe,{type:"time",value:a,onChange:i=>s(i.target.value),className:"cj-h-12 cj-rounded-xl","aria-label":e||o("widget_pick_time")}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}const Hc={en:aa,es:Rm,pt:Om},Yc={en:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/YYYY"},es:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pt:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pl:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/RRRR"}};function _k(e,t){const n=e.replace(/\D/g,"").slice(0,t.replace(/[^a-zA-Z]/g,"").length);if(!n)return"";let r="",o=0;for(const a of t){if(o>=n.length)break;/[a-zA-Z]/.test(a)?r+=n[o++]:r+=a}return r}function gk({label:e,value:t,onChange:n,helpText:r,allowFuture:o=!0}){const{t:a,language:s}=je(),[i,l]=y.useState(!1),d=t?new Date(t):void 0,u=d&&!Number.isNaN(d.getTime())?d:void 0,f=y.useMemo(()=>Hc[s]||Hc.en,[s]),{fmt:m,placeholder:p}=Yc[s]||Yc.en,j=y.useMemo(()=>{if(!u)return"";const C=String(u.getHours()).padStart(2,"0"),E=String(u.getMinutes()).padStart(2,"0");return`${C}:${E}`},[u]),[_,g]=y.useState(u?No(u,m):""),[v,x]=y.useState(!1);y.useEffect(()=>{g(u?No(u,m):""),x(!1)},[u,m]);const b=new Date,w=C=>{const E=C.trim();if(!E){x(!1),n("");return}const k=Tm(E,m,new Date);if(!ti(k)){x(!0);return}if(!o&&k>b){x(!0);return}u?k.setHours(u.getHours(),u.getMinutes(),0,0):k.setHours(12,0,0,0),x(!1),n(k.toISOString())},S=C=>{if(!C)return;const E=new Date(C);u?E.setHours(u.getHours(),u.getMinutes(),0,0):E.setHours(12,0,0,0),n(E.toISOString()),l(!1)},N=C=>{if(!C)return;const[E,k]=C.split(":").map(Number),M=u?new Date(u):new Date;M.setHours(E,k,0,0),n(M.toISOString())};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsxs("div",{className:"cj-relative cj-flex-1",children:[c.jsx(pe,{type:"text",inputMode:"numeric",value:_,placeholder:p,onChange:C=>{const E=_k(C.target.value,m);g(E),v&&x(!1)},onBlur:C=>w(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),w(C.target.value))},"aria-invalid":v||void 0,className:ne("cj-pr-12",v&&"cj-border-destructive focus-visible:cj-ring-destructive")}),c.jsxs(_i,{open:i,onOpenChange:l,children:[c.jsx(gi,{asChild:!0,children:c.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":a("widget_pick_date"),className:"cj-absolute cj-right-1 cj-top-1/2 -cj-translate-y-1/2 cj-h-10 cj-w-10 cj-rounded-lg cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Cl,{className:"cj-h-4 cj-w-4"})})}),c.jsx(la,{className:"cj-w-auto cj-p-0 cj-z-50 cj-rounded-2xl cj-shadow-lg cj-border-border/30",align:"end",sideOffset:8,children:c.jsx(pi,{mode:"single",selected:u,onSelect:S,defaultMonth:u??new Date,locale:f,autoFocus:!0,captionLayout:"dropdown",startMonth:new Date(1900,0),endMonth:new Date(o?b.getFullYear()+20:b.getFullYear(),11),disabled:o?void 0:{after:b},className:ne("cj-p-4 cj-pointer-events-auto")})})]})]}),c.jsx(pe,{type:"time",value:j,onChange:C=>N(C.target.value),className:"cj-h-12 cj-rounded-xl cj-w-32","aria-label":a("widget_pick_time")})]}),v&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:a("widget_invalid_date")}),r&&!v&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function jk({label:e,value:t,onChange:n,helpText:r,currency:o="EUR"}){const{t:a}=je(),[s,i]=y.useState("");y.useEffect(()=>{if(t){const p=parseFloat(t);isNaN(p)||i(l(p))}else i("")},[t]);const l=p=>new Intl.NumberFormat("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2}).format(p),d=p=>{const j=p.replace(/\./g,"").replace(",",".");return parseFloat(j)||0},u=p=>{const _=p.target.value.replace(/[^\d.,]/g,"");i(_)},f=()=>{if(s){const p=d(s);n(p.toString()),i(l(p))}else n("")},m=p=>({EUR:"€",USD:"$",GBP:"£"})[p]||p;return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx("span",{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-text-muted-foreground",children:m(o)}),c.jsx(pe,{type:"text",value:s,onChange:u,onBlur:f,placeholder:a("placeholder_currency"),className:"cj-pl-8"})]}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function Zr(e){return typeof e=="object"&&e!==null&&"filename"in e&&"url"in e}function yk({label:e,value:t,onChange:n,onFileSelect:r,helpText:o,accept:a,maxSizeMB:s}){const{t:i}=je(),l=y.useRef(null),[d,u]=y.useState(!1),[f,m]=y.useState(null),p=k=>{if(s&&k.size>s*1024*1024)return i("widget_file_too_large",{max:String(s),size:(k.size/1024/1024).toFixed(1)});if(a){const M=a.split(",").map(A=>A.trim().toLowerCase()),D=k.name.toLowerCase(),T=k.type.toLowerCase();if(!M.some(A=>A.startsWith(".")?D.endsWith(A):A.endsWith("/*")?T.startsWith(A.replace("/*","/")):T===A))return i("widget_file_type_rejected",{accept:a})}return null},j=async k=>{m(null);const M=p(k);if(M){m(M);return}if(!r){n(k.name);return}u(!0);try{const D=await r(k);Zr(D)?n(D):n(typeof D=="string"?D:k.name)}catch(D){m(D instanceof Error?D.message:i("widget_upload_failed")),n("")}finally{u(!1)}},_=k=>{if(k.preventDefault(),d)return;const M=k.dataTransfer.files;M.length>0&&j(M[0])},g=k=>{k.preventDefault()},v=()=>{var k;d||(k=l.current)==null||k.click()},x=k=>{const M=k.target.files;M&&M.length>0&&j(M[0]),k.target.value=""},b=k=>{k.stopPropagation(),n(""),m(null)},w=Zr(t)?!!t.url:!!t,S=Zr(t)?t.filename:t,N=Zr(t)?t.url:null,C=[];a&&C.push(i("widget_accepted_hint",{accept:a})),s&&C.push(i("widget_max_size_hint",{max:String(s)}));const E=C.length>0?C.join(" · "):null;return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsx("input",{ref:l,type:"file",className:"cj-hidden",accept:a,onChange:x}),c.jsx("div",{onDrop:_,onDragOver:g,onClick:v,className:`cj-border-2 cj-border-dashed cj-rounded-lg cj-p-8 cj-text-center cj-transition-colors ${d?"cj-border-muted-foreground/25 cj-cursor-wait cj-opacity-60":f?"cj-border-destructive/50 cj-cursor-pointer hover:cj-border-destructive/75":"cj-border-muted-foreground/25 cj-cursor-pointer hover:cj-border-muted-foreground/50"}`,children:d?c.jsxs(c.Fragment,{children:[c.jsx(_s,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2 cj-animate-spin"}),c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:i("upload_uploading")})]}):w?c.jsxs(c.Fragment,{children:[c.jsx(v_,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-center cj-gap-2",children:[N?c.jsx("a",{href:N,target:"_blank",rel:"noopener noreferrer",onClick:k=>k.stopPropagation(),className:"cj-text-sm cj-font-medium cj-text-primary cj-underline cj-truncate cj-max-w-[240px]",title:S,children:S}):c.jsx("p",{className:"cj-text-sm cj-font-medium cj-truncate cj-max-w-[240px]",children:S}),c.jsx("button",{type:"button",onClick:b,className:"cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Vt,{className:"cj-h-4 cj-w-4"})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx(Dl,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:i("upload_drag_drop")})]})}),f&&c.jsxs("p",{className:"cj-text-xs cj-text-destructive cj-flex cj-items-center cj-gap-1",children:[c.jsx(kl,{className:"cj-h-3 cj-w-3"})," ",f]}),(o||E)&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o||E})]})}const $a=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"PT",name:"Portugal",dial:"+351",flag:"🇵🇹"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"BE",name:"Belgium",dial:"+32",flag:"🇧🇪"},{code:"CH",name:"Switzerland",dial:"+41",flag:"🇨🇭"},{code:"AT",name:"Austria",dial:"+43",flag:"🇦🇹"},{code:"SE",name:"Sweden",dial:"+46",flag:"🇸🇪"},{code:"NO",name:"Norway",dial:"+47",flag:"🇳🇴"},{code:"DK",name:"Denmark",dial:"+45",flag:"🇩🇰"},{code:"FI",name:"Finland",dial:"+358",flag:"🇫🇮"},{code:"IE",name:"Ireland",dial:"+353",flag:"🇮🇪"},{code:"PL",name:"Poland",dial:"+48",flag:"🇵🇱"},{code:"CZ",name:"Czech Republic",dial:"+420",flag:"🇨🇿"},{code:"RO",name:"Romania",dial:"+40",flag:"🇷🇴"},{code:"HU",name:"Hungary",dial:"+36",flag:"🇭🇺"},{code:"GR",name:"Greece",dial:"+30",flag:"🇬🇷"},{code:"TR",name:"Turkey",dial:"+90",flag:"🇹🇷"},{code:"RU",name:"Russia",dial:"+7",flag:"🇷🇺"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"CN",name:"China",dial:"+86",flag:"🇨🇳"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"PK",name:"Pakistan",dial:"+92",flag:"🇵🇰"},{code:"BD",name:"Bangladesh",dial:"+880",flag:"🇧🇩"},{code:"ID",name:"Indonesia",dial:"+62",flag:"🇮🇩"},{code:"MY",name:"Malaysia",dial:"+60",flag:"🇲🇾"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"},{code:"PH",name:"Philippines",dial:"+63",flag:"🇵🇭"},{code:"TH",name:"Thailand",dial:"+66",flag:"🇹🇭"},{code:"VN",name:"Vietnam",dial:"+84",flag:"🇻🇳"},{code:"AE",name:"UAE",dial:"+971",flag:"🇦🇪"},{code:"SA",name:"Saudi Arabia",dial:"+966",flag:"🇸🇦"},{code:"IL",name:"Israel",dial:"+972",flag:"🇮🇱"},{code:"EG",name:"Egypt",dial:"+20",flag:"🇪🇬"},{code:"ZA",name:"South Africa",dial:"+27",flag:"🇿🇦"},{code:"NG",name:"Nigeria",dial:"+234",flag:"🇳🇬"},{code:"KE",name:"Kenya",dial:"+254",flag:"🇰🇪"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"AR",name:"Argentina",dial:"+54",flag:"🇦🇷"},{code:"CO",name:"Colombia",dial:"+57",flag:"🇨🇴"},{code:"CL",name:"Chile",dial:"+56",flag:"🇨🇱"},{code:"PE",name:"Peru",dial:"+51",flag:"🇵🇪"},{code:"NZ",name:"New Zealand",dial:"+64",flag:"🇳🇿"}];function vk({label:e,value:t,onChange:n,placeholder:r,helpText:o,onValidationChange:a}){const{t:s}=je(),[i,l]=y.useState(null),[d,u]=y.useState($a[0]),[f,m]=y.useState(""),[p,j]=y.useState(!1),_=y.useMemo(()=>t?t.startsWith(d.dial)?t.slice(d.dial.length).trimStart():t.replace(/^\+\d+\s*/,""):"",[t,d.dial]),g=y.useMemo(()=>{if(!f)return $a;const w=f.toLowerCase();return $a.filter(S=>S.name.toLowerCase().includes(w)||S.code.toLowerCase().includes(w)||S.dial.includes(w))},[f]),v=w=>{const S=!!w&&!/^[\d\s\-()]{4,20}$/.test(w);l(S?s("widget_invalid_phone"):null),a==null||a(S)};y.useEffect(()=>{v(_)},[]);const x=w=>{const S=w.replace(/[^\d\s\-()]/g,""),N=S?`${d.dial} ${S}`:"";n(N),v(S)},b=w=>{u(w),j(!1),m(""),_&&n(`${w.dial} ${_}`)};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-flex cj-gap-1.5",children:[c.jsxs(_i,{open:p,onOpenChange:j,children:[c.jsx(gi,{asChild:!0,children:c.jsxs(Z,{variant:"outline",role:"combobox","aria-expanded":p,className:"cj-w-[100px] cj-justify-between cj-px-2 cj-shrink-0",children:[c.jsx("span",{className:"cj-text-base cj-leading-none",children:d.flag}),c.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:d.dial}),c.jsx(on,{className:"cj-h-3 cj-w-3 cj-opacity-50"})]})}),c.jsxs(la,{className:"cj-w-[260px] cj-p-0",align:"start",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-border-b cj-px-3 cj-py-2",children:[c.jsx(Ml,{className:"cj-h-4 cj-w-4 cj-shrink-0 cj-text-muted-foreground cj-mr-2"}),c.jsx("input",{placeholder:s("widget_search_country"),value:f,onChange:w=>m(w.target.value),className:"cj-flex-1 cj-bg-transparent cj-text-sm cj-outline-none placeholder:cj-text-muted-foreground"})]}),c.jsx(Rt,{className:"cj-h-[200px]",children:c.jsxs("div",{className:"cj-p-1",children:[g.map(w=>c.jsxs("button",{onClick:()=>b(w),className:`cj-flex cj-w-full cj-items-center cj-gap-2 cj-rounded-sm cj-px-3 cj-py-2.5 cj-text-sm hover:cj-bg-accent hover:cj-text-accent-foreground cj-cursor-pointer cj-transition-colors ${d.code===w.code?"cj-bg-accent":""}`,children:[c.jsx("span",{className:"cj-text-base",children:w.flag}),c.jsx("span",{className:"cj-flex-1 cj-text-left cj-truncate",children:w.name}),c.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:w.dial})]},w.code)),g.length===0&&c.jsx("p",{className:"cj-py-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:s("widget_no_country")})]})})]})]}),c.jsx(pe,{type:"tel",value:_,onChange:w=>x(w.target.value),placeholder:r||s("placeholder_phone"),className:"cj-flex-1"})]}),i&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:i}),!i&&o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function xk({label:e,value:t,onChange:n,placeholder:r,helpText:o,onValidationChange:a}){const{t:s}=je(),[i,l]=y.useState(null),d=f=>{const m=!!f&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f);l(m?s("widget_invalid_email"):null),a==null||a(m)};y.useEffect(()=>{d(t)},[]);const u=f=>{const m=f.trim();n(m),d(m)};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx(C_,{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx(pe,{type:"email",value:t,onChange:f=>u(f.target.value),placeholder:r||s("placeholder_email"),className:"cj-pl-9"})]}),i&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:i}),!i&&o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}let ds=!1,eo=!1;const Fa=[];function bk(e){return ds?Promise.resolve():eo?new Promise(t=>{Fa.push(t)}):(eo=!0,new Promise((t,n)=>{const r=document.createElement("script");r.src=`https://maps.googleapis.com/maps/api/js?key=${e}&libraries=places`,r.async=!0,r.onload=()=>{ds=!0,eo=!1,t(),Fa.forEach(o=>o()),Fa.length=0},r.onerror=()=>{eo=!1,n(new Error("Failed to load Google Maps"))},document.head.appendChild(r)}))}function wk({label:e,value:t,onChange:n,onValidationChange:r,googleMapsApiKey:o}){const{t:a}=je(),[s,i]=y.useState(""),[l,d]=y.useState([]),[u,f]=y.useState(!1),[m,p]=y.useState(!1),[j,_]=y.useState(ds),[g,v]=y.useState(!1),x=y.useRef(null),b=y.useRef(null),w=y.useRef(null),S=y.useRef();y.useEffect(()=>{if(t)try{const M=JSON.parse(t);M.address&&i(M.address)}catch{t&&i(t)}},[]),y.useEffect(()=>{if(!o){v(!0);return}bk(o).then(()=>{_(!0),x.current=new window.google.maps.places.AutocompleteService,b.current=new window.google.maps.Geocoder}).catch(()=>v(!0))},[o]),y.useEffect(()=>{const M=D=>{w.current&&!w.current.contains(D.target)&&p(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);const N=y.useCallback(M=>{if(!x.current||M.length<3){d([]);return}f(!0),x.current.getPlacePredictions({input:M},(D,T)=>{f(!1),T===window.google.maps.places.PlacesServiceStatus.OK&&D?(d(D.map($=>({place_id:$.place_id,description:$.description}))),p(!0)):d([])})},[]),C=M=>{const D=M.target.value;if(i(D),!D){n(""),d([]),p(!1);return}clearTimeout(S.current),S.current=setTimeout(()=>N(D),300)},E=M=>{p(!1),i(M.description),d([]),b.current&&b.current.geocode({placeId:M.place_id},(D,T)=>{if(T===window.google.maps.GeocoderStatus.OK&&(D!=null&&D[0])){const $=D[0].geometry.location,A={address:M.description,latitude:$.lat(),longitude:$.lng()};n(JSON.stringify(A))}else n(JSON.stringify({address:M.description,latitude:0,longitude:0}))})},k=()=>{i(""),n(""),d([]),p(!1)};return g||!o?c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{children:e}),c.jsxs("div",{className:"cj-p-3 cj-border cj-border-dashed cj-rounded-lg cj-text-center cj-text-muted-foreground cj-text-sm",children:[c.jsx(_a,{className:"cj-h-5 cj-w-5 cj-mx-auto cj-mb-1 cj-opacity-50"}),a("location_no_api_key")]})]}):c.jsxs("div",{className:"cj-space-y-2",ref:w,children:[c.jsx(X,{children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx(_a,{className:"cj-absolute cj-left-3 cj-top-1/2 cj--translate-y-1/2 cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx(pe,{value:s,onChange:C,onFocus:()=>l.length>0&&p(!0),placeholder:a("location_placeholder"),className:"cj-pl-9 cj-pr-8",disabled:!j}),u&&c.jsx(_s,{className:"cj-absolute cj-right-3 cj-top-1/2 cj--translate-y-1/2 cj-h-4 cj-w-4 cj-animate-spin cj-text-muted-foreground"}),!u&&s&&c.jsx("button",{type:"button",onClick:k,className:"cj-absolute cj-right-3 cj-top-1/2 cj--translate-y-1/2 cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Vt,{className:"cj-h-4 cj-w-4"})}),m&&l.length>0&&c.jsx("div",{className:"cj-absolute cj-z-50 cj-mt-1 cj-w-full cj-rounded-md cj-border cj-bg-popover cj-shadow-md cj-max-h-60 cj-overflow-y-auto",children:l.map(M=>c.jsxs("button",{type:"button",onClick:()=>E(M),className:"cj-w-full cj-text-left cj-px-3 cj-py-3 cj-text-sm hover:cj-bg-accent hover:cj-text-accent-foreground cj-flex cj-items-start cj-gap-2 cj-transition-colors",children:[c.jsx(_a,{className:"cj-h-4 cj-w-4 cj-mt-0.5 cj-shrink-0 cj-text-muted-foreground"}),c.jsx("span",{children:M.description})]},M.place_id))})]})]})}function Nk(e){if(typeof e=="boolean")return e;if(e==="true"||e==="1"||e===1)return!0;if(e==="false"||e==="0"||e===0)return!1}function Sk({label:e,value:t,onChange:n,helpText:r,variant:o="switch",options:a}){var u,f;const{t:s}=je(),i=Nk(t),l=((u=a==null?void 0:a[0])==null?void 0:u.label)??s("widget_yes"),d=((f=a==null?void 0:a[1])==null?void 0:f.label)??s("widget_no");return o==="segmented"?c.jsxs("div",{className:"cj-space-y-2",children:[e&&c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsx("div",{role:"radiogroup",className:"cj-grid cj-grid-cols-2 cj-gap-2",children:[{val:!0,label:l},{val:!1,label:d}].map(m=>{const p=i===m.val;return c.jsx("button",{type:"button",role:"radio","aria-checked":p,onClick:()=>n(m.val),className:["cj-flex cj-items-center cj-justify-center cj-text-center","cj-min-h-12 cj-px-4 cj-py-3 cj-rounded-xl cj-border cj-text-sm cj-font-medium","cj-transition-colors",p?"cj-border-primary cj-bg-primary/10 cj-text-primary":"cj-border-border/40 cj-bg-card cj-text-foreground hover:cj-bg-accent/50"].join(" "),children:m.label},String(m.val))})}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]}):c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-rounded-xl cj-border cj-border-border/40 cj-bg-card cj-px-4 cj-py-3.5",children:[c.jsxs("div",{className:"cj-flex-1 cj-pr-3",children:[e&&c.jsx(X,{className:"cj-text-sm cj-font-medium cj-text-foreground",children:e}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:r})]}),c.jsx(Cn,{checked:i===!0,onCheckedChange:m=>n(!!m)})]})}const Ck={text:"v1_string",textarea:"v1_string",select:"v2_single_option_select-1",radio:"v2_single_option_select-1",datepicker:"v2_date-1",timepicker:"v2_time-1",datetimepicker:"v2_datetime-1",currency:"v2_currency-1",upload:"v2_single_asset_upload",email:"v2_email-1",phone:"v2_phone-1",location:"v2_address_coordinates",boolean:"v2_boolean-1",switch:"v2_boolean-1"};function kk({nodeData:e,value:t,onChange:n,onValidationChange:r,onFileSelect:o,googleMapsApiKey:a,hideLabel:s=!1}){var j,_;const{t:i}=je(),{schema:l,label:d,options:u}=e,f=s?"":e.required?`${e.labelOverride||d} *`:e.labelOverride||d,m=t!=null?String(t):"";switch(e.widget&&Ck[e.widget]||l){case"v1_string":return c.jsx(Bb,{label:f,value:m,onChange:n,multiline:e.widget==="textarea"});case"v2_single_option_select-1":return!u||u.length===0?c.jsx("div",{className:"cj-text-sm cj-text-muted-foreground",children:i("widget_no_options")}):c.jsx(Zb,{label:f,value:m,onChange:n,options:u,variant:e.ui_variant??"auto"});case"v2_date-1":return c.jsx(pk,{label:f,value:m,onChange:n,allowFuture:e.allowFuture});case"v2_time-1":return c.jsx(hk,{label:f,value:m,onChange:n});case"v2_datetime-1":return c.jsx(gk,{label:f,value:m,onChange:n,allowFuture:e.allowFuture??!0});case"v2_currency-1":return c.jsx(jk,{label:f,value:m,onChange:n});case"v2_single_asset_upload":return c.jsx(yk,{label:f,value:typeof t=="object"&&t!==null&&"filename"in t?t:m,onChange:n,onFileSelect:o,accept:(j=e.uploadConfig)==null?void 0:j.accept,maxSizeMB:(_=e.uploadConfig)==null?void 0:_.maxSizeMB});case"v2_phone-1":return c.jsx(vk,{label:f,value:m,onChange:n,onValidationChange:r});case"v2_email-1":return c.jsx(xk,{label:f,value:m,onChange:n,onValidationChange:r});case"v2_address_coordinates":return c.jsx(wk,{label:f,value:m,onChange:n,onValidationChange:r,googleMapsApiKey:a});case"v2_boolean-1":return c.jsx(Sk,{label:f,value:t,onChange:n,options:u,variant:e.ui_variant??"switch"});default:return c.jsxs("div",{className:"cj-p-4 cj-border cj-border-dashed cj-rounded-lg cj-text-center cj-text-muted-foreground",children:[c.jsx("p",{className:"cj-text-sm",children:i("widget_unknown_schema",{schema:l})}),c.jsx("p",{className:"cj-text-xs cj-mt-1",children:i("widget_no_widget")})]})}}var Pk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ek(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bp={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Pk,function(){Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"});function n(a){for(var s=[],i=0,l=a.length;i<l;i++)s.indexOf(a[i])===-1&&s.push(a[i]);return s}var r={},o={"==":function(a,s){return a==s},"===":function(a,s){return a===s},"!=":function(a,s){return a!=s},"!==":function(a,s){return a!==s},">":function(a,s){return a>s},">=":function(a,s){return a>=s},"<":function(a,s,i){return i===void 0?a<s:a<s&&s<i},"<=":function(a,s,i){return i===void 0?a<=s:a<=s&&s<=i},"!!":function(a){return r.truthy(a)},"!":function(a){return!r.truthy(a)},"%":function(a,s){return a%s},log:function(a){return console.log(a),a},in:function(a,s){return!s||typeof s.indexOf>"u"?!1:s.indexOf(a)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(a,s,i){if(i<0){var l=String(a).substr(s);return l.substr(0,l.length+i)}return String(a).substr(s,i)},"+":function(){return Array.prototype.reduce.call(arguments,function(a,s){return parseFloat(a,10)+parseFloat(s,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(a,s){return parseFloat(a,10)*parseFloat(s,10)})},"-":function(a,s){return s===void 0?-a:a-s},"/":function(a,s){return a/s},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(a,s){return a.concat(s)},[])},var:function(a,s){var i=s===void 0?null:s,l=this;if(typeof a>"u"||a===""||a===null)return l;for(var d=String(a).split("."),u=0;u<d.length;u++)if(l==null||(l=l[d[u]],l===void 0))return i;return l},missing:function(){for(var a=[],s=Array.isArray(arguments[0])?arguments[0]:arguments,i=0;i<s.length;i++){var l=s[i],d=r.apply({var:l},this);(d===null||d==="")&&a.push(l)}return a},missing_some:function(a,s){var i=r.apply({missing:s},this);return s.length-i.length>=a?[]:i}};return r.is_logic=function(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.keys(a).length===1},r.truthy=function(a){return Array.isArray(a)&&a.length===0?!1:!!a},r.get_operator=function(a){return Object.keys(a)[0]},r.get_values=function(a){return a[r.get_operator(a)]},r.apply=function(a,s){if(Array.isArray(a))return a.map(function(g){return r.apply(g,s)});if(!r.is_logic(a))return a;var i=r.get_operator(a),l=a[i],d,u,f,m,p;if(Array.isArray(l)||(l=[l]),i==="if"||i=="?:"){for(d=0;d<l.length-1;d+=2)if(r.truthy(r.apply(l[d],s)))return r.apply(l[d+1],s);return l.length===d+1?r.apply(l[d],s):null}else if(i==="and"){for(d=0;d<l.length;d+=1)if(u=r.apply(l[d],s),!r.truthy(u))return u;return u}else if(i==="or"){for(d=0;d<l.length;d+=1)if(u=r.apply(l[d],s),r.truthy(u))return u;return u}else{if(i==="filter")return m=r.apply(l[0],s),f=l[1],Array.isArray(m)?m.filter(function(g){return r.truthy(r.apply(f,g))}):[];if(i==="map")return m=r.apply(l[0],s),f=l[1],Array.isArray(m)?m.map(function(g){return r.apply(f,g)}):[];if(i==="reduce")return m=r.apply(l[0],s),f=l[1],p=typeof l[2]<"u"?r.apply(l[2],s):null,Array.isArray(m)?m.reduce(function(g,v){return r.apply(f,{current:v,accumulator:g})},p):p;if(i==="all"){if(m=r.apply(l[0],s),f=l[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!r.truthy(r.apply(f,m[d])))return!1;return!0}else if(i==="none"){if(m=r.apply(l[0],s),f=l[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!1;return!0}else if(i==="some"){if(m=r.apply(l[0],s),f=l[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!0;return!1}}if(l=l.map(function(g){return r.apply(g,s)}),o.hasOwnProperty(i)&&typeof o[i]=="function")return o[i].apply(s,l);if(i.indexOf(".")>0){var j=String(i).split("."),_=o;for(d=0;d<j.length;d++){if(!_.hasOwnProperty(j[d]))throw new Error("Unrecognized operation "+i+" (failed at "+j.slice(0,d+1).join(".")+")");_=_[j[d]]}return _.apply(s,l)}throw new Error("Unrecognized operation "+i)},r.uses_data=function(a){var s=[];if(r.is_logic(a)){var i=r.get_operator(a),l=a[i];Array.isArray(l)||(l=[l]),i==="var"?s.push(l[0]):l.forEach(function(d){s.push.apply(s,r.uses_data(d))})}return n(s)},r.add_operation=function(a,s){o[a]=s},r.rm_operation=function(a){delete o[a]},r.rule_like=function(a,s){if(s===a||s==="@")return!0;if(s==="number")return typeof a=="number";if(s==="string")return typeof a=="string";if(s==="array")return Array.isArray(a)&&!r.is_logic(a);if(r.is_logic(s)){if(r.is_logic(a)){var i=r.get_operator(s),l=r.get_operator(a);if(i==="@"||i===l)return r.rule_like(r.get_values(a,!1),r.get_values(s,!1))}return!1}if(Array.isArray(s))if(Array.isArray(a)){if(s.length!==a.length)return!1;for(var d=0;d<s.length;d+=1)if(!r.rule_like(a[d],s[d]))return!1;return!0}else return!1;return!1},r})})(bp);var Mk=bp.exports;const Dk=Ek(Mk);function Tk(e,t){if(!t||t.length===0)return e;const n=r=>{const o=t.find(a=>a.data===String(r));return o?o.label:r};return Array.isArray(e)?e.map(n):n(e)}function to(e){return String(e).padStart(2,"0")}function Rk(e,t){const n=`${to(e.getDate())}/${to(e.getMonth()+1)}/${e.getFullYear()}`;return t?`${n} ${to(e.getHours())}:${to(e.getMinutes())}`:n}function Ok(e,t,n){if(e==null||e==="")return"—";if(typeof e=="object"&&e!==null&&"filename"in e&&"url"in e)return e.filename;const r=Tk(e,n);switch(t){case"currency":return typeof r=="number"?new Intl.NumberFormat(void 0,{style:"currency",currency:"EUR"}).format(r):String(r);case"date":case"datetime":try{const o=new Date(String(r));return Rk(o,t==="datetime")}catch{return String(r)}default:return Array.isArray(r)?r.join(", "):String(r)}}function Ak(e){return{specId:e.specId||"custom",namespace:e.namespace,label:e.label,labelOverride:e.labelOverride,schema:e.schema,options:e.options??null,actor:e.actor||"customer",bindings:e.bindings||[{target_namespace:e.namespace}],widget:e.widget,required:!!e.required,uploadConfig:e.uploadConfig,allowFuture:e.allowFuture,ui_variant:e.ui_variant}}function zk(e){return bb(e,".jb-widget-root.jb-themed")}function kn(e,t){const n=e.bindings;return n!=null&&n.length?t[n[0].target_namespace]:t[e.namespace]}function Ik(e,t,n){const r={...n},o=e.bindings;if(o!=null&&o.length)for(const a of o)r[a.target_namespace]=t;else r[e.namespace]=t;return r}function qc(e,t){return e.replace(/\{\{\s*answers\.([\w.]+)\s*\}\}/g,(n,r)=>{const o=t[r];return o==null?"":typeof o=="object"?JSON.stringify(o):String(o)})}function ji(e,t){if(!t)return e;const n=t.split(".");let r=e;for(const o of n)if(r&&typeof r=="object")r=r[o];else return;return r}function Wk(e){const{journey:t}=e,n=y.useMemo(()=>t.form_config?La(t.form_config):Gc(t),[t]),r=y.useMemo(()=>zk(t.theme),[t.theme]);return c.jsxs(c.Fragment,{children:[r&&c.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),c.jsx($k,{...e,formConfig:n})]})}function $k({formConfig:e,onSubmit:t,onSave:n,onFileSelect:r,onStepApiCall:o,onStepApiError:a,onInitApiCall:s,enrichedOutput:i=!1,initialAnswers:l,googleMapsApiKey:d,fullScreen:u=!0,showWelcome:f=!0}){const{t:m}=je(),{steps:p,fields:j,summary:_,init:g}=e,v=y.useMemo(()=>{const P=new Map;for(const O of j)P.set(O.field_id,O);return P},[j]),[x,b]=y.useState(()=>({...(g==null?void 0:g.values)||{},...l||{}})),[w,S]=y.useState({}),[N,C]=y.useState(p[0]?[p[0].step_id]:[]),[E,k]=y.useState(f?"welcome":"form"),[M,D]=y.useState(!1),[T,$]=y.useState(!1);y.useEffect(()=>{var O;if(!((O=g==null?void 0:g.api)!=null&&O.enabled)||!g.api.url)return;let P=!1;return(async()=>{try{const B=g.api.method||"GET",L=g.api.url,V=s?await s({method:B,url:L}):await fetch(L,{method:B}).then(_e=>_e.json());if(P)return;const ee=g.api.mapping||{},ae={};for(const[_e,Se]of Object.entries(ee))ae[_e]=ji(V,Se);b(_e=>({..._e,...ae}))}catch(B){console.error("[FormRunner] init API failed",B)}})(),()=>{P=!0}},[]);const A=N[N.length-1],H=p.find(P=>P.step_id===A),W=H?p.findIndex(P=>P.step_id===H.step_id):-1,Q=E==="summary"?100:E==="welcome"?0:Math.round((W+1)/Math.max(p.length,1)*100),G=y.useCallback((P,O)=>{b(B=>Ik(P,O,B))},[]),z=y.useCallback(async(P,O)=>{if(r)return r(O,P.namespace)},[r]),oe=y.useCallback(P=>{for(const O of P.rows)for(const B of O.field_ids){const L=v.get(B);if(!L||!L.required)continue;const V=kn(L,x);if(V==null||V==="")return!1}return!0},[x,v]),le=y.useCallback((P,O)=>{const B=[...P.navigation.rules].sort((L,V)=>(V.priority||0)-(L.priority||0));for(const L of B){if(L.condition===null)return L.next_step_id;try{if(Dk.apply(L.condition,{answers:O}))return L.next_step_id}catch(V){console.warn("[FormRunner] rule eval error",V)}}return"__submit__"},[]),ie=y.useCallback(async()=>{if(!H)return;if(!oe(H)){$(!0),jn.error(m("runner_toast_required_fields"));return}$(!1);const P=H.navigation.api_call;if(P!=null&&P.enabled&&P.url){const B=qc(P.url,x),L={"Content-Type":"application/json",...P.headers||{}},V=P.body_template?qc(P.body_template,x):void 0,ee=P.method!=="GET"&&!!V;let ae;if(ee)try{ae=JSON.parse(V)}catch{ae=V}const _e={step_id:H.step_id,method:P.method,url:B,headers:L,body:ae,answers:x};D(!0);try{let Se=null;o?Se=await o(_e):Se=await(await fetch(B,{method:P.method,headers:L,body:ee?V:void 0})).json().catch(()=>null),S(Me=>({...Me,[H.step_id]:Se}))}catch(Se){if(console.error("[FormRunner] step API failed",Se),a)try{a(Se,_e)}catch(Be){console.error("[FormRunner] onStepApiError handler threw",Be)}const Me=P.on_error??"block";if(Me==="block"){a||jn.error(m("runner_toast_api_failed")),D(!1);return}if(typeof Me=="string"&&Me.startsWith("goto:")){const Be=Me.slice(5);D(!1),Be==="__submit__"||N.includes(Be)?k("summary"):C(ke=>[...ke,Be]);return}}D(!1)}const O=le(H,x);if(O==="__submit__"){k("summary");return}if(N.includes(O)){k("summary");return}C(B=>[...B,O])},[H,x,le,N,oe,o,a]),R=y.useCallback(()=>{if(E==="summary"){k("form");return}N.length>1&&C(N.slice(0,-1))},[N,E]),I=y.useCallback(P=>{if(!i)return P;const O={};for(const[B,L]of Object.entries(P)){const V=j.find(ee=>{var ae;return((ae=ee.bindings)==null?void 0:ae.some(_e=>_e.target_namespace===B))||ee.namespace===B});O[B]={data:L,schema:(V==null?void 0:V.schema)||"unknown"}}return O},[i,j]),Y=y.useCallback(()=>{const P=I(x);t?t(P):navigator.clipboard.writeText(JSON.stringify(P,null,2)).then(()=>{jn.success(m("runner_toast_answers_copied"))})},[x,I,t]),U=y.useCallback(()=>{b({...(g==null?void 0:g.values)||{}}),S({}),C(p[0]?[p[0].step_id]:[]),k(f?"welcome":"form"),$(!1)},[g,p,f]);return p.length===0?c.jsx("div",{className:`jb-widget-root jb-themed ${u?"cj-min-h-screen":"cj-h-full"} cj-bg-background cj-flex cj-items-center cj-justify-center cj-p-6`,children:c.jsx("p",{className:"cj-text-muted-foreground cj-text-base",children:"No form to display."})}):c.jsxs("div",{className:`jb-widget-root jb-themed ${u?"cj-min-h-screen":"cj-h-full"} cj-flex cj-flex-col cj-bg-background`,style:{fontFamily:"var(--claims-journey-font-body)"},children:[c.jsxs("header",{className:"cj-px-4 cj-py-3 sm:cj-px-6 cj-flex cj-items-center cj-justify-between cj-bg-card cj-border-b cj-border-border/40",children:[c.jsx("span",{className:"cj-text-xs cj-font-medium cj-text-muted-foreground cj-uppercase cj-tracking-wide",children:E==="summary"?_.title||"Summary":E==="welcome"?"":`Step ${W+1} of ${p.length}`}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[n&&Object.keys(x).length>0&&E!=="summary"&&c.jsx("button",{onClick:()=>n(I(x)),className:"cj-text-xs cj-text-muted-foreground hover:cj-text-foreground cj-bg-transparent cj-border-none cj-cursor-pointer",children:"Save & exit"}),c.jsxs("button",{onClick:U,className:"cj-text-xs cj-text-muted-foreground hover:cj-text-foreground cj-bg-transparent cj-border-none cj-cursor-pointer cj-flex cj-items-center cj-gap-1",children:[c.jsx(El,{className:"cj-h-3.5 cj-w-3.5"}),"Reset"]})]})]}),c.jsx("div",{className:"cj-px-4 sm:cj-px-6 cj-bg-card",children:c.jsx(rm,{value:Q,className:"cj-h-1 cj-rounded-none"})}),c.jsxs("main",{className:"cj-flex-1 cj-flex cj-flex-col md:cj-flex-row cj-items-stretch cj-w-full",children:[E==="form"&&c.jsx("div",{className:"md:cj-hidden cj-border-b cj-border-border/40 cj-bg-card",children:c.jsx(Fk,{formConfig:e,answers:x,apiResponses:w,currentStepIndex:W+1})}),c.jsx("div",{className:"cj-flex-1 md:cj-w-[70%] cj-flex cj-justify-center cj-px-4 sm:cj-px-6 cj-py-6 md:cj-py-8 md:cj-px-3",children:c.jsx("div",{className:"cj-w-full cj-max-w-4xl",children:E==="welcome"?c.jsx(Hk,{onStart:()=>k("form")}):E==="summary"?c.jsx(Bk,{formConfig:e,answers:x,apiResponses:w,currentStepIndex:W+1,onBack:R,onSubmit:Y}):H?c.jsx(Lk,{step:H,fields:v,answers:x,onAnswerChange:G,onFileSelect:z,googleMapsApiKey:d,onNext:ie,onBack:R,canGoBack:N.length>1,submitting:M,showValidation:T,stepIndex:W+1}):null})}),E==="form"&&c.jsx("aside",{className:"cj-hidden md:cj-block md:cj-w-[30%] md:cj-shrink-0 cj-self-start cj-sticky cj-top-0 cj-px-4 sm:cj-px-6 cj-py-6 md:cj-py-8 md:cj-px-3",children:c.jsx("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-5 sm:cj-p-7 cj-space-y-5 cj-max-h-[calc(100vh-5rem)] cj-overflow-y-auto",children:c.jsx(wp,{formConfig:e,answers:x,apiResponses:w,currentStepIndex:W+1})})})]})]})}function wp({formConfig:e,answers:t,apiResponses:n,currentStepIndex:r}){const{summary:o,fields:a}=e,s=y.useMemo(()=>new Map(a.map(l=>[l.field_id,l])),[a]),i=y.useMemo(()=>{const l=[];if(o.sections.length===0){const d=[];return e.steps.forEach(u=>{u.rows.forEach(f=>{f.field_ids.forEach(m=>{const p=s.get(m);if(!p)return;const j=kn(p,t);d.push({label:p.label||p.namespace,value:us(j,p.schema,p.options)})})})}),d.length>0&&l.push({id:"all",title:o.title||"Summary",rows:d}),l}return o.sections.forEach(d=>{const u=d.visible_from_step??1,f=d.until_step;if(r<u||f!==void 0&&r>f)return;const m=d.display_fields.map(p=>{let j,_;if(p.source==="form_field"&&p.field_id){const g=s.get(p.field_id);g&&(j=kn(g,t),_=g.options)}else if(p.source==="api_response"&&p.step_id){const g=n[p.step_id];j=ji(g,p.response_path||"")}return{label:p.label||"(label)",value:us(j,p.format,_)}});l.push({id:d.section_id,title:d.title,rows:m})}),l},[o,e.steps,s,t,n,r]);return c.jsxs("div",{children:[c.jsx("h2",{className:"cj-text-base cj-font-semibold cj-text-foreground cj-mb-6",style:{fontFamily:"var(--claims-journey-font-heading)"},children:o.title||"Summary"}),i.length===0?c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:"Suas respostas aparecerão aqui."}):c.jsx("div",{className:"cj-space-y-8",children:i.map((l,d)=>c.jsxs("div",{className:d>0?"cj-pt-8 cj-border-t cj-border-border/40":"",children:[c.jsx("h3",{className:"cj-text-xs cj-font-bold cj-uppercase cj-tracking-wider cj-text-muted-foreground cj-mb-4",children:l.title}),c.jsxs("div",{className:"cj-space-y-4",children:[l.rows.map((u,f)=>c.jsxs("div",{className:"cj-flex cj-flex-col cj-gap-2 cj-text-sm cj-leading-relaxed",children:[c.jsx("span",{className:"cj-text-muted-foreground cj-text-left",children:u.label}),c.jsx("span",{className:`cj-text-right cj-font-medium cj-break-words cj-pl-4 cj-leading-snug ${u.value==="—"?"cj-text-muted-foreground/60":"cj-text-foreground"}`,children:u.value})]},f)),l.rows.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:"—"})]})]},l.id))})]})}function Fk(e){const[t,n]=y.useState(!1),{formConfig:r,answers:o}=e,a=y.useMemo(()=>{let s=0;const i=new Map(r.fields.map(l=>[l.field_id,l]));return r.steps.forEach(l=>l.rows.forEach(d=>d.field_ids.forEach(u=>{const f=i.get(u);if(!f)return;const m=kn(f,o);m!=null&&m!==""&&s++}))),s},[r,o]);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>n(s=>!s),className:"cj-w-full cj-flex cj-items-center cj-justify-between cj-px-4 cj-py-3 cj-bg-transparent cj-border-none cj-cursor-pointer",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx("div",{className:"cj-h-1.5 cj-w-1.5 cj-rounded-full cj-bg-primary"}),c.jsx("span",{className:"cj-text-xs cj-font-semibold cj-text-foreground",children:r.summary.title||"Summary"}),c.jsxs("span",{className:"cj-text-xs cj-text-muted-foreground",children:["· ",a," preenchidos"]})]}),c.jsx(on,{className:`cj-h-4 cj-w-4 cj-text-muted-foreground cj-transition-transform ${t?"cj-rotate-180":""}`})]}),t&&c.jsx("div",{className:"cj-px-4 cj-pb-4",children:c.jsx(wp,{...e})})]})}const us=Ok;function Lk({step:e,fields:t,answers:n,onAnswerChange:r,onFileSelect:o,googleMapsApiKey:a,onNext:s,onBack:i,canGoBack:l,submitting:d,showValidation:u,stepIndex:f}){return c.jsxs("div",{className:"cj-space-y-4",children:[c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-5 sm:cj-p-7 cj-space-y-5",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[c.jsx("div",{className:"cj-h-9 cj-w-9 cj-rounded-full cj-bg-primary cj-text-primary-foreground cj-flex cj-items-center cj-justify-center cj-font-bold cj-text-sm",children:f}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold cj-text-foreground",style:{fontFamily:"var(--claims-journey-font-heading)"},children:e.title}),e.description&&c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:e.description})]})]}),c.jsx("div",{className:"cj-space-y-4",children:e.rows.map(m=>{const p=m.field_ids.map(v=>t.get(v)).filter(v=>!!v);if(p.length===0)return null;const j=Math.min(p.length,3),_=m.layout==="horizontal",g=j===3?"sm:cj-grid-cols-3":j===2?"sm:cj-grid-cols-2":"sm:cj-grid-cols-1";return c.jsx("div",{className:_?`cj-grid cj-grid-cols-1 ${g} cj-gap-3`:"cj-flex cj-flex-col cj-gap-3",children:p.map(v=>{const x=kn(v,n),b=u&&v.required&&(x==null||x==="");return c.jsx("div",{className:`${b?"cj-rounded-xl cj-ring-2 cj-ring-destructive/40 cj-p-2":""}`,children:c.jsx(kk,{nodeData:Ak(v),value:x,onChange:w=>r(v,w),onFileSelect:w=>o(v,w),googleMapsApiKey:a})},v.field_id)})},m.row_id)})})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsxs(Z,{variant:"ghost",size:"sm",onClick:i,disabled:!l||d,className:"cj-text-muted-foreground hover:cj-text-foreground",children:[c.jsx(Sl,{className:"cj-h-4 cj-w-4 cj-mr-1.5"}),"Back"]}),c.jsx(Z,{size:"default",onClick:s,disabled:d,className:"cj-rounded-xl cj-px-6",children:d?c.jsxs(c.Fragment,{children:[c.jsx(_s,{className:"cj-h-4 cj-w-4 cj-mr-1.5 cj-animate-spin"}),"Loading…"]}):c.jsxs(c.Fragment,{children:[e.navigation.button_label||"Continue",c.jsx(Do,{className:"cj-h-4 cj-w-4 cj-ml-1.5"})]})})]})]})}function Bk({formConfig:e,answers:t,apiResponses:n,currentStepIndex:r,onBack:o,onSubmit:a}){const{t:s}=je(),{summary:i,fields:l}=e,d=new Map(l.map(p=>[p.field_id,p])),u=(p,j,_)=>us(p,j,_),f=[];e.steps.forEach(p=>{p.rows.forEach(j=>{j.field_ids.forEach(_=>{const g=d.get(_);if(!g)return;const v=kn(g,t);v==null||v===""||Array.isArray(v)&&v.length===0||f.push({id:_,label:g.label||g.namespace,value:v,format:g.schema,options:g.options})})})});const m=p=>f.length===0?c.jsx("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-6 cj-text-sm cj-text-muted-foreground cj-text-center",children:s("runner_no_answers")}):c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-overflow-hidden",children:[p&&c.jsx("div",{className:"cj-px-4 cj-py-3 cj-border-b cj-border-border/30 cj-bg-muted/30",children:c.jsx("h3",{className:"cj-text-sm cj-font-semibold",children:s("runner_summary_all_answers")})}),c.jsx("div",{className:"cj-divide-y cj-divide-border/30",children:f.map(j=>c.jsxs("div",{className:"cj-px-4 cj-py-3",children:[c.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-medium",children:j.label}),c.jsx("div",{className:"cj-text-sm cj-font-medium cj-mt-0.5 cj-break-words",children:u(j.value,j.format,j.options)})]},j.id))})]});return c.jsxs("div",{className:"cj-space-y-4",children:[c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-6 cj-text-center cj-space-y-2",children:[c.jsx(f_,{className:"cj-h-7 cj-w-7 cj-text-primary cj-mx-auto"}),c.jsx("h2",{className:"cj-text-xl cj-font-bold",style:{fontFamily:"var(--claims-journey-font-heading)"},children:i.title||"Summary"})]}),i.sections.length===0?m(!1):i.sections.map(p=>{const j=p.visible_from_step??1,_=p.until_step;return r<j||_!==void 0&&r>_?null:c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-overflow-hidden",children:[c.jsx("div",{className:"cj-px-4 cj-py-3 cj-border-b cj-border-border/30 cj-bg-muted/30",children:c.jsx("h3",{className:"cj-text-sm cj-font-semibold",children:p.title})}),c.jsxs("div",{className:"cj-divide-y cj-divide-border/30",children:[p.display_fields.map(g=>{let v,x;if(g.source==="form_field"&&g.field_id){const b=d.get(g.field_id);b&&(v=kn(b,t),x=b.options)}else if(g.source==="api_response"&&g.step_id){const b=n[g.step_id];v=ji(b,g.response_path||"")}return c.jsxs("div",{className:"cj-px-4 cj-py-3",children:[c.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-medium",children:g.label||"(label)"}),c.jsx("div",{className:"cj-text-sm cj-font-medium cj-mt-0.5",children:u(v,g.format,x)})]},g.display_id)}),p.display_fields.length===0&&c.jsx("div",{className:"cj-px-4 cj-py-3 cj-text-xs cj-text-muted-foreground cj-italic",children:"No display fields configured."})]})]},p.section_id)}),i.sections.length>0&&m(!0),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-pt-2",children:[c.jsxs(Z,{variant:"ghost",size:"sm",onClick:o,className:"cj-text-muted-foreground hover:cj-text-foreground",children:[c.jsx(Sl,{className:"cj-h-4 cj-w-4 cj-mr-1.5"}),"Back"]}),c.jsxs(Z,{size:"default",onClick:a,className:"cj-rounded-xl cj-px-6",children:[c.jsx(D_,{className:"cj-h-4 cj-w-4 cj-mr-1.5"}),"Submit"]})]})]})}function Hk({onStart:e}){const{t}=je();return c.jsx("div",{className:"cj-w-full cj-max-w-xl cj-mx-auto cj-py-8",style:{fontFamily:"var(--claims-journey-font-body)"},children:c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/40 cj-p-8 sm:cj-p-10 cj-flex cj-flex-col cj-items-center cj-text-center cj-gap-6",children:[c.jsx("div",{className:"cj-h-16 cj-w-16 cj-rounded-full cj-bg-muted cj-flex cj-items-center cj-justify-center",children:c.jsx(y_,{className:"cj-h-7 cj-w-7 cj-text-muted-foreground"})}),c.jsxs("div",{className:"cj-space-y-3",children:[c.jsx("h1",{className:"cj-text-xl sm:cj-text-2xl cj-font-semibold cj-text-foreground",style:{fontFamily:"var(--claims-journey-font-heading)"},children:t("runner_onboarding_line1")}),c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:t("runner_onboarding_line2")})]}),c.jsxs(Z,{size:"lg",onClick:e,className:"cj-w-full cj-rounded-xl cj-min-h-[56px] cj-text-base",children:[t("runner_start_claim"),c.jsx(Do,{className:"cj-h-4 cj-w-4 cj-ml-2"})]})]})})}const Yk="http://json-schema.org/draft-07/schema#",qk="https://habit.ai/schemas/form-config.schema.json",Vk="FormConfig",Gk="v2.0 linear form configuration: ordered steps, a flat field catalog, summary panel, and init values.",Uk="object",Xk=["steps","fields","summary","init"],Kk=!1,Jk={steps:{type:"array",items:{$ref:"#/definitions/FormStep"}},fields:{type:"array",items:{$ref:"#/definitions/FormField"}},summary:{$ref:"#/definitions/SummaryPanelConfig"},init:{$ref:"#/definitions/InitConfig"}},Qk={HttpMethod:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE"]},JsonLogic:{description:"JSON Logic expression evaluated against { answers, api_responses }. null means 'always true' (default rule).",type:["object","null"]},ClaimPropertySpecOption:{type:"object",required:["data","label"],additionalProperties:!1,properties:{data:{type:"string",description:"Stored value when this option is selected."},label:{type:"string",description:"Human-readable display text."},next:{type:"array",items:{type:"string"}}}},NodeBinding:{type:"object",required:["target_namespace"],additionalProperties:!1,properties:{target_namespace:{type:"string"}}},UploadConfig:{type:"object",additionalProperties:!1,properties:{accept:{type:"string",description:"HTML accept attribute (MIME types or extensions)."},maxSizeMB:{type:"number",minimum:0}}},FormField:{type:"object",required:["field_id","namespace","label","schema"],additionalProperties:!1,properties:{field_id:{type:"string",description:"Unique id; referenced from FormRow.field_ids."},namespace:{type:"string",description:"Answer key (dot-notation, e.g. 'insured.full_name')."},label:{type:"string"},labelOverride:{type:"string"},specId:{type:"string",description:"Source ClaimPropertySpec id, or 'custom'."},schema:{type:"string",description:"Schema type, e.g. 'v1_string', 'v2_date-1'."},options:{oneOf:[{type:"null"},{type:"array",items:{$ref:"#/definitions/ClaimPropertySpecOption"}}]},widget:{type:"string",description:"Widget override (e.g. 'email', 'textarea', 'phone')."},required:{type:"boolean"},actor:{type:"string",enum:["customer","operator"]},bindings:{type:"array",items:{$ref:"#/definitions/NodeBinding"}},uploadConfig:{$ref:"#/definitions/UploadConfig"},allowFuture:{type:"boolean",description:"Date/datetime widgets only."},placeholder:{type:"string"},helpText:{type:"string"},ui_variant:{type:"string",description:"Visual variant override. single_select: 'radio' | 'dropdown' | 'segmented'. boolean: 'switch' | 'segmented'."}}},FormRow:{type:"object",required:["row_id","layout","field_ids"],additionalProperties:!1,properties:{row_id:{type:"string"},layout:{type:"string",enum:["horizontal","vertical"]},field_ids:{type:"array",items:{type:"string"},description:"FK to FormField.field_id."}}},NavRule:{type:"object",required:["rule_id","condition","next_step_id"],additionalProperties:!1,properties:{rule_id:{type:"string"},condition:{$ref:"#/definitions/JsonLogic"},next_step_id:{type:"string",description:"Target FormStep.step_id or the literal '__submit__' to finish the form."},priority:{type:"integer",description:"Higher priority rules are evaluated first."}}},StepApiCall:{type:"object",required:["enabled","method","url"],additionalProperties:!1,properties:{enabled:{type:"boolean"},method:{$ref:"#/definitions/HttpMethod"},url:{type:"string",format:"uri"},headers:{type:"object",additionalProperties:{type:"string"}},body_template:{type:"string",description:"JSON string; '{{answers.foo}}' tokens are interpolated by the runner."},on_error:{type:"string",description:"Behavior on failure. 'block' (default) keeps the user on the step; 'continue' runs nav rules; 'goto:<step_id>' jumps to that step.",pattern:"^(block|continue|goto:.+)$",default:"block"}}},StepNavigation:{type:"object",required:["rules"],additionalProperties:!1,properties:{api_call:{$ref:"#/definitions/StepApiCall"},rules:{type:"array",items:{$ref:"#/definitions/NavRule"}},button_label:{type:"string"}}},FormStep:{type:"object",required:["step_id","title","rows","navigation"],additionalProperties:!1,properties:{step_id:{type:"string"},title:{type:"string"},description:{type:"string"},rows:{type:"array",items:{$ref:"#/definitions/FormRow"}},navigation:{$ref:"#/definitions/StepNavigation"}}},SummaryDisplayField:{type:"object",required:["display_id","source","label"],additionalProperties:!1,properties:{display_id:{type:"string"},source:{type:"string",enum:["form_field","api_response"]},field_id:{type:"string",description:"Required when source = 'form_field'."},step_id:{type:"string",description:"Required when source = 'api_response'."},response_path:{type:"string",description:"Dot-path inside the step's api_response."},label:{type:"string"},format:{type:"string",enum:["text","date","datetime","currency","number"]}},allOf:[{if:{properties:{source:{const:"form_field"}}},then:{required:["field_id"]}},{if:{properties:{source:{const:"api_response"}}},then:{required:["step_id","response_path"]}}]},SummarySection:{type:"object",required:["section_id","title","display_fields"],additionalProperties:!1,properties:{section_id:{type:"string"},title:{type:"string"},visible_from_step:{type:"integer",minimum:1,description:"1-based step index."},until_step:{type:"integer",minimum:1,description:"1-based step index."},display_fields:{type:"array",items:{$ref:"#/definitions/SummaryDisplayField"}}}},SummaryPanelConfig:{type:"object",required:["title","sections"],additionalProperties:!1,properties:{title:{type:"string"},show_pricing:{type:"boolean"},sections:{type:"array",items:{$ref:"#/definitions/SummarySection"}}}},InitConfig:{type:"object",required:["values"],additionalProperties:!1,properties:{values:{type:"object",description:"Static initial answers keyed by namespace.",additionalProperties:!0},api:{type:"object",required:["enabled","method","url"],additionalProperties:!1,properties:{enabled:{type:"boolean"},method:{type:"string",enum:["GET","POST"]},url:{type:"string",format:"uri"},headers:{type:"object",additionalProperties:{type:"string"}},mapping:{type:"object",description:"namespace -> dot-path inside the prefill response.",additionalProperties:{type:"string"}}}}}}},Zk={$schema:Yk,$id:qk,title:Vk,description:Gk,type:Uk,required:Xk,additionalProperties:Kk,properties:Jk,definitions:Qk},eP="http://json-schema.org/draft-07/schema#",tP="https://habit.ai/schemas/journey-spec.schema.json",nP="JourneySpec (v2.0)",rP="Portable envelope produced by JourneyBuilderWidget and consumed by FormRunnerWidget. v2.0 wraps a form_config; legacy v1.x nodes/edges/start_node_id are optional and preserved on re-export.",oP="object",aP=["journey_id","claimspec_id","version"],sP=!0,iP={journey_id:{type:"string",description:"Unique journey identifier."},claimspec_id:{type:"string",description:"Associated claim specification id."},version:{type:"string",description:"Schema version. Use '2.0' (or any '2.x.y') for the linear FormConfig model."},form_config:{$ref:"https://habit.ai/schemas/form-config.schema.json",description:"Source of truth in v2.0. When present, legacy nodes/edges/groups/mode are ignored at runtime."},theme:{$ref:"#/definitions/JourneyTheme"},mode:{type:"string",enum:["sequential","grouped"],description:"Legacy v1.x rendering mode."},nodes:{type:"array",description:"Legacy v1.x — preserved on re-export.",items:{type:"object"}},edges:{type:"array",description:"Legacy v1.x — preserved on re-export.",items:{type:"object"}},start_node_id:{type:["string","null"],description:"Legacy v1.x."},groups:{type:"array",description:"Legacy v1.x grouped layout.",items:{type:"object"}}},cP=[{required:["form_config"]},{required:["nodes","edges"]}],lP={JourneyTheme:{type:"object",description:"CSS variables injected on the runner/builder root. Colors are HSL triplets like '222 47% 11%'.",additionalProperties:!1,properties:{primaryColor:{type:"string"},backgroundColor:{type:"string"},cardColor:{type:"string"},foregroundColor:{type:"string"},fontFamilyHeading:{type:"string"},fontFamilyBody:{type:"string"},fontSizeBase:{type:"number",description:"Base font size in pixels."},borderRadius:{type:"number",description:"Border radius in rem."},spacing:{type:"string",enum:["compact","cozy","spacious"]}}}},dP={$schema:eP,$id:tP,title:nP,description:rP,type:oP,required:aP,additionalProperties:sP,properties:iP,anyOf:cP,definitions:lP};exports.FormRunnerWidget=Wk;exports.JourneyBuilderWidget=Db;exports.PortalContainerContext=Zo;exports.SCHEMA_TYPES=vr;exports.formConfigSchema=Zk;exports.getSchemaInfo=ta;exports.journeySpecSchema=dP;exports.setLanguage=pd;exports.useTranslation=je;
287
+ Defaulting to \`null\`.`}var nm=Qf,Lb=em;const rm=h.forwardRef(({className:e,value:t,...n},r)=>c.jsx(nm,{ref:r,className:ne("cj-relative cj-h-4 cj-w-full cj-overflow-hidden cj-rounded-full cj-bg-secondary",e),...n,children:c.jsx(Lb,{className:"cj-h-full cj-w-full cj-flex-1 cj-bg-primary cj-transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));rm.displayName=nm.displayName;function Bb({label:e,value:t,onChange:n,placeholder:r,helpText:o,multiline:a=!1}){const{t:s}=je();return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),a?c.jsx(Ar,{value:t,onChange:i=>n(i.target.value),placeholder:r||s("placeholder_text"),className:"cj-min-h-[100px]"}):c.jsx(pe,{type:"text",value:t,onChange:i=>n(i.target.value),placeholder:r||s("placeholder_text")}),o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}var ei="Radio",[Hb,om]=st(ei),[Yb,qb]=Hb(ei),am=h.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:a,disabled:s,value:i="on",onCheck:l,form:d,...u}=e,[f,m]=h.useState(null),p=he(t,j=>m(j)),g=h.useRef(!1),_=f?d||!!f.closest("form"):!0;return c.jsxs(Yb,{scope:n,checked:o,disabled:s,children:[c.jsx(se.button,{type:"button",role:"radio","aria-checked":o,"data-state":lm(o),"data-disabled":s?"":void 0,disabled:s,value:i,...u,ref:p,onClick:re(e.onClick,j=>{o||l==null||l(),_&&(g.current=j.isPropagationStopped(),g.current||j.stopPropagation())})}),_&&c.jsx(cm,{control:f,bubbles:!g.current,name:r,value:i,checked:o,required:a,disabled:s,form:d,style:{transform:"translateX(-100%)"}})]})});am.displayName=ei;var sm="RadioIndicator",im=h.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,a=qb(sm,n);return c.jsx(it,{present:r||a.checked,children:c.jsx(se.span,{"data-state":lm(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})});im.displayName=sm;var Vb="RadioBubbleInput",cm=h.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=h.useRef(null),i=he(s,a),l=Ys(n),d=Fs(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&p){const g=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(g)}},[l,n,r]),c.jsx(se.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});cm.displayName=Vb;function lm(e){return e?"checked":"unchecked"}var Gb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],oa="RadioGroup",[Ub]=st(oa,[Eo,om]),dm=Eo(),um=om(),[Xb,Kb]=Ub(oa),fm=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:a,required:s=!1,disabled:i=!1,orientation:l,dir:d,loop:u=!0,onValueChange:f,...m}=e,p=dm(n),g=kr(d),[_,j]=Ht({prop:a,defaultProp:o??null,onChange:f,caller:oa});return c.jsx(Xb,{scope:n,name:r,required:s,disabled:i,value:_,onValueChange:j,children:c.jsx(cl,{asChild:!0,...p,orientation:l,dir:g,loop:u,children:c.jsx(se.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":i?"":void 0,dir:g,...m,ref:t})})})});fm.displayName=oa;var mm="RadioGroupItem",pm=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,a=Kb(mm,n),s=a.disabled||r,i=dm(n),l=um(n),d=h.useRef(null),u=he(t,d),f=a.value===o.value,m=h.useRef(!1);return h.useEffect(()=>{const p=_=>{Gb.includes(_.key)&&(m.current=!0)},g=()=>m.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),c.jsx(ll,{asChild:!0,...i,focusable:!s,active:f,children:c.jsx(am,{disabled:s,required:a.required,checked:f,...l,...o,name:a.name,ref:u,onCheck:()=>a.onValueChange(o.value),onKeyDown:re(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:re(o.onFocus,()=>{var p;m.current&&((p=d.current)==null||p.click())})})})});pm.displayName=mm;var Jb="RadioGroupIndicator",hm=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=um(n);return c.jsx(im,{...o,...r,ref:t})});hm.displayName=Jb;var _m=fm,gm=pm,Qb=hm;const jm=h.forwardRef(({className:e,...t},n)=>c.jsx(_m,{className:ne("cj-grid cj-gap-2",e),...t,ref:n}));jm.displayName=_m.displayName;const ym=h.forwardRef(({className:e,...t},n)=>c.jsx(gm,{ref:n,className:ne("cj-aspect-square cj-h-5 cj-w-5 cj-rounded-full cj-border cj-border-primary cj-text-primary cj-ring-offset-background focus:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 cj-shrink-0",e),...t,children:c.jsx(Qb,{className:"cj-flex cj-items-center cj-justify-center",children:c.jsx(m_,{className:"cj-h-3 cj-w-3 cj-fill-current cj-text-current"})})}));ym.displayName=gm.displayName;function Zb({label:e,value:t,onChange:n,options:r,helpText:o,variant:a="auto"}){const{t:s}=je(),i=a==="auto"?r.length<=5?"radio":"dropdown":a;return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),i==="radio"&&c.jsx(jm,{value:t,onValueChange:n,className:"cj-space-y-1",children:r.map(l=>c.jsxs("label",{htmlFor:l.data,className:"cj-flex cj-items-center cj-gap-3 cj-rounded-xl cj-border cj-border-border/40 cj-bg-card cj-px-4 cj-py-3.5 cj-cursor-pointer cj-transition-colors hover:cj-bg-accent/50 data-[state=checked]:cj-border-primary/40 data-[state=checked]:cj-bg-primary/5",children:[c.jsx(ym,{value:l.data,id:l.data}),c.jsx("span",{className:"cj-text-sm cj-font-normal cj-text-foreground cj-select-none",children:l.label})]},l.data))}),i==="dropdown"&&c.jsxs(Oe,{value:t,onValueChange:n,children:[c.jsx(Pe,{className:"cj-w-full cj-h-12",children:c.jsx(Ae,{placeholder:s("placeholder_select")})}),c.jsx(Ee,{className:"cj-bg-popover cj-z-50",children:r.map(l=>c.jsx(K,{value:l.data,className:"cj-py-3",children:l.label},l.data))})]}),i==="segmented"&&c.jsx("div",{role:"radiogroup",className:"cj-grid cj-gap-2",style:{gridTemplateColumns:`repeat(${Math.min(r.length,4)}, minmax(0, 1fr))`},children:r.map(l=>{const d=t===l.data;return c.jsx("button",{type:"button",role:"radio","aria-checked":d,onClick:()=>n(l.data),className:["cj-flex cj-items-center cj-justify-center cj-text-center","cj-min-h-12 cj-px-4 cj-py-3 cj-rounded-xl cj-border cj-text-sm cj-font-medium","cj-transition-colors",d?"cj-border-primary cj-bg-primary/10 cj-text-primary":"cj-border-border/40 cj-bg-card cj-text-foreground hover:cj-bg-accent/50"].join(" "),children:l.label},l.data)})}),o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function He(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ie(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function vm(e,t){const n=He(e);return isNaN(t)?Ie(e,NaN):(t&&n.setDate(n.getDate()+t),n)}const xm=6048e5,ew=864e5,tw=6e4,nw=36e5,rw=1e3;let ow={};function nr(){return ow}function cn(e,t){var i,l,d,u;const n=nr(),r=(t==null?void 0:t.weekStartsOn)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,o=He(e),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Xn(e){return cn(e,{weekStartsOn:1})}function bm(e){const t=He(e),n=t.getFullYear(),r=Ie(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Xn(r),a=Ie(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=Xn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function bc(e){const t=He(e);return t.setHours(0,0,0,0),t}function wo(e){const t=He(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function aw(e,t){const n=bc(e),r=bc(t),o=+n-wo(n),a=+r-wo(r);return Math.round((o-a)/ew)}function sw(e){const t=bm(e),n=Ie(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Xn(n)}function iw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ti(e){if(!iw(e)&&typeof e!="number")return!1;const t=He(e);return!isNaN(Number(t))}function cw(e){const t=He(e),n=Ie(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const lw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dw=(e,t,n)=>{let r;const o=lw[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Bt(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pw={date:Bt({formats:uw,defaultWidth:"full"}),time:Bt({formats:fw,defaultWidth:"full"}),dateTime:Bt({formats:mw,defaultWidth:"full"})},hw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_w=(e,t,n,r)=>hw[e];function Xe(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):s;o=e.formattingValues[i]||e.formattingValues[s]}else{const s=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const gw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yw={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vw={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},bw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ww=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Nw={ordinalNumber:ww,era:Xe({values:gw,defaultWidth:"wide"}),quarter:Xe({values:jw,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xe({values:yw,defaultWidth:"wide"}),day:Xe({values:vw,defaultWidth:"wide"}),dayPeriod:Xe({values:xw,defaultWidth:"wide",formattingValues:bw,defaultFormattingWidth:"wide"})};function Ke(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?Cw(i,f=>f.test(s)):Sw(i,f=>f.test(s));let d;d=e.valueCallback?e.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(s.length);return{value:d,rest:u}}}function Sw(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Cw(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ni(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const i=t.slice(o.length);return{value:s,rest:i}}}const kw=/^(\d+)(th|st|nd|rd)?/i,Pw=/\d+/i,Ew={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Mw={any:[/^b/i,/^(a|c)/i]},Dw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tw={any:[/1/i,/2/i,/3/i,/4/i]},Rw={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ow={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Aw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},zw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Iw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ww={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$w={ordinalNumber:ni({matchPattern:kw,parsePattern:Pw,valueCallback:e=>parseInt(e,10)}),era:Ke({matchPatterns:Ew,defaultMatchWidth:"wide",parsePatterns:Mw,defaultParseWidth:"any"}),quarter:Ke({matchPatterns:Dw,defaultMatchWidth:"wide",parsePatterns:Tw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ke({matchPatterns:Rw,defaultMatchWidth:"wide",parsePatterns:Ow,defaultParseWidth:"any"}),day:Ke({matchPatterns:Aw,defaultMatchWidth:"wide",parsePatterns:zw,defaultParseWidth:"any"}),dayPeriod:Ke({matchPatterns:Iw,defaultMatchWidth:"any",parsePatterns:Ww,defaultParseWidth:"any"})},aa={code:"en-US",formatDistance:dw,formatLong:pw,formatRelative:_w,localize:Nw,match:$w,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Fw(e){const t=He(e);return aw(t,cw(t))+1}function wm(e){const t=He(e),n=+Xn(t)-+sw(t);return Math.round(n/xm)+1}function ri(e,t){var u,f,m,p;const n=He(e),r=n.getFullYear(),o=nr(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(m=o.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ie(e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const i=cn(s,t),l=Ie(e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const d=cn(l,t);return n.getTime()>=i.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lw(e,t){var i,l,d,u;const n=nr(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,o=ri(e,t),a=Ie(e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),cn(a,t)}function Nm(e,t){const n=He(e),r=+cn(n,t)-+Lw(n,t);return Math.round(r/xm)+1}function xe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const en={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return xe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):xe(n+1,2)},d(e,t){return xe(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return xe(e.getHours()%12||12,t.length)},H(e,t){return xe(e.getHours(),t.length)},m(e,t){return xe(e.getMinutes(),t.length)},s(e,t){return xe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return xe(o,t.length)}},zn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wc={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return en.y(e,t)},Y:function(e,t,n,r){const o=ri(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return xe(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):xe(a,t.length)},R:function(e,t){const n=bm(e);return xe(n,t.length)},u:function(e,t){const n=e.getFullYear();return xe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return xe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return xe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return en.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return xe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Nm(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):xe(o,t.length)},I:function(e,t,n){const r=wm(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):xe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):en.d(e,t)},D:function(e,t,n){const r=Fw(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):xe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return xe(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return xe(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return xe(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=zn.noon:r===0?o=zn.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=zn.evening:r>=12?o=zn.afternoon:r>=4?o=zn.morning:o=zn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return en.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):en.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):xe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):xe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):en.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):en.s(e,t)},S:function(e,t){return en.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Sc(r);case"XXXX":case"XX":return hn(r);case"XXXXX":case"XXX":default:return hn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Sc(r);case"xxxx":case"xx":return hn(r);case"xxxxx":case"xxx":default:return hn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nc(r,":");case"OOOO":default:return"GMT"+hn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nc(r,":");case"zzzz":default:return"GMT"+hn(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return xe(r,t.length)},T:function(e,t,n){const r=e.getTime();return xe(r,t.length)}};function Nc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+xe(a,2)}function Sc(e,t){return e%60===0?(e>0?"-":"+")+xe(Math.abs(e)/60,2):hn(e,t)}function hn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=xe(Math.trunc(r/60),2),a=xe(r%60,2);return n+o+t+a}const Cc=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Sm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Bw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Cc(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Cc(r,t)).replace("{{time}}",Sm(o,t))},is={p:Sm,P:Bw},Hw=/^D+$/,Yw=/^Y+$/,qw=["D","DD","YY","YYYY"];function Cm(e){return Hw.test(e)}function km(e){return Yw.test(e)}function cs(e,t,n){const r=Vw(e,t,n);if(console.warn(r),qw.includes(e))throw new RangeError(r)}function Vw(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Uw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xw=/^'([^]*?)'?$/,Kw=/''/g,Jw=/[a-zA-Z]/;function No(e,t,n){var u,f,m,p;const r=nr(),o=r.locale??aa,a=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=r.weekStartsOn??((p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,i=He(e);if(!ti(i))throw new RangeError("Invalid time value");let l=t.match(Uw).map(g=>{const _=g[0];if(_==="p"||_==="P"){const j=is[_];return j(g,o.formatLong)}return g}).join("").match(Gw).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const _=g[0];if(_==="'")return{isToken:!1,value:Qw(g)};if(wc[_])return{isToken:!0,value:g};if(_.match(Jw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:g}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const d={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return l.map(g=>{if(!g.isToken)return g.value;const _=g.value;(km(_)||Cm(_))&&cs(_,t,String(e));const j=wc[_[0]];return j(i,_,o.localize,d)}).join("")}function Qw(e){const t=e.match(Xw);return t?t[1].replace(Kw,"'"):e}function Zw(){return Object.assign({},nr())}function e0(e){let n=He(e).getDay();return n===0&&(n=7),n}function t0(e,t){const n=t instanceof Date?Ie(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const n0=10;class Pm{constructor(){q(this,"subPriority",0)}validate(t,n){return!0}}class r0 extends Pm{constructor(t,n,r,o,a){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,a&&(this.subPriority=a)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class o0 extends Pm{constructor(){super(...arguments);q(this,"priority",n0);q(this,"subPriority",-1)}set(n,r){return r.timestampIsSet?n:Ie(n,t0(n,Date))}}class ye{run(t,n,r,o){const a=this.parse(t,n,r,o);return a?{setter:new r0(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,n,r){return!0}}class a0 extends ye{constructor(){super(...arguments);q(this,"priority",140);q(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}const $e={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},kt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Fe(e,t){return e&&{value:t(e.value),rest:e.rest}}function Re(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Pt(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,s=n[5]?parseInt(n[5],10):0;return{value:r*(o*nw+a*tw+s*rw),rest:t.slice(n[0].length)}}function Em(e){return Re($e.anyDigitsSigned,e)}function We(e,t){switch(e){case 1:return Re($e.singleDigit,t);case 2:return Re($e.twoDigits,t);case 3:return Re($e.threeDigits,t);case 4:return Re($e.fourDigits,t);default:return Re(new RegExp("^\\d{1,"+e+"}"),t)}}function So(e,t){switch(e){case 1:return Re($e.singleDigitSigned,t);case 2:return Re($e.twoDigitsSigned,t);case 3:return Re($e.threeDigitsSigned,t);case 4:return Re($e.fourDigitsSigned,t);default:return Re(new RegExp("^-?\\d{1,"+e+"}"),t)}}function oi(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Mm(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const a=r+50,s=Math.trunc(a/100)*100,i=e>=a%100;o=e+s-(i?100:0)}return n?o:1-o}function Dm(e){return e%400===0||e%4===0&&e%100!==0}class s0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const a=s=>({year:s,isTwoDigitYear:r==="yy"});switch(r){case"y":return Fe(We(4,n),a);case"yo":return Fe(o.ordinalNumber(n,{unit:"year"}),a);default:return Fe(We(r.length,n),a)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o){const a=n.getFullYear();if(o.isTwoDigitYear){const i=Mm(o.year,a);return n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}const s=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}class i0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const a=s=>({year:s,isTwoDigitYear:r==="YY"});switch(r){case"Y":return Fe(We(4,n),a);case"Yo":return Fe(o.ordinalNumber(n,{unit:"year"}),a);default:return Fe(We(r.length,n),a)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o,a){const s=ri(n,a);if(o.isTwoDigitYear){const l=Mm(o.year,s);return n.setFullYear(l,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),cn(n,a)}const i=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(i,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),cn(n,a)}}class c0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return So(r==="R"?4:r.length,n)}set(n,r,o){const a=Ie(n,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Xn(a)}}class l0 extends ye{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return So(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class d0 extends ye{constructor(){super(...arguments);q(this,"priority",120);q(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return We(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class u0 extends ye{constructor(){super(...arguments);q(this,"priority",120);q(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return We(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class f0 extends ye{constructor(){super(...arguments);q(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);q(this,"priority",110)}parse(n,r,o){const a=s=>s-1;switch(r){case"M":return Fe(Re($e.month,n),a);case"MM":return Fe(We(2,n),a);case"Mo":return Fe(o.ordinalNumber(n,{unit:"month"}),a);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class m0 extends ye{constructor(){super(...arguments);q(this,"priority",110);q(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){const a=s=>s-1;switch(r){case"L":return Fe(Re($e.month,n),a);case"LL":return Fe(We(2,n),a);case"Lo":return Fe(o.ordinalNumber(n,{unit:"month"}),a);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function p0(e,t,n){const r=He(e),o=Nm(r,n)-t;return r.setDate(r.getDate()-o*7),r}class h0 extends ye{constructor(){super(...arguments);q(this,"priority",100);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return Re($e.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,a){return cn(p0(n,o,a),a)}}function _0(e,t){const n=He(e),r=wm(n)-t;return n.setDate(n.getDate()-r*7),n}class g0 extends ye{constructor(){super(...arguments);q(this,"priority",100);q(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return Re($e.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return Xn(_0(n,o))}}const j0=[31,28,31,30,31,30,31,31,30,31,30,31],y0=[31,29,31,30,31,30,31,31,30,31,30,31];class v0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"subPriority",1);q(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return Re($e.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return We(r.length,n)}}validate(n,r){const o=n.getFullYear(),a=Dm(o),s=n.getMonth();return a?r>=1&&r<=y0[s]:r>=1&&r<=j0[s]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class x0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"subpriority",1);q(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return Re($e.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return We(r.length,n)}}validate(n,r){const o=n.getFullYear();return Dm(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function ai(e,t,n){var f,m,p,g;const r=nr(),o=(n==null?void 0:n.weekStartsOn)??((m=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((g=(p=r.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??0,a=He(e),s=a.getDay(),l=(t%7+7)%7,d=7-o,u=t<0||t>6?t-(s+d)%7:(l+d)%7-(s+d)%7;return vm(a,u)}class b0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,a){return n=ai(n,o,a),n.setHours(0,0,0,0),n}}class w0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,a){const s=i=>{const l=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+l};switch(r){case"e":case"ee":return Fe(We(r.length,n),s);case"eo":return Fe(o.ordinalNumber(n,{unit:"day"}),s);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,a){return n=ai(n,o,a),n.setHours(0,0,0,0),n}}class N0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,a){const s=i=>{const l=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+l};switch(r){case"c":case"cc":return Fe(We(r.length,n),s);case"co":return Fe(o.ordinalNumber(n,{unit:"day"}),s);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,a){return n=ai(n,o,a),n.setHours(0,0,0,0),n}}function S0(e,t){const n=He(e),r=e0(n),o=t-r;return vm(n,o)}class C0 extends ye{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const a=s=>s===0?7:s;switch(r){case"i":case"ii":return We(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return Fe(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiii":return Fe(o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Fe(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Fe(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=S0(n,o),n.setHours(0,0,0,0),n}}class k0 extends ye{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(oi(o),0,0,0),n}}class P0 extends ye{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(oi(o),0,0,0),n}}class E0 extends ye{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(oi(o),0,0,0),n}}class M0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return Re($e.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const a=n.getHours()>=12;return a&&o<12?n.setHours(o+12,0,0,0):!a&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class D0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return Re($e.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class T0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return Re($e.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class R0 extends ye{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return Re($e.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return We(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const a=o<=24?o%24:o;return n.setHours(a,0,0,0),n}}class O0 extends ye{constructor(){super(...arguments);q(this,"priority",60);q(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return Re($e.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class A0 extends ye{constructor(){super(...arguments);q(this,"priority",50);q(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return Re($e.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return We(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class z0 extends ye{constructor(){super(...arguments);q(this,"priority",30);q(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=a=>Math.trunc(a*Math.pow(10,-r.length+3));return Fe(We(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class I0 extends ye{constructor(){super(...arguments);q(this,"priority",10);q(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return Pt(kt.basicOptionalMinutes,n);case"XX":return Pt(kt.basic,n);case"XXXX":return Pt(kt.basicOptionalSeconds,n);case"XXXXX":return Pt(kt.extendedOptionalSeconds,n);case"XXX":default:return Pt(kt.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Ie(n,n.getTime()-wo(n)-o)}}class W0 extends ye{constructor(){super(...arguments);q(this,"priority",10);q(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return Pt(kt.basicOptionalMinutes,n);case"xx":return Pt(kt.basic,n);case"xxxx":return Pt(kt.basicOptionalSeconds,n);case"xxxxx":return Pt(kt.extendedOptionalSeconds,n);case"xxx":default:return Pt(kt.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Ie(n,n.getTime()-wo(n)-o)}}class $0 extends ye{constructor(){super(...arguments);q(this,"priority",40);q(this,"incompatibleTokens","*")}parse(n){return Em(n)}set(n,r,o){return[Ie(n,o*1e3),{timestampIsSet:!0}]}}class F0 extends ye{constructor(){super(...arguments);q(this,"priority",20);q(this,"incompatibleTokens","*")}parse(n){return Em(n)}set(n,r,o){return[Ie(n,o),{timestampIsSet:!0}]}}const L0={G:new a0,y:new s0,Y:new i0,R:new c0,u:new l0,Q:new d0,q:new u0,M:new f0,L:new m0,w:new h0,I:new g0,d:new v0,D:new x0,E:new b0,e:new w0,c:new N0,i:new C0,a:new k0,b:new P0,B:new E0,h:new M0,H:new D0,K:new T0,k:new R0,m:new O0,s:new A0,S:new z0,X:new I0,x:new W0,t:new $0,T:new F0},B0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,H0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Y0=/^'([^]*?)'?$/,q0=/''/g,V0=/\S/,G0=/[a-zA-Z]/;function Tm(e,t,n,r){var _,j,y,x;const o=Zw(),a=o.locale??aa,s=o.firstWeekContainsDate??((j=(_=o.locale)==null?void 0:_.options)==null?void 0:j.firstWeekContainsDate)??1,i=o.weekStartsOn??((x=(y=o.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??0;if(t==="")return e===""?He(n):Ie(n,NaN);const l={firstWeekContainsDate:s,weekStartsOn:i,locale:a},d=[new o0],u=t.match(H0).map(b=>{const w=b[0];if(w in is){const S=is[w];return S(b,a.formatLong)}return b}).join("").match(B0),f=[];for(let b of u){km(b)&&cs(b,t,e),Cm(b)&&cs(b,t,e);const w=b[0],S=L0[w];if(S){const{incompatibleTokens:N}=S;if(Array.isArray(N)){const E=f.find(k=>N.includes(k.token)||k.token===w);if(E)throw new RangeError(`The format string mustn't contain \`${E.fullToken}\` and \`${b}\` at the same time`)}else if(S.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:w,fullToken:b});const C=S.run(e,b,a.match,l);if(!C)return Ie(n,NaN);d.push(C.setter),e=C.rest}else{if(w.match(G0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(b==="''"?b="'":w==="'"&&(b=U0(b)),e.indexOf(b)===0)e=e.slice(b.length);else return Ie(n,NaN)}}if(e.length>0&&V0.test(e))return Ie(n,NaN);const m=d.map(b=>b.priority).sort((b,w)=>w-b).filter((b,w,S)=>S.indexOf(b)===w).map(b=>d.filter(w=>w.priority===b).sort((w,S)=>S.subPriority-w.subPriority)).map(b=>b[0]);let p=He(n);if(isNaN(p.getTime()))return Ie(n,NaN);const g={};for(const b of m){if(!b.validate(p,l))return Ie(n,NaN);const w=b.set(p,g,l);Array.isArray(w)?(p=w[0],Object.assign(g,w[1])):p=w}return Ie(n,p)}function U0(e){return e.match(Y0)[1].replace(q0,"'")}const X0={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},K0=(e,t,n)=>{let r;const o=X0[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},J0={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},Q0={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Z0={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},e1={date:Bt({formats:J0,defaultWidth:"full"}),time:Bt({formats:Q0,defaultWidth:"full"}),dateTime:Bt({formats:Z0,defaultWidth:"full"})},t1={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},n1={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},r1=(e,t,n,r)=>t.getHours()!==1?n1[e]:t1[e],o1={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},a1={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},s1={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},i1={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},c1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},l1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},d1=(e,t)=>Number(e)+"º",u1={ordinalNumber:d1,era:Xe({values:o1,defaultWidth:"wide"}),quarter:Xe({values:a1,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:Xe({values:s1,defaultWidth:"wide"}),day:Xe({values:i1,defaultWidth:"wide"}),dayPeriod:Xe({values:c1,defaultWidth:"wide",formattingValues:l1,defaultFormattingWidth:"wide"})},f1=/^(\d+)(º)?/i,m1=/\d+/i,p1={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},h1={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},_1={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},g1={any:[/1/i,/2/i,/3/i,/4/i]},j1={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},y1={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},v1={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},x1={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},b1={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},w1={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},N1={ordinalNumber:ni({matchPattern:f1,parsePattern:m1,valueCallback:function(e){return parseInt(e,10)}}),era:Ke({matchPatterns:p1,defaultMatchWidth:"wide",parsePatterns:h1,defaultParseWidth:"any"}),quarter:Ke({matchPatterns:_1,defaultMatchWidth:"wide",parsePatterns:g1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ke({matchPatterns:j1,defaultMatchWidth:"wide",parsePatterns:y1,defaultParseWidth:"any"}),day:Ke({matchPatterns:v1,defaultMatchWidth:"wide",parsePatterns:x1,defaultParseWidth:"any"}),dayPeriod:Ke({matchPatterns:b1,defaultMatchWidth:"any",parsePatterns:w1,defaultParseWidth:"any"})},Rm={code:"es",formatDistance:K0,formatLong:e1,formatRelative:r1,localize:u1,match:N1,options:{weekStartsOn:1,firstWeekContainsDate:1}},S1={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},C1=(e,t,n)=>{let r;const o=S1[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"daqui a "+r:"há "+r:r},k1={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},P1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},E1={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},M1={date:Bt({formats:k1,defaultWidth:"full"}),time:Bt({formats:P1,defaultWidth:"full"}),dateTime:Bt({formats:E1,defaultWidth:"full"})},D1={lastWeek:e=>{const t=e.getDay();return"'"+(t===0||t===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},T1=(e,t,n,r)=>{const o=D1[e];return typeof o=="function"?o(t):o},R1={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},O1={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},A1={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},z1={narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},I1={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},W1={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},$1=(e,t)=>Number(e)+"º",F1={ordinalNumber:$1,era:Xe({values:R1,defaultWidth:"wide"}),quarter:Xe({values:O1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xe({values:A1,defaultWidth:"wide"}),day:Xe({values:z1,defaultWidth:"wide"}),dayPeriod:Xe({values:I1,defaultWidth:"wide",formattingValues:W1,defaultFormattingWidth:"wide"})},L1=/^(\d+)(º|ª)?/i,B1=/\d+/i,H1={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},Y1={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},q1={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},V1={any:[/1/i,/2/i,/3/i,/4/i]},G1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},U1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},X1={narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},K1={narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},J1={narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},Q1={any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},Z1={ordinalNumber:ni({matchPattern:L1,parsePattern:B1,valueCallback:e=>parseInt(e,10)}),era:Ke({matchPatterns:H1,defaultMatchWidth:"wide",parsePatterns:Y1,defaultParseWidth:"any"}),quarter:Ke({matchPatterns:q1,defaultMatchWidth:"wide",parsePatterns:V1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ke({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:U1,defaultParseWidth:"any"}),day:Ke({matchPatterns:X1,defaultMatchWidth:"wide",parsePatterns:K1,defaultParseWidth:"any"}),dayPeriod:Ke({matchPatterns:J1,defaultMatchWidth:"any",parsePatterns:Q1,defaultParseWidth:"any"})},Om={code:"pt",formatDistance:C1,formatLong:M1,formatRelative:T1,localize:F1,match:Z1,options:{weekStartsOn:1,firstWeekContainsDate:4}};function eN(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Ra={},gr={};function yn(e,t){try{const r=(Ra[e]||(Ra[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in gr?gr[r]:kc(r,r.split(":"))}catch{if(e in gr)return gr[e];const n=e==null?void 0:e.match(tN);return n?kc(e,n.slice(1)):NaN}}const tN=/([+-]\d\d):?(\d\d)?/;function kc(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return gr[e]=n*60+r>0?n*60+r+o:n*60-r-o}class Mt extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(yn(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Am(this),ls(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Mt(...n,t):new Mt(Date.now(),t)}withTimeZone(t){return new Mt(+this,t)}getTimezoneOffset(){const t=-yn(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),ls(this),+this}[Symbol.for("constructDateFrom")](t){return new Mt(+new Date(t),this.timeZone)}}const Pc=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Pc.test(e))return;const t=e.replace(Pc,"$1UTC");Mt.prototype[t]&&(e.startsWith("get")?Mt.prototype[e]=function(){return this.internal[t]()}:(Mt.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),nN(this),+this},Mt.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),ls(this),+this}))});function ls(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-yn(e.timeZone,e)*60))}function nN(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Am(e)}function Am(e){const t=yn(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),a=-new Date(+r).getTimezoneOffset(),s=o-a,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);const l=o-n;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);const d=new Date(+e);d.setUTCSeconds(0);const u=o>0?d.getSeconds():(d.getSeconds()-60)%60,f=Math.round(-(yn(e.timeZone,e)*60))%60;(f||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+u));const m=yn(e.timeZone,e),p=m>0?Math.floor(m):Math.ceil(m),_=-new Date(+e).getTimezoneOffset()-p,j=p!==n,y=_-l;if(j&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const x=yn(e.timeZone,e),b=x>0?Math.floor(x):Math.ceil(x),w=p-b;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class qe extends Mt{static tz(t,...n){return n.length?new qe(...n,t):new qe(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${eN(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new qe(+this,t)}[Symbol.for("constructDateFrom")](t){return new qe(+new Date(t),this.timeZone)}}const zm=6048e5,rN=864e5,Ec=Symbol.for("constructDateFrom");function Le(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ec in e?e[Ec](t):e instanceof Date?new e.constructor(t):new Date(t)}function we(e,t){return Le(t||e,e)}function Im(e,t,n){const r=we(e,n==null?void 0:n.in);return isNaN(t)?Le(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Wm(e,t,n){const r=we(e,n==null?void 0:n.in);if(isNaN(t))return Le(e,NaN);if(!t)return r;const o=r.getDate(),a=Le(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const s=a.getDate();return o>=s?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let oN={};function zr(){return oN}function Kn(e,t){var i,l,d,u;const n=zr(),r=(t==null?void 0:t.weekStartsOn)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,o=we(e,t==null?void 0:t.in),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Sr(e,t){return Kn(e,{...t,weekStartsOn:1})}function $m(e,t){const n=we(e,t==null?void 0:t.in),r=n.getFullYear(),o=Le(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=Sr(o),s=Le(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const i=Sr(s);return n.getTime()>=a.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Mc(e){const t=we(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function rr(e,...t){const n=Le.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Cr(e,t){const n=we(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function si(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t),a=Cr(r),s=Cr(o),i=+a-Mc(a),l=+s-Mc(s);return Math.round((i-l)/rN)}function aN(e,t){const n=$m(e,t),r=Le(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Sr(r)}function sN(e,t,n){return Im(e,t*7,n)}function iN(e,t,n){return Wm(e,t*12,n)}function cN(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Le.bind(null,o));const a=we(o,r);(!n||n<a||isNaN(+a))&&(n=a)}),Le(r,n||NaN)}function lN(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Le.bind(null,o));const a=we(o,r);(!n||n>a||isNaN(+a))&&(n=a)}),Le(r,n||NaN)}function dN(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t);return+Cr(r)==+Cr(o)}function Fm(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function uN(e){return!(!Fm(e)&&typeof e!="number"||isNaN(+we(e)))}function Lm(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t),a=r.getFullYear()-o.getFullYear(),s=r.getMonth()-o.getMonth();return a*12+s}function fN(e,t){const n=we(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Bm(e,t){const[n,r]=rr(e,t.start,t.end);return{start:n,end:r}}function mN(e,t){const{start:n,end:r}=Bm(t==null?void 0:t.in,e);let o=+n>+r;const a=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let i=1;const l=[];for(;+s<=a;)l.push(Le(n,s)),s.setMonth(s.getMonth()+i);return o?l.reverse():l}function pN(e,t){const n=we(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function hN(e,t){const n=we(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Hm(e,t){const n=we(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function _N(e,t){const{start:n,end:r}=Bm(t==null?void 0:t.in,e);let o=+n>+r;const a=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setMonth(0,1);let i=1;const l=[];for(;+s<=a;)l.push(Le(n,s)),s.setFullYear(s.getFullYear()+i);return o?l.reverse():l}function Ym(e,t){var i,l,d,u;const n=zr(),r=(t==null?void 0:t.weekStartsOn)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,o=we(e,t==null?void 0:t.in),a=o.getDay(),s=(a<r?-7:0)+6-(a-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function gN(e,t){return Ym(e,{...t,weekStartsOn:1})}const jN={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yN=(e,t,n)=>{let r;const o=jN[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Oa(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const vN={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xN={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bN={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wN={date:Oa({formats:vN,defaultWidth:"full"}),time:Oa({formats:xN,defaultWidth:"full"}),dateTime:Oa({formats:bN,defaultWidth:"full"})},NN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SN=(e,t,n,r)=>NN[e];function dr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):s;o=e.formattingValues[i]||e.formattingValues[s]}else{const s=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const CN={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kN={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},PN={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},EN={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},MN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},DN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},TN=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},RN={ordinalNumber:TN,era:dr({values:CN,defaultWidth:"wide"}),quarter:dr({values:kN,defaultWidth:"wide",argumentCallback:e=>e-1}),month:dr({values:PN,defaultWidth:"wide"}),day:dr({values:EN,defaultWidth:"wide"}),dayPeriod:dr({values:MN,defaultWidth:"wide",formattingValues:DN,defaultFormattingWidth:"wide"})};function ur(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?AN(i,f=>f.test(s)):ON(i,f=>f.test(s));let d;d=e.valueCallback?e.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(s.length);return{value:d,rest:u}}}function ON(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function AN(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function zN(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const i=t.slice(o.length);return{value:s,rest:i}}}const IN=/^(\d+)(th|st|nd|rd)?/i,WN=/\d+/i,$N={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},FN={any:[/^b/i,/^(a|c)/i]},LN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BN={any:[/1/i,/2/i,/3/i,/4/i]},HN={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},YN={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qN={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},VN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},GN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},UN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},XN={ordinalNumber:zN({matchPattern:IN,parsePattern:WN,valueCallback:e=>parseInt(e,10)}),era:ur({matchPatterns:$N,defaultMatchWidth:"wide",parsePatterns:FN,defaultParseWidth:"any"}),quarter:ur({matchPatterns:LN,defaultMatchWidth:"wide",parsePatterns:BN,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ur({matchPatterns:HN,defaultMatchWidth:"wide",parsePatterns:YN,defaultParseWidth:"any"}),day:ur({matchPatterns:qN,defaultMatchWidth:"wide",parsePatterns:VN,defaultParseWidth:"any"}),dayPeriod:ur({matchPatterns:GN,defaultMatchWidth:"any",parsePatterns:UN,defaultParseWidth:"any"})},Fn={code:"en-US",formatDistance:yN,formatLong:wN,formatRelative:SN,localize:RN,match:XN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function KN(e,t){const n=we(e,t==null?void 0:t.in);return si(n,Hm(n))+1}function ii(e,t){const n=we(e,t==null?void 0:t.in),r=+Sr(n)-+aN(n);return Math.round(r/zm)+1}function qm(e,t){var u,f,m,p;const n=we(e,t==null?void 0:t.in),r=n.getFullYear(),o=zr(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(m=o.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=Le((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const i=Kn(s,t),l=Le((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const d=Kn(l,t);return+n>=+i?r+1:+n>=+d?r:r-1}function JN(e,t){var i,l,d,u;const n=zr(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,o=qm(e,t),a=Le((t==null?void 0:t.in)||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Kn(a,t)}function ci(e,t){const n=we(e,t==null?void 0:t.in),r=+Kn(n,t)-+JN(n,t);return Math.round(r/zm)+1}function be(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const tn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return be(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):be(n+1,2)},d(e,t){return be(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return be(e.getHours()%12||12,t.length)},H(e,t){return be(e.getHours(),t.length)},m(e,t){return be(e.getMinutes(),t.length)},s(e,t){return be(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return be(o,t.length)}},In={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dc={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return tn.y(e,t)},Y:function(e,t,n,r){const o=qm(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return be(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):be(a,t.length)},R:function(e,t){const n=$m(e);return be(n,t.length)},u:function(e,t){const n=e.getFullYear();return be(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return be(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return be(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return tn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return be(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=ci(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):be(o,t.length)},I:function(e,t,n){const r=ii(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):be(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):tn.d(e,t)},D:function(e,t,n){const r=KN(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):be(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return be(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return be(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return be(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=In.noon:r===0?o=In.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=In.evening:r>=12?o=In.afternoon:r>=4?o=In.morning:o=In.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return tn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):tn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):be(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):be(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tn.s(e,t)},S:function(e,t){return tn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Rc(r);case"XXXX":case"XX":return _n(r);case"XXXXX":case"XXX":default:return _n(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Rc(r);case"xxxx":case"xx":return _n(r);case"xxxxx":case"xxx":default:return _n(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tc(r,":");case"OOOO":default:return"GMT"+_n(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tc(r,":");case"zzzz":default:return"GMT"+_n(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return be(r,t.length)},T:function(e,t,n){return be(+e,t.length)}};function Tc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+be(a,2)}function Rc(e,t){return e%60===0?(e>0?"-":"+")+be(Math.abs(e)/60,2):_n(e,t)}function _n(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=be(Math.trunc(r/60),2),a=be(r%60,2);return n+o+t+a}const Oc=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Vm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},QN=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Oc(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Oc(r,t)).replace("{{time}}",Vm(o,t))},ZN={p:Vm,P:QN},eS=/^D+$/,tS=/^Y+$/,nS=["D","DD","YY","YYYY"];function rS(e){return eS.test(e)}function oS(e){return tS.test(e)}function aS(e,t,n){const r=sS(e,t,n);if(console.warn(r),nS.includes(e))throw new RangeError(r)}function sS(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const iS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lS=/^'([^]*?)'?$/,dS=/''/g,uS=/[a-zA-Z]/;function jr(e,t,n){var u,f,m,p,g,_,j,y;const r=zr(),o=(n==null?void 0:n.locale)??r.locale??Fn,a=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((_=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:_.weekStartsOn)??r.weekStartsOn??((y=(j=r.locale)==null?void 0:j.options)==null?void 0:y.weekStartsOn)??0,i=we(e,n==null?void 0:n.in);if(!uN(i))throw new RangeError("Invalid time value");let l=t.match(cS).map(x=>{const b=x[0];if(b==="p"||b==="P"){const w=ZN[b];return w(x,o.formatLong)}return x}).join("").match(iS).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const b=x[0];if(b==="'")return{isToken:!1,value:fS(x)};if(Dc[b])return{isToken:!0,value:x};if(b.match(uS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:x}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const d={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return l.map(x=>{if(!x.isToken)return x.value;const b=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&oS(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&rS(b))&&aS(b,t,String(e));const w=Dc[b[0]];return w(i,b,o.localize,d)}).join("")}function fS(e){const t=e.match(lS);return t?t[1].replace(dS,"'"):e}function mS(e,t){const n=we(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),a=Le(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}function pS(e,t){return we(e,t==null?void 0:t.in).getMonth()}function hS(e,t){return we(e,t==null?void 0:t.in).getFullYear()}function _S(e,t){return+we(e)>+we(t)}function gS(e,t){return+we(e)<+we(t)}function jS(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function yS(e,t,n){const[r,o]=rr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function vS(e,t,n){const r=we(e,n==null?void 0:n.in),o=r.getFullYear(),a=r.getDate(),s=Le(e,0);s.setFullYear(o,t,15),s.setHours(0,0,0,0);const i=mS(s);return r.setMonth(t,Math.min(a,i)),r}function xS(e,t,n){const r=we(e,n==null?void 0:n.in);return isNaN(+r)?Le(e,NaN):(r.setFullYear(t),r)}const Ac=5,bS=4;function wS(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),a=t.addDays(o,Ac*7-1);return t.getMonth(e)===t.getMonth(a)?Ac:bS}function Gm(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function NS(e,t){const n=Gm(e,t),r=wS(e,t);return t.addDays(n,r*7-1)}const Um={...Fn,labels:{labelDayButton:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(s,i)=>jr(s,i,{locale:Fn,...n});let a=o(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,a)=>jr(o,a,{locale:Fn,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(s,i)=>jr(s,i,{locale:Fn,...n});let a=o(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,a)=>jr(o,a,{locale:Fn,...t}),r(e,"cccc")}}};class at{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?qe.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,a)=>{var s;return(s=this.overrides)!=null&&s.newDate?this.overrides.newDate(r,o,a):this.options.timeZone?new qe(r,o,a,this.options.timeZone):new Date(r,o,a)},this.addDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addDays?this.overrides.addDays(r,o):Im(r,o)},this.addMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addMonths?this.overrides.addMonths(r,o):Wm(r,o)},this.addWeeks=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addWeeks?this.overrides.addWeeks(r,o):sN(r,o)},this.addYears=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addYears?this.overrides.addYears(r,o):iN(r,o)},this.differenceInCalendarDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):si(r,o)},this.differenceInCalendarMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Lm(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):mN(r)},this.eachYearOfInterval=r=>{var i;const o=(i=this.overrides)!=null&&i.eachYearOfInterval?this.overrides.eachYearOfInterval(r):_N(r),a=new Set(o.map(l=>this.getYear(l)));if(a.size===o.length)return o;const s=[];return a.forEach(l=>{s.push(new Date(l,0,1))}),s},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):NS(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):gN(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):fN(r)},this.endOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.endOfWeek?this.overrides.endOfWeek(r,o):Ym(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):hN(r)},this.format=(r,o,a)=>{var i;const s=(i=this.overrides)!=null&&i.format?this.overrides.format(r,o,this.options):jr(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(s):s},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):ii(r)},this.getMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getMonth?this.overrides.getMonth(r,this.options):pS(r,this.options)},this.getYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getYear?this.overrides.getYear(r,this.options):hS(r,this.options)},this.getWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getWeek?this.overrides.getWeek(r,this.options):ci(r,this.options)},this.isAfter=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isAfter?this.overrides.isAfter(r,o):_S(r,o)},this.isBefore=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isBefore?this.overrides.isBefore(r,o):gS(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Fm(r)},this.isSameDay=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameDay?this.overrides.isSameDay(r,o):dN(r,o)},this.isSameMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameMonth?this.overrides.isSameMonth(r,o):jS(r,o)},this.isSameYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameYear?this.overrides.isSameYear(r,o):yS(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):cN(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):lN(r)},this.setMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setMonth?this.overrides.setMonth(r,o):vS(r,o)},this.setYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setYear?this.overrides.setYear(r,o):xS(r,o)},this.startOfBroadcastWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Gm(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):Cr(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):Sr(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):pN(r)},this.startOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfWeek?this.overrides.startOfWeek(r,this.options):Kn(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):Hm(r)},this.options={locale:Um,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&at.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,a=n==null?void 0:n.code;if(a&&at.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const s=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,s)}}at.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const It=new at;class Xm{constructor(t,n,r=It){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class SS{constructor(t,n){this.date=t,this.weeks=n}}class CS{constructor(t,n){this.days=n,this.weekNumber=t}}function kS(e){return v.createElement("button",{...e})}function PS(e){return v.createElement("span",{...e})}function ES(e){const{size:t=24,orientation:n="left",className:r}=e;return v.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&v.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&v.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&v.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&v.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function MS(e){const{day:t,modifiers:n,...r}=e;return v.createElement("td",{...r})}function DS(e){const{day:t,modifiers:n,...r}=e,o=v.useRef(null);return v.useEffect(()=>{var a;n.focused&&((a=o.current)==null||a.focus())},[n.focused]),v.createElement("button",{ref:o,...r})}var J;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(J||(J={}));var De;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(De||(De={}));var gt;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(gt||(gt={}));var nt;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(nt||(nt={}));function TS(e){const{options:t,className:n,components:r,classNames:o,...a}=e,s=[o[J.Dropdown],n].join(" "),i=t==null?void 0:t.find(({value:l})=>l===a.value);return v.createElement("span",{"data-disabled":a.disabled,className:o[J.DropdownRoot]},v.createElement(r.Select,{className:s,...a},t==null?void 0:t.map(({value:l,label:d,disabled:u})=>v.createElement(r.Option,{key:l,value:l,disabled:u},d))),v.createElement("span",{className:o[J.CaptionLabel],"aria-hidden":!0},i==null?void 0:i.label,v.createElement(r.Chevron,{orientation:"down",size:18,className:o[J.Chevron]})))}function RS(e){return v.createElement("div",{...e})}function OS(e){return v.createElement("div",{...e})}function AS(e){const{calendarMonth:t,displayIndex:n,...r}=e;return v.createElement("div",{...r},e.children)}function zS(e){const{calendarMonth:t,displayIndex:n,...r}=e;return v.createElement("div",{...r})}function IS(e){return v.createElement("table",{...e})}function WS(e){return v.createElement("div",{...e})}const Km=v.createContext(void 0);function Ir(){const e=v.useContext(Km);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function $S(e){const{components:t}=Ir();return v.createElement(t.Dropdown,{...e})}function FS(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...a}=e,{components:s,classNames:i,labels:{labelPrevious:l,labelNext:d}}=Ir(),u=v.useCallback(m=>{o&&(n==null||n(m))},[o,n]),f=v.useCallback(m=>{r&&(t==null||t(m))},[r,t]);return v.createElement("nav",{...a},v.createElement(s.PreviousMonthButton,{type:"button",className:i[J.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":l(r),onClick:f},v.createElement(s.Chevron,{disabled:r?void 0:!0,className:i[J.Chevron],orientation:"left"})),v.createElement(s.NextMonthButton,{type:"button",className:i[J.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":d(o),onClick:u},v.createElement(s.Chevron,{disabled:o?void 0:!0,orientation:"right",className:i[J.Chevron]})))}function LS(e){const{components:t}=Ir();return v.createElement(t.Button,{...e})}function BS(e){return v.createElement("option",{...e})}function HS(e){const{components:t}=Ir();return v.createElement(t.Button,{...e})}function YS(e){const{rootRef:t,...n}=e;return v.createElement("div",{...n,ref:t})}function qS(e){return v.createElement("select",{...e})}function VS(e){const{week:t,...n}=e;return v.createElement("tr",{...n})}function GS(e){return v.createElement("th",{...e})}function US(e){return v.createElement("thead",{"aria-hidden":!0},v.createElement("tr",{...e}))}function XS(e){const{week:t,...n}=e;return v.createElement("th",{...n})}function KS(e){return v.createElement("th",{...e})}function JS(e){return v.createElement("tbody",{...e})}function QS(e){const{components:t}=Ir();return v.createElement(t.Dropdown,{...e})}const ZS=Object.freeze(Object.defineProperty({__proto__:null,Button:kS,CaptionLabel:PS,Chevron:ES,Day:MS,DayButton:DS,Dropdown:TS,DropdownNav:RS,Footer:OS,Month:AS,MonthCaption:zS,MonthGrid:IS,Months:WS,MonthsDropdown:$S,Nav:FS,NextMonthButton:LS,Option:BS,PreviousMonthButton:HS,Root:YS,Select:qS,Week:VS,WeekNumber:XS,WeekNumberHeader:KS,Weekday:GS,Weekdays:US,Weeks:JS,YearsDropdown:QS},Symbol.toStringTag,{value:"Module"}));function Ft(e,t,n=!1,r=It){let{from:o,to:a}=e;const{differenceInCalendarDays:s,isSameDay:i}=r;return o&&a?(s(a,o)<0&&([o,a]=[a,o]),s(t,o)>=(n?1:0)&&s(a,t)>=(n?1:0)):!n&&a?i(a,t):!n&&o?i(o,t):!1}function li(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function sa(e){return!!(e&&typeof e=="object"&&"from"in e)}function di(e){return!!(e&&typeof e=="object"&&"after"in e)}function ui(e){return!!(e&&typeof e=="object"&&"before"in e)}function Jm(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Qm(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Lt(e,t,n=It){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:s}=n;return r.some(i=>{if(typeof i=="boolean")return i;if(n.isDate(i))return o(e,i);if(Qm(i,n))return i.some(l=>o(e,l));if(sa(i))return Ft(i,e,!1,n);if(Jm(i))return Array.isArray(i.dayOfWeek)?i.dayOfWeek.includes(e.getDay()):i.dayOfWeek===e.getDay();if(li(i)){const l=a(i.before,e),d=a(i.after,e),u=l>0,f=d<0;return s(i.before,i.after)?f&&u:u||f}return di(i)?a(e,i.after)>0:ui(i)?a(i.before,e)>0:typeof i=="function"?i(e):!1})}function eC(e,t,n,r,o){const{disabled:a,hidden:s,modifiers:i,showOutsideDays:l,broadcastCalendar:d,today:u=o.today()}=t,{isSameDay:f,isSameMonth:m,startOfMonth:p,isBefore:g,endOfMonth:_,isAfter:j}=o,y=n&&p(n),x=r&&_(r),b={[De.focused]:[],[De.outside]:[],[De.disabled]:[],[De.hidden]:[],[De.today]:[]},w={};for(const S of e){const{date:N,displayMonth:C}=S,E=!!(C&&!m(N,C)),k=!!(y&&g(N,y)),M=!!(x&&j(N,x)),D=!!(a&&Lt(N,a,o)),T=!!(s&&Lt(N,s,o))||k||M||!d&&!l&&E||d&&l===!1&&E,$=f(N,u);E&&b.outside.push(S),D&&b.disabled.push(S),T&&b.hidden.push(S),$&&b.today.push(S),i&&Object.keys(i).forEach(A=>{const H=i==null?void 0:i[A];H&&Lt(N,H,o)&&(w[A]?w[A].push(S):w[A]=[S])})}return S=>{const N={[De.focused]:!1,[De.disabled]:!1,[De.hidden]:!1,[De.outside]:!1,[De.today]:!1},C={};for(const E in b){const k=b[E];N[E]=k.some(M=>M===S)}for(const E in w)C[E]=w[E].some(k=>k===S);return{...N,...C}}}function tC(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[a])=>(n[a]?o.push(n[a]):t[De[a]]?o.push(t[De[a]]):t[gt[a]]&&o.push(t[gt[a]]),o),[t[J.Day]])}function nC(e){return{...ZS,...e}}function rC(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function oC(){const e={};for(const t in J)e[J[t]]=`rdp-${J[t]}`;for(const t in De)e[De[t]]=`rdp-${De[t]}`;for(const t in gt)e[gt[t]]=`rdp-${gt[t]}`;for(const t in nt)e[nt[t]]=`rdp-${nt[t]}`;return e}function Zm(e,t,n){return(n??new at(t)).formatMonthYear(e)}const aC=Zm;function sC(e,t,n){return(n??new at(t)).format(e,"d")}function iC(e,t=It){return t.format(e,"LLLL")}function cC(e,t,n){return(n??new at(t)).format(e,"cccccc")}function lC(e,t=It){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function dC(){return""}function ep(e,t=It){return t.format(e,"yyyy")}const uC=ep,fC=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Zm,formatDay:sC,formatMonthCaption:aC,formatMonthDropdown:iC,formatWeekNumber:lC,formatWeekNumberHeader:dC,formatWeekdayName:cC,formatYearCaption:uC,formatYearDropdown:ep},Symbol.toStringTag,{value:"Module"}));function mC(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...fC,...e}}function fi(e,t,n,r){let o=(r??new at(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const pC=fi;function mi(e,t,n){return(n??new at(t)).formatMonthYear(e)}const hC=mi;function tp(e,t,n,r){let o=(r??new at(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function np(e){return"Choose the Month"}function rp(){return""}const _C="Go to the Next Month";function op(e,t){return _C}function ap(e){return"Go to the Previous Month"}function sp(e,t,n){return(n??new at(t)).format(e,"cccc")}function ip(e,t){return`Week ${e}`}function cp(e){return"Week Number"}function lp(e){return"Choose the Year"}const gC=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:hC,labelDay:pC,labelDayButton:fi,labelGrid:mi,labelGridcell:tp,labelMonthDropdown:np,labelNav:rp,labelNext:op,labelPrevious:ap,labelWeekNumber:ip,labelWeekNumberHeader:cp,labelWeekday:sp,labelYearDropdown:lp},Symbol.toStringTag,{value:"Module"})),ht=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function jC(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...gC,...e??{},labelDayButton:ht(fi,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:ht(np,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:ht(op,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:ht(ap,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:ht(ip,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:ht(lp,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:ht(mi,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:ht(tp,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:ht(rp,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:ht(cp,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:ht(sp,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function yC(e,t,n,r,o){const{startOfMonth:a,startOfYear:s,endOfYear:i,eachMonthOfInterval:l,getMonth:d}=o;return l({start:s(e),end:i(e)}).map(m=>{const p=r.formatMonthDropdown(m,o),g=d(m),_=t&&m<a(t)||n&&m>a(n)||!1;return{value:g,label:p,disabled:_}})}function vC(e,t={},n={}){let r={...t==null?void 0:t[J.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function xC(e,t,n,r){const o=r??e.today(),a=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),s=[];for(let i=0;i<7;i++){const l=e.addDays(a,i);s.push(l)}return s}function bC(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:a,endOfYear:s,eachYearOfInterval:i,getYear:l}=r,d=a(e),u=s(t),f=i({start:d,end:u});return o&&f.reverse(),f.map(m=>{const p=n.formatYearDropdown(m,r);return{value:l(m),label:p,disabled:!1}})}function wC(e,t={}){var i;const{weekStartsOn:n,locale:r}=t,o=n??((i=r==null?void 0:r.options)==null?void 0:i.weekStartsOn)??0,a=l=>{const d=typeof l=="number"||typeof l=="string"?new Date(l):l;return new qe(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,e)},s=l=>{const d=a(l);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>a(qe.tz(e)),newDate:(l,d,u)=>new qe(l,d,u,12,0,0,e),startOfDay:l=>a(l),startOfWeek:(l,d)=>{const u=a(l),f=(d==null?void 0:d.weekStartsOn)??o,m=(u.getDay()-f+7)%7;return u.setDate(u.getDate()-m),u},startOfISOWeek:l=>{const d=a(l),u=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-u),d},startOfMonth:l=>{const d=a(l);return d.setDate(1),d},startOfYear:l=>{const d=a(l);return d.setMonth(0,1),d},endOfWeek:(l,d)=>{const u=a(l),p=((((d==null?void 0:d.weekStartsOn)??o)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+p),u},endOfISOWeek:l=>{const d=a(l),u=(7-d.getDay())%7;return d.setDate(d.getDate()+u),d},endOfMonth:l=>{const d=a(l);return d.setMonth(d.getMonth()+1,0),d},endOfYear:l=>{const d=a(l);return d.setMonth(11,31),d},eachMonthOfInterval:l=>{const d=a(l.start),u=a(l.end),f=[],m=new qe(d.getFullYear(),d.getMonth(),1,12,0,0,e),p=u.getFullYear()*12+u.getMonth();for(;m.getFullYear()*12+m.getMonth()<=p;)f.push(new qe(m,e)),m.setMonth(m.getMonth()+1,1);return f},addDays:(l,d)=>{const u=a(l);return u.setDate(u.getDate()+d),u},addWeeks:(l,d)=>{const u=a(l);return u.setDate(u.getDate()+d*7),u},addMonths:(l,d)=>{const u=a(l);return u.setMonth(u.getMonth()+d),u},addYears:(l,d)=>{const u=a(l);return u.setFullYear(u.getFullYear()+d),u},eachYearOfInterval:l=>{const d=a(l.start),u=a(l.end),f=[],m=new qe(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new qe(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(l,d)=>{var f;const u=s(l);return ci(u,{weekStartsOn:(d==null?void 0:d.weekStartsOn)??o,firstWeekContainsDate:(d==null?void 0:d.firstWeekContainsDate)??((f=r==null?void 0:r.options)==null?void 0:f.firstWeekContainsDate)??1})},getISOWeek:l=>{const d=s(l);return ii(d)},differenceInCalendarDays:(l,d)=>{const u=s(l),f=s(d);return si(u,f)},differenceInCalendarMonths:(l,d)=>{const u=s(l),f=s(d);return Lm(u,f)}}}const Wr=e=>e instanceof HTMLElement?e:null,Aa=e=>[...e.querySelectorAll("[data-animated-month]")??[]],NC=e=>Wr(e.querySelector("[data-animated-month]")),za=e=>Wr(e.querySelector("[data-animated-caption]")),Ia=e=>Wr(e.querySelector("[data-animated-weeks]")),SC=e=>Wr(e.querySelector("[data-animated-nav]")),CC=e=>Wr(e.querySelector("[data-animated-weekdays]"));function kC(e,t,{classNames:n,months:r,focused:o,dateLib:a}){const s=v.useRef(null),i=v.useRef(r),l=v.useRef(!1);v.useLayoutEffect(()=>{const d=i.current;if(i.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const u=a.isSameMonth(r[0].date,d[0].date),f=a.isAfter(r[0].date,d[0].date),m=f?n[nt.caption_after_enter]:n[nt.caption_before_enter],p=f?n[nt.weeks_after_enter]:n[nt.weeks_before_enter],g=s.current,_=e.current.cloneNode(!0);if(_ instanceof HTMLElement?(Aa(_).forEach(b=>{if(!(b instanceof HTMLElement))return;const w=NC(b);w&&b.contains(w)&&b.removeChild(w);const S=za(b);S&&S.classList.remove(m);const N=Ia(b);N&&N.classList.remove(p)}),s.current=_):s.current=null,l.current||u||o)return;const j=g instanceof HTMLElement?Aa(g):[],y=Aa(e.current);if(y!=null&&y.every(x=>x instanceof HTMLElement)&&j&&j.every(x=>x instanceof HTMLElement)){l.current=!0,e.current.style.isolation="isolate";const x=SC(e.current);x&&(x.style.zIndex="1"),y.forEach((b,w)=>{const S=j[w];if(!S)return;b.style.position="relative",b.style.overflow="hidden";const N=za(b);N&&N.classList.add(m);const C=Ia(b);C&&C.classList.add(p);const E=()=>{l.current=!1,e.current&&(e.current.style.isolation=""),x&&(x.style.zIndex=""),N&&N.classList.remove(m),C&&C.classList.remove(p),b.style.position="",b.style.overflow="",b.contains(S)&&b.removeChild(S)};S.style.pointerEvents="none",S.style.position="absolute",S.style.overflow="hidden",S.setAttribute("aria-hidden","true");const k=CC(S);k&&(k.style.opacity="0");const M=za(S);M&&(M.classList.add(f?n[nt.caption_before_exit]:n[nt.caption_after_exit]),M.addEventListener("animationend",E));const D=Ia(S);D&&D.classList.add(f?n[nt.weeks_before_exit]:n[nt.weeks_after_exit]),b.insertBefore(S,b.firstChild)})}})}function PC(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:s,fixedWeeks:i,broadcastCalendar:l}=n??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:f,endOfBroadcastWeek:m,endOfISOWeek:p,endOfMonth:g,endOfWeek:_,isAfter:j,startOfBroadcastWeek:y,startOfISOWeek:x,startOfWeek:b}=r,w=l?y(o,r):s?x(o):b(o),S=l?m(a):s?p(g(a)):_(g(a)),N=t&&(l?m(t):s?p(t):_(t)),C=N&&j(S,N)?N:S,E=u(C,w),k=f(a,o)+1,M=[];for(let $=0;$<=E;$++){const A=d(w,$);M.push(A)}const T=(l?35:42)*k;if(i&&M.length<T){const $=T-M.length;for(let A=0;A<$;A++){const H=d(M[M.length-1],1);M.push(H)}}return M}function EC(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((a,s)=>a.concat(s.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function MC(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let s=0;s<o;s++){const i=r.addMonths(e,s);if(t&&i>t)break;a.push(i)}return a}function zc(e,t,n,r){const{month:o,defaultMonth:a,today:s=r.today(),numberOfMonths:i=1}=e;let l=o||a||s;const{differenceInCalendarMonths:d,addMonths:u,startOfMonth:f}=r;if(n&&d(n,l)<i-1){const m=-1*(i-1);l=u(n,m)}return t&&d(l,t)<0&&(l=t),f(l)}function DC(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:s,endOfMonth:i,endOfWeek:l,getISOWeek:d,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:m,startOfWeek:p}=r,g=e.reduce((_,j)=>{const y=n.broadcastCalendar?f(j,r):n.ISOWeek?m(j):p(j),x=n.broadcastCalendar?a(j):n.ISOWeek?s(i(j)):l(i(j)),b=t.filter(C=>C>=y&&C<=x),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&b.length<w){const C=t.filter(E=>{const k=w-b.length;return E>x&&E<=o(x,k)});b.push(...C)}const S=b.reduce((C,E)=>{const k=n.ISOWeek?d(E):u(E),M=C.find(T=>T.weekNumber===k),D=new Xm(E,j,r);return M?M.days.push(D):C.push(new CS(k,[D])),C},[]),N=new SS(j,S);return _.push(N),_},[]);return n.reverseMonths?g.reverse():g}function TC(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:s,endOfMonth:i,addYears:l,endOfYear:d,newDate:u,today:f}=t,{fromYear:m,toYear:p,fromMonth:g,toMonth:_}=e;!n&&g&&(n=g),!n&&m&&(n=t.newDate(m,0,1)),!r&&_&&(r=_),!r&&p&&(r=u(p,11,31));const j=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=s(n):m?n=u(m,0,1):!n&&j&&(n=o(l(e.today??f(),-100))),r?r=i(r):p?r=u(p,11,31):!r&&j&&(r=d(e.today??f())),[n&&a(n),r&&a(r)]}function RC(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:s,addMonths:i,differenceInCalendarMonths:l}=r,d=o?a:1,u=s(e);if(!t)return i(u,d);if(!(l(t,e)<a))return i(u,d)}function OC(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:s,addMonths:i,differenceInCalendarMonths:l}=r,d=o?a??1:1,u=s(e);if(!t)return i(u,-d);if(!(l(u,t)<=0))return i(u,-d)}function AC(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function ia(e,t){const[n,r]=v.useState(e);return[t===void 0?n:t,r]}function zC(e,t){var w;const[n,r]=TC(e,t),{startOfMonth:o,endOfMonth:a}=t,s=zc(e,n,r,t),[i,l]=ia(s,e.month?s:void 0);v.useEffect(()=>{const S=zc(e,n,r,t);l(S)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:p}=v.useMemo(()=>{const S=MC(i,r,{numberOfMonths:e.numberOfMonths},t),N=PC(S,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),C=DC(S,N,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),E=AC(C),k=EC(C),M=OC(i,n,e,t),D=RC(i,r,e,t);return{months:C,weeks:E,days:k,previousMonth:M,nextMonth:D}},[t,i.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(w=e.endMonth)==null?void 0:w.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:g,onMonthChange:_}=e,j=S=>u.some(N=>N.days.some(C=>C.isEqualTo(S))),y=S=>{if(g)return;let N=o(S);n&&N<o(n)&&(N=o(n)),r&&N>o(r)&&(N=o(r)),l(N),_==null||_(N)};return{months:d,weeks:u,days:f,navStart:n,navEnd:r,previousMonth:m,nextMonth:p,goToMonth:y,goToDay:S=>{j(S)||y(S.date)}}}var St;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(St||(St={}));function Ic(e){return!e[De.disabled]&&!e[De.hidden]&&!e[De.outside]}function IC(e,t,n,r){let o,a=-1;for(const s of e){const i=t(s);Ic(i)&&(i[De.focused]&&a<St.FocusedModifier?(o=s,a=St.FocusedModifier):r!=null&&r.isEqualTo(s)&&a<St.LastFocused?(o=s,a=St.LastFocused):n(s.date)&&a<St.Selected?(o=s,a=St.Selected):i[De.today]&&a<St.Today&&(o=s,a=St.Today))}return o||(o=e.find(s=>Ic(t(s)))),o}function WC(e,t,n,r,o,a,s){const{ISOWeek:i,broadcastCalendar:l}=a,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:p,endOfISOWeek:g,endOfWeek:_,max:j,min:y,startOfBroadcastWeek:x,startOfISOWeek:b,startOfWeek:w}=s;let N={day:d,week:f,month:u,year:m,startOfWeek:C=>l?x(C,s):i?b(C):w(C),endOfWeek:C=>l?p(C):i?g(C):_(C)}[e](n,t==="after"?1:-1);return t==="before"&&r?N=j([r,N]):t==="after"&&o&&(N=y([o,N])),N}function dp(e,t,n,r,o,a,s,i=0){if(i>365)return;const l=WC(e,t,n.date,r,o,a,s),d=!!(a.disabled&&Lt(l,a.disabled,s)),u=!!(a.hidden&&Lt(l,a.hidden,s)),f=l,m=new Xm(l,f,s);return!d&&!u?m:dp(e,t,m,r,o,a,s,i+1)}function $C(e,t,n,r,o){const{autoFocus:a}=e,[s,i]=v.useState(),l=IC(t.days,n,r||(()=>!1),s),[d,u]=v.useState(a?l:void 0);return{isFocusTarget:_=>!!(l!=null&&l.isEqualTo(_)),setFocused:u,focused:d,blur:()=>{i(d),u(void 0)},moveFocus:(_,j)=>{if(!d)return;const y=dp(_,j,d,t.navStart,t.navEnd,e,o);y&&(e.disableNavigation&&!t.days.some(b=>b.isEqualTo(y))||(t.goToDay(y),u(y)))}}}function FC(e,t){const{selected:n,required:r,onSelect:o}=e,[a,s]=ia(n,o?n:void 0),i=o?n:a,{isSameDay:l}=t,d=p=>(i==null?void 0:i.some(g=>l(g,p)))??!1,{min:u,max:f}=e;return{selected:i,select:(p,g,_)=>{let j=[...i??[]];if(d(p)){if((i==null?void 0:i.length)===u||r&&(i==null?void 0:i.length)===1)return;j=i==null?void 0:i.filter(y=>!l(y,p))}else(i==null?void 0:i.length)===f?j=[p]:j=[...j,p];return o||s(j),o==null||o(j,p,g,_),j},isSelected:d}}function LC(e,t,n=0,r=0,o=!1,a=It){const{from:s,to:i}=t||{},{isSameDay:l,isAfter:d,isBefore:u}=a;let f;if(!s&&!i)f={from:e,to:n>0?void 0:e};else if(s&&!i)l(s,e)?n===0?f={from:s,to:e}:o?f={from:s,to:void 0}:f=void 0:u(e,s)?f={from:e,to:s}:f={from:s,to:e};else if(s&&i)if(l(s,e)&&l(i,e))o?f={from:s,to:i}:f=void 0;else if(l(s,e))f={from:s,to:n>0?void 0:e};else if(l(i,e))f={from:e,to:n>0?void 0:e};else if(u(e,s))f={from:e,to:i};else if(d(e,s))f={from:s,to:e};else if(d(e,i))f={from:s,to:e};else throw new Error("Invalid range");if(f!=null&&f.from&&(f!=null&&f.to)){const m=a.differenceInCalendarDays(f.to,f.from);r>0&&m>r?f={from:e,to:void 0}:n>1&&m<n&&(f={from:e,to:void 0})}return f}function BC(e,t,n=It){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),s=Math.min(a,6);for(let i=0;i<=s;i++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function Wc(e,t,n=It){return Ft(e,t.from,!1,n)||Ft(e,t.to,!1,n)||Ft(t,e.from,!1,n)||Ft(t,e.to,!1,n)}function HC(e,t,n=It){const r=Array.isArray(t)?t:[t];if(r.filter(i=>typeof i!="function").some(i=>typeof i=="boolean"?i:n.isDate(i)?Ft(e,i,!1,n):Qm(i,n)?i.some(l=>Ft(e,l,!1,n)):sa(i)?i.from&&i.to?Wc(e,{from:i.from,to:i.to},n):!1:Jm(i)?BC(e,i.dayOfWeek,n):li(i)?n.isAfter(i.before,i.after)?Wc(e,{from:n.addDays(i.after,1),to:n.addDays(i.before,-1)},n):Lt(e.from,i,n)||Lt(e.to,i,n):di(i)||ui(i)?Lt(e.from,i,n)||Lt(e.to,i,n):!1))return!0;const s=r.filter(i=>typeof i=="function");if(s.length){let i=e.from;const l=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=l;d++){if(s.some(u=>u(i)))return!0;i=n.addDays(i,1)}}return!1}function YC(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:a,onSelect:s}=e,[i,l]=ia(o,s?o:void 0),d=s?o:i;return{selected:d,select:(m,p,g)=>{const{min:_,max:j}=e,y=m?LC(m,d,_,j,a,t):void 0;return r&&n&&(y!=null&&y.from)&&y.to&&HC({from:y.from,to:y.to},n,t)&&(y.from=m,y.to=void 0),s||l(y),s==null||s(y,m,p,g),y},isSelected:m=>d&&Ft(d,m,!1,t)}}function qC(e,t){const{selected:n,required:r,onSelect:o}=e,[a,s]=ia(n,o?n:void 0),i=o?n:a,{isSameDay:l}=t;return{selected:i,select:(f,m,p)=>{let g=f;return!r&&i&&i&&l(f,i)&&(g=void 0),o||s(g),o==null||o(g,f,m,p),g},isSelected:f=>i?l(i,f):!1}}function VC(e,t){const n=qC(e,t),r=FC(e,t),o=YC(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function dt(e,t){return e instanceof qe&&e.timeZone===t?e:new qe(e,t)}function Wn(e,t,n){return dt(e,t)}function $c(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Wn(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Wn(r,t):r):sa(e)?{...e,from:e.from?dt(e.from,t):e.from,to:e.to?dt(e.to,t):e.to}:li(e)?{before:Wn(e.before,t),after:Wn(e.after,t)}:di(e)?{after:Wn(e.after,t)}:ui(e)?{before:Wn(e.before,t)}:e}function Wa(e,t,n){return e&&(Array.isArray(e)?e.map(r=>$c(r,t)):$c(e,t))}function GC(e){var ir;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=dt(t.today,n)),t.month&&(t.month=dt(t.month,n)),t.defaultMonth&&(t.defaultMonth=dt(t.defaultMonth,n)),t.startMonth&&(t.startMonth=dt(t.startMonth,n)),t.endMonth&&(t.endMonth=dt(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=dt(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(ir=t.selected)==null?void 0:ir.map(ce=>dt(ce,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?dt(t.selected.from,n):t.selected.from,to:t.selected.to?dt(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Wa(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Wa(t.hidden,n)),t.modifiers)){const ce={};Object.keys(t.modifiers).forEach(ge=>{var te;ce[ge]=Wa((te=t.modifiers)==null?void 0:te[ge],n)}),t.modifiers=ce}const{components:r,formatters:o,labels:a,dateLib:s,locale:i,classNames:l}=v.useMemo(()=>{const ce={...Um,...t.locale},ge=t.broadcastCalendar?1:t.weekStartsOn,te=t.noonSafe&&t.timeZone?wC(t.timeZone,{weekStartsOn:ge,locale:ce}):void 0,fe=t.dateLib&&te?{...te,...t.dateLib}:t.dateLib??te,Ve=new at({locale:ce,weekStartsOn:ge,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},fe);return{dateLib:Ve,components:nC(t.components),formatters:mC(t.formatters),labels:jC(t.labels,Ve.options),locale:ce,classNames:{...oC(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:s.today()});const{captionLayout:d,mode:u,navLayout:f,numberOfMonths:m=1,onDayBlur:p,onDayClick:g,onDayFocus:_,onDayKeyDown:j,onDayMouseEnter:y,onDayMouseLeave:x,onNextClick:b,onPrevClick:w,showWeekNumber:S,styles:N}=t,{formatCaption:C,formatDay:E,formatMonthDropdown:k,formatWeekNumber:M,formatWeekNumberHeader:D,formatWeekdayName:T,formatYearDropdown:$}=o,A=zC(t,s),{days:H,months:W,navStart:Q,navEnd:G,previousMonth:z,nextMonth:oe,goToMonth:le}=A,ie=eC(H,t,Q,G,s),{isSelected:R,select:I,selected:Y}=VC(t,s)??{},{blur:U,focused:P,isFocusTarget:O,moveFocus:B,setFocused:L}=$C(t,A,ie,R??(()=>!1),s),{labelDayButton:V,labelGridcell:ee,labelGrid:ae,labelMonthDropdown:_e,labelNav:Se,labelPrevious:Me,labelNext:Be,labelWeekday:ke,labelWeekNumber:ft,labelWeekNumberHeader:Mn,labelYearDropdown:Ze}=a,fn=v.useMemo(()=>xC(s,t.ISOWeek,t.broadcastCalendar,t.today),[s,t.ISOWeek,t.broadcastCalendar,t.today]),ct=u!==void 0||g!==void 0,or=v.useCallback(()=>{z&&(le(z),w==null||w(z))},[z,le,w]),ar=v.useCallback(()=>{oe&&(le(oe),b==null||b(oe))},[le,oe,b]),Je=v.useCallback((ce,ge)=>te=>{te.preventDefault(),te.stopPropagation(),L(ce),!ge.disabled&&(I==null||I(ce.date,ge,te),g==null||g(ce.date,ge,te))},[I,g,L]),Ut=v.useCallback((ce,ge)=>te=>{L(ce),_==null||_(ce.date,ge,te)},[_,L]),da=v.useCallback((ce,ge)=>te=>{U(),p==null||p(ce.date,ge,te)},[U,p]),ua=v.useCallback((ce,ge)=>te=>{const fe={ArrowLeft:[te.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[te.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[te.shiftKey?"year":"week","after"],ArrowUp:[te.shiftKey?"year":"week","before"],PageUp:[te.shiftKey?"year":"month","before"],PageDown:[te.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(fe[te.key]){te.preventDefault(),te.stopPropagation();const[Ve,F]=fe[te.key];B(Ve,F)}j==null||j(ce.date,ge,te)},[B,j,t.dir]),Dn=v.useCallback((ce,ge)=>te=>{y==null||y(ce.date,ge,te)},[y]),fa=v.useCallback((ce,ge)=>te=>{x==null||x(ce.date,ge,te)},[x]),Fr=v.useCallback(ce=>ge=>{const te=Number(ge.target.value),fe=s.setMonth(s.startOfMonth(ce),te);le(fe)},[s,le]),sr=v.useCallback(ce=>ge=>{const te=Number(ge.target.value),fe=s.setYear(s.startOfMonth(ce),te);le(fe)},[s,le]),{className:Xt,style:Lr}=v.useMemo(()=>({className:[l[J.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[J.Root],...t.style}}),[l,t.className,t.style,N]),Kt=rC(t),Br=v.useRef(null);kC(Br,!!t.animate,{classNames:l,months:W,focused:P,dateLib:s});const ma={dayPickerProps:t,selected:Y,select:I,isSelected:R,months:W,nextMonth:oe,previousMonth:z,goToMonth:le,getModifiers:ie,components:r,classNames:l,styles:N,labels:a,formatters:o};return v.createElement(Km.Provider,{value:ma},v.createElement(r.Root,{rootRef:t.animate?Br:void 0,className:Xt,style:Lr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Kt},v.createElement(r.Months,{className:l[J.Months],style:N==null?void 0:N[J.Months]},!t.hideNavigation&&!f&&v.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[J.Nav],style:N==null?void 0:N[J.Nav],"aria-label":Se(),onPreviousClick:or,onNextClick:ar,previousMonth:z,nextMonth:oe}),W.map((ce,ge)=>v.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:l[J.Month],style:N==null?void 0:N[J.Month],key:ge,displayIndex:ge,calendarMonth:ce},f==="around"&&!t.hideNavigation&&ge===0&&v.createElement(r.PreviousMonthButton,{type:"button",className:l[J.PreviousMonthButton],tabIndex:z?void 0:-1,"aria-disabled":z?void 0:!0,"aria-label":Me(z),onClick:or,"data-animated-button":t.animate?"true":void 0},v.createElement(r.Chevron,{disabled:z?void 0:!0,className:l[J.Chevron],orientation:t.dir==="rtl"?"right":"left"})),v.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[J.MonthCaption],style:N==null?void 0:N[J.MonthCaption],calendarMonth:ce,displayIndex:ge},d!=null&&d.startsWith("dropdown")?v.createElement(r.DropdownNav,{className:l[J.Dropdowns],style:N==null?void 0:N[J.Dropdowns]},(()=>{const te=d==="dropdown"||d==="dropdown-months"?v.createElement(r.MonthsDropdown,{key:"month",className:l[J.MonthsDropdown],"aria-label":_e(),classNames:l,components:r,disabled:!!t.disableNavigation,onChange:Fr(ce.date),options:yC(ce.date,Q,G,o,s),style:N==null?void 0:N[J.Dropdown],value:s.getMonth(ce.date)}):v.createElement("span",{key:"month"},k(ce.date,s)),fe=d==="dropdown"||d==="dropdown-years"?v.createElement(r.YearsDropdown,{key:"year",className:l[J.YearsDropdown],"aria-label":Ze(s.options),classNames:l,components:r,disabled:!!t.disableNavigation,onChange:sr(ce.date),options:bC(Q,G,o,s,!!t.reverseYears),style:N==null?void 0:N[J.Dropdown],value:s.getYear(ce.date)}):v.createElement("span",{key:"year"},$(ce.date,s));return s.getMonthYearOrder()==="year-first"?[fe,te]:[te,fe]})(),v.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},C(ce.date,s.options,s))):v.createElement(r.CaptionLabel,{className:l[J.CaptionLabel],role:"status","aria-live":"polite"},C(ce.date,s.options,s))),f==="around"&&!t.hideNavigation&&ge===m-1&&v.createElement(r.NextMonthButton,{type:"button",className:l[J.NextMonthButton],tabIndex:oe?void 0:-1,"aria-disabled":oe?void 0:!0,"aria-label":Be(oe),onClick:ar,"data-animated-button":t.animate?"true":void 0},v.createElement(r.Chevron,{disabled:oe?void 0:!0,className:l[J.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ge===m-1&&f==="after"&&!t.hideNavigation&&v.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[J.Nav],style:N==null?void 0:N[J.Nav],"aria-label":Se(),onPreviousClick:or,onNextClick:ar,previousMonth:z,nextMonth:oe}),v.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ae(ce.date,s.options,s)||void 0,className:l[J.MonthGrid],style:N==null?void 0:N[J.MonthGrid]},!t.hideWeekdays&&v.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[J.Weekdays],style:N==null?void 0:N[J.Weekdays]},S&&v.createElement(r.WeekNumberHeader,{"aria-label":Mn(s.options),className:l[J.WeekNumberHeader],style:N==null?void 0:N[J.WeekNumberHeader],scope:"col"},D()),fn.map(te=>v.createElement(r.Weekday,{"aria-label":ke(te,s.options,s),className:l[J.Weekday],key:String(te),style:N==null?void 0:N[J.Weekday],scope:"col"},T(te,s.options,s)))),v.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[J.Weeks],style:N==null?void 0:N[J.Weeks]},ce.weeks.map(te=>v.createElement(r.Week,{className:l[J.Week],key:te.weekNumber,style:N==null?void 0:N[J.Week],week:te},S&&v.createElement(r.WeekNumber,{week:te,style:N==null?void 0:N[J.WeekNumber],"aria-label":ft(te.weekNumber,{locale:i}),className:l[J.WeekNumber],scope:"row",role:"rowheader"},M(te.weekNumber,s)),te.days.map(fe=>{const{date:Ve}=fe,F=ie(fe);if(F[De.focused]=!F.hidden&&!!(P!=null&&P.isEqualTo(fe)),F[gt.selected]=(R==null?void 0:R(Ve))||F.selected,sa(Y)){const{from:Ge,to:lt}=Y;F[gt.range_start]=!!(Ge&&lt&&s.isSameDay(Ve,Ge)),F[gt.range_end]=!!(Ge&&lt&&s.isSameDay(Ve,lt)),F[gt.range_middle]=Ft(Y,Ve,!0,s)}const ve=vC(F,N,t.modifiersStyles),Ne=tC(F,l,t.modifiersClassNames),et=!ct&&!F.hidden?ee(Ve,F,s.options,s):void 0;return v.createElement(r.Day,{key:`${fe.isoDate}_${fe.displayMonthId}`,day:fe,modifiers:F,className:Ne.join(" "),style:ve,role:"gridcell","aria-selected":F.selected||void 0,"aria-label":et,"data-day":fe.isoDate,"data-month":fe.outside?fe.dateMonthId:void 0,"data-selected":F.selected||void 0,"data-disabled":F.disabled||void 0,"data-hidden":F.hidden||void 0,"data-outside":fe.outside||void 0,"data-focused":F.focused||void 0,"data-today":F.today||void 0},!F.hidden&&ct?v.createElement(r.DayButton,{className:l[J.DayButton],style:N==null?void 0:N[J.DayButton],type:"button",day:fe,modifiers:F,disabled:!F.focused&&F.disabled||void 0,"aria-disabled":F.focused&&F.disabled||void 0,tabIndex:O(fe)?0:-1,"aria-label":V(Ve,F,s.options,s),onClick:Je(fe,F),onBlur:da(fe,F),onFocus:Ut(fe,F),onKeyDown:ua(fe,F),onMouseEnter:Dn(fe,F),onMouseLeave:fa(fe,F)},E(Ve,s.options,s)):!F.hidden&&E(fe.date,s.options,s))})))))))),t.footer&&v.createElement(r.Footer,{className:l[J.Footer],style:N==null?void 0:N[J.Footer],role:"status","aria-live":"polite"},t.footer)))}function pi({className:e,classNames:t,showOutsideDays:n=!0,...r}){return c.jsx(GC,{showOutsideDays:n,className:ne("cj-p-4",e),classNames:{months:"cj-flex cj-flex-col cj-space-y-4",month:"cj-space-y-4",month_caption:"cj-flex cj-justify-center cj-pt-1 cj-relative cj-items-center cj-pb-2",caption_label:"cj-hidden",nav:"cj-space-x-1 cj-flex cj-items-center",button_previous:ne("cj-inline-flex cj-items-center cj-justify-center cj-rounded-full cj-h-9 cj-w-9 cj-bg-transparent cj-border-none cj-p-0 cj-text-muted-foreground hover:cj-text-foreground hover:cj-bg-accent cj-transition-colors cj-cursor-pointer cj-absolute cj-left-1"),button_next:ne("cj-inline-flex cj-items-center cj-justify-center cj-rounded-full cj-h-9 cj-w-9 cj-bg-transparent cj-border-none cj-p-0 cj-text-muted-foreground hover:cj-text-foreground hover:cj-bg-accent cj-transition-colors cj-cursor-pointer cj-absolute cj-right-1"),month_grid:"cj-w-full cj-border-collapse",weekdays:"cj-flex",weekday:"cj-text-muted-foreground/70 cj-w-10 cj-font-medium cj-text-xs cj-uppercase cj-tracking-wider cj-pb-2",week:"cj-flex cj-w-full",day:"cj-h-10 cj-w-10 cj-text-center cj-text-sm cj-p-0 cj-relative [&:has([aria-selected].day-range-end)]:cj-rounded-r-full [&:has([aria-selected].day-outside)]:cj-bg-accent/50 [&:has([aria-selected])]:cj-bg-accent first:[&:has([aria-selected])]:cj-rounded-l-full last:[&:has([aria-selected])]:cj-rounded-r-full focus-within:cj-relative focus-within:cj-z-20",day_button:"cj-inline-flex cj-items-center cj-justify-center cj-h-10 cj-w-10 cj-rounded-full cj-bg-transparent cj-border-none cj-p-0 cj-font-normal cj-cursor-pointer cj-transition-colors hover:cj-bg-accent hover:cj-text-accent-foreground aria-selected:cj-opacity-100",range_end:"day-range-end",selected:"cj-bg-primary cj-text-primary-foreground cj-rounded-full hover:cj-bg-primary hover:cj-text-primary-foreground focus:cj-bg-primary focus:cj-text-primary-foreground",today:"cj-bg-primary cj-text-white cj-rounded-full cj-font-bold cj-ring-2 cj-ring-primary/50",outside:"day-outside cj-text-muted-foreground cj-opacity-40 aria-selected:cj-bg-accent/50 aria-selected:cj-text-muted-foreground aria-selected:cj-opacity-30",disabled:"cj-text-muted-foreground cj-opacity-50",range_middle:"aria-selected:cj-bg-accent aria-selected:cj-text-accent-foreground",hidden:"cj-invisible",dropdowns:"cj-flex cj-items-center cj-gap-1.5",dropdown_root:"cj-relative cj-inline-flex cj-items-center",dropdown:"cj-appearance-none cj-bg-muted/50 cj-border cj-border-border/40 cj-rounded-lg cj-h-8 cj-px-2 cj-pr-6 cj-text-sm cj-font-medium cj-text-foreground hover:cj-bg-accent focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring cj-cursor-pointer",years_dropdown:"cj-max-h-60",months_dropdown:"cj-max-h-60",...t},components:{Chevron:({orientation:o})=>o==="left"?c.jsx(d_,{className:"cj-h-4 cj-w-4"}):c.jsx(u_,{className:"cj-h-4 cj-w-4"})},...r})}pi.displayName="Calendar";function UC(e){const t=XC(e),n=h.forwardRef((r,o)=>{const{children:a,...s}=r,i=h.Children.toArray(a),l=i.find(JC);if(l){const d=l.props.children,u=i.map(f=>f===l?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function XC(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const s=ZC(o),i=QC(a,o.props);return o.type!==h.Fragment&&(i.ref=r?Pn(r,s):s),h.cloneElement(o,i)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KC=Symbol("radix.slottable");function JC(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KC}function QC(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const l=a(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ZC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ca="Popover",[up]=st(ca,[Xo]),$r=Xo(),[ek,un]=up(ca),fp=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:s=!1}=e,i=$r(t),l=h.useRef(null),[d,u]=h.useState(!1),[f,m]=Ht({prop:r,defaultProp:o??!1,onChange:a,caller:ca});return c.jsx($u,{...i,children:c.jsx(ek,{scope:t,contentId:Dt(),triggerRef:l,open:f,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:s,children:n})})};fp.displayName=ca;var mp="PopoverAnchor",tk=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=un(mp,n),a=$r(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:i}=o;return h.useEffect(()=>(s(),()=>i()),[s,i]),c.jsx(Hs,{...a,...r,ref:t})});tk.displayName=mp;var pp="PopoverTrigger",hp=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=un(pp,n),a=$r(n),s=he(t,o.triggerRef),i=c.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vp(o.open),...r,ref:s,onClick:re(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(Hs,{asChild:!0,...a,children:i})});hp.displayName=pp;var hi="PopoverPortal",[nk,rk]=up(hi,{forceMount:void 0}),_p=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=un(hi,t);return c.jsx(nk,{scope:t,forceMount:n,children:c.jsx(it,{present:n||a.open,children:c.jsx(Fo,{asChild:!0,container:o,children:r})})})};_p.displayName=hi;var Jn="PopoverContent",gp=h.forwardRef((e,t)=>{const n=rk(Jn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=un(Jn,e.__scopePopover);return c.jsx(it,{present:r||a.open,children:a.modal?c.jsx(ak,{...o,ref:t}):c.jsx(sk,{...o,ref:t})})});gp.displayName=Jn;var ok=UC("PopoverContent.RemoveScroll"),ak=h.forwardRef((e,t)=>{const n=un(Jn,e.__scopePopover),r=h.useRef(null),o=he(t,r),a=h.useRef(!1);return h.useEffect(()=>{const s=r.current;if(s)return Ps(s)},[]),c.jsx(Bo,{as:ok,allowPinchZoom:!0,children:c.jsx(jp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),a.current||(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,d=i.button===2||l;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),sk=h.forwardRef((e,t)=>{const n=un(Jn,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return c.jsx(jp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),jp=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=e,m=un(Jn,n),p=$r(n);return ks(),c.jsx($o,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:c.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:c.jsx(Fu,{"data-state":vp(m.open),role:"dialog",id:m.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),yp="PopoverClose",ik=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=un(yp,n);return c.jsx(se.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))})});ik.displayName=yp;var ck="PopoverArrow",lk=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=$r(n);return c.jsx(Lu,{...o,...r,ref:t})});lk.displayName=ck;function vp(e){return e?"open":"closed"}var dk=fp,uk=hp,fk=_p,xp=gp;const _i=dk,gi=uk,la=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>{const a=ea();return c.jsx(fk,{container:a??void 0,children:c.jsx(xp,{ref:o,align:t,sideOffset:n,className:ne("cj-z-50 cj-w-72 cj-rounded-md cj-border cj-bg-popover cj-p-4 cj-text-popover-foreground cj-shadow-md cj-outline-none data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",e),...r})})});la.displayName=xp.displayName;const Fc={en:aa,es:Rm,pt:Om},Lc={en:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/YYYY"},es:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pt:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pl:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/RRRR"}};function Bc(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function mk(e,t){const n=e.replace(/\D/g,"").slice(0,t.replace(/[^a-zA-Z]/g,"").length);if(!n)return"";let r="",o=0;for(const a of t){if(o>=n.length)break;/[a-zA-Z]/.test(a)?r+=n[o++]:r+=a}return r}function pk({label:e,value:t,onChange:n,helpText:r,allowFuture:o=!1}){const{t:a,language:s}=je(),[i,l]=v.useState(!1),d=v.useMemo(()=>{if(!t)return;const N=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(N)return new Date(Number(N[1]),Number(N[2])-1,Number(N[3]));const C=new Date(t);return Number.isNaN(C.getTime())?void 0:C},[t]),u=v.useMemo(()=>Fc[s]||Fc.en,[s]),{fmt:f,placeholder:m}=Lc[s]||Lc.en,[p,g]=v.useState(d?No(d,f):""),[_,j]=v.useState(!1);v.useEffect(()=>{g(d?No(d,f):""),j(!1)},[d,f]);const y=new Date,x=1900,b=o?y.getFullYear()+20:y.getFullYear(),w=N=>{const C=N.trim();if(!C){j(!1),n("");return}const E=Tm(C,f,new Date);if(!ti(E)){j(!0);return}if(!o&&E>y){j(!0);return}j(!1),n(Bc(E))},S=N=>{N&&(n(Bc(N)),l(!1))};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx(pe,{type:"text",inputMode:"numeric",value:p,placeholder:m,onChange:N=>{const C=mk(N.target.value,f);g(C),_&&j(!1)},onBlur:N=>w(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),w(N.target.value))},"aria-invalid":_||void 0,className:ne("cj-pr-12",_&&"cj-border-destructive focus-visible:cj-ring-destructive")}),c.jsxs(_i,{open:i,onOpenChange:l,children:[c.jsx(gi,{asChild:!0,children:c.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":a("widget_pick_date"),className:"cj-absolute cj-right-1 cj-top-1/2 -cj-translate-y-1/2 cj-h-10 cj-w-10 cj-rounded-lg cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Cl,{className:"cj-h-4 cj-w-4"})})}),c.jsx(la,{className:"cj-w-auto cj-p-0 cj-z-50 cj-rounded-2xl cj-shadow-lg cj-border-border/30",align:"end",sideOffset:8,children:c.jsx(pi,{mode:"single",selected:d,onSelect:S,defaultMonth:d??new Date,locale:u,autoFocus:!0,captionLayout:"dropdown",startMonth:new Date(x,0),endMonth:new Date(b,11),disabled:o?void 0:{after:y},className:ne("cj-p-4 cj-pointer-events-auto")})})]})]}),_&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:a("widget_invalid_date")}),r&&!_&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function hk({label:e,value:t,onChange:n,helpText:r}){const{t:o}=je(),a=v.useMemo(()=>{if(!t)return"";if(/^\d{2}:\d{2}/.test(t))return t.slice(0,5);const i=new Date(t);if(Number.isNaN(i.getTime()))return"";const l=String(i.getHours()).padStart(2,"0"),d=String(i.getMinutes()).padStart(2,"0");return`${l}:${d}`},[t]),s=i=>{n(i||"")};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsx(pe,{type:"time",value:a,onChange:i=>s(i.target.value),className:"cj-h-12 cj-rounded-xl","aria-label":e||o("widget_pick_time")}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}const Hc={en:aa,es:Rm,pt:Om},Yc={en:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/YYYY"},es:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pt:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/AAAA"},pl:{fmt:"dd/MM/yyyy",placeholder:"DD/MM/RRRR"}};function _k(e,t){const n=e.replace(/\D/g,"").slice(0,t.replace(/[^a-zA-Z]/g,"").length);if(!n)return"";let r="",o=0;for(const a of t){if(o>=n.length)break;/[a-zA-Z]/.test(a)?r+=n[o++]:r+=a}return r}function gk({label:e,value:t,onChange:n,helpText:r,allowFuture:o=!0}){const{t:a,language:s}=je(),[i,l]=v.useState(!1),d=t?new Date(t):void 0,u=d&&!Number.isNaN(d.getTime())?d:void 0,f=v.useMemo(()=>Hc[s]||Hc.en,[s]),{fmt:m,placeholder:p}=Yc[s]||Yc.en,g=v.useMemo(()=>{if(!u)return"";const C=String(u.getHours()).padStart(2,"0"),E=String(u.getMinutes()).padStart(2,"0");return`${C}:${E}`},[u]),[_,j]=v.useState(u?No(u,m):""),[y,x]=v.useState(!1);v.useEffect(()=>{j(u?No(u,m):""),x(!1)},[u,m]);const b=new Date,w=C=>{const E=C.trim();if(!E){x(!1),n("");return}const k=Tm(E,m,new Date);if(!ti(k)){x(!0);return}if(!o&&k>b){x(!0);return}u?k.setHours(u.getHours(),u.getMinutes(),0,0):k.setHours(12,0,0,0),x(!1),n(k.toISOString())},S=C=>{if(!C)return;const E=new Date(C);u?E.setHours(u.getHours(),u.getMinutes(),0,0):E.setHours(12,0,0,0),n(E.toISOString()),l(!1)},N=C=>{if(!C)return;const[E,k]=C.split(":").map(Number),M=u?new Date(u):new Date;M.setHours(E,k,0,0),n(M.toISOString())};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-flex cj-gap-2",children:[c.jsxs("div",{className:"cj-relative cj-flex-1",children:[c.jsx(pe,{type:"text",inputMode:"numeric",value:_,placeholder:p,onChange:C=>{const E=_k(C.target.value,m);j(E),y&&x(!1)},onBlur:C=>w(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),w(C.target.value))},"aria-invalid":y||void 0,className:ne("cj-pr-12",y&&"cj-border-destructive focus-visible:cj-ring-destructive")}),c.jsxs(_i,{open:i,onOpenChange:l,children:[c.jsx(gi,{asChild:!0,children:c.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":a("widget_pick_date"),className:"cj-absolute cj-right-1 cj-top-1/2 -cj-translate-y-1/2 cj-h-10 cj-w-10 cj-rounded-lg cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Cl,{className:"cj-h-4 cj-w-4"})})}),c.jsx(la,{className:"cj-w-auto cj-p-0 cj-z-50 cj-rounded-2xl cj-shadow-lg cj-border-border/30",align:"end",sideOffset:8,children:c.jsx(pi,{mode:"single",selected:u,onSelect:S,defaultMonth:u??new Date,locale:f,autoFocus:!0,captionLayout:"dropdown",startMonth:new Date(1900,0),endMonth:new Date(o?b.getFullYear()+20:b.getFullYear(),11),disabled:o?void 0:{after:b},className:ne("cj-p-4 cj-pointer-events-auto")})})]})]}),c.jsx(pe,{type:"time",value:g,onChange:C=>N(C.target.value),className:"cj-h-12 cj-rounded-xl cj-w-32","aria-label":a("widget_pick_time")})]}),y&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:a("widget_invalid_date")}),r&&!y&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function jk({label:e,value:t,onChange:n,helpText:r,currency:o="EUR"}){const{t:a}=je(),[s,i]=v.useState("");v.useEffect(()=>{if(t){const p=parseFloat(t);isNaN(p)||i(l(p))}else i("")},[t]);const l=p=>new Intl.NumberFormat("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2}).format(p),d=p=>{const g=p.replace(/\./g,"").replace(",",".");return parseFloat(g)||0},u=p=>{const _=p.target.value.replace(/[^\d.,]/g,"");i(_)},f=()=>{if(s){const p=d(s);n(p.toString()),i(l(p))}else n("")},m=p=>({EUR:"€",USD:"$",GBP:"£"})[p]||p;return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx("span",{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-text-muted-foreground",children:m(o)}),c.jsx(pe,{type:"text",value:s,onChange:u,onBlur:f,placeholder:a("placeholder_currency"),className:"cj-pl-8"})]}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function Zr(e){return typeof e=="object"&&e!==null&&"filename"in e&&"url"in e}function yk({label:e,value:t,onChange:n,onFileSelect:r,helpText:o,accept:a,maxSizeMB:s}){const{t:i}=je(),l=v.useRef(null),[d,u]=v.useState(!1),[f,m]=v.useState(null),p=k=>{if(s&&k.size>s*1024*1024)return i("widget_file_too_large",{max:String(s),size:(k.size/1024/1024).toFixed(1)});if(a){const M=a.split(",").map(A=>A.trim().toLowerCase()),D=k.name.toLowerCase(),T=k.type.toLowerCase();if(!M.some(A=>A.startsWith(".")?D.endsWith(A):A.endsWith("/*")?T.startsWith(A.replace("/*","/")):T===A))return i("widget_file_type_rejected",{accept:a})}return null},g=async k=>{m(null);const M=p(k);if(M){m(M);return}if(!r){n(k.name);return}u(!0);try{const D=await r(k);Zr(D)?n(D):n(typeof D=="string"?D:k.name)}catch(D){m(D instanceof Error?D.message:i("widget_upload_failed")),n("")}finally{u(!1)}},_=k=>{if(k.preventDefault(),d)return;const M=k.dataTransfer.files;M.length>0&&g(M[0])},j=k=>{k.preventDefault()},y=()=>{var k;d||(k=l.current)==null||k.click()},x=k=>{const M=k.target.files;M&&M.length>0&&g(M[0]),k.target.value=""},b=k=>{k.stopPropagation(),n(""),m(null)},w=Zr(t)?!!t.url:!!t,S=Zr(t)?t.filename:t,N=Zr(t)?t.url:null,C=[];a&&C.push(i("widget_accepted_hint",{accept:a})),s&&C.push(i("widget_max_size_hint",{max:String(s)}));const E=C.length>0?C.join(" · "):null;return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsx("input",{ref:l,type:"file",className:"cj-hidden",accept:a,onChange:x}),c.jsx("div",{onDrop:_,onDragOver:j,onClick:y,className:`cj-border-2 cj-border-dashed cj-rounded-lg cj-p-8 cj-text-center cj-transition-colors ${d?"cj-border-muted-foreground/25 cj-cursor-wait cj-opacity-60":f?"cj-border-destructive/50 cj-cursor-pointer hover:cj-border-destructive/75":"cj-border-muted-foreground/25 cj-cursor-pointer hover:cj-border-muted-foreground/50"}`,children:d?c.jsxs(c.Fragment,{children:[c.jsx(_s,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2 cj-animate-spin"}),c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:i("upload_uploading")})]}):w?c.jsxs(c.Fragment,{children:[c.jsx(v_,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-center cj-gap-2",children:[N?c.jsx("a",{href:N,target:"_blank",rel:"noopener noreferrer",onClick:k=>k.stopPropagation(),className:"cj-text-sm cj-font-medium cj-text-primary cj-underline cj-truncate cj-max-w-[240px]",title:S,children:S}):c.jsx("p",{className:"cj-text-sm cj-font-medium cj-truncate cj-max-w-[240px]",children:S}),c.jsx("button",{type:"button",onClick:b,className:"cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Vt,{className:"cj-h-4 cj-w-4"})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx(Dl,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:i("upload_drag_drop")})]})}),f&&c.jsxs("p",{className:"cj-text-xs cj-text-destructive cj-flex cj-items-center cj-gap-1",children:[c.jsx(kl,{className:"cj-h-3 cj-w-3"})," ",f]}),(o||E)&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o||E})]})}const $a=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"PT",name:"Portugal",dial:"+351",flag:"🇵🇹"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"BE",name:"Belgium",dial:"+32",flag:"🇧🇪"},{code:"CH",name:"Switzerland",dial:"+41",flag:"🇨🇭"},{code:"AT",name:"Austria",dial:"+43",flag:"🇦🇹"},{code:"SE",name:"Sweden",dial:"+46",flag:"🇸🇪"},{code:"NO",name:"Norway",dial:"+47",flag:"🇳🇴"},{code:"DK",name:"Denmark",dial:"+45",flag:"🇩🇰"},{code:"FI",name:"Finland",dial:"+358",flag:"🇫🇮"},{code:"IE",name:"Ireland",dial:"+353",flag:"🇮🇪"},{code:"PL",name:"Poland",dial:"+48",flag:"🇵🇱"},{code:"CZ",name:"Czech Republic",dial:"+420",flag:"🇨🇿"},{code:"RO",name:"Romania",dial:"+40",flag:"🇷🇴"},{code:"HU",name:"Hungary",dial:"+36",flag:"🇭🇺"},{code:"GR",name:"Greece",dial:"+30",flag:"🇬🇷"},{code:"TR",name:"Turkey",dial:"+90",flag:"🇹🇷"},{code:"RU",name:"Russia",dial:"+7",flag:"🇷🇺"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"CN",name:"China",dial:"+86",flag:"🇨🇳"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"PK",name:"Pakistan",dial:"+92",flag:"🇵🇰"},{code:"BD",name:"Bangladesh",dial:"+880",flag:"🇧🇩"},{code:"ID",name:"Indonesia",dial:"+62",flag:"🇮🇩"},{code:"MY",name:"Malaysia",dial:"+60",flag:"🇲🇾"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"},{code:"PH",name:"Philippines",dial:"+63",flag:"🇵🇭"},{code:"TH",name:"Thailand",dial:"+66",flag:"🇹🇭"},{code:"VN",name:"Vietnam",dial:"+84",flag:"🇻🇳"},{code:"AE",name:"UAE",dial:"+971",flag:"🇦🇪"},{code:"SA",name:"Saudi Arabia",dial:"+966",flag:"🇸🇦"},{code:"IL",name:"Israel",dial:"+972",flag:"🇮🇱"},{code:"EG",name:"Egypt",dial:"+20",flag:"🇪🇬"},{code:"ZA",name:"South Africa",dial:"+27",flag:"🇿🇦"},{code:"NG",name:"Nigeria",dial:"+234",flag:"🇳🇬"},{code:"KE",name:"Kenya",dial:"+254",flag:"🇰🇪"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"AR",name:"Argentina",dial:"+54",flag:"🇦🇷"},{code:"CO",name:"Colombia",dial:"+57",flag:"🇨🇴"},{code:"CL",name:"Chile",dial:"+56",flag:"🇨🇱"},{code:"PE",name:"Peru",dial:"+51",flag:"🇵🇪"},{code:"NZ",name:"New Zealand",dial:"+64",flag:"🇳🇿"}];function vk({label:e,value:t,onChange:n,placeholder:r,helpText:o,onValidationChange:a}){const{t:s}=je(),[i,l]=v.useState(null),[d,u]=v.useState($a[0]),[f,m]=v.useState(""),[p,g]=v.useState(!1),_=v.useMemo(()=>t?t.startsWith(d.dial)?t.slice(d.dial.length).trimStart():t.replace(/^\+\d+\s*/,""):"",[t,d.dial]),j=v.useMemo(()=>{if(!f)return $a;const w=f.toLowerCase();return $a.filter(S=>S.name.toLowerCase().includes(w)||S.code.toLowerCase().includes(w)||S.dial.includes(w))},[f]),y=w=>{const S=!!w&&!/^[\d\s\-()]{4,20}$/.test(w);l(S?s("widget_invalid_phone"):null),a==null||a(S)};v.useEffect(()=>{y(_)},[]);const x=w=>{const S=w.replace(/[^\d\s\-()]/g,""),N=S?`${d.dial} ${S}`:"";n(N),y(S)},b=w=>{u(w),g(!1),m(""),_&&n(`${w.dial} ${_}`)};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-flex cj-gap-1.5",children:[c.jsxs(_i,{open:p,onOpenChange:g,children:[c.jsx(gi,{asChild:!0,children:c.jsxs(Z,{variant:"outline",role:"combobox","aria-expanded":p,className:"cj-w-[100px] cj-justify-between cj-px-2 cj-shrink-0",children:[c.jsx("span",{className:"cj-text-base cj-leading-none",children:d.flag}),c.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:d.dial}),c.jsx(on,{className:"cj-h-3 cj-w-3 cj-opacity-50"})]})}),c.jsxs(la,{className:"cj-w-[260px] cj-p-0",align:"start",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-border-b cj-px-3 cj-py-2",children:[c.jsx(Ml,{className:"cj-h-4 cj-w-4 cj-shrink-0 cj-text-muted-foreground cj-mr-2"}),c.jsx("input",{placeholder:s("widget_search_country"),value:f,onChange:w=>m(w.target.value),className:"cj-flex-1 cj-bg-transparent cj-text-sm cj-outline-none placeholder:cj-text-muted-foreground"})]}),c.jsx(Rt,{className:"cj-h-[200px]",children:c.jsxs("div",{className:"cj-p-1",children:[j.map(w=>c.jsxs("button",{onClick:()=>b(w),className:`cj-flex cj-w-full cj-items-center cj-gap-2 cj-rounded-sm cj-px-3 cj-py-2.5 cj-text-sm hover:cj-bg-accent hover:cj-text-accent-foreground cj-cursor-pointer cj-transition-colors ${d.code===w.code?"cj-bg-accent":""}`,children:[c.jsx("span",{className:"cj-text-base",children:w.flag}),c.jsx("span",{className:"cj-flex-1 cj-text-left cj-truncate",children:w.name}),c.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:w.dial})]},w.code)),j.length===0&&c.jsx("p",{className:"cj-py-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:s("widget_no_country")})]})})]})]}),c.jsx(pe,{type:"tel",value:_,onChange:w=>x(w.target.value),placeholder:r||s("placeholder_phone"),className:"cj-flex-1"})]}),i&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:i}),!i&&o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function xk({label:e,value:t,onChange:n,placeholder:r,helpText:o,onValidationChange:a}){const{t:s}=je(),[i,l]=v.useState(null),d=f=>{const m=!!f&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f);l(m?s("widget_invalid_email"):null),a==null||a(m)};v.useEffect(()=>{d(t)},[]);const u=f=>{const m=f.trim();n(m),d(m)};return c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx(C_,{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx(pe,{type:"email",value:t,onChange:f=>u(f.target.value),placeholder:r||s("placeholder_email"),className:"cj-pl-9"})]}),i&&c.jsx("p",{className:"cj-text-xs cj-text-destructive",children:i}),!i&&o&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}let ds=!1,eo=!1;const Fa=[];function bk(e){return ds?Promise.resolve():eo?new Promise(t=>{Fa.push(t)}):(eo=!0,new Promise((t,n)=>{const r=document.createElement("script");r.src=`https://maps.googleapis.com/maps/api/js?key=${e}&libraries=places`,r.async=!0,r.onload=()=>{ds=!0,eo=!1,t(),Fa.forEach(o=>o()),Fa.length=0},r.onerror=()=>{eo=!1,n(new Error("Failed to load Google Maps"))},document.head.appendChild(r)}))}function wk({label:e,value:t,onChange:n,onValidationChange:r,googleMapsApiKey:o}){const{t:a}=je(),[s,i]=v.useState(""),[l,d]=v.useState([]),[u,f]=v.useState(!1),[m,p]=v.useState(!1),[g,_]=v.useState(ds),[j,y]=v.useState(!1),x=v.useRef(null),b=v.useRef(null),w=v.useRef(null),S=v.useRef();v.useEffect(()=>{if(t)try{const M=JSON.parse(t);M.address&&i(M.address)}catch{t&&i(t)}},[]),v.useEffect(()=>{if(!o){y(!0);return}bk(o).then(()=>{_(!0),x.current=new window.google.maps.places.AutocompleteService,b.current=new window.google.maps.Geocoder}).catch(()=>y(!0))},[o]),v.useEffect(()=>{const M=D=>{w.current&&!w.current.contains(D.target)&&p(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);const N=v.useCallback(M=>{if(!x.current||M.length<3){d([]);return}f(!0),x.current.getPlacePredictions({input:M},(D,T)=>{f(!1),T===window.google.maps.places.PlacesServiceStatus.OK&&D?(d(D.map($=>({place_id:$.place_id,description:$.description}))),p(!0)):d([])})},[]),C=M=>{const D=M.target.value;if(i(D),!D){n(""),d([]),p(!1);return}clearTimeout(S.current),S.current=setTimeout(()=>N(D),300)},E=M=>{p(!1),i(M.description),d([]),b.current&&b.current.geocode({placeId:M.place_id},(D,T)=>{if(T===window.google.maps.GeocoderStatus.OK&&(D!=null&&D[0])){const $=D[0].geometry.location,A={address:M.description,latitude:$.lat(),longitude:$.lng()};n(JSON.stringify(A))}else n(JSON.stringify({address:M.description,latitude:0,longitude:0}))})},k=()=>{i(""),n(""),d([]),p(!1)};return j||!o?c.jsxs("div",{className:"cj-space-y-2",children:[c.jsx(X,{children:e}),c.jsxs("div",{className:"cj-p-3 cj-border cj-border-dashed cj-rounded-lg cj-text-center cj-text-muted-foreground cj-text-sm",children:[c.jsx(_a,{className:"cj-h-5 cj-w-5 cj-mx-auto cj-mb-1 cj-opacity-50"}),a("location_no_api_key")]})]}):c.jsxs("div",{className:"cj-space-y-2",ref:w,children:[c.jsx(X,{children:e}),c.jsxs("div",{className:"cj-relative",children:[c.jsx(_a,{className:"cj-absolute cj-left-3 cj-top-1/2 cj--translate-y-1/2 cj-h-4 cj-w-4 cj-text-muted-foreground"}),c.jsx(pe,{value:s,onChange:C,onFocus:()=>l.length>0&&p(!0),placeholder:a("location_placeholder"),className:"cj-pl-9 cj-pr-8",disabled:!g}),u&&c.jsx(_s,{className:"cj-absolute cj-right-3 cj-top-1/2 cj--translate-y-1/2 cj-h-4 cj-w-4 cj-animate-spin cj-text-muted-foreground"}),!u&&s&&c.jsx("button",{type:"button",onClick:k,className:"cj-absolute cj-right-3 cj-top-1/2 cj--translate-y-1/2 cj-text-muted-foreground hover:cj-text-foreground",children:c.jsx(Vt,{className:"cj-h-4 cj-w-4"})}),m&&l.length>0&&c.jsx("div",{className:"cj-absolute cj-z-50 cj-mt-1 cj-w-full cj-rounded-md cj-border cj-bg-popover cj-shadow-md cj-max-h-60 cj-overflow-y-auto",children:l.map(M=>c.jsxs("button",{type:"button",onClick:()=>E(M),className:"cj-w-full cj-text-left cj-px-3 cj-py-3 cj-text-sm hover:cj-bg-accent hover:cj-text-accent-foreground cj-flex cj-items-start cj-gap-2 cj-transition-colors",children:[c.jsx(_a,{className:"cj-h-4 cj-w-4 cj-mt-0.5 cj-shrink-0 cj-text-muted-foreground"}),c.jsx("span",{children:M.description})]},M.place_id))})]})]})}function Nk(e){if(typeof e=="boolean")return e;if(e==="true"||e==="1"||e===1)return!0;if(e==="false"||e==="0"||e===0)return!1}function Sk({label:e,value:t,onChange:n,helpText:r,variant:o="switch",options:a}){var u,f;const{t:s}=je(),i=Nk(t),l=((u=a==null?void 0:a[0])==null?void 0:u.label)??s("widget_yes"),d=((f=a==null?void 0:a[1])==null?void 0:f.label)??s("widget_no");return o==="segmented"?c.jsxs("div",{className:"cj-space-y-2",children:[e&&c.jsx(X,{className:"cj-text-sm cj-font-medium",children:e}),c.jsx("div",{role:"radiogroup",className:"cj-grid cj-grid-cols-2 cj-gap-2",children:[{val:!0,label:l},{val:!1,label:d}].map(m=>{const p=i===m.val;return c.jsx("button",{type:"button",role:"radio","aria-checked":p,onClick:()=>n(m.val),className:["cj-flex cj-items-center cj-justify-center cj-text-center","cj-min-h-12 cj-px-4 cj-py-3 cj-rounded-xl cj-border cj-text-sm cj-font-medium","cj-transition-colors",p?"cj-border-primary cj-bg-primary/10 cj-text-primary":"cj-border-border/40 cj-bg-card cj-text-foreground hover:cj-bg-accent/50"].join(" "),children:m.label},String(m.val))})}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]}):c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-rounded-xl cj-border cj-border-border/40 cj-bg-card cj-px-4 cj-py-3.5",children:[c.jsxs("div",{className:"cj-flex-1 cj-pr-3",children:[e&&c.jsx(X,{className:"cj-text-sm cj-font-medium cj-text-foreground",children:e}),r&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:r})]}),c.jsx(Cn,{checked:i===!0,onCheckedChange:m=>n(!!m)})]})}const Ck={text:"v1_string",textarea:"v1_string",select:"v2_single_option_select-1",radio:"v2_single_option_select-1",datepicker:"v2_date-1",timepicker:"v2_time-1",datetimepicker:"v2_datetime-1",currency:"v2_currency-1",upload:"v2_single_asset_upload",email:"v2_email-1",phone:"v2_phone-1",location:"v2_address_coordinates",boolean:"v2_boolean-1",switch:"v2_boolean-1"};function kk({nodeData:e,value:t,onChange:n,onValidationChange:r,onFileSelect:o,googleMapsApiKey:a,hideLabel:s=!1}){var g,_;const{t:i}=je(),{schema:l,label:d,options:u}=e,f=s?"":e.required?`${e.labelOverride||d} *`:e.labelOverride||d,m=t!=null?String(t):"";switch(e.widget&&Ck[e.widget]||l){case"v1_string":return c.jsx(Bb,{label:f,value:m,onChange:n,multiline:e.widget==="textarea"});case"v2_single_option_select-1":return!u||u.length===0?c.jsx("div",{className:"cj-text-sm cj-text-muted-foreground",children:i("widget_no_options")}):c.jsx(Zb,{label:f,value:m,onChange:n,options:u,variant:e.ui_variant??"auto"});case"v2_date-1":return c.jsx(pk,{label:f,value:m,onChange:n,allowFuture:e.allowFuture});case"v2_time-1":return c.jsx(hk,{label:f,value:m,onChange:n});case"v2_datetime-1":return c.jsx(gk,{label:f,value:m,onChange:n,allowFuture:e.allowFuture??!0});case"v2_currency-1":return c.jsx(jk,{label:f,value:m,onChange:n});case"v2_single_asset_upload":return c.jsx(yk,{label:f,value:typeof t=="object"&&t!==null&&"filename"in t?t:m,onChange:n,onFileSelect:o,accept:(g=e.uploadConfig)==null?void 0:g.accept,maxSizeMB:(_=e.uploadConfig)==null?void 0:_.maxSizeMB});case"v2_phone-1":return c.jsx(vk,{label:f,value:m,onChange:n,onValidationChange:r});case"v2_email-1":return c.jsx(xk,{label:f,value:m,onChange:n,onValidationChange:r});case"v2_address_coordinates":return c.jsx(wk,{label:f,value:m,onChange:n,onValidationChange:r,googleMapsApiKey:a});case"v2_boolean-1":return c.jsx(Sk,{label:f,value:t,onChange:n,options:u,variant:e.ui_variant??"switch"});default:return c.jsxs("div",{className:"cj-p-4 cj-border cj-border-dashed cj-rounded-lg cj-text-center cj-text-muted-foreground",children:[c.jsx("p",{className:"cj-text-sm",children:i("widget_unknown_schema",{schema:l})}),c.jsx("p",{className:"cj-text-xs cj-mt-1",children:i("widget_no_widget")})]})}}var Pk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ek(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bp={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Pk,function(){Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"});function n(a){for(var s=[],i=0,l=a.length;i<l;i++)s.indexOf(a[i])===-1&&s.push(a[i]);return s}var r={},o={"==":function(a,s){return a==s},"===":function(a,s){return a===s},"!=":function(a,s){return a!=s},"!==":function(a,s){return a!==s},">":function(a,s){return a>s},">=":function(a,s){return a>=s},"<":function(a,s,i){return i===void 0?a<s:a<s&&s<i},"<=":function(a,s,i){return i===void 0?a<=s:a<=s&&s<=i},"!!":function(a){return r.truthy(a)},"!":function(a){return!r.truthy(a)},"%":function(a,s){return a%s},log:function(a){return console.log(a),a},in:function(a,s){return!s||typeof s.indexOf>"u"?!1:s.indexOf(a)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(a,s,i){if(i<0){var l=String(a).substr(s);return l.substr(0,l.length+i)}return String(a).substr(s,i)},"+":function(){return Array.prototype.reduce.call(arguments,function(a,s){return parseFloat(a,10)+parseFloat(s,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(a,s){return parseFloat(a,10)*parseFloat(s,10)})},"-":function(a,s){return s===void 0?-a:a-s},"/":function(a,s){return a/s},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(a,s){return a.concat(s)},[])},var:function(a,s){var i=s===void 0?null:s,l=this;if(typeof a>"u"||a===""||a===null)return l;for(var d=String(a).split("."),u=0;u<d.length;u++)if(l==null||(l=l[d[u]],l===void 0))return i;return l},missing:function(){for(var a=[],s=Array.isArray(arguments[0])?arguments[0]:arguments,i=0;i<s.length;i++){var l=s[i],d=r.apply({var:l},this);(d===null||d==="")&&a.push(l)}return a},missing_some:function(a,s){var i=r.apply({missing:s},this);return s.length-i.length>=a?[]:i}};return r.is_logic=function(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.keys(a).length===1},r.truthy=function(a){return Array.isArray(a)&&a.length===0?!1:!!a},r.get_operator=function(a){return Object.keys(a)[0]},r.get_values=function(a){return a[r.get_operator(a)]},r.apply=function(a,s){if(Array.isArray(a))return a.map(function(j){return r.apply(j,s)});if(!r.is_logic(a))return a;var i=r.get_operator(a),l=a[i],d,u,f,m,p;if(Array.isArray(l)||(l=[l]),i==="if"||i=="?:"){for(d=0;d<l.length-1;d+=2)if(r.truthy(r.apply(l[d],s)))return r.apply(l[d+1],s);return l.length===d+1?r.apply(l[d],s):null}else if(i==="and"){for(d=0;d<l.length;d+=1)if(u=r.apply(l[d],s),!r.truthy(u))return u;return u}else if(i==="or"){for(d=0;d<l.length;d+=1)if(u=r.apply(l[d],s),r.truthy(u))return u;return u}else{if(i==="filter")return m=r.apply(l[0],s),f=l[1],Array.isArray(m)?m.filter(function(j){return r.truthy(r.apply(f,j))}):[];if(i==="map")return m=r.apply(l[0],s),f=l[1],Array.isArray(m)?m.map(function(j){return r.apply(f,j)}):[];if(i==="reduce")return m=r.apply(l[0],s),f=l[1],p=typeof l[2]<"u"?r.apply(l[2],s):null,Array.isArray(m)?m.reduce(function(j,y){return r.apply(f,{current:y,accumulator:j})},p):p;if(i==="all"){if(m=r.apply(l[0],s),f=l[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!r.truthy(r.apply(f,m[d])))return!1;return!0}else if(i==="none"){if(m=r.apply(l[0],s),f=l[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!1;return!0}else if(i==="some"){if(m=r.apply(l[0],s),f=l[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!0;return!1}}if(l=l.map(function(j){return r.apply(j,s)}),o.hasOwnProperty(i)&&typeof o[i]=="function")return o[i].apply(s,l);if(i.indexOf(".")>0){var g=String(i).split("."),_=o;for(d=0;d<g.length;d++){if(!_.hasOwnProperty(g[d]))throw new Error("Unrecognized operation "+i+" (failed at "+g.slice(0,d+1).join(".")+")");_=_[g[d]]}return _.apply(s,l)}throw new Error("Unrecognized operation "+i)},r.uses_data=function(a){var s=[];if(r.is_logic(a)){var i=r.get_operator(a),l=a[i];Array.isArray(l)||(l=[l]),i==="var"?s.push(l[0]):l.forEach(function(d){s.push.apply(s,r.uses_data(d))})}return n(s)},r.add_operation=function(a,s){o[a]=s},r.rm_operation=function(a){delete o[a]},r.rule_like=function(a,s){if(s===a||s==="@")return!0;if(s==="number")return typeof a=="number";if(s==="string")return typeof a=="string";if(s==="array")return Array.isArray(a)&&!r.is_logic(a);if(r.is_logic(s)){if(r.is_logic(a)){var i=r.get_operator(s),l=r.get_operator(a);if(i==="@"||i===l)return r.rule_like(r.get_values(a,!1),r.get_values(s,!1))}return!1}if(Array.isArray(s))if(Array.isArray(a)){if(s.length!==a.length)return!1;for(var d=0;d<s.length;d+=1)if(!r.rule_like(a[d],s[d]))return!1;return!0}else return!1;return!1},r})})(bp);var Mk=bp.exports;const Dk=Ek(Mk);function Tk(e,t){if(!t||t.length===0)return e;const n=r=>{const o=t.find(a=>a.data===String(r));return o?o.label:r};return Array.isArray(e)?e.map(n):n(e)}function to(e){return String(e).padStart(2,"0")}function Rk(e,t){const n=`${to(e.getDate())}/${to(e.getMonth()+1)}/${e.getFullYear()}`;return t?`${n} ${to(e.getHours())}:${to(e.getMinutes())}`:n}function Ok(e,t,n){if(e==null||e==="")return"—";if(typeof e=="object"&&e!==null&&"filename"in e&&"url"in e)return e.filename;const r=Tk(e,n);switch(t){case"currency":return typeof r=="number"?new Intl.NumberFormat(void 0,{style:"currency",currency:"EUR"}).format(r):String(r);case"date":case"datetime":try{const o=new Date(String(r));return Rk(o,t==="datetime")}catch{return String(r)}default:return Array.isArray(r)?r.join(", "):String(r)}}function Ak(e){return{specId:e.specId||"custom",namespace:e.namespace,label:e.label,labelOverride:e.labelOverride,schema:e.schema,options:e.options??null,actor:e.actor||"customer",bindings:e.bindings||[{target_namespace:e.namespace}],widget:e.widget,required:!!e.required,uploadConfig:e.uploadConfig,allowFuture:e.allowFuture,ui_variant:e.ui_variant}}function zk(e){return bb(e,".jb-widget-root.jb-themed")}function kn(e,t){const n=e.bindings;return n!=null&&n.length?t[n[0].target_namespace]:t[e.namespace]}function Ik(e,t,n){const r={...n},o=e.bindings;if(o!=null&&o.length)for(const a of o)r[a.target_namespace]=t;else r[e.namespace]=t;return r}function qc(e,t){return e.replace(/\{\{\s*answers\.([\w.]+)\s*\}\}/g,(n,r)=>{const o=t[r];return o==null?"":typeof o=="object"?JSON.stringify(o):String(o)})}function ji(e,t){if(!t)return e;const n=t.split(".");let r=e;for(const o of n)if(r&&typeof r=="object")r=r[o];else return;return r}function Wk(e){const{journey:t}=e,n=v.useMemo(()=>t.form_config?La(t.form_config):Gc(t),[t]),r=v.useMemo(()=>zk(t.theme),[t.theme]);return c.jsxs(c.Fragment,{children:[r&&c.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),c.jsx($k,{...e,formConfig:n})]})}function $k({formConfig:e,onSubmit:t,onSave:n,onFileSelect:r,onStepApiCall:o,onStepApiError:a,onInitApiCall:s,enrichedOutput:i=!1,initialAnswers:l,googleMapsApiKey:d,fullScreen:u=!0,showWelcome:f=!0}){const{t:m}=je(),{steps:p,fields:g,summary:_,init:j}=e,y=v.useMemo(()=>{const P=new Map;for(const O of g)P.set(O.field_id,O);return P},[g]),[x,b]=v.useState(()=>({...(j==null?void 0:j.values)||{},...l||{}})),[w,S]=v.useState({}),[N,C]=v.useState(p[0]?[p[0].step_id]:[]),[E,k]=v.useState(f?"welcome":"form"),[M,D]=v.useState(!1),[T,$]=v.useState(!1);v.useEffect(()=>{var O;if(!((O=j==null?void 0:j.api)!=null&&O.enabled)||!j.api.url)return;let P=!1;return(async()=>{try{const B=j.api.method||"GET",L=j.api.url,V=s?await s({method:B,url:L}):await fetch(L,{method:B}).then(_e=>_e.json());if(P)return;const ee=j.api.mapping||{},ae={};for(const[_e,Se]of Object.entries(ee))ae[_e]=ji(V,Se);b(_e=>({..._e,...ae}))}catch(B){console.error("[FormRunner] init API failed",B)}})(),()=>{P=!0}},[]);const A=N[N.length-1],H=p.find(P=>P.step_id===A),W=H?p.findIndex(P=>P.step_id===H.step_id):-1,Q=E==="summary"?100:E==="welcome"?0:Math.round((W+1)/Math.max(p.length,1)*100),G=v.useCallback((P,O)=>{b(B=>Ik(P,O,B))},[]),z=v.useCallback(async(P,O)=>{if(r)return r(O,P.namespace)},[r]),oe=v.useCallback(P=>{for(const O of P.rows)for(const B of O.field_ids){const L=y.get(B);if(!L||!L.required)continue;const V=kn(L,x);if(V==null||V==="")return!1}return!0},[x,y]),le=v.useCallback((P,O)=>{const B=[...P.navigation.rules].sort((L,V)=>(V.priority||0)-(L.priority||0));for(const L of B){if(L.condition===null)return L.next_step_id;try{if(Dk.apply(L.condition,{answers:O}))return L.next_step_id}catch(V){console.warn("[FormRunner] rule eval error",V)}}return"__submit__"},[]),ie=v.useCallback(async()=>{if(!H)return;if(!oe(H)){$(!0),jn.error(m("runner_toast_required_fields"));return}$(!1),window.scrollTo({top:0,behavior:"smooth"});const P=H.navigation.api_call;if(P!=null&&P.enabled&&P.url){const B=qc(P.url,x),L={"Content-Type":"application/json",...P.headers||{}},V=P.body_template?qc(P.body_template,x):void 0,ee=P.method!=="GET"&&!!V;let ae;if(ee)try{ae=JSON.parse(V)}catch{ae=V}const _e={step_id:H.step_id,method:P.method,url:B,headers:L,body:ae,answers:x};D(!0);try{let Se=null;o?Se=await o(_e):Se=await(await fetch(B,{method:P.method,headers:L,body:ee?V:void 0})).json().catch(()=>null),S(Me=>({...Me,[H.step_id]:Se}))}catch(Se){if(console.error("[FormRunner] step API failed",Se),a)try{a(Se,_e)}catch(Be){console.error("[FormRunner] onStepApiError handler threw",Be)}const Me=P.on_error??"block";if(Me==="block"){a||jn.error(m("runner_toast_api_failed")),D(!1);return}if(typeof Me=="string"&&Me.startsWith("goto:")){const Be=Me.slice(5);D(!1),Be==="__submit__"||N.includes(Be)?k("summary"):C(ke=>[...ke,Be]);return}}D(!1)}const O=le(H,x);if(O==="__submit__"){k("summary");return}if(N.includes(O)){k("summary");return}C(B=>[...B,O])},[H,x,le,N,oe,o,a]),R=v.useCallback(()=>{if(E==="summary"){k("form"),window.scrollTo({top:0,behavior:"smooth"});return}N.length>1&&(C(N.slice(0,-1)),window.scrollTo({top:0,behavior:"smooth"}))},[N,E]),I=v.useCallback(P=>{if(!i)return P;const O={};for(const[B,L]of Object.entries(P)){const V=g.find(ee=>{var ae;return((ae=ee.bindings)==null?void 0:ae.some(_e=>_e.target_namespace===B))||ee.namespace===B});O[B]={data:L,schema:(V==null?void 0:V.schema)||"unknown"}}return O},[i,g]),Y=v.useCallback(()=>{const P=I(x);t?t(P):navigator.clipboard.writeText(JSON.stringify(P,null,2)).then(()=>{jn.success(m("runner_toast_answers_copied"))})},[x,I,t]),U=v.useCallback(()=>{b({...(j==null?void 0:j.values)||{}}),S({}),C(p[0]?[p[0].step_id]:[]),k(f?"welcome":"form"),$(!1)},[j,p,f]);return p.length===0?c.jsx("div",{className:`jb-widget-root jb-themed ${u?"cj-min-h-screen":"cj-h-full"} cj-bg-background cj-flex cj-items-center cj-justify-center cj-p-6`,children:c.jsx("p",{className:"cj-text-muted-foreground cj-text-base",children:"No form to display."})}):c.jsxs("div",{className:`jb-widget-root jb-themed ${u?"cj-min-h-screen":"cj-h-full"} cj-flex cj-flex-col cj-bg-background`,style:{fontFamily:"var(--claims-journey-font-body)"},children:[c.jsxs("header",{className:"cj-px-4 cj-py-3 sm:cj-px-6 cj-flex cj-items-center cj-justify-between cj-bg-card cj-border-b cj-border-border/40",children:[c.jsx("span",{className:"cj-text-xs cj-font-medium cj-text-muted-foreground cj-uppercase cj-tracking-wide",children:E==="summary"?_.title||"Summary":E==="welcome"?"":`Step ${W+1} of ${p.length}`}),c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[n&&Object.keys(x).length>0&&E!=="summary"&&c.jsx("button",{onClick:()=>n(I(x)),className:"cj-text-xs cj-text-muted-foreground hover:cj-text-foreground cj-bg-transparent cj-border-none cj-cursor-pointer",children:"Save & exit"}),c.jsxs("button",{onClick:U,className:"cj-text-xs cj-text-muted-foreground hover:cj-text-foreground cj-bg-transparent cj-border-none cj-cursor-pointer cj-flex cj-items-center cj-gap-1",children:[c.jsx(El,{className:"cj-h-3.5 cj-w-3.5"}),"Reset"]})]})]}),c.jsx("div",{className:"cj-px-4 sm:cj-px-6 cj-bg-card",children:c.jsx(rm,{value:Q,className:"cj-h-1 cj-rounded-none"})}),c.jsxs("main",{className:"cj-flex-1 cj-flex cj-flex-col md:cj-flex-row cj-items-stretch cj-w-full",children:[E==="form"&&c.jsx("div",{className:"md:cj-hidden cj-border-b cj-border-border/40 cj-bg-card",children:c.jsx(Fk,{formConfig:e,answers:x,apiResponses:w,currentStepIndex:W+1})}),c.jsx("div",{className:"cj-flex-1 md:cj-w-[70%] cj-flex cj-justify-center cj-px-4 sm:cj-px-6 cj-py-6 md:cj-py-8 md:cj-px-3",children:c.jsx("div",{className:"cj-w-full cj-max-w-4xl",children:E==="welcome"?c.jsx(Hk,{onStart:()=>{k("form"),window.scrollTo({top:0,behavior:"smooth"})}}):E==="summary"?c.jsx(Bk,{formConfig:e,answers:x,apiResponses:w,currentStepIndex:W+1,onBack:R,onSubmit:Y}):H?c.jsx(Lk,{step:H,fields:y,answers:x,onAnswerChange:G,onFileSelect:z,googleMapsApiKey:d,onNext:ie,onBack:R,canGoBack:N.length>1,submitting:M,showValidation:T,stepIndex:W+1}):null})}),E==="form"&&c.jsx("aside",{className:"cj-hidden md:cj-block md:cj-w-[30%] md:cj-shrink-0 cj-self-start cj-sticky cj-top-0 cj-px-4 sm:cj-px-6 cj-py-6 md:cj-py-8 md:cj-px-3",children:c.jsx("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-5 sm:cj-p-7 cj-space-y-5 cj-max-h-[calc(100vh-5rem)] cj-overflow-y-auto",children:c.jsx(wp,{formConfig:e,answers:x,apiResponses:w,currentStepIndex:W+1})})})]})]})}function wp({formConfig:e,answers:t,apiResponses:n,currentStepIndex:r}){const{summary:o,fields:a}=e,s=v.useMemo(()=>new Map(a.map(l=>[l.field_id,l])),[a]),i=v.useMemo(()=>{const l=[];if(o.sections.length===0){const d=[];return e.steps.forEach(u=>{u.rows.forEach(f=>{f.field_ids.forEach(m=>{const p=s.get(m);if(!p)return;const g=kn(p,t);d.push({label:p.label||p.namespace,value:us(g,p.schema,p.options)})})})}),d.length>0&&l.push({id:"all",title:o.title||"Summary",rows:d}),l}return o.sections.forEach(d=>{const u=d.visible_from_step??1,f=d.until_step;if(r<u||f!==void 0&&r>f)return;const m=d.display_fields.map(p=>{let g,_;if(p.source==="form_field"&&p.field_id){const j=s.get(p.field_id);j&&(g=kn(j,t),_=j.options)}else if(p.source==="api_response"&&p.step_id){const j=n[p.step_id];g=ji(j,p.response_path||"")}return{label:p.label||"(label)",value:us(g,p.format,_)}});l.push({id:d.section_id,title:d.title,rows:m})}),l},[o,e.steps,s,t,n,r]);return c.jsxs("div",{children:[c.jsx("h2",{className:"cj-text-base cj-font-semibold cj-text-foreground cj-mb-6",style:{fontFamily:"var(--claims-journey-font-heading)"},children:o.title||"Summary"}),i.length===0?c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:"Suas respostas aparecerão aqui."}):c.jsx("div",{className:"cj-space-y-8",children:i.map((l,d)=>c.jsxs("div",{className:d>0?"cj-pt-8 cj-border-t cj-border-border/40":"",children:[c.jsx("h3",{className:"cj-text-xs cj-font-bold cj-uppercase cj-tracking-wider cj-text-muted-foreground cj-mb-4",children:l.title}),c.jsxs("div",{className:"cj-space-y-4",children:[l.rows.map((u,f)=>c.jsxs("div",{className:"cj-flex cj-flex-col cj-gap-2 cj-text-sm cj-leading-relaxed",children:[c.jsx("span",{className:"cj-text-muted-foreground cj-text-left",children:u.label}),c.jsx("span",{className:`cj-text-right cj-font-medium cj-break-words cj-pl-4 cj-leading-snug ${u.value==="—"?"cj-text-muted-foreground/60":"cj-text-foreground"}`,children:u.value})]},f)),l.rows.length===0&&c.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic",children:"—"})]})]},l.id))})]})}function Fk(e){const[t,n]=v.useState(!1),{formConfig:r,answers:o}=e,a=v.useMemo(()=>{let s=0;const i=new Map(r.fields.map(l=>[l.field_id,l]));return r.steps.forEach(l=>l.rows.forEach(d=>d.field_ids.forEach(u=>{const f=i.get(u);if(!f)return;const m=kn(f,o);m!=null&&m!==""&&s++}))),s},[r,o]);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>n(s=>!s),className:"cj-w-full cj-flex cj-items-center cj-justify-between cj-px-4 cj-py-3 cj-bg-transparent cj-border-none cj-cursor-pointer",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[c.jsx("div",{className:"cj-h-1.5 cj-w-1.5 cj-rounded-full cj-bg-primary"}),c.jsx("span",{className:"cj-text-xs cj-font-semibold cj-text-foreground",children:r.summary.title||"Summary"}),c.jsxs("span",{className:"cj-text-xs cj-text-muted-foreground",children:["· ",a," preenchidos"]})]}),c.jsx(on,{className:`cj-h-4 cj-w-4 cj-text-muted-foreground cj-transition-transform ${t?"cj-rotate-180":""}`})]}),t&&c.jsx("div",{className:"cj-px-4 cj-pb-4",children:c.jsx(wp,{...e})})]})}const us=Ok;function Lk({step:e,fields:t,answers:n,onAnswerChange:r,onFileSelect:o,googleMapsApiKey:a,onNext:s,onBack:i,canGoBack:l,submitting:d,showValidation:u,stepIndex:f}){return c.jsxs("div",{className:"cj-space-y-4",children:[c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-5 sm:cj-p-7 cj-space-y-5",children:[c.jsxs("div",{className:"cj-flex cj-items-center cj-gap-3",children:[c.jsx("div",{className:"cj-h-9 cj-w-9 cj-rounded-full cj-bg-primary cj-text-primary-foreground cj-flex cj-items-center cj-justify-center cj-font-bold cj-text-sm",children:f}),c.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[c.jsx("h2",{className:"cj-text-lg cj-font-semibold cj-text-foreground",style:{fontFamily:"var(--claims-journey-font-heading)"},children:e.title}),e.description&&c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:e.description})]})]}),c.jsx("div",{className:"cj-space-y-4",children:e.rows.map(m=>{const p=m.field_ids.map(y=>t.get(y)).filter(y=>!!y);if(p.length===0)return null;const g=Math.min(p.length,3),_=m.layout==="horizontal",j=g===3?"sm:cj-grid-cols-3":g===2?"sm:cj-grid-cols-2":"sm:cj-grid-cols-1";return c.jsx("div",{className:_?`cj-grid cj-grid-cols-1 ${j} cj-gap-3`:"cj-flex cj-flex-col cj-gap-3",children:p.map(y=>{const x=kn(y,n),b=u&&y.required&&(x==null||x==="");return c.jsx("div",{className:`${b?"cj-rounded-xl cj-ring-2 cj-ring-destructive/40 cj-p-2":""}`,children:c.jsx(kk,{nodeData:Ak(y),value:x,onChange:w=>r(y,w),onFileSelect:w=>o(y,w),googleMapsApiKey:a})},y.field_id)})},m.row_id)})})]}),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[c.jsxs(Z,{variant:"ghost",size:"sm",onClick:i,disabled:!l||d,className:"cj-text-muted-foreground hover:cj-text-foreground",children:[c.jsx(Sl,{className:"cj-h-4 cj-w-4 cj-mr-1.5"}),"Back"]}),c.jsx(Z,{size:"default",onClick:s,disabled:d,className:"cj-rounded-xl cj-px-6",children:d?c.jsxs(c.Fragment,{children:[c.jsx(_s,{className:"cj-h-4 cj-w-4 cj-mr-1.5 cj-animate-spin"}),"Loading…"]}):c.jsxs(c.Fragment,{children:[e.navigation.button_label||"Continue",c.jsx(Do,{className:"cj-h-4 cj-w-4 cj-ml-1.5"})]})})]})]})}function Bk({formConfig:e,answers:t,apiResponses:n,currentStepIndex:r,onBack:o,onSubmit:a}){const{t:s}=je(),{summary:i,fields:l}=e,d=new Map(l.map(g=>[g.field_id,g])),u=g=>typeof g=="object"&&g!==null&&"filename"in g&&"url"in g,f=(g,_,j)=>u(g)&&g.url?c.jsx("a",{href:g.url,target:"_blank",rel:"noopener noreferrer",className:"cj-text-primary cj-underline cj-break-all",onClick:y=>y.stopPropagation(),children:g.filename}):us(g,_,j),m=[];e.steps.forEach(g=>{g.rows.forEach(_=>{_.field_ids.forEach(j=>{const y=d.get(j);if(!y)return;const x=kn(y,t);x==null||x===""||Array.isArray(x)&&x.length===0||m.push({id:j,label:y.label||y.namespace,value:x,format:y.schema,options:y.options})})})});const p=g=>m.length===0?c.jsx("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-6 cj-text-sm cj-text-muted-foreground cj-text-center",children:s("runner_no_answers")}):c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-overflow-hidden",children:[g&&c.jsx("div",{className:"cj-px-4 cj-py-3 cj-border-b cj-border-border/30 cj-bg-muted/30",children:c.jsx("h3",{className:"cj-text-sm cj-font-semibold",children:s("runner_summary_all_answers")})}),c.jsx("div",{className:"cj-divide-y cj-divide-border/30",children:m.map(_=>c.jsxs("div",{className:"cj-px-4 cj-py-3",children:[c.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-medium",children:_.label}),c.jsx("div",{className:"cj-text-sm cj-font-medium cj-mt-0.5 cj-break-words",children:f(_.value,_.format,_.options)})]},_.id))})]});return c.jsxs("div",{className:"cj-space-y-4",children:[c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-p-6 cj-text-center cj-space-y-2",children:[c.jsx(f_,{className:"cj-h-7 cj-w-7 cj-text-primary cj-mx-auto"}),c.jsx("h2",{className:"cj-text-xl cj-font-bold",style:{fontFamily:"var(--claims-journey-font-heading)"},children:i.title||"Summary"})]}),i.sections.length===0?p(!1):i.sections.map(g=>{const _=g.visible_from_step??1,j=g.until_step;return r<_||j!==void 0&&r>j?null:c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/30 cj-overflow-hidden",children:[c.jsx("div",{className:"cj-px-4 cj-py-3 cj-border-b cj-border-border/30 cj-bg-muted/30",children:c.jsx("h3",{className:"cj-text-sm cj-font-semibold",children:g.title})}),c.jsxs("div",{className:"cj-divide-y cj-divide-border/30",children:[g.display_fields.map(y=>{let x,b;if(y.source==="form_field"&&y.field_id){const w=d.get(y.field_id);w&&(x=kn(w,t),b=w.options)}else if(y.source==="api_response"&&y.step_id){const w=n[y.step_id];x=ji(w,y.response_path||"")}return c.jsxs("div",{className:"cj-px-4 cj-py-3",children:[c.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-medium",children:y.label||"(label)"}),c.jsx("div",{className:"cj-text-sm cj-font-medium cj-mt-0.5",children:f(x,y.format,b)})]},y.display_id)}),g.display_fields.length===0&&c.jsx("div",{className:"cj-px-4 cj-py-3 cj-text-xs cj-text-muted-foreground cj-italic",children:"No display fields configured."})]})]},g.section_id)}),i.sections.length>0&&p(!0),c.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-pt-2",children:[c.jsxs(Z,{variant:"ghost",size:"sm",onClick:o,className:"cj-text-muted-foreground hover:cj-text-foreground",children:[c.jsx(Sl,{className:"cj-h-4 cj-w-4 cj-mr-1.5"}),"Back"]}),c.jsxs(Z,{size:"default",onClick:a,className:"cj-rounded-xl cj-px-6",children:[c.jsx(D_,{className:"cj-h-4 cj-w-4 cj-mr-1.5"}),"Submit"]})]})]})}function Hk({onStart:e}){const{t}=je();return c.jsx("div",{className:"cj-w-full cj-max-w-xl cj-mx-auto cj-py-8",style:{fontFamily:"var(--claims-journey-font-body)"},children:c.jsxs("div",{className:"cj-rounded-2xl cj-bg-card cj-border cj-border-border/40 cj-p-8 sm:cj-p-10 cj-flex cj-flex-col cj-items-center cj-text-center cj-gap-6",children:[c.jsx("div",{className:"cj-h-16 cj-w-16 cj-rounded-full cj-bg-muted cj-flex cj-items-center cj-justify-center",children:c.jsx(y_,{className:"cj-h-7 cj-w-7 cj-text-muted-foreground"})}),c.jsxs("div",{className:"cj-space-y-3",children:[c.jsx("h1",{className:"cj-text-xl sm:cj-text-2xl cj-font-semibold cj-text-foreground",style:{fontFamily:"var(--claims-journey-font-heading)"},children:t("runner_onboarding_line1")}),c.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:t("runner_onboarding_line2")})]}),c.jsxs(Z,{size:"lg",onClick:e,className:"cj-w-full cj-rounded-xl cj-min-h-[56px] cj-text-base",children:[t("runner_start_claim"),c.jsx(Do,{className:"cj-h-4 cj-w-4 cj-ml-2"})]})]})})}const Yk="http://json-schema.org/draft-07/schema#",qk="https://habit.ai/schemas/form-config.schema.json",Vk="FormConfig",Gk="v2.0 linear form configuration: ordered steps, a flat field catalog, summary panel, and init values.",Uk="object",Xk=["steps","fields","summary","init"],Kk=!1,Jk={steps:{type:"array",items:{$ref:"#/definitions/FormStep"}},fields:{type:"array",items:{$ref:"#/definitions/FormField"}},summary:{$ref:"#/definitions/SummaryPanelConfig"},init:{$ref:"#/definitions/InitConfig"}},Qk={HttpMethod:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE"]},JsonLogic:{description:"JSON Logic expression evaluated against { answers, api_responses }. null means 'always true' (default rule).",type:["object","null"]},ClaimPropertySpecOption:{type:"object",required:["data","label"],additionalProperties:!1,properties:{data:{type:"string",description:"Stored value when this option is selected."},label:{type:"string",description:"Human-readable display text."},next:{type:"array",items:{type:"string"}}}},NodeBinding:{type:"object",required:["target_namespace"],additionalProperties:!1,properties:{target_namespace:{type:"string"}}},UploadConfig:{type:"object",additionalProperties:!1,properties:{accept:{type:"string",description:"HTML accept attribute (MIME types or extensions)."},maxSizeMB:{type:"number",minimum:0}}},FormField:{type:"object",required:["field_id","namespace","label","schema"],additionalProperties:!1,properties:{field_id:{type:"string",description:"Unique id; referenced from FormRow.field_ids."},namespace:{type:"string",description:"Answer key (dot-notation, e.g. 'insured.full_name')."},label:{type:"string"},labelOverride:{type:"string"},specId:{type:"string",description:"Source ClaimPropertySpec id, or 'custom'."},schema:{type:"string",description:"Schema type, e.g. 'v1_string', 'v2_date-1'."},options:{oneOf:[{type:"null"},{type:"array",items:{$ref:"#/definitions/ClaimPropertySpecOption"}}]},widget:{type:"string",description:"Widget override (e.g. 'email', 'textarea', 'phone')."},required:{type:"boolean"},actor:{type:"string",enum:["customer","operator"]},bindings:{type:"array",items:{$ref:"#/definitions/NodeBinding"}},uploadConfig:{$ref:"#/definitions/UploadConfig"},allowFuture:{type:"boolean",description:"Date/datetime widgets only."},placeholder:{type:"string"},helpText:{type:"string"},ui_variant:{type:"string",description:"Visual variant override. single_select: 'radio' | 'dropdown' | 'segmented'. boolean: 'switch' | 'segmented'."}}},FormRow:{type:"object",required:["row_id","layout","field_ids"],additionalProperties:!1,properties:{row_id:{type:"string"},layout:{type:"string",enum:["horizontal","vertical"]},field_ids:{type:"array",items:{type:"string"},description:"FK to FormField.field_id."}}},NavRule:{type:"object",required:["rule_id","condition","next_step_id"],additionalProperties:!1,properties:{rule_id:{type:"string"},condition:{$ref:"#/definitions/JsonLogic"},next_step_id:{type:"string",description:"Target FormStep.step_id or the literal '__submit__' to finish the form."},priority:{type:"integer",description:"Higher priority rules are evaluated first."}}},StepApiCall:{type:"object",required:["enabled","method","url"],additionalProperties:!1,properties:{enabled:{type:"boolean"},method:{$ref:"#/definitions/HttpMethod"},url:{type:"string",format:"uri"},headers:{type:"object",additionalProperties:{type:"string"}},body_template:{type:"string",description:"JSON string; '{{answers.foo}}' tokens are interpolated by the runner."},on_error:{type:"string",description:"Behavior on failure. 'block' (default) keeps the user on the step; 'continue' runs nav rules; 'goto:<step_id>' jumps to that step.",pattern:"^(block|continue|goto:.+)$",default:"block"}}},StepNavigation:{type:"object",required:["rules"],additionalProperties:!1,properties:{api_call:{$ref:"#/definitions/StepApiCall"},rules:{type:"array",items:{$ref:"#/definitions/NavRule"}},button_label:{type:"string"}}},FormStep:{type:"object",required:["step_id","title","rows","navigation"],additionalProperties:!1,properties:{step_id:{type:"string"},title:{type:"string"},description:{type:"string"},rows:{type:"array",items:{$ref:"#/definitions/FormRow"}},navigation:{$ref:"#/definitions/StepNavigation"}}},SummaryDisplayField:{type:"object",required:["display_id","source","label"],additionalProperties:!1,properties:{display_id:{type:"string"},source:{type:"string",enum:["form_field","api_response"]},field_id:{type:"string",description:"Required when source = 'form_field'."},step_id:{type:"string",description:"Required when source = 'api_response'."},response_path:{type:"string",description:"Dot-path inside the step's api_response."},label:{type:"string"},format:{type:"string",enum:["text","date","datetime","currency","number"]}},allOf:[{if:{properties:{source:{const:"form_field"}}},then:{required:["field_id"]}},{if:{properties:{source:{const:"api_response"}}},then:{required:["step_id","response_path"]}}]},SummarySection:{type:"object",required:["section_id","title","display_fields"],additionalProperties:!1,properties:{section_id:{type:"string"},title:{type:"string"},visible_from_step:{type:"integer",minimum:1,description:"1-based step index."},until_step:{type:"integer",minimum:1,description:"1-based step index."},display_fields:{type:"array",items:{$ref:"#/definitions/SummaryDisplayField"}}}},SummaryPanelConfig:{type:"object",required:["title","sections"],additionalProperties:!1,properties:{title:{type:"string"},show_pricing:{type:"boolean"},sections:{type:"array",items:{$ref:"#/definitions/SummarySection"}}}},InitConfig:{type:"object",required:["values"],additionalProperties:!1,properties:{values:{type:"object",description:"Static initial answers keyed by namespace.",additionalProperties:!0},api:{type:"object",required:["enabled","method","url"],additionalProperties:!1,properties:{enabled:{type:"boolean"},method:{type:"string",enum:["GET","POST"]},url:{type:"string",format:"uri"},headers:{type:"object",additionalProperties:{type:"string"}},mapping:{type:"object",description:"namespace -> dot-path inside the prefill response.",additionalProperties:{type:"string"}}}}}}},Zk={$schema:Yk,$id:qk,title:Vk,description:Gk,type:Uk,required:Xk,additionalProperties:Kk,properties:Jk,definitions:Qk},eP="http://json-schema.org/draft-07/schema#",tP="https://habit.ai/schemas/journey-spec.schema.json",nP="JourneySpec (v2.0)",rP="Portable envelope produced by JourneyBuilderWidget and consumed by FormRunnerWidget. v2.0 wraps a form_config; legacy v1.x nodes/edges/start_node_id are optional and preserved on re-export.",oP="object",aP=["journey_id","claimspec_id","version"],sP=!0,iP={journey_id:{type:"string",description:"Unique journey identifier."},claimspec_id:{type:"string",description:"Associated claim specification id."},version:{type:"string",description:"Schema version. Use '2.0' (or any '2.x.y') for the linear FormConfig model."},form_config:{$ref:"https://habit.ai/schemas/form-config.schema.json",description:"Source of truth in v2.0. When present, legacy nodes/edges/groups/mode are ignored at runtime."},theme:{$ref:"#/definitions/JourneyTheme"},mode:{type:"string",enum:["sequential","grouped"],description:"Legacy v1.x rendering mode."},nodes:{type:"array",description:"Legacy v1.x — preserved on re-export.",items:{type:"object"}},edges:{type:"array",description:"Legacy v1.x — preserved on re-export.",items:{type:"object"}},start_node_id:{type:["string","null"],description:"Legacy v1.x."},groups:{type:"array",description:"Legacy v1.x grouped layout.",items:{type:"object"}}},cP=[{required:["form_config"]},{required:["nodes","edges"]}],lP={JourneyTheme:{type:"object",description:"CSS variables injected on the runner/builder root. Colors are HSL triplets like '222 47% 11%'.",additionalProperties:!1,properties:{primaryColor:{type:"string"},backgroundColor:{type:"string"},cardColor:{type:"string"},foregroundColor:{type:"string"},fontFamilyHeading:{type:"string"},fontFamilyBody:{type:"string"},fontSizeBase:{type:"number",description:"Base font size in pixels."},borderRadius:{type:"number",description:"Border radius in rem."},spacing:{type:"string",enum:["compact","cozy","spacious"]}}}},dP={$schema:eP,$id:tP,title:nP,description:rP,type:oP,required:aP,additionalProperties:sP,properties:iP,anyOf:cP,definitions:lP};exports.FormRunnerWidget=Wk;exports.JourneyBuilderWidget=Db;exports.PortalContainerContext=Zo;exports.SCHEMA_TYPES=vr;exports.formConfigSchema=Zk;exports.getSchemaInfo=ta;exports.journeySpecSchema=dP;exports.setLanguage=pd;exports.useTranslation=je;