diff --git a/backend/app/routes/__pycache__/focus_group_ai.cpython-313.pyc b/backend/app/routes/__pycache__/focus_group_ai.cpython-313.pyc index b9bb1456..9b5afa60 100644 Binary files a/backend/app/routes/__pycache__/focus_group_ai.cpython-313.pyc and b/backend/app/routes/__pycache__/focus_group_ai.cpython-313.pyc differ diff --git a/backend/app/routes/focus_group_ai.py b/backend/app/routes/focus_group_ai.py index e1c1b30d..23edb242 100644 --- a/backend/app/routes/focus_group_ai.py +++ b/backend/app/routes/focus_group_ai.py @@ -563,26 +563,30 @@ def advance_moderator_discussion(focus_group_id): activates_visual_context = True print(f"🎨 ADVANCE DISCUSSION: Will activate visual context for asset: {asset_filename}") + # Create visual asset metadata for frontend display + visual_asset_metadata = None + if activates_visual_context and attached_assets and len(attached_assets) > 0: + # Create visual asset metadata that frontend expects + visual_asset_metadata = { + "filename": attached_assets[0], # Use first asset + "displayReference": display_reference or attached_assets[0] # Use display reference or filename as fallback + } + message_data = { "text": result["moderator_response"], "type": "question", "senderId": "moderator", "attached_assets": attached_assets, - "activates_visual_context": activates_visual_context + "activates_visual_context": activates_visual_context, + "visual_asset": visual_asset_metadata # Frontend needs this for image display } message_id = FocusGroup.add_message(focus_group_id, message_data) - # Activate visual assets if needed + # Visual context activation is handled automatically by FocusGroup.add_message() + # when activates_visual_context=True and attached_assets are present if activates_visual_context and attached_assets: - try: - success = FocusGroup._activate_visual_assets(focus_group_id, attached_assets, message_id) - if success: - print(f"✅ ADVANCE DISCUSSION: Visual context activated for {attached_assets}") - else: - print(f"⚠️ ADVANCE DISCUSSION: Failed to activate visual context for {attached_assets}") - except Exception as activation_error: - print(f"⚠️ ADVANCE DISCUSSION: Error activating visual context: {activation_error}") + print(f"✅ ADVANCE DISCUSSION: Visual context activated for {attached_assets}") if message_id: result["message_id"] = message_id @@ -838,13 +842,8 @@ def stop_autonomous_conversation(focus_group_id): current_app.logger.info(f"Signaled autonomous conversation to stop for focus group {focus_group_id}: {reason}") - # Log the manual mode start event (AI mode stopped) - try: - user_id = get_jwt_identity() # Get user ID if available - mode_event_id = FocusGroup.add_mode_event(focus_group_id, 'manual_mode_started', user_id) - current_app.logger.info(f"Logged manual mode start event: {mode_event_id}") - except Exception as e: - current_app.logger.warning(f"Failed to log manual mode start event: {e}") + # Mode events are now handled by AIModeratorService.end_session_with_concluding_statement() + # to prevent duplicate mode event indicators # Return immediately with a success response like start_autonomous_conversation result = { diff --git a/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc b/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc index cfac7b31..da4f0b31 100644 Binary files a/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc and b/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc differ diff --git a/backend/app/services/ai_moderator_service.py b/backend/app/services/ai_moderator_service.py index f0325c97..76ca08f1 100644 --- a/backend/app/services/ai_moderator_service.py +++ b/backend/app/services/ai_moderator_service.py @@ -722,23 +722,17 @@ class AIModeratorService: 'status': 'completed' }) - # Add mode event for AI-driven session conclusions - # This includes auto_complete, natural_completion, discussion_guide_completed, etc. - ai_driven_reasons = [ - 'auto_complete', 'natural_completion', 'discussion_guide_completed', - 'action_limit_reached', 'time_limit' - ] + # Add mode event for all AI session conclusions + # This includes auto_complete, natural_completion, discussion_guide_completed, manual_stop, etc. + mode_event_id = FocusGroup.add_mode_event( + focus_group_id=focus_group_id, + event_type='ai_session_concluded' + ) - if reason in ai_driven_reasons: - mode_event_id = FocusGroup.add_mode_event( - focus_group_id=focus_group_id, - event_type='ai_session_concluded' - ) - - if mode_event_id: - print(f"🎯 Added AI session concluded mode event for focus group {focus_group_id} (reason: {reason})") - else: - print(f"Warning: Failed to add AI session concluded mode event for focus group {focus_group_id} (reason: {reason})") + if mode_event_id: + print(f"🎯 Added AI session concluded mode event for focus group {focus_group_id} (reason: {reason})") + else: + print(f"Warning: Failed to add AI session concluded mode event for focus group {focus_group_id} (reason: {reason})") print(f"🎬 Session ended for focus group {focus_group_id} with reason: {reason}") diff --git a/backend/app/services/autonomous_conversation_controller.py b/backend/app/services/autonomous_conversation_controller.py index f1efe634..267286b6 100644 --- a/backend/app/services/autonomous_conversation_controller.py +++ b/backend/app/services/autonomous_conversation_controller.py @@ -156,14 +156,8 @@ class AutonomousConversationController: # GPT-5 fix: Emit AI status update to notify frontend of completion # The FocusGroup.update() will trigger the websocket event automatically - # Log the mode change event for automatic completion - completion_events = ['completed', 'discussion_guide_completed', 'natural_completion'] - if reason in completion_events: - mode_event_id = FocusGroup.add_mode_event(self.focus_group_id, 'ai_session_concluded', None) - self.logger.info(f"Logged AI session conclusion event: {mode_event_id}") - else: - mode_event_id = FocusGroup.add_mode_event(self.focus_group_id, 'manual_mode_started', None) - self.logger.info(f"Logged manual mode start event: {mode_event_id}") + # Mode events are now handled by AIModeratorService.end_session_with_concluding_statement() + # to prevent duplicate mode event indicators self.logger.info(f"Stopped autonomous conversation for focus group {self.focus_group_id}: {reason}") @@ -782,22 +776,21 @@ class AutonomousConversationController: async def _add_moderator_message(self, content: str, message_type: str) -> Optional[str]: """Add a moderator message to the conversation.""" try: - # Check if this message corresponds to a creative review activity + # Initialize image detection variables attached_assets = [] activates_visual_context = False + display_reference = None - # Check if we're currently at a creative review activity in the discussion guide + # Check if current discussion guide item has image attachments try: from app.services.ai_moderator_service import AIModeratorService from app.services.focus_group_response_service import extract_asset_filename_from_content - print(f"🔍 MODERATOR MESSAGE DEBUG: Checking for creative review activity") - print(f"🔍 Message content: {content[:100]}...") + print(f"🔍 Checking current discussion guide item for image attachments") moderator_status = AIModeratorService.get_moderator_status(self.focus_group_id) - print(f"🔍 Moderator status: {moderator_status}") - current_item = None + if moderator_status and 'moderator_position' in moderator_status: focus_group = FocusGroup.find_by_id(self.focus_group_id) if focus_group: @@ -810,12 +803,8 @@ class AutonomousConversationController: item_type = pos.get('item_type', 'activity') subsection_idx = pos.get('subsection_index') - print(f"🔍 Position: section_idx={section_idx}, item_idx={item_idx}, item_type={item_type}, subsection_idx={subsection_idx}") - print(f"🔍 Total sections: {len(sections)}") - if section_idx < len(sections): section = sections[section_idx] - print(f"🔍 Section found: {section.get('title', 'No title')}") # Get current item from subsection or section if subsection_idx is not None and section.get('subsections'): @@ -831,39 +820,22 @@ class AutonomousConversationController: if item_idx < len(items): current_item = items[item_idx] - # Check if item has an image attached (any item type) - print(f"🔍 Item to check: {current_item}") + # Check if current item has visual asset metadata if current_item: - print(f"🔍 Item type: {current_item.get('type')}") - - # Try to get asset info from metadata (new metadata-driven approach) - asset_filename = None - display_reference = None + print(f"🔍 Current item: {current_item.get('content', '')[:50]}...") metadata = current_item.get('metadata', {}) visual_asset = metadata.get('visual_asset') if visual_asset: - # Use metadata (preferred method) + # Found image in metadata - use it asset_filename = visual_asset.get('filename') display_reference = visual_asset.get('display_reference') - print(f"🔍 Found asset metadata: {display_reference} -> {asset_filename}") - else: - # Fallback to content parsing (legacy support) - activity_content = current_item.get('content', '') - asset_filename = extract_asset_filename_from_content(activity_content) - print(f"🔍 Legacy asset filename extraction: {asset_filename}") - - if asset_filename: - print(f"🔍 Item with image found! Type: {current_item.get('type')}") - print(f"🔍 Asset: {display_reference or 'legacy'} -> {asset_filename}") + + print(f"🎨 Found image in current item metadata: {display_reference} -> {asset_filename}") attached_assets = [asset_filename] activates_visual_context = True - self.logger.info(f"🎨 Detected creative review activity - will activate visual asset: {asset_filename}") - print(f"🎨 MODERATOR MESSAGE: Activating visual context for asset: {asset_filename}") - print(f"🎨 Activity content: {activity_content}") - print(f"🎨 Original moderator message: {content}") # Generate AI description and enhance the content try: @@ -887,28 +859,47 @@ class AutonomousConversationController: content = enhanced_content print(f"✅ AI MODE: Enhanced moderator message with image description") - print(f"🔍 Enhanced message: {content}") except ImageDescriptionError as desc_error: print(f"⚠️ AI MODE: Failed to generate image description: {desc_error}") self.logger.warning(f"Failed to generate image description in autonomous mode: {desc_error}") # Continue with original content else: - self.logger.warning(f"Creative review activity found but no asset filename detected in content: {activity_content}") - + # No visual asset metadata, try legacy content parsing + activity_content = current_item.get('content', '') + asset_filename = extract_asset_filename_from_content(activity_content) + + if asset_filename: + print(f"🔍 Legacy: Found asset filename in content: {asset_filename}") + attached_assets = [asset_filename] + activates_visual_context = True + else: + print(f"🔍 No image attachments found for current item") + else: + print(f"🔍 No current discussion guide item found") except Exception as e: self.logger.warning(f"Error checking for creative review activity: {e}") print(f"⚠️ Error checking creative review: {e}") print(f"🔍 FINAL RESULT: attached_assets={attached_assets}, activates_visual_context={activates_visual_context}") + # Create visual asset metadata for frontend display + visual_asset_metadata = None + if activates_visual_context and attached_assets and len(attached_assets) > 0: + # Create visual asset metadata that frontend expects + visual_asset_metadata = { + "filename": attached_assets[0], # Use first asset + "displayReference": display_reference or attached_assets[0] # Use display reference or filename as fallback + } + # Create message data with visual context information message_data = { "text": content, "type": message_type, "senderId": "moderator", "attached_assets": attached_assets, - "activates_visual_context": activates_visual_context + "activates_visual_context": activates_visual_context, + "visual_asset": visual_asset_metadata # Frontend needs this for image display } message_id = FocusGroup.add_message(self.focus_group_id, message_data) @@ -916,19 +907,11 @@ class AutonomousConversationController: # GPT-5 fix: Yield after database write to flush WebSocket events await self._yield_to_eventlet() + # Visual context activation is handled automatically by FocusGroup.add_message() + # when activates_visual_context=True and attached_assets are present if activates_visual_context and attached_assets: - # Actually activate the visual assets in the focus group for LLM context - try: - success = FocusGroup._activate_visual_assets(self.focus_group_id, attached_assets, message_id) - if success: - self.logger.info(f"✅ Added moderator message with visual context activation: {attached_assets}") - print(f"✅ VISUAL CONTEXT ACTIVATED: {attached_assets}") - else: - self.logger.warning(f"⚠️ Failed to activate visual context for: {attached_assets}") - print(f"⚠️ Failed to activate visual context for: {attached_assets}") - except Exception as activation_error: - self.logger.error(f"⚠️ Error activating visual context: {activation_error}") - print(f"⚠️ Error activating visual context: {activation_error}") + self.logger.info(f"✅ Added moderator message with visual context activation: {attached_assets}") + print(f"✅ VISUAL CONTEXT ACTIVATED: {attached_assets}") return message_id diff --git a/dist/assets/index-BLNu9bos.css b/dist/assets/index-BLNu9bos.css deleted file mode 100644 index c1f3a48d..00000000 --- a/dist/assets/index-BLNu9bos.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap";.back-button{position:absolute;top:1.25rem;left:1.25rem;z-index:10;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:9999px;background-color:#fffc;border:1px solid rgba(0,0,0,.1);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:all .15s ease}.back-button:hover{background-color:#ffffffe6;transform:translateY(-1px);box-shadow:0 2px 4px #0000000d}.back-button:active{transform:translateY(0)}.back-button-content{display:flex;align-items:center;gap:.25rem}.page-header-with-back{display:flex;align-items:center;gap:.75rem;padding-left:2.5rem;position:relative}*,: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: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 350 30% 98%;--foreground: 345 30% 15%;--card: 0 0% 100%;--card-foreground: 345 30% 15%;--popover: 0 0% 100%;--popover-foreground: 345 30% 15%;--primary: 350 85% 80%;--primary-foreground: 350 30% 20%;--secondary: 350 30% 96.1%;--secondary-foreground: 345 30% 15%;--muted: 350 30% 96.1%;--muted-foreground: 350 10% 50%;--accent: 350 30% 96.1%;--accent-foreground: 345 30% 15%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 350 30% 98%;--border: 350 30% 91.4%;--input: 350 30% 91.4%;--ring: 350 85% 80%;--radius: .5rem;--sidebar-background: 0 0% 100%;--sidebar-foreground: 345 30% 15%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 20%;--sidebar-accent: 350 30% 96.1%;--sidebar-accent-foreground: 345 30% 15%;--sidebar-border: 350 30% 91.4%;--sidebar-ring: 350 85% 80%}.dark{--background: 345 30% 10%;--foreground: 350 30% 98%;--card: 345 30% 10%;--card-foreground: 350 30% 98%;--popover: 345 30% 10%;--popover-foreground: 350 30% 98%;--primary: 350 85% 80%;--primary-foreground: 345 30% 15%;--secondary: 342 20% 17.5%;--secondary-foreground: 350 30% 98%;--muted: 342 20% 17.5%;--muted-foreground: 350 10% 70%;--accent: 342 20% 17.5%;--accent-foreground: 350 30% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 350 30% 98%;--border: 342 20% 17.5%;--input: 342 20% 17.5%;--ring: 350 70% 85%;--sidebar-background: 345 30% 10%;--sidebar-foreground: 350 30% 98%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 98%;--sidebar-accent: 342 20% 17.5%;--sidebar-accent-foreground: 350 30% 98%;--sidebar-border: 342 20% 17.5%;--sidebar-ring: 350 70% 85%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));font-family:Inter,system-ui,sans-serif;color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;background-color:hsl(var(--muted-foreground) / .4)}::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--muted-foreground) / .6)}@font-face{font-family:SF Pro Display;src:local("SF Pro Display"),local("SFProDisplay"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Medium"),local("SFProDisplay-Medium"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Semibold"),local("SFProDisplay-Semibold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Bold"),local("SFProDisplay-Bold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff) format("woff");font-weight:700;font-style:normal}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.glass-card{border-width:1px;border-color:#fff3;background-color:#fffc;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.glass-panel{border-width:1px;border-color:#fff6;background-color:#ffffffe6;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #f9a8d4 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.hover-transition{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1)}.button-transition{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.sidebar-icon{margin-right:.75rem;margin-top:.125rem;height:1rem;width:1rem;flex-shrink:0;--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.sidebar-section{display:flex;align-items:flex-start}.sidebar-sub-item{font-size:.875rem;line-height:1.25rem;color:hsl(var(--muted-foreground))}.persona-card{position:relative;overflow:hidden;min-height:360px}.persona-card-overlay{pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.persona-card:hover .persona-card-overlay,.persona-card.selected .persona-card-overlay{background-color:#ecd1de4d}.persona-card-checkmark{position:absolute;top:.75rem;left:.75rem;z-index:20;opacity:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1);border-radius:9999px;border-width:1px;border-color:#fff6;background-color:#ffffffe6;padding:.25rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.persona-card.selected .persona-card-checkmark{opacity:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-12{bottom:-3rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-top-12{top:-3rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[-10rem\]{bottom:-10rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-\[50\%\]{left:50%}.left-\[calc\(50\%\+11rem\)\]{left:calc(50% + 11rem)}.left-\[calc\(50\%-11rem\)\]{left:calc(50% - 11rem)}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-16{top:4rem}.top-2{top:.5rem}.top-20{top:5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[-10rem\]{top:-10rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.col-span-full{grid-column:1 / -1}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-5{margin-right:1.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[1155\/678\]{aspect-ratio:1155/678}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1px\]{height:1px}.h-\[25vh\]{height:25vh}.h-\[450px\]{height:450px}.h-\[70vh\]{height:70vh}.h-\[calc\(100vh-12rem\)\]{height:calc(100vh - 12rem)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-\[100px\]{min-height:100px}.min-h-\[40px\]{min-height:40px}.min-h-\[60px\]{min-height:60px}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-5\/6{width:83.333333%}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[100px\]{width:100px}.w-\[1px\]{width:1px}.w-\[350px\]{width:350px}.w-\[36\.125rem\]{width:36.125rem}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-32{min-width:8rem}.min-w-36{min-width:9rem}.min-w-5{min-width:1.25rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[400px\]{max-width:400px}.max-w-\[70\%\]{max-width:70%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;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))}.-translate-x-px{--tw-translate-x: -1px;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))}.-translate-y-1\/2{--tw-translate-y: -50%;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))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;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))}.translate-x-px{--tw-translate-x: 1px;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))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;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))}.rotate-45{--tw-rotate: 45deg;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))}.rotate-90{--tw-rotate: 90deg;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))}.rotate-\[30deg\]{--tw-rotate: 30deg;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))}.transform{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))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .5s ease-out}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}.animate-float{animation:float 3s ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.border-\[\#0078d4\]{--tw-border-opacity: 1;border-color:rgb(0 120 212 / var(--tw-border-opacity, 1))}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-200\/80{border-color:#e2e8f0cc}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-l-green-500{--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-l-primary{border-left-color:hsl(var(--primary))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[\#0078d4\]{--tw-bg-opacity: 1;background-color:rgb(0 120 212 / var(--tw-bg-opacity, 1))}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-50\/50{background-color:#eff6ff80}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-foreground{background-color:hsl(var(--foreground))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-900\/10{background-color:#1118271a}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(251 207 232 / var(--tw-bg-opacity, 1))}.bg-pink-300{--tw-bg-opacity: 1;background-color:rgb(249 168 212 / var(--tw-bg-opacity, 1))}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--tw-gradient-stops))}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position);--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-100{--tw-gradient-from: #f3f4f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(243 244 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary{--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position)}.to-blue-400\/5{--tw-gradient-to: rgb(96 165 250 / .05) var(--tw-gradient-to-position)}.to-gray-200{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.to-primary{--tw-gradient-to: hsl(var(--primary)) var(--tw-gradient-to-position)}.to-slate-50{--tw-gradient-to: #f8fafc var(--tw-gradient-to-position)}.fill-amber-400{fill:#fbbf24}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:Inter,system-ui,sans-serif}.font-sf{font-family:SF Pro Display,system-ui,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.8rem\]{font-size:.8rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-8{line-height:2rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-\[0_-2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 -2px 4px rgba(0,0,0,.05);--tw-shadow-colored: 0 -2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity, 1))}.ring-gray-900\/10{--tw-ring-color: rgb(17 24 39 / .1)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@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))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.fade-in-80{--tw-enter-opacity: .8}.zoom-in-95{--tw-enter-scale: .95}.duration-1000{animation-duration:1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.running{animation-play-state:running}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-slate-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-500::placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;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))}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:pb-0:last-child{padding-bottom:0}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.hover\:translate-y-\[-2px\]:hover{--tw-translate-y: -2px;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))}.hover\:translate-y-\[-4px\]:hover{--tw-translate-y: -4px;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))}.hover\:border-\[\#106ebe\]:hover{--tw-border-opacity: 1;border-color:rgb(16 110 190 / var(--tw-border-opacity, 1))}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#106ebe\]:hover{--tw-bg-opacity: 1;background-color:rgb(16 110 190 / var(--tw-bg-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50\/50:hover{background-color:#f9fafb80}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-300:hover{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-gray-900\/20:hover{--tw-ring-color: rgb(17 24 39 / .2)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary:focus{--tw-ring-color: hsl(var(--primary))}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\: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);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\: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);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-slate-950:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(2 6 23 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.toast .group-\[\.toast\]\:absolute{position:absolute}.group.toast .group-\[\.toast\]\:left-3{left:.75rem}.group.toast .group-\[\.toast\]\:top-3{top:.75rem}.group.toast .group-\[\.toast\]\:h-5{height:1.25rem}.group.toast .group-\[\.toast\]\:w-5{width:1.25rem}.group.toast .group-\[\.toast\]\:rounded-md{border-radius:calc(var(--radius) - 2px)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.toast .group-\[\.toast\]\:p-1{padding:.25rem}.group.toaster .group-\[\.toaster\]\:pr-8{padding-right:2rem}.group.toast .group-\[\.toast\]\:text-foreground\/70{color:hsl(var(--foreground) / .7)}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toast .group-\[\.toast\]\:opacity-100{opacity:1}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.toast .group-\[\.toast\]\:transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.group.toast .hover\:group-\[\.toast\]\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.group.toast .hover\:group-\[\.toast\]\:text-foreground:hover{color:hsl(var(--foreground))}.group.toast .focus\:group-\[\.toast\]\:opacity-100:focus{opacity:1}.group.toast .focus\:group-\[\.toast\]\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.group.toast .focus\:group-\[\.toast\]\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group.toast .focus\:group-\[\.toast\]\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.has-\[\:disabled\]\:opacity-50:has(:disabled){opacity:.5}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.aria-selected\:opacity-30[aria-selected=true]{opacity:.3}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;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))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;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))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;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))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;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))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;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))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;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))}.data-\[state\=open\]\:rotate-90[data-state=open]{--tw-rotate: 90deg;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))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed],.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;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))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;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))}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;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))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180,.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;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))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:from-gray-900:is(.dark *){--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-gray-800:is(.dark *){--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:bottom-\[-20rem\]{bottom:-20rem}.sm\:left-\[calc\(50\%\+30rem\)\]{left:calc(50% + 30rem)}.sm\:left-\[calc\(50\%-30rem\)\]{left:calc(50% - 30rem)}.sm\:top-\[-20rem\]{top:-20rem}.sm\:mt-0{margin-top:0}.sm\:mt-24{margin-top:6rem}.sm\:flex{display:flex}.sm\:w-\[72\.1875rem\]{width:72.1875rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:.625rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-32{padding-top:8rem;padding-bottom:8rem}.sm\:text-left{text-align:left}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-6xl{font-size:3.75rem;line-height:1}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-64{width:16rem}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:border-l{border-left-width:1px}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-0{margin-left:0;margin-right:0}.lg\:mt-0{margin-top:0}.lg\:flex{display:flex}.lg\:w-64{width:16rem}.lg\:flex-auto{flex:1 1 auto}.lg\:flex-shrink-0{flex-shrink:0}.lg\:flex-grow{flex-grow:1}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:gap-x-10{-moz-column-gap:2.5rem;column-gap:2.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-40{padding-top:10rem;padding-bottom:10rem}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;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))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;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))}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;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))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/dist/assets/index-BgDz3VL9.js b/dist/assets/index-BgDz3VL9.js deleted file mode 100644 index 21be3941..00000000 --- a/dist/assets/index-BgDz3VL9.js +++ /dev/null @@ -1,715 +0,0 @@ -var uk=t=>{throw TypeError(t)};var nS=(t,e,n)=>e.has(t)||uk("Cannot "+n);var ge=(t,e,n)=>(nS(t,e,"read from private field"),n?n.call(t):e.get(t)),pn=(t,e,n)=>e.has(t)?uk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),zt=(t,e,n,r)=>(nS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Qr=(t,e,n)=>(nS(t,e,"access private method"),n);var Bg=(t,e,n,r)=>({set _(i){zt(t,e,i,n)},get _(){return ge(t,e,r)}});function HW(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Hg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Q$={exports:{}},Kb={},X$={exports:{}},Yt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var lg=Symbol.for("react.element"),zW=Symbol.for("react.portal"),VW=Symbol.for("react.fragment"),GW=Symbol.for("react.strict_mode"),KW=Symbol.for("react.profiler"),WW=Symbol.for("react.provider"),qW=Symbol.for("react.context"),YW=Symbol.for("react.forward_ref"),QW=Symbol.for("react.suspense"),XW=Symbol.for("react.memo"),JW=Symbol.for("react.lazy"),dk=Symbol.iterator;function ZW(t){return t===null||typeof t!="object"?null:(t=dk&&t[dk]||t["@@iterator"],typeof t=="function"?t:null)}var J$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z$=Object.assign,eL={};function kf(t,e,n){this.props=t,this.context=e,this.refs=eL,this.updater=n||J$}kf.prototype.isReactComponent={};kf.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};kf.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function tL(){}tL.prototype=kf.prototype;function xj(t,e,n){this.props=t,this.context=e,this.refs=eL,this.updater=n||J$}var bj=xj.prototype=new tL;bj.constructor=xj;Z$(bj,kf.prototype);bj.isPureReactComponent=!0;var fk=Array.isArray,nL=Object.prototype.hasOwnProperty,wj={current:null},rL={key:!0,ref:!0,__self:!0,__source:!0};function iL(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)nL.call(e,r)&&!rL.hasOwnProperty(r)&&(i[r]=e[r]);var c=arguments.length-2;if(c===1)i.children=n;else if(1>>1,J=R[q];if(0>>1;qi(oe,Y))sei(le,oe)?(R[q]=le,R[se]=Y,q=se):(R[q]=oe,R[F]=Y,q=F);else if(sei(le,Y))R[q]=le,R[se]=Y,q=se;else break e}}return L}function i(R,L){var Y=R.sortIndex-L.sortIndex;return Y!==0?Y:R.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var l=[],u=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(R){for(var L=n(u);L!==null;){if(L.callback===null)r(u);else if(L.startTime<=R)r(u),L.sortIndex=L.expirationTime,e(l,L);else break;L=n(u)}}function S(R){if(m=!1,w(R),!g)if(n(l)!==null)g=!0,D(C);else{var L=n(u);L!==null&&B(S,L.startTime-R)}}function C(R,L){g=!1,m&&(m=!1,b(j),j=-1),p=!0;var Y=h;try{for(w(L),f=n(l);f!==null&&(!(f.expirationTime>L)||R&&!I());){var q=f.callback;if(typeof q=="function"){f.callback=null,h=f.priorityLevel;var J=q(f.expirationTime<=L);L=t.unstable_now(),typeof J=="function"?f.callback=J:f===n(l)&&r(l),w(L)}else r(l);f=n(l)}if(f!==null)var me=!0;else{var F=n(u);F!==null&&B(S,F.startTime-L),me=!1}return me}finally{f=null,h=Y,p=!1}}var _=!1,A=null,j=-1,T=5,k=-1;function I(){return!(t.unstable_now()-kR||125q?(R.sortIndex=Y,e(u,R),n(l)===null&&R===n(u)&&(m?(b(j),j=-1):m=!0,B(S,Y-q))):(R.sortIndex=J,e(l,R),g||p||(g=!0,D(C))),R},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(R){var L=h;return function(){var Y=h;h=L;try{return R.apply(this,arguments)}finally{h=Y}}}})(uL);lL.exports=uL;var uq=lL.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var dq=y,is=uq;function Ce(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),MC=Object.prototype.hasOwnProperty,fq=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,pk={},mk={};function hq(t){return MC.call(mk,t)?!0:MC.call(pk,t)?!1:fq.test(t)?mk[t]=!0:(pk[t]=!0,!1)}function pq(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function mq(t,e,n,r){if(e===null||typeof e>"u"||pq(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ci(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Wr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Wr[t]=new Ci(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Wr[e]=new Ci(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Wr[t]=new Ci(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Wr[t]=new Ci(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Wr[t]=new Ci(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Wr[t]=new Ci(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Wr[t]=new Ci(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Wr[t]=new Ci(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Wr[t]=new Ci(t,5,!1,t.toLowerCase(),null,!1,!1)});var Cj=/[\-:]([a-z])/g;function _j(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Cj,_j);Wr[e]=new Ci(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Cj,_j);Wr[e]=new Ci(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Cj,_j);Wr[e]=new Ci(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Wr[t]=new Ci(t,1,!1,t.toLowerCase(),null,!1,!1)});Wr.xlinkHref=new Ci("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Wr[t]=new Ci(t,1,!1,t.toLowerCase(),null,!0,!0)});function Aj(t,e,n,r){var i=Wr.hasOwnProperty(e)?Wr[e]:null;(i!==null?i.type!==0:r||!(2c||i[o]!==s[c]){var l=` -`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=c);break}}}finally{sS=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Fh(t):""}function gq(t){switch(t.tag){case 5:return Fh(t.type);case 16:return Fh("Lazy");case 13:return Fh("Suspense");case 19:return Fh("SuspenseList");case 0:case 2:case 15:return t=oS(t.type,!1),t;case 11:return t=oS(t.type.render,!1),t;case 1:return t=oS(t.type,!0),t;default:return""}}function FC(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Zu:return"Fragment";case Ju:return"Portal";case DC:return"Profiler";case jj:return"StrictMode";case $C:return"Suspense";case LC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case hL:return(t.displayName||"Context")+".Consumer";case fL:return(t._context.displayName||"Context")+".Provider";case Ej:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Nj:return e=t.displayName||null,e!==null?e:FC(t.type)||"Memo";case ic:e=t._payload,t=t._init;try{return FC(t(e))}catch{}}return null}function vq(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return FC(e);case 8:return e===jj?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Kc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function mL(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function yq(t){var e=mL(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Gg(t){t._valueTracker||(t._valueTracker=yq(t))}function gL(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=mL(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function my(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function UC(t,e){var n=e.checked;return Yn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function vk(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Kc(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function vL(t,e){e=e.checked,e!=null&&Aj(t,"checked",e,!1)}function BC(t,e){vL(t,e);var n=Kc(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?HC(t,e.type,n):e.hasOwnProperty("defaultValue")&&HC(t,e.type,Kc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function yk(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function HC(t,e,n){(e!=="number"||my(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Uh=Array.isArray;function md(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Kg.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ap(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Zh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xq=["Webkit","ms","Moz","O"];Object.keys(Zh).forEach(function(t){xq.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Zh[e]=Zh[t]})});function wL(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Zh.hasOwnProperty(t)&&Zh[t]?(""+e).trim():e+"px"}function SL(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=wL(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var bq=Yn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function GC(t,e){if(e){if(bq[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function KC(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var WC=null;function Tj(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var qC=null,gd=null,vd=null;function wk(t){if(t=fg(t)){if(typeof qC!="function")throw Error(Ce(280));var e=t.stateNode;e&&(e=Xb(e),qC(t.stateNode,t.type,e))}}function CL(t){gd?vd?vd.push(t):vd=[t]:gd=t}function _L(){if(gd){var t=gd,e=vd;if(vd=gd=null,wk(t),e)for(t=0;t>>=0,t===0?32:31-(kq(t)/Oq|0)|0}var Wg=64,qg=4194304;function Bh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function xy(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var c=o&~i;c!==0?r=Bh(c):(s&=o,s!==0&&(r=Bh(s)))}else o=n&~i,o!==0?r=Bh(o):s!==0&&(r=Bh(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ug(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Xs(e),t[e]=n}function Dq(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=tp),Pk=" ",kk=!1;function VL(t,e){switch(t){case"keyup":return u7.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GL(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ed=!1;function f7(t,e){switch(t){case"compositionend":return GL(e);case"keypress":return e.which!==32?null:(kk=!0,Pk);case"textInput":return t=e.data,t===Pk&&kk?null:t;default:return null}}function h7(t,e){if(ed)return t==="compositionend"||!$j&&VL(t,e)?(t=HL(),Bv=Rj=xc=null,ed=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mk(n)}}function YL(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?YL(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function QL(){for(var t=window,e=my();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=my(t.document)}return e}function Lj(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function S7(t){var e=QL(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&YL(n.ownerDocument.documentElement,n)){if(r!==null&&Lj(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=Dk(n,s);var o=Dk(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,td=null,e_=null,rp=null,t_=!1;function $k(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;t_||td==null||td!==my(r)||(r=td,"selectionStart"in r&&Lj(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),rp&&kp(rp,r)||(rp=r,r=Sy(e_,"onSelect"),0id||(t.current=a_[id],a_[id]=null,id--)}function Pn(t,e){id++,a_[id]=t.current,t.current=e}var Wc={},oi=cl(Wc),Oi=cl(!1),su=Wc;function Vd(t,e){var n=t.type.contextTypes;if(!n)return Wc;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ii(t){return t=t.childContextTypes,t!=null}function _y(){Fn(Oi),Fn(oi)}function Vk(t,e,n){if(oi.current!==Wc)throw Error(Ce(168));Pn(oi,e),Pn(Oi,n)}function sF(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ce(108,vq(t)||"Unknown",i));return Yn({},n,r)}function Ay(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Wc,su=oi.current,Pn(oi,t),Pn(Oi,Oi.current),!0}function Gk(t,e,n){var r=t.stateNode;if(!r)throw Error(Ce(169));n?(t=sF(t,e,su),r.__reactInternalMemoizedMergedChildContext=t,Fn(Oi),Fn(oi),Pn(oi,t)):Fn(Oi),Pn(Oi,n)}var pa=null,Jb=!1,bS=!1;function oF(t){pa===null?pa=[t]:pa.push(t)}function R7(t){Jb=!0,oF(t)}function ll(){if(!bS&&pa!==null){bS=!0;var t=0,e=xn;try{var n=pa;for(xn=1;t>=o,i-=o,va=1<<32-Xs(e)+i|n<j?(T=A,A=null):T=A.sibling;var k=h(b,A,w[j],S);if(k===null){A===null&&(A=T);break}t&&A&&k.alternate===null&&e(b,A),x=s(k,x,j),_===null?C=k:_.sibling=k,_=k,A=T}if(j===w.length)return n(b,A),zn&&_l(b,j),C;if(A===null){for(;jj?(T=A,A=null):T=A.sibling;var I=h(b,A,k.value,S);if(I===null){A===null&&(A=T);break}t&&A&&I.alternate===null&&e(b,A),x=s(I,x,j),_===null?C=I:_.sibling=I,_=I,A=T}if(k.done)return n(b,A),zn&&_l(b,j),C;if(A===null){for(;!k.done;j++,k=w.next())k=f(b,k.value,S),k!==null&&(x=s(k,x,j),_===null?C=k:_.sibling=k,_=k);return zn&&_l(b,j),C}for(A=r(b,A);!k.done;j++,k=w.next())k=p(A,b,j,k.value,S),k!==null&&(t&&k.alternate!==null&&A.delete(k.key===null?j:k.key),x=s(k,x,j),_===null?C=k:_.sibling=k,_=k);return t&&A.forEach(function(E){return e(b,E)}),zn&&_l(b,j),C}function v(b,x,w,S){if(typeof w=="object"&&w!==null&&w.type===Zu&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Vg:e:{for(var C=w.key,_=x;_!==null;){if(_.key===C){if(C=w.type,C===Zu){if(_.tag===7){n(b,_.sibling),x=i(_,w.props.children),x.return=b,b=x;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ic&&qk(C)===_.type){n(b,_.sibling),x=i(_,w.props),x.ref=xh(b,_,w),x.return=b,b=x;break e}n(b,_);break}else e(b,_);_=_.sibling}w.type===Zu?(x=Ql(w.props.children,b.mode,S,w.key),x.return=b,b=x):(S=Yv(w.type,w.key,w.props,null,b.mode,S),S.ref=xh(b,x,w),S.return=b,b=S)}return o(b);case Ju:e:{for(_=w.key;x!==null;){if(x.key===_)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(b,x.sibling),x=i(x,w.children||[]),x.return=b,b=x;break e}else{n(b,x);break}else e(b,x);x=x.sibling}x=NS(w,b.mode,S),x.return=b,b=x}return o(b);case ic:return _=w._init,v(b,x,_(w._payload),S)}if(Uh(w))return g(b,x,w,S);if(ph(w))return m(b,x,w,S);tv(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(b,x.sibling),x=i(x,w),x.return=b,b=x):(n(b,x),x=ES(w,b.mode,S),x.return=b,b=x),o(b)):n(b,x)}return v}var Kd=uF(!0),dF=uF(!1),Ny=cl(null),Ty=null,ad=null,Hj=null;function zj(){Hj=ad=Ty=null}function Vj(t){var e=Ny.current;Fn(Ny),t._currentValue=e}function u_(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function xd(t,e){Ty=t,Hj=ad=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Pi=!0),t.firstContext=null)}function Es(t){var e=t._currentValue;if(Hj!==t)if(t={context:t,memoizedValue:e,next:null},ad===null){if(Ty===null)throw Error(Ce(308));ad=t,Ty.dependencies={lanes:0,firstContext:t}}else ad=ad.next=t;return e}var Ol=null;function Gj(t){Ol===null?Ol=[t]:Ol.push(t)}function fF(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Gj(e)):(n.next=i.next,i.next=n),e.interleaved=n,Oa(t,r)}function Oa(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var sc=!1;function Kj(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hF(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Aa(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Tc(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,sn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Oa(t,n)}return i=r.interleaved,i===null?(e.next=e,Gj(r)):(e.next=i.next,i.next=e),r.interleaved=e,Oa(t,n)}function zv(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,kj(t,n)}}function Yk(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Py(t,e,n,r){var i=t.updateQueue;sc=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,c=i.shared.pending;if(c!==null){i.shared.pending=null;var l=c,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==o&&(c===null?d.firstBaseUpdate=u:c.next=u,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,d=u=l=null,c=s;do{var h=c.lane,p=c.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var g=t,m=c;switch(h=e,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=Yn({},f,h);break e;case 2:sc=!0}}c.callback!==null&&c.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[c]:h.push(c))}else p={eventTime:p,lane:h,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,o|=h;if(c=c.next,c===null){if(c=i.shared.pending,c===null)break;h=c,c=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);cu|=o,t.lanes=o,t.memoizedState=f}}function Qk(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=SS.transition;SS.transition={};try{t(!1),e()}finally{xn=n,SS.transition=r}}function PF(){return Ns().memoizedState}function L7(t,e,n){var r=kc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},kF(t))OF(e,n);else if(n=fF(t,e,n,r),n!==null){var i=bi();Js(n,t,r,i),IF(n,e,r)}}function F7(t,e,n){var r=kc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(kF(t))OF(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,c=s(o,n);if(i.hasEagerState=!0,i.eagerState=c,oo(c,o)){var l=e.interleaved;l===null?(i.next=i,Gj(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=fF(t,e,i,r),n!==null&&(i=bi(),Js(n,t,r,i),IF(n,e,r))}}function kF(t){var e=t.alternate;return t===qn||e!==null&&e===qn}function OF(t,e){ip=Oy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function IF(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,kj(t,n)}}var Iy={readContext:Es,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useInsertionEffect:Xr,useLayoutEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useMutableSource:Xr,useSyncExternalStore:Xr,useId:Xr,unstable_isNewReconciler:!1},U7={readContext:Es,useCallback:function(t,e){return _o().memoizedState=[t,e===void 0?null:e],t},useContext:Es,useEffect:Jk,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Gv(4194308,4,AF.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Gv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Gv(4,2,t,e)},useMemo:function(t,e){var n=_o();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=_o();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=L7.bind(null,qn,t),[r.memoizedState,t]},useRef:function(t){var e=_o();return t={current:t},e.memoizedState=t},useState:Xk,useDebugValue:eE,useDeferredValue:function(t){return _o().memoizedState=t},useTransition:function(){var t=Xk(!1),e=t[0];return t=$7.bind(null,t[1]),_o().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=qn,i=_o();if(zn){if(n===void 0)throw Error(Ce(407));n=n()}else{if(n=e(),Lr===null)throw Error(Ce(349));au&30||vF(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Jk(xF.bind(null,r,s,t),[t]),r.flags|=2048,Fp(9,yF.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=_o(),e=Lr.identifierPrefix;if(zn){var n=ya,r=va;n=(r&~(1<<32-Xs(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=$p++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[ko]=e,t[Rp]=r,zF(t,e,!1,!1),e.stateNode=t;e:{switch(o=KC(n,r),n){case"dialog":On("cancel",t),On("close",t),i=r;break;case"iframe":case"object":case"embed":On("load",t),i=r;break;case"video":case"audio":for(i=0;iYd&&(e.flags|=128,r=!0,bh(s,!1),e.lanes=4194304)}else{if(!r)if(t=ky(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),bh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!zn)return Jr(e),null}else 2*sr()-s.renderingStartTime>Yd&&n!==1073741824&&(e.flags|=128,r=!0,bh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=sr(),e.sibling=null,n=Wn.current,Pn(Wn,r?n&1|2:n&1),e):(Jr(e),null);case 22:case 23:return oE(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Wi&1073741824&&(Jr(e),e.subtreeFlags&6&&(e.flags|=8192)):Jr(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function q7(t,e){switch(Uj(e),e.tag){case 1:return Ii(e.type)&&_y(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Wd(),Fn(Oi),Fn(oi),Yj(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return qj(e),null;case 13:if(Fn(Wn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Gd()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Fn(Wn),null;case 4:return Wd(),null;case 10:return Vj(e.type._context),null;case 22:case 23:return oE(),null;case 24:return null;default:return null}}var rv=!1,ri=!1,Y7=typeof WeakSet=="function"?WeakSet:Set,Ye=null;function cd(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Zn(t,e,r)}else n.current=null}function x_(t,e,n){try{n()}catch(r){Zn(t,e,r)}}var lO=!1;function Q7(t,e){if(n_=by,t=QL(),Lj(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,c=-1,l=-1,u=0,d=0,f=t,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(c=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===t)break t;if(h===n&&++u===i&&(c=o),h===s&&++d===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(r_={focusedElem:t,selectionRange:n},by=!1,Ye=e;Ye!==null;)if(e=Ye,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ye=t;else for(;Ye!==null;){e=Ye;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,b=e.stateNode,x=b.getSnapshotBeforeUpdate(e.elementType===e.type?m:Fs(e.type,m),v);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(S){Zn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,Ye=t;break}Ye=e.return}return g=lO,lO=!1,g}function sp(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&x_(e,n,s)}i=i.next}while(i!==r)}}function t0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function b_(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function KF(t){var e=t.alternate;e!==null&&(t.alternate=null,KF(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ko],delete e[Rp],delete e[o_],delete e[O7],delete e[I7])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function WF(t){return t.tag===5||t.tag===3||t.tag===4}function uO(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||WF(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function w_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Cy));else if(r!==4&&(t=t.child,t!==null))for(w_(t,e,n),t=t.sibling;t!==null;)w_(t,e,n),t=t.sibling}function S_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(S_(t,e,n),t=t.sibling;t!==null;)S_(t,e,n),t=t.sibling}var zr=null,Hs=!1;function Xa(t,e,n){for(n=n.child;n!==null;)qF(t,e,n),n=n.sibling}function qF(t,e,n){if(Lo&&typeof Lo.onCommitFiberUnmount=="function")try{Lo.onCommitFiberUnmount(Wb,n)}catch{}switch(n.tag){case 5:ri||cd(n,e);case 6:var r=zr,i=Hs;zr=null,Xa(t,e,n),zr=r,Hs=i,zr!==null&&(Hs?(t=zr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):zr.removeChild(n.stateNode));break;case 18:zr!==null&&(Hs?(t=zr,n=n.stateNode,t.nodeType===8?xS(t.parentNode,n):t.nodeType===1&&xS(t,n),Tp(t)):xS(zr,n.stateNode));break;case 4:r=zr,i=Hs,zr=n.stateNode.containerInfo,Hs=!0,Xa(t,e,n),zr=r,Hs=i;break;case 0:case 11:case 14:case 15:if(!ri&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&x_(n,e,o),i=i.next}while(i!==r)}Xa(t,e,n);break;case 1:if(!ri&&(cd(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Zn(n,e,c)}Xa(t,e,n);break;case 21:Xa(t,e,n);break;case 22:n.mode&1?(ri=(r=ri)||n.memoizedState!==null,Xa(t,e,n),ri=r):Xa(t,e,n);break;default:Xa(t,e,n)}}function dO(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Y7),e.forEach(function(r){var i=s9.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ms(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=sr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*J7(r/1960))-r,10t?16:t,bc===null)var r=!1;else{if(t=bc,bc=null,Dy=0,sn&6)throw Error(Ce(331));var i=sn;for(sn|=4,Ye=t.current;Ye!==null;){var s=Ye,o=s.child;if(Ye.flags&16){var c=s.deletions;if(c!==null){for(var l=0;lsr()-iE?Yl(t,0):rE|=n),Ri(t,e)}function n4(t,e){e===0&&(t.mode&1?(e=qg,qg<<=1,!(qg&130023424)&&(qg=4194304)):e=1);var n=bi();t=Oa(t,e),t!==null&&(ug(t,e,n),Ri(t,n))}function i9(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),n4(t,n)}function s9(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Ce(314))}r!==null&&r.delete(e),n4(t,n)}var r4;r4=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Oi.current)Pi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Pi=!1,K7(t,e,n);Pi=!!(t.flags&131072)}else Pi=!1,zn&&e.flags&1048576&&aF(e,Ey,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Kv(t,e),t=e.pendingProps;var i=Vd(e,oi.current);xd(e,n),i=Xj(null,e,r,t,i,n);var s=Jj();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ii(r)?(s=!0,Ay(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Kj(e),i.updater=e0,e.stateNode=i,i._reactInternals=e,f_(e,r,t,n),e=m_(null,e,r,!0,s,n)):(e.tag=0,zn&&s&&Fj(e),fi(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Kv(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=a9(r),t=Fs(r,t),i){case 0:e=p_(null,e,r,t,n);break e;case 1:e=oO(null,e,r,t,n);break e;case 11:e=iO(null,e,r,t,n);break e;case 14:e=sO(null,e,r,Fs(r.type,t),n);break e}throw Error(Ce(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),p_(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),oO(t,e,r,i,n);case 3:e:{if(UF(e),t===null)throw Error(Ce(387));r=e.pendingProps,s=e.memoizedState,i=s.element,hF(t,e),Py(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=qd(Error(Ce(423)),e),e=aO(t,e,r,n,i);break e}else if(r!==i){i=qd(Error(Ce(424)),e),e=aO(t,e,r,n,i);break e}else for(Ji=Nc(e.stateNode.containerInfo.firstChild),Zi=e,zn=!0,Ks=null,n=dF(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gd(),r===i){e=Ia(t,e,n);break e}fi(t,e,r,n)}e=e.child}return e;case 5:return pF(e),t===null&&l_(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,i_(r,i)?o=null:s!==null&&i_(r,s)&&(e.flags|=32),FF(t,e),fi(t,e,o,n),e.child;case 6:return t===null&&l_(e),null;case 13:return BF(t,e,n);case 4:return Wj(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Kd(e,null,r,n):fi(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),iO(t,e,r,i,n);case 7:return fi(t,e,e.pendingProps,n),e.child;case 8:return fi(t,e,e.pendingProps.children,n),e.child;case 12:return fi(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Pn(Ny,r._currentValue),r._currentValue=o,s!==null)if(oo(s.value,o)){if(s.children===i.children&&!Oi.current){e=Ia(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){o=s.child;for(var l=c.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Aa(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),u_(s.return,n,e),c.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ce(341));o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),u_(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}fi(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,xd(e,n),i=Es(i),r=r(i),e.flags|=1,fi(t,e,r,n),e.child;case 14:return r=e.type,i=Fs(r,e.pendingProps),i=Fs(r.type,i),sO(t,e,r,i,n);case 15:return $F(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),Kv(t,e),e.tag=1,Ii(r)?(t=!0,Ay(e)):t=!1,xd(e,n),RF(e,r,i),f_(e,r,i,n),m_(null,e,r,!0,t,n);case 19:return HF(t,e,n);case 22:return LF(t,e,n)}throw Error(Ce(156,e.tag))};function i4(t,e){return kL(t,e)}function o9(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(t,e,n,r){return new o9(t,e,n,r)}function cE(t){return t=t.prototype,!(!t||!t.isReactComponent)}function a9(t){if(typeof t=="function")return cE(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Ej)return 11;if(t===Nj)return 14}return 2}function Oc(t,e){var n=t.alternate;return n===null?(n=Ss(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Yv(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")cE(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Zu:return Ql(n.children,i,s,e);case jj:o=8,i|=8;break;case DC:return t=Ss(12,n,e,i|2),t.elementType=DC,t.lanes=s,t;case $C:return t=Ss(13,n,e,i),t.elementType=$C,t.lanes=s,t;case LC:return t=Ss(19,n,e,i),t.elementType=LC,t.lanes=s,t;case pL:return r0(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case fL:o=10;break e;case hL:o=9;break e;case Ej:o=11;break e;case Nj:o=14;break e;case ic:o=16,r=null;break e}throw Error(Ce(130,t==null?t:typeof t,""))}return e=Ss(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Ql(t,e,n,r){return t=Ss(7,t,r,e),t.lanes=n,t}function r0(t,e,n,r){return t=Ss(22,t,r,e),t.elementType=pL,t.lanes=n,t.stateNode={isHidden:!1},t}function ES(t,e,n){return t=Ss(6,t,null,e),t.lanes=n,t}function NS(t,e,n){return e=Ss(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function c9(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cS(0),this.expirationTimes=cS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cS(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function lE(t,e,n,r,i,s,o,c,l){return t=new c9(t,e,n,c,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ss(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Kj(s),t}function l9(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c4)}catch(t){console.error(t)}}c4(),cL.exports=ss;var Rf=cL.exports;const l4=dn(Rf);var u4,xO=Rf;u4=xO.createRoot,xO.hydrateRoot;var bO=["light","dark"],p9="(prefers-color-scheme: dark)",m9=y.createContext(void 0),g9={setTheme:t=>{},themes:[]},v9=()=>{var t;return(t=y.useContext(m9))!=null?t:g9};y.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:c,nonce:l})=>{let u=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=i?bO.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,m=!1,v=!0)=>{let b=o?o[g]:g,x=m?g+"|| ''":`'${b}'`,w="";return i&&v&&!m&&bO.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?m||b?w+=`c.add(${x})`:w+="null":b&&(w+=`d[s](n,${x})`),w},p=t?`!function(){${d}${h(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${p9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(s,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(s,!1,!1)};}${f}}catch(t){}}();`;return y.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var y9=t=>{switch(t){case"success":return w9;case"info":return C9;case"warning":return S9;case"error":return _9;default:return null}},x9=Array(12).fill(0),b9=({visible:t})=>P.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},P.createElement("div",{className:"sonner-spinner"},x9.map((e,n)=>P.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),w9=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),S9=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},P.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"})),C9=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),_9=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),A9=()=>{let[t,e]=P.useState(document.hidden);return P.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},E_=1,j9=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:E_++,s=this.toasts.find(c=>c.id===i),o=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:n}),{...c,...t,id:i,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0;return r.then(async s=>{if(N9(s)&&!s.ok){i=!1;let o=typeof e.error=="function"?await e.error(`HTTP error! status: ${s.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${s.status}`):e.description;this.create({id:n,type:"error",message:o,description:c})}else if(e.success!==void 0){i=!1;let o=typeof e.success=="function"?await e.success(s):e.success,c=typeof e.description=="function"?await e.description(s):e.description;this.create({id:n,type:"success",message:o,description:c})}}).catch(async s=>{if(e.error!==void 0){i=!1;let o=typeof e.error=="function"?await e.error(s):e.error,c=typeof e.description=="function"?await e.description(s):e.description;this.create({id:n,type:"error",message:o,description:c})}}).finally(()=>{var s;i&&(this.dismiss(n),n=void 0),(s=e.finally)==null||s.call(e)}),n},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||E_++;return this.create({jsx:t(n),id:n,...e}),n},this.subscribers=[],this.toasts=[]}},Ki=new j9,E9=(t,e)=>{let n=(e==null?void 0:e.id)||E_++;return Ki.addToast({title:t,...e,id:n}),n},N9=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",T9=E9,P9=()=>Ki.toasts,ne=Object.assign(T9,{success:Ki.success,info:Ki.info,warning:Ki.warning,error:Ki.error,custom:Ki.custom,message:Ki.message,promise:Ki.promise,dismiss:Ki.dismiss,loading:Ki.loading},{getHistory:P9});function k9(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}k9(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;background:var(--gray1);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}: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:0;right:0;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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--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-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%)} -`);function ov(t){return t.label!==void 0}var O9=3,I9="32px",R9=4e3,M9=356,D9=14,$9=20,L9=200;function F9(...t){return t.filter(Boolean).join(" ")}var U9=t=>{var e,n,r,i,s,o,c,l,u,d;let{invert:f,toast:h,unstyled:p,interacting:g,setHeights:m,visibleToasts:v,heights:b,index:x,toasts:w,expanded:S,removeToast:C,defaultRichColors:_,closeButton:A,style:j,cancelButtonStyle:T,actionButtonStyle:k,className:I="",descriptionClassName:E="",duration:O,position:M,gap:U,loadingIcon:D,expandByDefault:B,classNames:R,icons:L,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:q,cn:J}=t,[me,F]=P.useState(!1),[oe,se]=P.useState(!1),[le,ke]=P.useState(!1),[ue,we]=P.useState(!1),[Ae,ee]=P.useState(0),[wt,et]=P.useState(0),Ct=P.useRef(null),Xe=P.useRef(null),nn=x===0,N=x+1<=v,$=h.type,z=h.dismissible!==!1,G=h.className||"",Q=h.descriptionClassName||"",H=P.useMemo(()=>b.findIndex(at=>at.toastId===h.id)||0,[b,h.id]),Z=P.useMemo(()=>{var at;return(at=h.closeButton)!=null?at:A},[h.closeButton,A]),he=P.useMemo(()=>h.duration||O||R9,[h.duration,O]),xe=P.useRef(0),Oe=P.useRef(0),be=P.useRef(0),We=P.useRef(null),[ot,Rt]=M.split("-"),Ke=P.useMemo(()=>b.reduce((at,Wt,st)=>st>=H?at:at+Wt.height,0),[b,H]),Ze=A9(),_t=h.invert||f,Kt=$==="loading";Oe.current=P.useMemo(()=>H*U+Ke,[H,Ke]),P.useEffect(()=>{F(!0)},[]),P.useLayoutEffect(()=>{if(!me)return;let at=Xe.current,Wt=at.style.height;at.style.height="auto";let st=at.getBoundingClientRect().height;at.style.height=Wt,et(st),m(Je=>Je.find(fn=>fn.toastId===h.id)?Je.map(fn=>fn.toastId===h.id?{...fn,height:st}:fn):[{toastId:h.id,height:st,position:h.position},...Je])},[me,h.title,h.description,m,h.id]);let Qn=P.useCallback(()=>{se(!0),ee(Oe.current),m(at=>at.filter(Wt=>Wt.toastId!==h.id)),setTimeout(()=>{C(h)},L9)},[h,C,m,Oe]);P.useEffect(()=>{if(h.promise&&$==="loading"||h.duration===1/0||h.type==="loading")return;let at,Wt=he;return S||g||q&&Ze?(()=>{if(be.current{var st;(st=h.onAutoClose)==null||st.call(h,h),Qn()},Wt)),()=>clearTimeout(at)},[S,g,B,h,he,Qn,h.promise,$,q,Ze]),P.useEffect(()=>{let at=Xe.current;if(at){let Wt=at.getBoundingClientRect().height;return et(Wt),m(st=>[{toastId:h.id,height:Wt,position:h.position},...st]),()=>m(st=>st.filter(Je=>Je.toastId!==h.id))}},[m,h.id]),P.useEffect(()=>{h.delete&&Qn()},[Qn,h.delete]);function Xt(){return L!=null&&L.loading?P.createElement("div",{className:"sonner-loader","data-visible":$==="loading"},L.loading):D?P.createElement("div",{className:"sonner-loader","data-visible":$==="loading"},D):P.createElement(b9,{visible:$==="loading"})}return P.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Xe,className:J(I,G,R==null?void 0:R.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,R==null?void 0:R.default,R==null?void 0:R[$],(n=h==null?void 0:h.classNames)==null?void 0:n[$]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:_,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":me,"data-promise":!!h.promise,"data-removed":oe,"data-visible":N,"data-y-position":ot,"data-x-position":Rt,"data-index":x,"data-front":nn,"data-swiping":le,"data-dismissible":z,"data-type":$,"data-invert":_t,"data-swipe-out":ue,"data-expanded":!!(S||B&&me),style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${oe?Ae:Oe.current}px`,"--initial-height":B?"auto":`${wt}px`,...j,...h.style},onPointerDown:at=>{Kt||!z||(Ct.current=new Date,ee(Oe.current),at.target.setPointerCapture(at.pointerId),at.target.tagName!=="BUTTON"&&(ke(!0),We.current={x:at.clientX,y:at.clientY}))},onPointerUp:()=>{var at,Wt,st,Je;if(ue||!z)return;We.current=null;let fn=Number(((at=Xe.current)==null?void 0:at.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Is=new Date().getTime()-((Wt=Ct.current)==null?void 0:Wt.getTime()),ra=Math.abs(fn)/Is;if(Math.abs(fn)>=$9||ra>.11){ee(Oe.current),(st=h.onDismiss)==null||st.call(h,h),Qn(),we(!0);return}(Je=Xe.current)==null||Je.style.setProperty("--swipe-amount","0px"),ke(!1)},onPointerMove:at=>{var Wt;if(!We.current||!z)return;let st=at.clientY-We.current.y,Je=at.clientX-We.current.x,fn=(ot==="top"?Math.min:Math.max)(0,st),Is=at.pointerType==="touch"?10:2;Math.abs(fn)>Is?(Wt=Xe.current)==null||Wt.style.setProperty("--swipe-amount",`${st}px`):Math.abs(Je)>Is&&(We.current=null)}},Z&&!h.jsx?P.createElement("button",{"aria-label":Y,"data-disabled":Kt,"data-close-button":!0,onClick:Kt||!z?()=>{}:()=>{var at;Qn(),(at=h.onDismiss)==null||at.call(h,h)},className:J(R==null?void 0:R.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},P.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"},P.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||P.isValidElement(h.title)?h.jsx||h.title:P.createElement(P.Fragment,null,$||h.icon||h.promise?P.createElement("div",{"data-icon":"",className:J(R==null?void 0:R.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Xt():null,h.type!=="loading"?h.icon||(L==null?void 0:L[$])||y9($):null):null,P.createElement("div",{"data-content":"",className:J(R==null?void 0:R.content,(o=h==null?void 0:h.classNames)==null?void 0:o.content)},P.createElement("div",{"data-title":"",className:J(R==null?void 0:R.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},h.title),h.description?P.createElement("div",{"data-description":"",className:J(E,Q,R==null?void 0:R.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),P.isValidElement(h.cancel)?h.cancel:h.cancel&&ov(h.cancel)?P.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||T,onClick:at=>{var Wt,st;ov(h.cancel)&&z&&((st=(Wt=h.cancel).onClick)==null||st.call(Wt,at),Qn())},className:J(R==null?void 0:R.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,P.isValidElement(h.action)?h.action:h.action&&ov(h.action)?P.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||k,onClick:at=>{var Wt,st;ov(h.action)&&(at.defaultPrevented||((st=(Wt=h.action).onClick)==null||st.call(Wt,at),Qn()))},className:J(R==null?void 0:R.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function wO(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var B9=t=>{let{invert:e,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:s,className:o,offset:c,theme:l="light",richColors:u,duration:d,style:f,visibleToasts:h=O9,toastOptions:p,dir:g=wO(),gap:m=D9,loadingIcon:v,icons:b,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:w,cn:S=F9}=t,[C,_]=P.useState([]),A=P.useMemo(()=>Array.from(new Set([n].concat(C.filter(q=>q.position).map(q=>q.position)))),[C,n]),[j,T]=P.useState([]),[k,I]=P.useState(!1),[E,O]=P.useState(!1),[M,U]=P.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=P.useRef(null),B=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=P.useRef(null),L=P.useRef(!1),Y=P.useCallback(q=>{var J;(J=C.find(me=>me.id===q.id))!=null&&J.delete||Ki.dismiss(q.id),_(me=>me.filter(({id:F})=>F!==q.id))},[C]);return P.useEffect(()=>Ki.subscribe(q=>{if(q.dismiss){_(J=>J.map(me=>me.id===q.id?{...me,delete:!0}:me));return}setTimeout(()=>{l4.flushSync(()=>{_(J=>{let me=J.findIndex(F=>F.id===q.id);return me!==-1?[...J.slice(0,me),{...J[me],...q},...J.slice(me+1)]:[q,...J]})})})}),[]),P.useEffect(()=>{if(l!=="system"){U(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:q})=>{U(q?"dark":"light")})},[l]),P.useEffect(()=>{C.length<=1&&I(!1)},[C]),P.useEffect(()=>{let q=J=>{var me,F;r.every(oe=>J[oe]||J.code===oe)&&(I(!0),(me=D.current)==null||me.focus()),J.code==="Escape"&&(document.activeElement===D.current||(F=D.current)!=null&&F.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[r]),P.useEffect(()=>{if(D.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,L.current=!1)}},[D.current]),C.length?P.createElement("section",{"aria-label":`${x} ${B}`,tabIndex:-1},A.map((q,J)=>{var me;let[F,oe]=q.split("-");return P.createElement("ol",{key:q,dir:g==="auto"?wO():g,tabIndex:-1,ref:D,className:o,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":F,"data-x-position":oe,style:{"--front-toast-height":`${((me=j[0])==null?void 0:me.height)||0}px`,"--offset":typeof c=="number"?`${c}px`:c||I9,"--width":`${M9}px`,"--gap":`${m}px`,...f},onBlur:se=>{L.current&&!se.currentTarget.contains(se.relatedTarget)&&(L.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||L.current||(L.current=!0,R.current=se.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{E||I(!1)},onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},C.filter(se=>!se.position&&J===0||se.position===q).map((se,le)=>{var ke,ue;return P.createElement(U9,{key:se.id,icons:b,index:le,toast:se,defaultRichColors:u,duration:(ke=p==null?void 0:p.duration)!=null?ke:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:e,visibleToasts:h,closeButton:(ue=p==null?void 0:p.closeButton)!=null?ue:s,interacting:E,position:q,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:Y,toasts:C.filter(we=>we.position==se.position),heights:j.filter(we=>we.position==se.position),setHeights:T,expandByDefault:i,gap:m,loadingIcon:v,expanded:k,pauseWhenPageIsHidden:w,cn:S})}))})):null};const H9=({...t})=>{const{theme:e="system"}=v9();return a.jsx(B9,{theme:e,className:"toaster group",position:"bottom-right",visibleToasts:2,closeButton:!0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:pr-8",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",closeButton:"group-[.toast]:absolute group-[.toast]:left-3 group-[.toast]:top-3 group-[.toast]:h-5 group-[.toast]:w-5 group-[.toast]:rounded-md group-[.toast]:p-1 group-[.toast]:text-foreground/70 group-[.toast]:opacity-100 group-[.toast]:transition-opacity hover:group-[.toast]:text-foreground hover:group-[.toast]:bg-muted/50 focus:group-[.toast]:opacity-100 focus:group-[.toast]:outline-none focus:group-[.toast]:ring-1 focus:group-[.toast]:ring-ring"}},...t})};function Ne(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function z9(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function c0(...t){return e=>t.forEach(n=>z9(n,e))}function Pt(...t){return y.useCallback(c0(...t),t)}function V9(t,e){const n=y.createContext(e),r=s=>{const{children:o,...c}=s,l=y.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function i(s){const o=y.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function Ui(t,e=[]){let n=[];function r(s,o){const c=y.createContext(o),l=n.length;n=[...n,o];const u=f=>{var b;const{scope:h,children:p,...g}=f,m=((b=h==null?void 0:h[t])==null?void 0:b[l])||c,v=y.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:v,children:p})};u.displayName=s+"Provider";function d(f,h){var m;const p=((m=h==null?void 0:h[t])==null?void 0:m[l])||c,g=y.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(o=>y.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return y.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,G9(i,...e)]}function G9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Go=y.forwardRef((t,e)=>{const{children:n,...r}=t,i=y.Children.toArray(n),s=i.find(K9);if(s){const o=s.props.children,c=i.map(l=>l===s?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:l);return a.jsx(N_,{...r,ref:e,children:y.isValidElement(o)?y.cloneElement(o,void 0,c):null})}return a.jsx(N_,{...r,ref:e,children:n})});Go.displayName="Slot";var N_=y.forwardRef((t,e)=>{const{children:n,...r}=t;if(y.isValidElement(n)){const i=q9(n);return y.cloneElement(n,{...W9(r,n.props),ref:e?c0(e,i):i})}return y.Children.count(n)>1?y.Children.only(null):null});N_.displayName="SlotClone";var hE=({children:t})=>a.jsx(a.Fragment,{children:t});function K9(t){return y.isValidElement(t)&&t.type===hE}function W9(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{s(...c),i(...c)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function q9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Y9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],it=Y9.reduce((t,e)=>{const n=y.forwardRef((r,i)=>{const{asChild:s,...o}=r,c=s?Go:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function d4(t,e){t&&Rf.flushSync(()=>t.dispatchEvent(e))}function Ar(t){const e=y.useRef(t);return y.useEffect(()=>{e.current=t}),y.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Q9(t,e=globalThis==null?void 0:globalThis.document){const n=Ar(t);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var X9="DismissableLayer",T_="dismissableLayer.update",J9="dismissableLayer.pointerDownOutside",Z9="dismissableLayer.focusOutside",SO,f4=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pg=y.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:c,...l}=t,u=y.useContext(f4),[d,f]=y.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=y.useState({}),g=Pt(e,A=>f(A)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),x=d?m.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=nY(A=>{const j=A.target,T=[...u.branches].some(k=>k.contains(j));!S||T||(i==null||i(A),o==null||o(A),A.defaultPrevented||c==null||c())},h),_=rY(A=>{const j=A.target;[...u.branches].some(k=>k.contains(j))||(s==null||s(A),o==null||o(A),A.defaultPrevented||c==null||c())},h);return Q9(A=>{x===u.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&c&&(A.preventDefault(),c()))},h),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(SO=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),CO(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=SO)}},[d,h,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),CO())},[d,u]),y.useEffect(()=>{const A=()=>p({});return document.addEventListener(T_,A),()=>document.removeEventListener(T_,A)},[]),a.jsx(it.div,{...l,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:Ne(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Ne(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Ne(t.onPointerDownCapture,C.onPointerDownCapture)})});pg.displayName=X9;var eY="DismissableLayerBranch",tY=y.forwardRef((t,e)=>{const n=y.useContext(f4),r=y.useRef(null),i=Pt(e,r);return y.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),a.jsx(it.div,{...t,ref:i})});tY.displayName=eY;function nY(t,e=globalThis==null?void 0:globalThis.document){const n=Ar(t),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let l=function(){h4(J9,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function rY(t,e=globalThis==null?void 0:globalThis.document){const n=Ar(t),r=y.useRef(!1);return y.useEffect(()=>{const i=s=>{s.target&&!r.current&&h4(Z9,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function CO(){const t=new CustomEvent(T_);document.dispatchEvent(t)}function h4(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?d4(i,s):i.dispatchEvent(s)}var qr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},iY=oL.useId||(()=>{}),sY=0;function Zs(t){const[e,n]=y.useState(iY());return qr(()=>{n(r=>r??String(sY++))},[t]),e?`radix-${e}`:""}const oY=["top","right","bottom","left"],qc=Math.min,Qi=Math.max,Fy=Math.round,av=Math.floor,Yc=t=>({x:t,y:t}),aY={left:"right",right:"left",bottom:"top",top:"bottom"},cY={start:"end",end:"start"};function P_(t,e,n){return Qi(t,qc(e,n))}function Ra(t,e){return typeof t=="function"?t(e):t}function Ma(t){return t.split("-")[0]}function Mf(t){return t.split("-")[1]}function pE(t){return t==="x"?"y":"x"}function mE(t){return t==="y"?"height":"width"}function Qc(t){return["top","bottom"].includes(Ma(t))?"y":"x"}function gE(t){return pE(Qc(t))}function lY(t,e,n){n===void 0&&(n=!1);const r=Mf(t),i=gE(t),s=mE(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Uy(o)),[o,Uy(o)]}function uY(t){const e=Uy(t);return[k_(t),e,k_(e)]}function k_(t){return t.replace(/start|end/g,e=>cY[e])}function dY(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function fY(t,e,n,r){const i=Mf(t);let s=dY(Ma(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(k_)))),s}function Uy(t){return t.replace(/left|right|bottom|top/g,e=>aY[e])}function hY(t){return{top:0,right:0,bottom:0,left:0,...t}}function p4(t){return typeof t!="number"?hY(t):{top:t,right:t,bottom:t,left:t}}function By(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function _O(t,e,n){let{reference:r,floating:i}=t;const s=Qc(e),o=gE(e),c=mE(o),l=Ma(e),u=s==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[c]/2-i[c]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Mf(e)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const pY=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,c=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=_O(u,r,l),h=r,p={},g=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:c,middlewareData:l}=e,{element:u,padding:d=0}=Ra(t,e)||{};if(u==null)return{};const f=p4(d),h={x:n,y:r},p=gE(i),g=mE(p),m=await o.getDimensions(u),v=p==="y",b=v?"top":"left",x=v?"bottom":"right",w=v?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[p]-h[p]-s.floating[g],C=h[p]-s.reference[p],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let A=_?_[w]:0;(!A||!await(o.isElement==null?void 0:o.isElement(_)))&&(A=c.floating[w]||s.floating[g]);const j=S/2-C/2,T=A/2-m[g]/2-1,k=qc(f[b],T),I=qc(f[x],T),E=k,O=A-m[g]-I,M=A/2-m[g]/2+j,U=P_(E,M,O),D=!l.arrow&&Mf(i)!=null&&M!==U&&s.reference[g]/2-(MM<=0)){var I,E;const M=(((I=s.flip)==null?void 0:I.index)||0)+1,U=A[M];if(U)return{data:{index:M,overflows:k},reset:{placement:U}};let D=(E=k.filter(B=>B.overflows[0]<=0).sort((B,R)=>B.overflows[1]-R.overflows[1])[0])==null?void 0:E.placement;if(!D)switch(p){case"bestFit":{var O;const B=(O=k.filter(R=>{if(_){const L=Qc(R.placement);return L===x||L==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(L=>L>0).reduce((L,Y)=>L+Y,0)]).sort((R,L)=>R[1]-L[1])[0])==null?void 0:O[0];B&&(D=B);break}case"initialPlacement":D=c;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function AO(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function jO(t){return oY.some(e=>t[e]>=0)}const vY=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Ra(t,e);switch(r){case"referenceHidden":{const s=await Bp(e,{...i,elementContext:"reference"}),o=AO(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:jO(o)}}}case"escaped":{const s=await Bp(e,{...i,altBoundary:!0}),o=AO(s,n.floating);return{data:{escapedOffsets:o,escaped:jO(o)}}}default:return{}}}}};async function yY(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ma(n),c=Mf(n),l=Qc(n)==="y",u=["left","top"].includes(o)?-1:1,d=s&&l?-1:1,f=Ra(e,t);let{mainAxis:h,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 c&&typeof g=="number"&&(p=c==="end"?g*-1:g),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const xY=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:c}=e,l=await yY(e,t);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},bY=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:c={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...l}=Ra(t,e),u={x:n,y:r},d=await Bp(e,l),f=Qc(Ma(i)),h=pE(f);let p=u[h],g=u[f];if(s){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[v],w=p-d[b];p=P_(x,p,w)}if(o){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=g+d[v],w=g-d[b];g=P_(x,g,w)}const m=c.fn({...e,[h]:p,[f]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[f]:o}}}}}},wY=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=Ra(t,e),d={x:n,y:r},f=Qc(i),h=pE(f);let p=d[h],g=d[f];const m=Ra(c,e),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=h==="y"?"height":"width",S=s.reference[h]-s.floating[w]+v.mainAxis,C=s.reference[h]+s.reference[w]-v.mainAxis;pC&&(p=C)}if(u){var b,x;const w=h==="y"?"width":"height",S=["top","left"].includes(Ma(i)),C=s.reference[f]-s.floating[w]+(S&&((b=o.offset)==null?void 0:b[f])||0)+(S?0:v.crossAxis),_=s.reference[f]+s.reference[w]+(S?0:((x=o.offset)==null?void 0:x[f])||0)-(S?v.crossAxis:0);g_&&(g=_)}return{[h]:p,[f]:g}}}},SY=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:c}=e,{apply:l=()=>{},...u}=Ra(t,e),d=await Bp(e,u),f=Ma(i),h=Mf(i),p=Qc(i)==="y",{width:g,height:m}=s.floating;let v,b;f==="top"||f==="bottom"?(v=f,b=h===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(b=f,v=h==="end"?"top":"bottom");const x=m-d.top-d.bottom,w=g-d.left-d.right,S=qc(m-d[v],x),C=qc(g-d[b],w),_=!e.middlewareData.shift;let A=S,j=C;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(A=x),_&&!h){const k=Qi(d.left,0),I=Qi(d.right,0),E=Qi(d.top,0),O=Qi(d.bottom,0);p?j=g-2*(k!==0||I!==0?k+I:Qi(d.left,d.right)):A=m-2*(E!==0||O!==0?E+O:Qi(d.top,d.bottom))}await l({...e,availableWidth:j,availableHeight:A});const T=await o.getDimensions(c.floating);return g!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function l0(){return typeof window<"u"}function Df(t){return m4(t)?(t.nodeName||"").toLowerCase():"#document"}function es(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Jo(t){var e;return(e=(m4(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function m4(t){return l0()?t instanceof Node||t instanceof es(t).Node:!1}function ao(t){return l0()?t instanceof Element||t instanceof es(t).Element:!1}function Ko(t){return l0()?t instanceof HTMLElement||t instanceof es(t).HTMLElement:!1}function EO(t){return!l0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof es(t).ShadowRoot}function mg(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=co(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function CY(t){return["table","td","th"].includes(Df(t))}function u0(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function vE(t){const e=yE(),n=ao(t)?co(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function _Y(t){let e=Xc(t);for(;Ko(e)&&!Qd(e);){if(vE(e))return e;if(u0(e))return null;e=Xc(e)}return null}function yE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Qd(t){return["html","body","#document"].includes(Df(t))}function co(t){return es(t).getComputedStyle(t)}function d0(t){return ao(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xc(t){if(Df(t)==="html")return t;const e=t.assignedSlot||t.parentNode||EO(t)&&t.host||Jo(t);return EO(e)?e.host:e}function g4(t){const e=Xc(t);return Qd(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ko(e)&&mg(e)?e:g4(e)}function Hp(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=g4(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=es(i);if(s){const c=O_(o);return e.concat(o,o.visualViewport||[],mg(i)?i:[],c&&n?Hp(c):[])}return e.concat(i,Hp(i,[],n))}function O_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function v4(t){const e=co(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ko(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,c=Fy(n)!==s||Fy(r)!==o;return c&&(n=s,r=o),{width:n,height:r,$:c}}function xE(t){return ao(t)?t:t.contextElement}function wd(t){const e=xE(t);if(!Ko(e))return Yc(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=v4(e);let o=(s?Fy(n.width):n.width)/r,c=(s?Fy(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const AY=Yc(0);function y4(t){const e=es(t);return!yE()||!e.visualViewport?AY:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jY(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==es(t)?!1:e}function uu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=xE(t);let o=Yc(1);e&&(r?ao(r)&&(o=wd(r)):o=wd(t));const c=jY(s,n,r)?y4(s):Yc(0);let l=(i.left+c.x)/o.x,u=(i.top+c.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(s){const h=es(s),p=r&&ao(r)?es(r):r;let g=h,m=O_(g);for(;m&&r&&p!==g;){const v=wd(m),b=m.getBoundingClientRect(),x=co(m),w=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*v.x,S=b.top+(m.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,f*=v.y,l+=w,u+=S,g=es(m),m=O_(g)}}return By({width:d,height:f,x:l,y:u})}function EY(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Jo(r),c=e?u0(e.floating):!1;if(r===o||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Yc(1);const d=Yc(0),f=Ko(r);if((f||!f&&!s)&&((Df(r)!=="body"||mg(o))&&(l=d0(r)),Ko(r))){const h=uu(r);u=wd(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function NY(t){return Array.from(t.getClientRects())}function I_(t,e){const n=d0(t).scrollLeft;return e?e.left+n:uu(Jo(t)).left+n}function TY(t){const e=Jo(t),n=d0(t),r=t.ownerDocument.body,i=Qi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Qi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+I_(t);const c=-n.scrollTop;return co(r).direction==="rtl"&&(o+=Qi(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:c}}function PY(t,e){const n=es(t),r=Jo(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,c=0,l=0;if(i){s=i.width,o=i.height;const u=yE();(!u||u&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:c,y:l}}function kY(t,e){const n=uu(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Ko(t)?wd(t):Yc(1),o=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:c,x:l,y:u}}function NO(t,e,n){let r;if(e==="viewport")r=PY(t,n);else if(e==="document")r=TY(Jo(t));else if(ao(e))r=kY(e,n);else{const i=y4(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return By(r)}function x4(t,e){const n=Xc(t);return n===e||!ao(n)||Qd(n)?!1:co(n).position==="fixed"||x4(n,e)}function OY(t,e){const n=e.get(t);if(n)return n;let r=Hp(t,[],!1).filter(c=>ao(c)&&Df(c)!=="body"),i=null;const s=co(t).position==="fixed";let o=s?Xc(t):t;for(;ao(o)&&!Qd(o);){const c=co(o),l=vE(o);!l&&c.position==="fixed"&&(i=null),(s?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mg(o)&&!l&&x4(t,o))?r=r.filter(d=>d!==o):i=c,o=Xc(o)}return e.set(t,r),r}function IY(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?u0(e)?[]:OY(e,this._c):[].concat(n),r],c=o[0],l=o.reduce((u,d)=>{const f=NO(e,d,i);return u.top=Qi(f.top,u.top),u.right=qc(f.right,u.right),u.bottom=qc(f.bottom,u.bottom),u.left=Qi(f.left,u.left),u},NO(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RY(t){const{width:e,height:n}=v4(t);return{width:e,height:n}}function MY(t,e,n){const r=Ko(e),i=Jo(e),s=n==="fixed",o=uu(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=Yc(0);if(r||!r&&!s)if((Df(e)!=="body"||mg(i))&&(c=d0(e)),r){const p=uu(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&(l.x=I_(i));let u=0,d=0;if(i&&!r&&!s){const p=i.getBoundingClientRect();d=p.top+c.scrollTop,u=p.left+c.scrollLeft-I_(i,p)}const f=o.left+c.scrollLeft-l.x-u,h=o.top+c.scrollTop-l.y-d;return{x:f,y:h,width:o.width,height:o.height}}function TS(t){return co(t).position==="static"}function TO(t,e){if(!Ko(t)||co(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Jo(t)===n&&(n=n.ownerDocument.body),n}function b4(t,e){const n=es(t);if(u0(t))return n;if(!Ko(t)){let i=Xc(t);for(;i&&!Qd(i);){if(ao(i)&&!TS(i))return i;i=Xc(i)}return n}let r=TO(t,e);for(;r&&CY(r)&&TS(r);)r=TO(r,e);return r&&Qd(r)&&TS(r)&&!vE(r)?n:r||_Y(t)||n}const DY=async function(t){const e=this.getOffsetParent||b4,n=this.getDimensions,r=await n(t.floating);return{reference:MY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $Y(t){return co(t).direction==="rtl"}const LY={convertOffsetParentRelativeRectToViewportRelativeRect:EY,getDocumentElement:Jo,getClippingRect:IY,getOffsetParent:b4,getElementRects:DY,getClientRects:NY,getDimensions:RY,getScale:wd,isElement:ao,isRTL:$Y};function FY(t,e){let n=null,r;const i=Jo(t);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const{left:u,top:d,width:f,height:h}=t.getBoundingClientRect();if(c||e(),!f||!h)return;const p=av(d),g=av(i.clientWidth-(u+f)),m=av(i.clientHeight-(d+h)),v=av(u),x={rootMargin:-p+"px "+-g+"px "+-m+"px "+-v+"px",threshold:Qi(0,qc(1,l))||1};let w=!0;function S(C){const _=C[0].intersectionRatio;if(_!==l){if(!w)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(t)}return o(!0),s}function UY(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xE(t),d=i||s?[...u?Hp(u):[],...Hp(e)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=u&&c?FY(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),n()}),u&&!l&&p.observe(u),p.observe(e));let g,m=l?uu(t):null;l&&v();function v(){const b=uu(t);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(v)}return n(),()=>{var b;d.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const BY=xY,HY=bY,zY=gY,VY=SY,GY=vY,PO=mY,KY=wY,WY=(t,e,n)=>{const r=new Map,i={platform:LY,...n},s={...i.platform,_c:r};return pY(t,e,{...i,platform:s})};var Qv=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Hy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Hy(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Hy(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function w4(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function kO(t,e){const n=w4(t);return Math.round(e*n)/n}function PS(t){const e=y.useRef(t);return Qv(()=>{e.current=t}),e}function qY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:c=!0,whileElementsMounted:l,open:u}=t,[d,f]=y.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,p]=y.useState(r);Hy(h,r)||p(r);const[g,m]=y.useState(null),[v,b]=y.useState(null),x=y.useCallback(R=>{R!==_.current&&(_.current=R,m(R))},[]),w=y.useCallback(R=>{R!==A.current&&(A.current=R,b(R))},[]),S=s||g,C=o||v,_=y.useRef(null),A=y.useRef(null),j=y.useRef(d),T=l!=null,k=PS(l),I=PS(i),E=PS(u),O=y.useCallback(()=>{if(!_.current||!A.current)return;const R={placement:e,strategy:n,middleware:h};I.current&&(R.platform=I.current),WY(_.current,A.current,R).then(L=>{const Y={...L,isPositioned:E.current!==!1};M.current&&!Hy(j.current,Y)&&(j.current=Y,Rf.flushSync(()=>{f(Y)}))})},[h,e,n,I,E]);Qv(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[u]);const M=y.useRef(!1);Qv(()=>(M.current=!0,()=>{M.current=!1}),[]),Qv(()=>{if(S&&(_.current=S),C&&(A.current=C),S&&C){if(k.current)return k.current(S,C,O);O()}},[S,C,O,k,T]);const U=y.useMemo(()=>({reference:_,floating:A,setReference:x,setFloating:w}),[x,w]),D=y.useMemo(()=>({reference:S,floating:C}),[S,C]),B=y.useMemo(()=>{const R={position:n,left:0,top:0};if(!D.floating)return R;const L=kO(D.floating,d.x),Y=kO(D.floating,d.y);return c?{...R,transform:"translate("+L+"px, "+Y+"px)",...w4(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Y}},[n,c,D.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:O,refs:U,elements:D,floatingStyles:B}),[d,O,U,D,B])}const YY=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?PO({element:r.current,padding:i}).fn(n):{}:r?PO({element:r,padding:i}).fn(n):{}}}},QY=(t,e)=>({...BY(t),options:[t,e]}),XY=(t,e)=>({...HY(t),options:[t,e]}),JY=(t,e)=>({...KY(t),options:[t,e]}),ZY=(t,e)=>({...zY(t),options:[t,e]}),eQ=(t,e)=>({...VY(t),options:[t,e]}),tQ=(t,e)=>({...GY(t),options:[t,e]}),nQ=(t,e)=>({...YY(t),options:[t,e]});var rQ="Arrow",S4=y.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return a.jsx(it.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});S4.displayName=rQ;var iQ=S4;function sQ(t,e=[]){let n=[];function r(s,o){const c=y.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,v=y.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:v,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=y.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>y.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return y.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,oQ(i,...e)]}function oQ(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function gg(t){const[e,n]=y.useState(void 0);return qr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,c;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,c=u.blockSize}else o=t.offsetWidth,c=t.offsetHeight;n({width:o,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var bE="Popper",[C4,$f]=sQ(bE),[aQ,_4]=C4(bE),A4=t=>{const{__scopePopper:e,children:n}=t,[r,i]=y.useState(null);return a.jsx(aQ,{scope:e,anchor:r,onAnchorChange:i,children:n})};A4.displayName=bE;var j4="PopperAnchor",E4=y.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=_4(j4,n),o=y.useRef(null),c=Pt(e,o);return y.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:a.jsx(it.div,{...i,ref:c})});E4.displayName=j4;var wE="PopperContent",[cQ,lQ]=C4(wE),N4=y.forwardRef((t,e)=>{var le,ke,ue,we,Ae,ee;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=t,v=_4(wE,n),[b,x]=y.useState(null),w=Pt(e,wt=>x(wt)),[S,C]=y.useState(null),_=gg(S),A=(_==null?void 0:_.width)??0,j=(_==null?void 0:_.height)??0,T=r+(s!=="center"?"-"+s:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(u)?u:[u],E=I.length>0,O={padding:k,boundary:I.filter(dQ),altBoundary:E},{refs:M,floatingStyles:U,placement:D,isPositioned:B,middlewareData:R}=qY({strategy:"fixed",placement:T,whileElementsMounted:(...wt)=>UY(...wt,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[QY({mainAxis:i+j,alignmentAxis:o}),l&&XY({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?JY():void 0,...O}),l&&ZY({...O}),eQ({...O,apply:({elements:wt,rects:et,availableWidth:Ct,availableHeight:Xe})=>{const{width:nn,height:N}=et.reference,$=wt.floating.style;$.setProperty("--radix-popper-available-width",`${Ct}px`),$.setProperty("--radix-popper-available-height",`${Xe}px`),$.setProperty("--radix-popper-anchor-width",`${nn}px`),$.setProperty("--radix-popper-anchor-height",`${N}px`)}}),S&&nQ({element:S,padding:c}),fQ({arrowWidth:A,arrowHeight:j}),h&&tQ({strategy:"referenceHidden",...O})]}),[L,Y]=k4(D),q=Ar(g);qr(()=>{B&&(q==null||q())},[B,q]);const J=(le=R.arrow)==null?void 0:le.x,me=(ke=R.arrow)==null?void 0:ke.y,F=((ue=R.arrow)==null?void 0:ue.centerOffset)!==0,[oe,se]=y.useState();return qr(()=>{b&&se(window.getComputedStyle(b).zIndex)},[b]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:B?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(we=R.transformOrigin)==null?void 0:we.x,(Ae=R.transformOrigin)==null?void 0:Ae.y].join(" "),...((ee=R.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(cQ,{scope:n,placedSide:L,onArrowChange:C,arrowX:J,arrowY:me,shouldHideArrow:F,children:a.jsx(it.div,{"data-side":L,"data-align":Y,...m,ref:w,style:{...m.style,animation:B?void 0:"none"}})})})});N4.displayName=wE;var T4="PopperArrow",uQ={top:"bottom",right:"left",bottom:"top",left:"right"},P4=y.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=lQ(T4,r),o=uQ[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(iQ,{...i,ref:n,style:{...i.style,display:"block"}})})});P4.displayName=T4;function dQ(t){return t!==null}var fQ=t=>({name:"transformOrigin",options:t,fn(e){var v,b,x;const{placement:n,rects:r,middlewareData:i}=e,o=((v=i.arrow)==null?void 0:v.centerOffset)!==0,c=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,d]=k4(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((b=i.arrow)==null?void 0:b.x)??0)+c/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=o?f:`${h}px`,m=`${-l}px`):u==="top"?(g=o?f:`${h}px`,m=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=o?f:`${p}px`):u==="left"&&(g=`${r.floating.width+l}px`,m=o?f:`${p}px`),{data:{x:g,y:m}}}});function k4(t){const[e,n="center"]=t.split("-");return[e,n]}var O4=A4,SE=E4,CE=N4,_E=P4,hQ="Portal",f0=y.forwardRef((t,e)=>{var c;const{container:n,...r}=t,[i,s]=y.useState(!1);qr(()=>s(!0),[]);const o=n||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return o?l4.createPortal(a.jsx(it.div,{...r,ref:e}),o):null});f0.displayName=hQ;function pQ(t,e){return y.useReducer((n,r)=>e[n][r]??n,t)}var Yr=t=>{const{present:e,children:n}=t,r=mQ(e),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),s=Pt(r.ref,gQ(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:s}):null};Yr.displayName="Presence";function mQ(t){const[e,n]=y.useState(),r=y.useRef({}),i=y.useRef(t),s=y.useRef("none"),o=t?"mounted":"unmounted",[c,l]=pQ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=cv(r.current);s.current=c==="mounted"?u:"none"},[c]),qr(()=>{const u=r.current,d=i.current;if(d!==t){const h=s.current,p=cv(u);t?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),qr(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=p=>{const m=cv(r.current).includes(p.animationName);if(p.target===e&&m&&(l("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},h=p=>{p.target===e&&(s.current=cv(r.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function cv(t){return(t==null?void 0:t.animationName)||"none"}function gQ(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function lo({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=vQ({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,c=Ar(n),l=y.useCallback(u=>{if(s){const f=typeof u=="function"?u(t):u;f!==t&&c(f)}else i(u)},[s,t,i,c]);return[o,l]}function vQ({defaultProp:t,onChange:e}){const n=y.useState(t),[r]=n,i=y.useRef(r),s=Ar(e);return y.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var yQ="VisuallyHidden",AE=y.forwardRef((t,e)=>a.jsx(it.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));AE.displayName=yQ;var xQ=AE,[h0,oFe]=Ui("Tooltip",[$f]),jE=$f(),I4="TooltipProvider",bQ=700,OO="tooltip.open",[wQ,R4]=h0(I4),M4=t=>{const{__scopeTooltip:e,delayDuration:n=bQ,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,[o,c]=y.useState(!0),l=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),a.jsx(wQ,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),c(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:s})};M4.displayName=I4;var D4="Tooltip",[aFe,p0]=h0(D4),R_="TooltipTrigger",SQ=y.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=p0(R_,n),s=R4(R_,n),o=jE(n),c=y.useRef(null),l=Pt(e,c,i.onTriggerChange),u=y.useRef(!1),d=y.useRef(!1),f=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),a.jsx(SE,{asChild:!0,...o,children:a.jsx(it.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Ne(t.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ne(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Ne(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ne(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:Ne(t.onBlur,i.onClose),onClick:Ne(t.onClick,i.onClose)})})});SQ.displayName=R_;var CQ="TooltipPortal",[cFe,_Q]=h0(CQ,{forceMount:void 0}),Xd="TooltipContent",$4=y.forwardRef((t,e)=>{const n=_Q(Xd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=p0(Xd,t.__scopeTooltip);return a.jsx(Yr,{present:r||o.open,children:o.disableHoverableContent?a.jsx(L4,{side:i,...s,ref:e}):a.jsx(AQ,{side:i,...s,ref:e})})}),AQ=y.forwardRef((t,e)=>{const n=p0(Xd,t.__scopeTooltip),r=R4(Xd,t.__scopeTooltip),i=y.useRef(null),s=Pt(e,i),[o,c]=y.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,h=y.useCallback(()=>{c(null),f(!1)},[f]),p=y.useCallback((g,m)=>{const v=g.currentTarget,b={x:g.clientX,y:g.clientY},x=TQ(b,v.getBoundingClientRect()),w=PQ(b,x),S=kQ(m.getBoundingClientRect()),C=IQ([...w,...S]);c(C),f(!0)},[f]);return y.useEffect(()=>()=>h(),[h]),y.useEffect(()=>{if(l&&d){const g=v=>p(v,d),m=v=>p(v,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[l,d,p,h]),y.useEffect(()=>{if(o){const g=m=>{const v=m.target,b={x:m.clientX,y:m.clientY},x=(l==null?void 0:l.contains(v))||(d==null?void 0:d.contains(v)),w=!OQ(b,o);x?h():w&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,o,u,h]),a.jsx(L4,{...t,ref:s})}),[jQ,EQ]=h0(D4,{isInside:!1}),L4=y.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...c}=t,l=p0(Xd,n),u=jE(n),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(OO,d),()=>document.removeEventListener(OO,d)),[d]),y.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),a.jsx(pg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:a.jsxs(CE,{"data-state":l.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(hE,{children:r}),a.jsx(jQ,{scope:n,isInside:!0,children:a.jsx(xQ,{id:l.contentId,role:"tooltip",children:i||r})})]})})});$4.displayName=Xd;var F4="TooltipArrow",NQ=y.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=jE(n);return EQ(F4,n).isInside?null:a.jsx(_E,{...i,...r,ref:e})});NQ.displayName=F4;function TQ(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function PQ(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function kQ(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function OQ(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function IQ(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),RQ(e)}function RQ(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var MQ=M4,U4=$4;function B4(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const e=LQ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const c=o.split(EE);return c[0]===""&&c.length!==1&&c.shift(),H4(c,e)||$Q(o)},getConflictingClassGroupIds:(o,c)=>{const l=n[o]||[];return c&&r[o]?[...l,...r[o]]:l}}},H4=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?H4(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(EE);return(o=e.validators.find(({validator:c})=>c(s)))==null?void 0:o.classGroupId},IO=/^\[(.+)\]$/,$Q=t=>{if(IO.test(t)){const e=IO.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},LQ=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return UQ(Object.entries(t.classGroups),n).forEach(([s,o])=>{M_(o,r,s,e)}),r},M_=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:RO(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(FQ(i)){M_(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{M_(o,RO(e,s),n,r)})})},RO=(t,e)=>{let n=t;return e.split(EE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},FQ=t=>t.isThemeGetter,UQ=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,c])=>[e+o,c])):s);return[n,i]}):t,BQ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},z4="!",HQ=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=c=>{const l=[];let u=0,d=0,f;for(let v=0;vd?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?c=>n({className:c,parseClassName:o}):o},zQ=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},VQ=t=>({cache:BQ(t.cacheSize),parseClassName:HQ(t),...DQ(t)}),GQ=/\s+/,KQ=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(GQ);let c="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,m=r(g?h.substring(0,p):h);if(!m){if(!g){c=u+(c.length>0?" "+c:c);continue}if(m=r(h),!m){c=u+(c.length>0?" "+c:c);continue}g=!1}const v=zQ(d).join(":"),b=f?v+z4:v,x=b+m;if(s.includes(x))continue;s.push(x);const w=i(m,g);for(let S=0;S0?" "+c:c)}return c};function WQ(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rf(d),t());return n=VQ(u),r=n.cache.get,i=n.cache.set,s=c,c(l)}function c(l){const u=r(l);if(u)return u;const d=KQ(l,n);return i(l,d),d}return function(){return s(WQ.apply(null,arguments))}}const kn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},G4=/^\[(?:([a-z-]+):)?(.+)\]$/i,YQ=/^\d+\/\d+$/,QQ=new Set(["px","full","screen"]),XQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JQ=/\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$/,ZQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,eX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ia=t=>Sd(t)||QQ.has(t)||YQ.test(t),Ja=t=>Lf(t,"length",lX),Sd=t=>!!t&&!Number.isNaN(Number(t)),kS=t=>Lf(t,"number",Sd),Sh=t=>!!t&&Number.isInteger(Number(t)),nX=t=>t.endsWith("%")&&Sd(t.slice(0,-1)),Ft=t=>G4.test(t),Za=t=>XQ.test(t),rX=new Set(["length","size","percentage"]),iX=t=>Lf(t,rX,K4),sX=t=>Lf(t,"position",K4),oX=new Set(["image","url"]),aX=t=>Lf(t,oX,dX),cX=t=>Lf(t,"",uX),Ch=()=>!0,Lf=(t,e,n)=>{const r=G4.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},lX=t=>JQ.test(t)&&!ZQ.test(t),K4=()=>!1,uX=t=>eX.test(t),dX=t=>tX.test(t),fX=()=>{const t=kn("colors"),e=kn("spacing"),n=kn("blur"),r=kn("brightness"),i=kn("borderColor"),s=kn("borderRadius"),o=kn("borderSpacing"),c=kn("borderWidth"),l=kn("contrast"),u=kn("grayscale"),d=kn("hueRotate"),f=kn("invert"),h=kn("gap"),p=kn("gradientColorStops"),g=kn("gradientColorStopPositions"),m=kn("inset"),v=kn("margin"),b=kn("opacity"),x=kn("padding"),w=kn("saturate"),S=kn("scale"),C=kn("sepia"),_=kn("skew"),A=kn("space"),j=kn("translate"),T=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Ft,e],E=()=>[Ft,e],O=()=>["",ia,Ja],M=()=>["auto",Sd,Ft],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",Ft],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Sd,Ft];return{cacheSize:500,separator:":",theme:{colors:[Ch],spacing:[ia,Ja],blur:["none","",Za,Ft],brightness:q(),borderColor:[t],borderRadius:["none","","full",Za,Ft],borderSpacing:E(),borderWidth:O(),contrast:q(),grayscale:L(),hueRotate:q(),invert:L(),gap:E(),gradientColorStops:[t],gradientColorStopPositions:[nX,Ja],inset:I(),margin:I(),opacity:q(),padding:E(),saturate:q(),scale:q(),sepia:L(),skew:q(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Ft]}],container:["container"],columns:[{columns:[Za]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:[...U(),Ft]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Sh,Ft]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ft]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",Sh,Ft]}],"grid-cols":[{"grid-cols":[Ch]}],"col-start-end":[{col:["auto",{span:["full",Sh,Ft]},Ft]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Ch]}],"row-start-end":[{row:["auto",{span:[Sh,Ft]},Ft]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ft]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ft]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"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:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ft,e]}],"min-w":[{"min-w":[Ft,e,"min","max","fit"]}],"max-w":[{"max-w":[Ft,e,"none","full","min","max","fit","prose",{screen:[Za]},Za]}],h:[{h:[Ft,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ft,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ft,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ft,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Za,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",kS]}],"font-family":[{font:[Ch]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ft]}],"line-clamp":[{"line-clamp":["none",Sd,kS]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ia,Ft]}],"list-image":[{"list-image":["none",Ft]}],"list-style-type":[{list:["none","disc","decimal",Ft]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ia,Ja]}],"underline-offset":[{"underline-offset":["auto",ia,Ft]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ft]}],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",Ft]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),sX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",iX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},aX]}],"bg-color":[{bg:[t]}],"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:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:D()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[ia,Ft]}],"outline-w":[{outline:[ia,Ja]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ia,Ja]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Za,cX]}],"shadow-color":[{shadow:[Ch]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Za,Ft]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ft]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",Ft]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ft]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Sh,Ft]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ft]}],accent:[{accent:["auto",t]}],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",Ft]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",Ft]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ia,Ja,kS]}],stroke:[{stroke:[t,"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"]}}},hX=qQ(fX);function Pe(...t){return hX(It(t))}const pX=MQ,mX=y.forwardRef(({className:t,sideOffset:e=4,...n},r)=>a.jsx(U4,{ref:r,sideOffset:e,className:Pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));mX.displayName=U4.displayName;var m0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},g0=typeof window>"u"||"Deno"in globalThis;function Us(){}function gX(t,e){return typeof t=="function"?t(e):t}function vX(t){return typeof t=="number"&&t>=0&&t!==1/0}function yX(t,e){return Math.max(t+(e||0)-Date.now(),0)}function MO(t,e){return typeof t=="function"?t(e):t}function xX(t,e){return typeof t=="function"?t(e):t}function DO(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:c}=t;if(o){if(r){if(e.queryHash!==NE(o,e.options))return!1}else if(!Vp(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||s&&!s(e))}function $O(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(zp(e.options.mutationKey)!==zp(s))return!1}else if(!Vp(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function NE(t,e){return((e==null?void 0:e.queryKeyHashFn)||zp)(t)}function zp(t){return JSON.stringify(t,(e,n)=>D_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Vp(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Vp(t[n],e[n])):!1}function W4(t,e){if(t===e)return t;const n=LO(t)&&LO(e);if(n||D_(t)&&D_(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,c=n?[]:{};let l=0;for(let u=0;u{setTimeout(e,t)})}function wX(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?W4(t,e):e}function SX(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function CX(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var TE=Symbol();function q4(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===TE?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Gl,pc,Rd,H$,_X=(H$=class extends m0{constructor(){super();pn(this,Gl);pn(this,pc);pn(this,Rd);zt(this,Rd,e=>{if(!g0&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ge(this,pc)||this.setEventListener(ge(this,Rd))}onUnsubscribe(){var e;this.hasListeners()||((e=ge(this,pc))==null||e.call(this),zt(this,pc,void 0))}setEventListener(e){var n;zt(this,Rd,e),(n=ge(this,pc))==null||n.call(this),zt(this,pc,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){ge(this,Gl)!==e&&(zt(this,Gl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof ge(this,Gl)=="boolean"?ge(this,Gl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Gl=new WeakMap,pc=new WeakMap,Rd=new WeakMap,H$),Y4=new _X,Md,mc,Dd,z$,AX=(z$=class extends m0{constructor(){super();pn(this,Md,!0);pn(this,mc);pn(this,Dd);zt(this,Dd,e=>{if(!g0&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ge(this,mc)||this.setEventListener(ge(this,Dd))}onUnsubscribe(){var e;this.hasListeners()||((e=ge(this,mc))==null||e.call(this),zt(this,mc,void 0))}setEventListener(e){var n;zt(this,Dd,e),(n=ge(this,mc))==null||n.call(this),zt(this,mc,e(this.setOnline.bind(this)))}setOnline(e){ge(this,Md)!==e&&(zt(this,Md,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return ge(this,Md)}},Md=new WeakMap,mc=new WeakMap,Dd=new WeakMap,z$),zy=new AX;function jX(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function EX(t){return Math.min(1e3*2**t,3e4)}function Q4(t){return(t??"online")==="online"?zy.isOnline():!0}var X4=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function OS(t){return t instanceof X4}function J4(t){let e=!1,n=0,r=!1,i;const s=jX(),o=m=>{var v;r||(h(new X4(m)),(v=t.abort)==null||v.call(t))},c=()=>{e=!0},l=()=>{e=!1},u=()=>Y4.isFocused()&&(t.networkMode==="always"||zy.isOnline())&&t.canRun(),d=()=>Q4(t.networkMode)&&t.canRun(),f=m=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,m),i==null||i(),s.resolve(m))},h=m=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,m),i==null||i(),s.reject(m))},p=()=>new Promise(m=>{var v;i=b=>{(r||u())&&m(b)},(v=t.onPause)==null||v.call(t)}).then(()=>{var m;i=void 0,r||(m=t.onContinue)==null||m.call(t)}),g=()=>{if(r)return;let m;const v=n===0?t.initialPromise:void 0;try{m=v??t.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(f).catch(b=>{var _;if(r)return;const x=t.retry??(g0?0:3),w=t.retryDelay??EX,S=typeof w=="function"?w(n,b):w,C=x===!0||typeof x=="number"&&nu()?void 0:p()).then(()=>{e?h(b):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}function NX(){let t=[],e=0,n=c=>{c()},r=c=>{c()},i=c=>setTimeout(c,0);const s=c=>{e?t.push(c):i(()=>{n(c)})},o=()=>{const c=t;t=[],c.length&&i(()=>{r(()=>{c.forEach(l=>{n(l)})})})};return{batch:c=>{let l;e++;try{l=c()}finally{e--,e||o()}return l},batchCalls:c=>(...l)=>{s(()=>{c(...l)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var mi=NX(),Kl,V$,Z4=(V$=class{constructor(){pn(this,Kl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vX(this.gcTime)&&zt(this,Kl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(g0?1/0:5*60*1e3))}clearGcTimeout(){ge(this,Kl)&&(clearTimeout(ge(this,Kl)),zt(this,Kl,void 0))}},Kl=new WeakMap,V$),$d,Ld,ds,Zr,ag,Wl,Bs,ca,G$,TX=(G$=class extends Z4{constructor(e){super();pn(this,Bs);pn(this,$d);pn(this,Ld);pn(this,ds);pn(this,Zr);pn(this,ag);pn(this,Wl);zt(this,Wl,!1),zt(this,ag,e.defaultOptions),this.setOptions(e.options),this.observers=[],zt(this,ds,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,zt(this,$d,kX(this.options)),this.state=e.state??ge(this,$d),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=ge(this,Zr))==null?void 0:e.promise}setOptions(e){this.options={...ge(this,ag),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ge(this,ds).remove(this)}setData(e,n){const r=wX(this.state.data,e,this.options);return Qr(this,Bs,ca).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Qr(this,Bs,ca).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=ge(this,Zr))==null?void 0:r.promise;return(i=ge(this,Zr))==null||i.cancel(e),n?n.then(Us).catch(Us):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ge(this,$d))}isActive(){return this.observers.some(e=>xX(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===TE||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!yX(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=ge(this,Zr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=ge(this,Zr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ge(this,ds).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(ge(this,Zr)&&(ge(this,Wl)?ge(this,Zr).cancel({revert:!0}):ge(this,Zr).cancelRetry()),this.scheduleGc()),ge(this,ds).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qr(this,Bs,ca).call(this,{type:"invalidate"})}fetch(e,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ge(this,Zr))return ge(this,Zr).continueRetry(),ge(this,Zr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(zt(this,Wl,!0),r.signal)})},s=()=>{const f=q4(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return i(h),zt(this,Wl,!1),this.options.persister?this.options.persister(f,h,this):f(h)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),zt(this,Ld,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&Qr(this,Bs,ca).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const c=f=>{var h,p,g,m;OS(f)&&f.silent||Qr(this,Bs,ca).call(this,{type:"error",error:f}),OS(f)||((p=(h=ge(this,ds).config).onError)==null||p.call(h,f,this),(m=(g=ge(this,ds).config).onSettled)==null||m.call(g,this.state.data,f,this)),this.scheduleGc()};return zt(this,Zr,J4({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,p,g,m;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){c(v);return}(p=(h=ge(this,ds).config).onSuccess)==null||p.call(h,f,this),(m=(g=ge(this,ds).config).onSettled)==null||m.call(g,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,h)=>{Qr(this,Bs,ca).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Qr(this,Bs,ca).call(this,{type:"pause"})},onContinue:()=>{Qr(this,Bs,ca).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ge(this,Zr).start()}},$d=new WeakMap,Ld=new WeakMap,ds=new WeakMap,Zr=new WeakMap,ag=new WeakMap,Wl=new WeakMap,Bs=new WeakSet,ca=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...PX(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return OS(i)&&i.revert&&ge(this,Ld)?{...ge(this,Ld),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),mi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ge(this,ds).notify({query:this,type:"updated",action:e})})},G$);function PX(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Q4(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function kX(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jo,K$,OX=(K$=class extends m0{constructor(e={}){super();pn(this,jo);this.config=e,zt(this,jo,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??NE(i,n);let o=this.get(s);return o||(o=new TX({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){ge(this,jo).has(e.queryHash)||(ge(this,jo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=ge(this,jo).get(e.queryHash);n&&(e.destroy(),n===e&&ge(this,jo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){mi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ge(this,jo).get(e)}getAll(){return[...ge(this,jo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>DO(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>DO(e,r)):n}notify(e){mi.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){mi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){mi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},jo=new WeakMap,K$),Eo,li,ql,No,ec,W$,IX=(W$=class extends Z4{constructor(e){super();pn(this,No);pn(this,Eo);pn(this,li);pn(this,ql);this.mutationId=e.mutationId,zt(this,li,e.mutationCache),zt(this,Eo,[]),this.state=e.state||RX(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ge(this,Eo).includes(e)||(ge(this,Eo).push(e),this.clearGcTimeout(),ge(this,li).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){zt(this,Eo,ge(this,Eo).filter(n=>n!==e)),this.scheduleGc(),ge(this,li).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ge(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():ge(this,li).remove(this))}continue(){var e;return((e=ge(this,ql))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,c,l,u,d,f,h,p,g,m,v,b,x,w,S,C,_,A;zt(this,ql,J4({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(j,T)=>{Qr(this,No,ec).call(this,{type:"failed",failureCount:j,error:T})},onPause:()=>{Qr(this,No,ec).call(this,{type:"pause"})},onContinue:()=>{Qr(this,No,ec).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ge(this,li).canRun(this)}));const n=this.state.status==="pending",r=!ge(this,ql).canStart();try{if(!n){Qr(this,No,ec).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=ge(this,li).config).onMutate)==null?void 0:s.call(i,e,this));const T=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,e));T!==this.state.context&&Qr(this,No,ec).call(this,{type:"pending",context:T,variables:e,isPaused:r})}const j=await ge(this,ql).start();return await((u=(l=ge(this,li).config).onSuccess)==null?void 0:u.call(l,j,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,j,e,this.state.context)),await((p=(h=ge(this,li).config).onSettled)==null?void 0:p.call(h,j,null,this.state.variables,this.state.context,this)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,j,null,e,this.state.context)),Qr(this,No,ec).call(this,{type:"success",data:j}),j}catch(j){try{throw await((b=(v=ge(this,li).config).onError)==null?void 0:b.call(v,j,e,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,j,e,this.state.context)),await((C=(S=ge(this,li).config).onSettled)==null?void 0:C.call(S,void 0,j,this.state.variables,this.state.context,this)),await((A=(_=this.options).onSettled)==null?void 0:A.call(_,void 0,j,e,this.state.context)),j}finally{Qr(this,No,ec).call(this,{type:"error",error:j})}}finally{ge(this,li).runNext(this)}}},Eo=new WeakMap,li=new WeakMap,ql=new WeakMap,No=new WeakSet,ec=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),mi.batch(()=>{ge(this,Eo).forEach(r=>{r.onMutationUpdate(e)}),ge(this,li).notify({mutation:this,type:"updated",action:e})})},W$);function RX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gi,cg,q$,MX=(q$=class extends m0{constructor(e={}){super();pn(this,Gi);pn(this,cg);this.config=e,zt(this,Gi,new Map),zt(this,cg,Date.now())}build(e,n,r){const i=new IX({mutationCache:this,mutationId:++Bg(this,cg)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){const n=lv(e),r=ge(this,Gi).get(n)??[];r.push(e),ge(this,Gi).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=lv(e);if(ge(this,Gi).has(n)){const i=(r=ge(this,Gi).get(n))==null?void 0:r.filter(s=>s!==e);i&&(i.length===0?ge(this,Gi).delete(n):ge(this,Gi).set(n,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=ge(this,Gi).get(lv(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=ge(this,Gi).get(lv(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){mi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...ge(this,Gi).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>$O(n,r))}findAll(e={}){return this.getAll().filter(n=>$O(e,n))}notify(e){mi.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return mi.batch(()=>Promise.all(e.map(n=>n.continue().catch(Us))))}},Gi=new WeakMap,cg=new WeakMap,q$);function lv(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function UO(t){return{onFetch:(e,n)=>{var d,f,h,p,g;const r=e.options,i=(h=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,s=((p=e.state.data)==null?void 0:p.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let c={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},b=q4(e.options,e.fetchOptions),x=async(w,S,C)=>{if(m)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const _={queryKey:e.queryKey,pageParam:S,direction:C?"backward":"forward",meta:e.options.meta};v(_);const A=await b(_),{maxPages:j}=e.options,T=C?CX:SX;return{pages:T(w.pages,A,j),pageParams:T(w.pageParams,S,j)}};if(i&&s.length){const w=i==="backward",S=w?DX:BO,C={pages:s,pageParams:o},_=S(r,C);c=await x(C,_,w)}else{const w=t??s.length;do{const S=l===0?o[0]??r.initialPageParam:BO(r,c);if(l>0&&S==null)break;c=await x(c,S),l++}while(l{var m,v;return(v=(m=e.options).persister)==null?void 0:v.call(m,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function BO(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function DX(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Jn,gc,vc,Fd,Ud,yc,Bd,Hd,Y$,$X=(Y$=class{constructor(t={}){pn(this,Jn);pn(this,gc);pn(this,vc);pn(this,Fd);pn(this,Ud);pn(this,yc);pn(this,Bd);pn(this,Hd);zt(this,Jn,t.queryCache||new OX),zt(this,gc,t.mutationCache||new MX),zt(this,vc,t.defaultOptions||{}),zt(this,Fd,new Map),zt(this,Ud,new Map),zt(this,yc,0)}mount(){Bg(this,yc)._++,ge(this,yc)===1&&(zt(this,Bd,Y4.subscribe(async t=>{t&&(await this.resumePausedMutations(),ge(this,Jn).onFocus())})),zt(this,Hd,zy.subscribe(async t=>{t&&(await this.resumePausedMutations(),ge(this,Jn).onOnline())})))}unmount(){var t,e;Bg(this,yc)._--,ge(this,yc)===0&&((t=ge(this,Bd))==null||t.call(this),zt(this,Bd,void 0),(e=ge(this,Hd))==null||e.call(this),zt(this,Hd,void 0))}isFetching(t){return ge(this,Jn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return ge(this,gc).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ge(this,Jn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=ge(this,Jn).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(MO(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return ge(this,Jn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=ge(this,Jn).get(r.queryHash),s=i==null?void 0:i.state.data,o=gX(e,s);if(o!==void 0)return ge(this,Jn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return mi.batch(()=>ge(this,Jn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ge(this,Jn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=ge(this,Jn);mi.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=ge(this,Jn),r={type:"active",...t};return mi.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=mi.batch(()=>ge(this,Jn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Us).catch(Us)}invalidateQueries(t={},e={}){return mi.batch(()=>{if(ge(this,Jn).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=mi.batch(()=>ge(this,Jn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Us)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Us)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=ge(this,Jn).build(this,e);return n.isStaleByTime(MO(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Us).catch(Us)}fetchInfiniteQuery(t){return t.behavior=UO(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Us).catch(Us)}ensureInfiniteQueryData(t){return t.behavior=UO(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return zy.isOnline()?ge(this,gc).resumePausedMutations():Promise.resolve()}getQueryCache(){return ge(this,Jn)}getMutationCache(){return ge(this,gc)}getDefaultOptions(){return ge(this,vc)}setDefaultOptions(t){zt(this,vc,t)}setQueryDefaults(t,e){ge(this,Fd).set(zp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...ge(this,Fd).values()];let n={};return e.forEach(r=>{Vp(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){ge(this,Ud).set(zp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...ge(this,Ud).values()];let n={};return e.forEach(r=>{Vp(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...ge(this,vc).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=NE(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===TE&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...ge(this,vc).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){ge(this,Jn).clear(),ge(this,gc).clear()}},Jn=new WeakMap,gc=new WeakMap,vc=new WeakMap,Fd=new WeakMap,Ud=new WeakMap,yc=new WeakMap,Bd=new WeakMap,Hd=new WeakMap,Y$),LX=y.createContext(void 0),FX=({client:t,children:e})=>(y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a.jsx(LX.Provider,{value:t,children:e}));/** - * @remix-run/router v1.20.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Gp(){return Gp=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function e5(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function BX(){return Math.random().toString(36).substr(2,8)}function zO(t,e){return{usr:t.state,key:t.key,idx:e}}function $_(t,e,n,r){return n===void 0&&(n=null),Gp({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ff(e):e,{state:n,key:e&&e.key||r||BX()})}function Vy(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ff(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function HX(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,c=wc.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(Gp({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){c=wc.Pop;let v=d(),b=v==null?null:v-u;u=v,l&&l({action:c,location:m.location,delta:b})}function h(v,b){c=wc.Push;let x=$_(m.location,v,b);u=d()+1;let w=zO(x,u),S=m.createHref(x);try{o.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(S)}s&&l&&l({action:c,location:m.location,delta:1})}function p(v,b){c=wc.Replace;let x=$_(m.location,v,b);u=d();let w=zO(x,u),S=m.createHref(x);o.replaceState(w,"",S),s&&l&&l({action:c,location:m.location,delta:0})}function g(v){let b=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof v=="string"?v:Vy(v);return x=x.replace(/ $/,"%20"),ar(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let m={get action(){return c},get location(){return t(i,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(HO,f),l=v,()=>{i.removeEventListener(HO,f),l=null}},createHref(v){return e(i,v)},createURL:g,encodeLocation(v){let b=g(v);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(v){return o.go(v)}};return m}var VO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(VO||(VO={}));function zX(t,e,n){return n===void 0&&(n="/"),VX(t,e,n,!1)}function VX(t,e,n,r){let i=typeof e=="string"?Ff(e):e,s=PE(i.pathname||"/",n);if(s==null)return null;let o=t5(t);GX(o);let c=null;for(let l=0;c==null&&l{let l={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(ar(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Ic([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(ar(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),t5(s.children,e,d,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:JX(u,s.index),routesMeta:d})};return t.forEach((s,o)=>{var c;if(s.path===""||!((c=s.path)!=null&&c.includes("?")))i(s,o);else for(let l of n5(s.path))i(s,o,l)}),e}function n5(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=n5(r.join("/")),c=[];return c.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&c.push(...o),c.map(l=>t.startsWith("/")&&l===""?"/":l)}function GX(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:ZX(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const KX=/^:[\w-]+$/,WX=3,qX=2,YX=1,QX=10,XX=-2,GO=t=>t==="*";function JX(t,e){let n=t.split("/"),r=n.length;return n.some(GO)&&(r+=XX),e&&(r+=qX),n.filter(i=>!GO(i)).reduce((i,s)=>i+(KX.test(s)?WX:s===""?YX:QX),r)}function ZX(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function eJ(t,e,n){let{routesMeta:r}=t,i={},s="/",o=[];for(let c=0;c{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=c[f]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const g=c[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:t}}function tJ(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),e5(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,l)=>(r.push({paramName:c,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function nJ(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return e5(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function PE(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function rJ(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ff(t):t;return{pathname:n?n.startsWith("/")?n:iJ(n,e):e,search:aJ(r),hash:cJ(i)}}function iJ(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function IS(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function sJ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function kE(t,e){let n=sJ(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function OE(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Ff(t):(i=Gp({},t),ar(!i.pathname||!i.pathname.includes("?"),IS("?","pathname","search",i)),ar(!i.pathname||!i.pathname.includes("#"),IS("#","pathname","hash",i)),ar(!i.search||!i.search.includes("#"),IS("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,c;if(o==null)c=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}c=f>=0?e[f]:"/"}let l=rJ(i,c),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Ic=t=>t.join("/").replace(/\/\/+/g,"/"),oJ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),aJ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,cJ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function lJ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const r5=["post","put","patch","delete"];new Set(r5);const uJ=["get",...r5];new Set(uJ);/** - * React Router v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Kp(){return Kp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{c.current=!0}),y.useCallback(function(u,d){if(d===void 0&&(d={}),!c.current)return;if(typeof u=="number"){r.go(u);return}let f=OE(u,JSON.parse(o),s,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Ic([e,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[e,r,o,s,t])}function RE(){let{matches:t}=y.useContext(Ga),e=t[t.length-1];return e?e.params:{}}function o5(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=y.useContext(ul),{matches:i}=y.useContext(Ga),{pathname:s}=Bi(),o=JSON.stringify(kE(i,r.v7_relativeSplatPath));return y.useMemo(()=>OE(t,JSON.parse(o),s,n==="path"),[t,o,s,n])}function pJ(t,e){return mJ(t,e)}function mJ(t,e,n,r){Uf()||ar(!1);let{navigator:i}=y.useContext(ul),{matches:s}=y.useContext(Ga),o=s[s.length-1],c=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Bi(),d;if(e){var f;let v=typeof e=="string"?Ff(e):e;l==="/"||(f=v.pathname)!=null&&f.startsWith(l)||ar(!1),d=v}else d=u;let h=d.pathname||"/",p=h;if(l!=="/"){let v=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=zX(t,{pathname:p}),m=bJ(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},c,v.params),pathname:Ic([l,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Ic([l,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,n,r);return e&&m?y.createElement(v0.Provider,{value:{location:Kp({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:wc.Pop}},m):m}function gJ(){let t=_J(),e=lJ(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},e),n?y.createElement("pre",{style:i},n):null,null)}const vJ=y.createElement(gJ,null);class yJ extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?y.createElement(Ga.Provider,{value:this.props.routeContext},y.createElement(i5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xJ(t){let{routeContext:e,match:n,children:r}=t,i=y.useContext(IE);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Ga.Provider,{value:e},r)}function bJ(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,c=(i=n)==null?void 0:i.errors;if(c!=null){let d=o.findIndex(f=>f.route.id&&(c==null?void 0:c[f.route.id])!==void 0);d>=0||ar(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,m=null,v=null;n&&(p=c&&f.route.id?c[f.route.id]:void 0,m=f.route.errorElement||vJ,l&&(u<0&&h===0?(g=!0,v=null):u===h&&(g=!0,v=f.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,h+1)),x=()=>{let w;return p?w=m:g?w=v:f.route.Component?w=y.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,y.createElement(xJ,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?y.createElement(yJ,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var a5=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(a5||{}),Gy=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Gy||{});function wJ(t){let e=y.useContext(IE);return e||ar(!1),e}function SJ(t){let e=y.useContext(dJ);return e||ar(!1),e}function CJ(t){let e=y.useContext(Ga);return e||ar(!1),e}function c5(t){let e=CJ(),n=e.matches[e.matches.length-1];return n.route.id||ar(!1),n.route.id}function _J(){var t;let e=y.useContext(i5),n=SJ(Gy.UseRouteError),r=c5(Gy.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function AJ(){let{router:t}=wJ(a5.UseNavigateStable),e=c5(Gy.UseNavigateStable),n=y.useRef(!1);return s5(()=>{n.current=!0}),y.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Kp({fromRouteId:e},s)))},[t,e])}function l5(t){let{to:e,replace:n,state:r,relative:i}=t;Uf()||ar(!1);let{future:s,static:o}=y.useContext(ul),{matches:c}=y.useContext(Ga),{pathname:l}=Bi(),u=lr(),d=OE(e,kE(c,s.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(d);return y.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function $s(t){ar(!1)}function jJ(t){let{basename:e="/",children:n=null,location:r,navigationType:i=wc.Pop,navigator:s,static:o=!1,future:c}=t;Uf()&&ar(!1);let l=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:l,navigator:s,static:o,future:Kp({v7_relativeSplatPath:!1},c)}),[l,c,s,o]);typeof r=="string"&&(r=Ff(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=y.useMemo(()=>{let v=PE(d,l);return v==null?null:{location:{pathname:v,search:f,hash:h,state:p,key:g},navigationType:i}},[l,d,f,h,p,g,i]);return m==null?null:y.createElement(ul.Provider,{value:u},y.createElement(v0.Provider,{children:n,value:m}))}function EJ(t){let{children:e,location:n}=t;return pJ(L_(e),n)}new Promise(()=>{});function L_(t,e){e===void 0&&(e=[]);let n=[];return y.Children.forEach(t,(r,i)=>{if(!y.isValidElement(r))return;let s=[...e,i];if(r.type===y.Fragment){n.push.apply(n,L_(r.props.children,s));return}r.type!==$s&&ar(!1),!r.props.index||!r.props.children||ar(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=L_(r.props.children,s)),n.push(o)}),n}/** - * React Router DOM v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function F_(){return F_=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function TJ(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function PJ(t,e){return t.button===0&&(!e||e==="_self")&&!TJ(t)}function U_(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function kJ(t,e){let n=U_(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}const OJ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],IJ="6";try{window.__reactRouterVersion=IJ}catch{}const RJ="startTransition",WO=oL[RJ];function MJ(t){let{basename:e,children:n,future:r,window:i}=t,s=y.useRef();s.current==null&&(s.current=UX({window:i,v5Compat:!0}));let o=s.current,[c,l]=y.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=y.useCallback(f=>{u&&WO?WO(()=>l(f)):l(f)},[l,u]);return y.useLayoutEffect(()=>o.listen(d),[o,d]),y.createElement(jJ,{basename:e,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const DJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$J=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bs=y.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f}=e,h=NJ(e,OJ),{basename:p}=y.useContext(ul),g,m=!1;if(typeof u=="string"&&$J.test(u)&&(g=u,DJ))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=PE(S.pathname,p);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:m=!0}catch{}let v=fJ(u,{relative:i}),b=LJ(u,{replace:o,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f});function x(w){r&&r(w),w.defaultPrevented||b(w)}return y.createElement("a",F_({},h,{href:g||v,onClick:m||s?r:x,ref:n,target:l}))});var qO;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(qO||(qO={}));var YO;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(YO||(YO={}));function LJ(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:c}=e===void 0?{}:e,l=lr(),u=Bi(),d=o5(t,{relative:o});return y.useCallback(f=>{if(PJ(f,n)){f.preventDefault();let h=r!==void 0?r:Vy(u)===Vy(d);l(t,{replace:h,state:i,preventScrollReset:s,relative:o,viewTransition:c})}},[u,l,d,r,i,n,t,s,o,c])}function FJ(t){let e=y.useRef(U_(t)),n=y.useRef(!1),r=Bi(),i=y.useMemo(()=>kJ(r.search,n.current?null:e.current),[r.search]),s=lr(),o=y.useCallback((c,l)=>{const u=U_(typeof c=="function"?c(i):c);n.current=!0,s("?"+u,l)},[s,i]);return[i,o]}/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UJ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u5=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var BJ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HJ=y.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...c},l)=>y.createElement("svg",{ref:l,...BJ,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:u5("lucide",i),...c},[...o.map(([u,d])=>y.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const De=(t,e)=>{const n=y.forwardRef(({className:r,...i},s)=>y.createElement(HJ,{ref:s,iconNode:e,className:u5(`lucide-${UJ(t)}`,r),...i}));return n.displayName=`${t}`,n};/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ma=De("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QO=De("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wp=De("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RS=De("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xa=De("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const du=De("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XO=De("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zJ=De("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const VJ=De("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B_=De("ChartNoAxesColumnIncreasing",[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const GJ=De("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uo=De("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Da=De("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fs=De("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fu=De("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const KJ=De("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ME=De("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zh=De("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const d5=De("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WJ=De("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qJ=De("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DE=De("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YJ=De("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qp=De("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const H_=De("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JO=De("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jc=De("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z_=De("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QJ=De("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yp=De("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XJ=De("FileVideo",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $E=De("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const f5=De("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hs=De("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JJ=De("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const V_=De("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ky=De("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cp=De("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZJ=De("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eZ=De("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G_=De("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tZ=De("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hu=De("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uv=De("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eo=De("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nZ=De("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZO=De("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eI=De("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rZ=De("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iZ=De("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const To=De("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wo=De("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sZ=De("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tI=De("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K_=De("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oZ=De("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aZ=De("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vr=De("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cZ=De("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xl=De("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LE=De("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FE=De("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UE=De("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lZ=De("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uZ=De("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dZ=De("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fZ=De("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hZ=De("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wy=De("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pZ=De("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xv=De("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ir=De("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mZ=De("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gZ=De("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const h5=De("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qp=De("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fr=De("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vZ=De("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mi=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const p5=De("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"}]]);function m5(t,e){return function(){return t.apply(e,arguments)}}const{toString:yZ}=Object.prototype,{getPrototypeOf:BE}=Object,{iterator:y0,toStringTag:g5}=Symbol,x0=(t=>e=>{const n=yZ.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),vo=t=>(t=t.toLowerCase(),e=>x0(e)===t),b0=t=>e=>typeof e===t,{isArray:Bf}=Array,Xp=b0("undefined");function xZ(t){return t!==null&&!Xp(t)&&t.constructor!==null&&!Xp(t.constructor)&&Di(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const v5=vo("ArrayBuffer");function bZ(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&v5(t.buffer),e}const wZ=b0("string"),Di=b0("function"),y5=b0("number"),w0=t=>t!==null&&typeof t=="object",SZ=t=>t===!0||t===!1,Jv=t=>{if(x0(t)!=="object")return!1;const e=BE(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(g5 in t)&&!(y0 in t)},CZ=vo("Date"),_Z=vo("File"),AZ=vo("Blob"),jZ=vo("FileList"),EZ=t=>w0(t)&&Di(t.pipe),NZ=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Di(t.append)&&((e=x0(t))==="formdata"||e==="object"&&Di(t.toString)&&t.toString()==="[object FormData]"))},TZ=vo("URLSearchParams"),[PZ,kZ,OZ,IZ]=["ReadableStream","Request","Response","Headers"].map(vo),RZ=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vg(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Bf(t))for(r=0,i=t.length;r0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Rl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,b5=t=>!Xp(t)&&t!==Rl;function W_(){const{caseless:t}=b5(this)&&this||{},e={},n=(r,i)=>{const s=t&&x5(e,i)||i;Jv(e[s])&&Jv(r)?e[s]=W_(e[s],r):Jv(r)?e[s]=W_({},r):Bf(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r(vg(e,(i,s)=>{n&&Di(i)?t[s]=m5(i,n):t[s]=i},{allOwnKeys:r}),t),DZ=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),$Z=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},LZ=(t,e,n,r)=>{let i,s,o;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!r||r(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=n!==!1&&BE(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},FZ=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},UZ=t=>{if(!t)return null;if(Bf(t))return t;let e=t.length;if(!y5(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},BZ=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&BE(Uint8Array)),HZ=(t,e)=>{const r=(t&&t[y0]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},zZ=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},VZ=vo("HTMLFormElement"),GZ=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),nI=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),KZ=vo("RegExp"),w5=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};vg(n,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(r[s]=o||i)}),Object.defineProperties(t,r)},WZ=t=>{w5(t,(e,n)=>{if(Di(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Di(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},qZ=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Bf(t)?r(t):r(String(t).split(e)),n},YZ=()=>{},QZ=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function XZ(t){return!!(t&&Di(t.append)&&t[g5]==="FormData"&&t[y0])}const JZ=t=>{const e=new Array(10),n=(r,i)=>{if(w0(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=Bf(r)?[]:{};return vg(r,(o,c)=>{const l=n(o,i+1);!Xp(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},ZZ=vo("AsyncFunction"),eee=t=>t&&(w0(t)||Di(t))&&Di(t.then)&&Di(t.catch),S5=((t,e)=>t?setImmediate:e?((n,r)=>(Rl.addEventListener("message",({source:i,data:s})=>{i===Rl&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Rl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Di(Rl.postMessage)),tee=typeof queueMicrotask<"u"?queueMicrotask.bind(Rl):typeof process<"u"&&process.nextTick||S5,nee=t=>t!=null&&Di(t[y0]),re={isArray:Bf,isArrayBuffer:v5,isBuffer:xZ,isFormData:NZ,isArrayBufferView:bZ,isString:wZ,isNumber:y5,isBoolean:SZ,isObject:w0,isPlainObject:Jv,isReadableStream:PZ,isRequest:kZ,isResponse:OZ,isHeaders:IZ,isUndefined:Xp,isDate:CZ,isFile:_Z,isBlob:AZ,isRegExp:KZ,isFunction:Di,isStream:EZ,isURLSearchParams:TZ,isTypedArray:BZ,isFileList:jZ,forEach:vg,merge:W_,extend:MZ,trim:RZ,stripBOM:DZ,inherits:$Z,toFlatObject:LZ,kindOf:x0,kindOfTest:vo,endsWith:FZ,toArray:UZ,forEachEntry:HZ,matchAll:zZ,isHTMLForm:VZ,hasOwnProperty:nI,hasOwnProp:nI,reduceDescriptors:w5,freezeMethods:WZ,toObjectSet:qZ,toCamelCase:GZ,noop:YZ,toFiniteNumber:QZ,findKey:x5,global:Rl,isContextDefined:b5,isSpecCompliantForm:XZ,toJSONObject:JZ,isAsyncFn:ZZ,isThenable:eee,setImmediate:S5,asap:tee,isIterable:nee};function $t(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}re.inherits($t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:re.toJSONObject(this.config),code:this.code,status:this.status}}});const C5=$t.prototype,_5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{_5[t]={value:t}});Object.defineProperties($t,_5);Object.defineProperty(C5,"isAxiosError",{value:!0});$t.from=(t,e,n,r,i,s)=>{const o=Object.create(C5);return re.toFlatObject(t,o,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),$t.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const ree=null;function q_(t){return re.isPlainObject(t)||re.isArray(t)}function A5(t){return re.endsWith(t,"[]")?t.slice(0,-2):t}function rI(t,e,n){return t?t.concat(e).map(function(i,s){return i=A5(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function iee(t){return re.isArray(t)&&!t.some(q_)}const see=re.toFlatObject(re,{},null,function(e){return/^is[A-Z]/.test(e)});function S0(t,e,n){if(!re.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,v){return!re.isUndefined(v[m])});const r=n.metaTokens,i=n.visitor||d,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&re.isSpecCompliantForm(e);if(!re.isFunction(i))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(re.isDate(g))return g.toISOString();if(!l&&re.isBlob(g))throw new $t("Blob is not supported. Use a Buffer instead.");return re.isArrayBuffer(g)||re.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,v){let b=g;if(g&&!v&&typeof g=="object"){if(re.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(re.isArray(g)&&iee(g)||(re.isFileList(g)||re.endsWith(m,"[]"))&&(b=re.toArray(g)))return m=A5(m),b.forEach(function(w,S){!(re.isUndefined(w)||w===null)&&e.append(o===!0?rI([m],S,s):o===null?m:m+"[]",u(w))}),!1}return q_(g)?!0:(e.append(rI(v,m,s),u(g)),!1)}const f=[],h=Object.assign(see,{defaultVisitor:d,convertValue:u,isVisitable:q_});function p(g,m){if(!re.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(g),re.forEach(g,function(b,x){(!(re.isUndefined(b)||b===null)&&i.call(e,b,re.isString(x)?x.trim():x,m,h))===!0&&p(b,m?m.concat(x):[x])}),f.pop()}}if(!re.isObject(t))throw new TypeError("data must be an object");return p(t),e}function iI(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function HE(t,e){this._pairs=[],t&&S0(t,this,e)}const j5=HE.prototype;j5.append=function(e,n){this._pairs.push([e,n])};j5.toString=function(e){const n=e?function(r){return e.call(this,r,iI)}:iI;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function oee(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function E5(t,e,n){if(!e)return t;const r=n&&n.encode||oee;re.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(e,n):s=re.isURLSearchParams(e)?e.toString():new HE(e,n).toString(r),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class sI{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){re.forEach(this.handlers,function(r){r!==null&&e(r)})}}const N5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},aee=typeof URLSearchParams<"u"?URLSearchParams:HE,cee=typeof FormData<"u"?FormData:null,lee=typeof Blob<"u"?Blob:null,uee={isBrowser:!0,classes:{URLSearchParams:aee,FormData:cee,Blob:lee},protocols:["http","https","file","blob","url","data"]},zE=typeof window<"u"&&typeof document<"u",Y_=typeof navigator=="object"&&navigator||void 0,dee=zE&&(!Y_||["ReactNative","NativeScript","NS"].indexOf(Y_.product)<0),fee=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hee=zE&&window.location.href||"http://localhost",pee=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zE,hasStandardBrowserEnv:dee,hasStandardBrowserWebWorkerEnv:fee,navigator:Y_,origin:hee},Symbol.toStringTag,{value:"Module"})),si={...pee,...uee};function mee(t,e){return S0(t,new si.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return si.isNode&&re.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function gee(t){return re.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function vee(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r=n.length;return o=!o&&re.isArray(i)?i.length:o,l?(re.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!c):((!i[o]||!re.isObject(i[o]))&&(i[o]=[]),e(n,r,i[o],s)&&re.isArray(i[o])&&(i[o]=vee(i[o])),!c)}if(re.isFormData(t)&&re.isFunction(t.entries)){const n={};return re.forEachEntry(t,(r,i)=>{e(gee(r),i,n,0)}),n}return null}function yee(t,e,n){if(re.isString(t))try{return(e||JSON.parse)(t),re.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(t)}const yg={transitional:N5,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=re.isObject(e);if(s&&re.isHTMLForm(e)&&(e=new FormData(e)),re.isFormData(e))return i?JSON.stringify(T5(e)):e;if(re.isArrayBuffer(e)||re.isBuffer(e)||re.isStream(e)||re.isFile(e)||re.isBlob(e)||re.isReadableStream(e))return e;if(re.isArrayBufferView(e))return e.buffer;if(re.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mee(e,this.formSerializer).toString();if((c=re.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return S0(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),yee(e)):e}],transformResponse:[function(e){const n=this.transitional||yg.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(re.isResponse(e)||re.isReadableStream(e))return e;if(e&&re.isString(e)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(o)throw c.name==="SyntaxError"?$t.from(c,$t.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:si.classes.FormData,Blob:si.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};re.forEach(["delete","get","head","post","put","patch"],t=>{yg.headers[t]={}});const xee=re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bee=t=>{const e={};let n,r,i;return t&&t.split(` -`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||e[n]&&xee[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},oI=Symbol("internals");function _h(t){return t&&String(t).trim().toLowerCase()}function Zv(t){return t===!1||t==null?t:re.isArray(t)?t.map(Zv):String(t)}function wee(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const See=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function MS(t,e,n,r,i){if(re.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!re.isString(e)){if(re.isString(r))return e.indexOf(r)!==-1;if(re.isRegExp(r))return r.test(e)}}function Cee(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function _ee(t,e){const n=re.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,o){return this[r].call(this,e,i,s,o)},configurable:!0})})}class $i{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(c,l,u){const d=_h(l);if(!d)throw new Error("header name must be a non-empty string");const f=re.findKey(i,d);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(i[f||l]=Zv(c))}const o=(c,l)=>re.forEach(c,(u,d)=>s(u,d,l));if(re.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(re.isString(e)&&(e=e.trim())&&!See(e))o(bee(e),n);else if(re.isObject(e)&&re.isIterable(e)){let c={},l,u;for(const d of e){if(!re.isArray(d))throw TypeError("Object iterator must return a key-value pair");c[u=d[0]]=(l=c[u])?re.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}o(c,n)}else e!=null&&s(n,e,r);return this}get(e,n){if(e=_h(e),e){const r=re.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return wee(i);if(re.isFunction(n))return n.call(this,i,r);if(re.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=_h(e),e){const r=re.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||MS(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(o){if(o=_h(o),o){const c=re.findKey(r,o);c&&(!n||MS(r,r[c],c,n))&&(delete r[c],i=!0)}}return re.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||MS(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return re.forEach(this,(i,s)=>{const o=re.findKey(r,s);if(o){n[o]=Zv(i),delete n[s];return}const c=e?Cee(s):String(s).trim();c!==s&&delete n[s],n[c]=Zv(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return re.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&re.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[oI]=this[oI]={accessors:{}}).accessors,i=this.prototype;function s(o){const c=_h(o);r[c]||(_ee(i,o),r[c]=!0)}return re.isArray(e)?e.forEach(s):s(e),this}}$i.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);re.reduceDescriptors($i.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});re.freezeMethods($i);function DS(t,e){const n=this||yg,r=e||n,i=$i.from(r.headers);let s=r.data;return re.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function P5(t){return!!(t&&t.__CANCEL__)}function Hf(t,e,n){$t.call(this,t??"canceled",$t.ERR_CANCELED,e,n),this.name="CanceledError"}re.inherits(Hf,$t,{__CANCEL__:!0});function k5(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new $t("Request failed with status code "+n.status,[$t.ERR_BAD_REQUEST,$t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Aee(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function jee(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),d=r[s];o||(o=u),n[i]=l,r[i]=u;let f=s,h=0;for(;f!==i;)h+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o{n=d,i=null,s&&(clearTimeout(s),s=null),t.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-f)))},()=>i&&o(i)]}const qy=(t,e,n=3)=>{let r=0;const i=jee(50,250);return Eee(s=>{const o=s.loaded,c=s.lengthComputable?s.total:void 0,l=o-r,u=i(l),d=o<=c;r=o;const f={loaded:o,total:c,progress:c?o/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&d?(c-o)/u:void 0,event:s,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},aI=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},cI=t=>(...e)=>re.asap(()=>t(...e)),Nee=si.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,si.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(si.origin),si.navigator&&/(msie|trident)/i.test(si.navigator.userAgent)):()=>!0,Tee=si.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];re.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),re.isString(r)&&o.push("path="+r),re.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Pee(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function kee(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function O5(t,e,n){let r=!Pee(e);return t&&(r||n==!1)?kee(t,e):e}const lI=t=>t instanceof $i?{...t}:t;function pu(t,e){e=e||{};const n={};function r(u,d,f,h){return re.isPlainObject(u)&&re.isPlainObject(d)?re.merge.call({caseless:h},u,d):re.isPlainObject(d)?re.merge({},d):re.isArray(d)?d.slice():d}function i(u,d,f,h){if(re.isUndefined(d)){if(!re.isUndefined(u))return r(void 0,u,f,h)}else return r(u,d,f,h)}function s(u,d){if(!re.isUndefined(d))return r(void 0,d)}function o(u,d){if(re.isUndefined(d)){if(!re.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function c(u,d,f){if(f in e)return r(u,d);if(f in t)return r(void 0,u)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,d,f)=>i(lI(u),lI(d),f,!0)};return re.forEach(Object.keys(Object.assign({},t,e)),function(d){const f=l[d]||i,h=f(t[d],e[d],d);re.isUndefined(h)&&f!==c||(n[d]=h)}),n}const I5=t=>{const e=pu({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:c}=e;e.headers=o=$i.from(o),e.url=E5(O5(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(re.isFormData(n)){if(si.hasStandardBrowserEnv||si.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(si.hasStandardBrowserEnv&&(r&&re.isFunction(r)&&(r=r(e)),r||r!==!1&&Nee(e.url))){const u=i&&s&&Tee.read(s);u&&o.set(i,u)}return e},Oee=typeof XMLHttpRequest<"u",Iee=Oee&&function(t){return new Promise(function(n,r){const i=I5(t);let s=i.data;const o=$i.from(i.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:u}=i,d,f,h,p,g;function m(){p&&p(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function b(){if(!v)return;const w=$i.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),C={data:!c||c==="text"||c==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:w,config:t,request:v};k5(function(A){n(A),m()},function(A){r(A),m()},C),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(r(new $t("Request aborted",$t.ECONNABORTED,t,v)),v=null)},v.onerror=function(){r(new $t("Network Error",$t.ERR_NETWORK,t,v)),v=null},v.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const C=i.transitional||N5;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),r(new $t(S,C.clarifyTimeoutError?$t.ETIMEDOUT:$t.ECONNABORTED,t,v)),v=null},s===void 0&&o.setContentType(null),"setRequestHeader"in v&&re.forEach(o.toJSON(),function(S,C){v.setRequestHeader(C,S)}),re.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),c&&c!=="json"&&(v.responseType=i.responseType),u&&([h,g]=qy(u,!0),v.addEventListener("progress",h)),l&&v.upload&&([f,p]=qy(l),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(d=w=>{v&&(r(!w||w.type?new Hf(null,t,v):w),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const x=Aee(i.url);if(x&&si.protocols.indexOf(x)===-1){r(new $t("Unsupported protocol "+x+":",$t.ERR_BAD_REQUEST,t));return}v.send(s||null)})},Ree=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,c();const d=u instanceof Error?u:this.reason;r.abort(d instanceof $t?d:new Hf(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,s(new $t(`timeout ${e} of ms exceeded`,$t.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),t=null)};t.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>re.asap(c),l}},Mee=function*(t,e){let n=t.byteLength;if(n{const i=Dee(t,e);let s=0,o,c=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await i.next();if(u){c(),l.close();return}let f=d.byteLength;if(n){let h=s+=f;n(h)}l.enqueue(new Uint8Array(d))}catch(u){throw c(u),u}},cancel(l){return c(l),i.return()}},{highWaterMark:2})},C0=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",R5=C0&&typeof ReadableStream=="function",Lee=C0&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),M5=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Fee=R5&&M5(()=>{let t=!1;const e=new Request(si.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),dI=64*1024,Q_=R5&&M5(()=>re.isReadableStream(new Response("").body)),Yy={stream:Q_&&(t=>t.body)};C0&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Yy[e]&&(Yy[e]=re.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new $t(`Response type '${e}' is not supported`,$t.ERR_NOT_SUPPORT,r)})})})(new Response);const Uee=async t=>{if(t==null)return 0;if(re.isBlob(t))return t.size;if(re.isSpecCompliantForm(t))return(await new Request(si.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(re.isArrayBufferView(t)||re.isArrayBuffer(t))return t.byteLength;if(re.isURLSearchParams(t)&&(t=t+""),re.isString(t))return(await Lee(t)).byteLength},Bee=async(t,e)=>{const n=re.toFiniteNumber(t.getContentLength());return n??Uee(e)},Hee=C0&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:c,onUploadProgress:l,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=I5(t);u=u?(u+"").toLowerCase():"text";let p=Ree([i,s&&s.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let v;try{if(l&&Fee&&n!=="get"&&n!=="head"&&(v=await Bee(d,r))!==0){let C=new Request(e,{method:"POST",body:r,duplex:"half"}),_;if(re.isFormData(r)&&(_=C.headers.get("content-type"))&&d.setContentType(_),C.body){const[A,j]=aI(v,qy(cI(l)));r=uI(C.body,dI,A,j)}}re.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;g=new Request(e,{...h,signal:p,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:b?f:void 0});let x=await fetch(g);const w=Q_&&(u==="stream"||u==="response");if(Q_&&(c||w&&m)){const C={};["status","statusText","headers"].forEach(T=>{C[T]=x[T]});const _=re.toFiniteNumber(x.headers.get("content-length")),[A,j]=c&&aI(_,qy(cI(c),!0))||[];x=new Response(uI(x.body,dI,A,()=>{j&&j(),m&&m()}),C)}u=u||"text";let S=await Yy[re.findKey(Yy,u)||"text"](x,t);return!w&&m&&m(),await new Promise((C,_)=>{k5(C,_,{data:S,headers:$i.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new $t("Network Error",$t.ERR_NETWORK,t,g),{cause:b.cause||b}):$t.from(b,b&&b.code,t,g)}}),X_={http:ree,xhr:Iee,fetch:Hee};re.forEach(X_,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const fI=t=>`- ${t}`,zee=t=>re.isFunction(t)||t===null||t===!1,D5={getAdapter:t=>{t=re.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : -`+s.map(fI).join(` -`):" "+fI(s[0]):"as no adapter specified";throw new $t("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:X_};function $S(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Hf(null,t)}function hI(t){return $S(t),t.headers=$i.from(t.headers),t.data=DS.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),D5.getAdapter(t.adapter||yg.adapter)(t).then(function(r){return $S(t),r.data=DS.call(t,t.transformResponse,r),r.headers=$i.from(r.headers),r},function(r){return P5(r)||($S(t),r&&r.response&&(r.response.data=DS.call(t,t.transformResponse,r.response),r.response.headers=$i.from(r.response.headers))),Promise.reject(r)})}const $5="1.9.0",_0={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{_0[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const pI={};_0.transitional=function(e,n,r){function i(s,o){return"[Axios v"+$5+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,c)=>{if(e===!1)throw new $t(i(o," has been removed"+(n?" in "+n:"")),$t.ERR_DEPRECATED);return n&&!pI[o]&&(pI[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,c):!0}};_0.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Vee(t,e,n){if(typeof t!="object")throw new $t("options must be an object",$t.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const c=t[s],l=c===void 0||o(c,s,t);if(l!==!0)throw new $t("option "+s+" must be "+l,$t.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $t("Unknown option "+s,$t.ERR_BAD_OPTION)}}const ey={assertOptions:Vee,validators:_0},So=ey.validators;class Jl{constructor(e){this.defaults=e||{},this.interceptors={request:new sI,response:new sI}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=pu(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&ey.assertOptions(r,{silentJSONParsing:So.transitional(So.boolean),forcedJSONParsing:So.transitional(So.boolean),clarifyTimeoutError:So.transitional(So.boolean)},!1),i!=null&&(re.isFunction(i)?n.paramsSerializer={serialize:i}:ey.assertOptions(i,{encode:So.function,serialize:So.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ey.assertOptions(n,{baseUrl:So.spelling("baseURL"),withXsrfToken:So.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=$i.concat(o,s);const c=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!l){const g=[hI.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,u),h=g.length,d=Promise.resolve(n);f{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(c=>{r.subscribe(c),s=c}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,c){r.reason||(r.reason=new Hf(s,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new VE(function(i){e=i}),cancel:e}}}function Gee(t){return function(n){return t.apply(null,n)}}function Kee(t){return re.isObject(t)&&t.isAxiosError===!0}const J_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(J_).forEach(([t,e])=>{J_[e]=t});function L5(t){const e=new Jl(t),n=m5(Jl.prototype.request,e);return re.extend(n,Jl.prototype,e,{allOwnKeys:!0}),re.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return L5(pu(t,i))},n}const vr=L5(yg);vr.Axios=Jl;vr.CanceledError=Hf;vr.CancelToken=VE;vr.isCancel=P5;vr.VERSION=$5;vr.toFormData=S0;vr.AxiosError=$t;vr.Cancel=vr.CanceledError;vr.all=function(e){return Promise.all(e)};vr.spread=Gee;vr.isAxiosError=Kee;vr.mergeConfig=pu;vr.AxiosHeaders=$i;vr.formToJSON=t=>T5(re.isHTMLForm(t)?new FormData(t):t);vr.getAdapter=D5.getAdapter;vr.HttpStatusCode=J_;vr.default=vr;const F5="https://ai-sandbox.oliver.solutions/semblance_back/api",Le=vr.create({baseURL:F5,headers:{"Content-Type":"application/json"},timeout:6e5});Le.interceptors.request.use(t=>{var n,r;const e=localStorage.getItem("auth_token");return e&&(t.headers.Authorization=`Bearer ${e}`),t.method==="put"&&((n=t.url)!=null&&n.includes("/focus-groups/"))&&console.log("🌐 API Request:",{method:t.method,url:t.url,baseURL:t.baseURL,fullURL:`${t.baseURL}${t.url}`,data:t.data}),(r=t.url)!=null&&r.includes("/folders/")&&console.log("🌐 API Folder Request:",{method:t.method,url:t.url,baseURL:t.baseURL,fullURL:`${t.baseURL}${t.url}`,data:t.data}),t},t=>Promise.reject(t));const Z_="auth_error",Wee=t=>{t!=null&&t.isPersonaCreation||(localStorage.removeItem("auth_token"),localStorage.removeItem("user"));const e=new CustomEvent(Z_,{detail:t||{}});window.dispatchEvent(e)};Le.interceptors.response.use(t=>t,t=>{var e,n,r,i,s,o;if(t.response&&t.response.status===401){const c=t.config&&(((e=t.config.url)==null?void 0:e.includes("/personas"))||((n=t.config.url)==null?void 0:n.includes("/personas/batch"))||t.config.method&&((r=t.config.url)==null?void 0:r.startsWith("/personas")));console.log("API Error:",{url:(i=t.config)==null?void 0:i.url,method:(s=t.config)==null?void 0:s.method,isPersonaRequest:c}),c?console.warn("Authentication error in persona request, letting component handle it"):Wee({source:(o=t.config)==null?void 0:o.url,isPersonaCreation:!1})}return Promise.reject(t)});const ty={login:(t,e)=>Le.post("/auth/login",{username:t,password:e}),loginWithMicrosoft:t=>Le.post("/auth/microsoft",{id_token:t}),register:(t,e,n)=>Le.post("/auth/register",{username:t,email:e,password:n}),getProfile:()=>Le.get("/auth/me")},$r={getAll:()=>Le.get("/personas/all"),getById:t=>Le.get(`/personas/${t}`),create:t=>Le.post("/personas",t),update:(t,e)=>t&&t.startsWith("local-")?(console.log("Cannot update with local ID, creating new instead:",t),Le.post("/personas",e)):Le.put(`/personas/${t}`,e),delete:t=>{const e=typeof t=="object"&&t!==null&&t._id||t;return console.log(`Deleting persona with ID: ${e}`),Le.delete(`/personas/${e}`)},createBatch:t=>Le.post("/personas/batch",t),exportProfile:(t,e)=>Le.post(`/personas/${t}/export-profile`,e||{},{timeout:3e5})},da={generate:t=>Le.post("/ai-personas/generate",t||{},{timeout:6e5}),generateAndSave:t=>Le.post("/ai-personas/generate-and-save",t||{},{timeout:6e5}),batchGenerate:t=>Le.post("/ai-personas/batch-generate",t,{timeout:6e5}),batchGenerateAndSave:t=>Le.post("/ai-personas/batch-generate-and-save",t,{timeout:6e5}),generateBasicProfiles:(t,e=5,n=.8)=>Le.post("/ai-personas/generate-basic-profiles",{audience_brief:t,count:e,temperature:n},{timeout:6e5}),completePersona:(t,e=.7)=>Le.post("/ai-personas/complete-persona",{basic_profile:t,temperature:e},{timeout:6e5}),completeAndSavePersona:(t,e=.7)=>Le.post("/ai-personas/complete-and-save-persona",{basic_profile:t,temperature:e},{timeout:6e5}),generatePersonaSummary:(t,e=.7)=>Le.post("/ai-personas/generate-persona-summary",{persona_data:t,temperature:e},{timeout:6e5}),batchGenerateWithStages:async(t,e,n=5,r=.7,i,s)=>{var o;try{console.log(`📡 API call to generate-basic-profiles with model: ${s||"gemini-2.5-pro"}`);const l=(await Le.post("/ai-personas/generate-basic-profiles",{audience_brief:t,research_objective:e,count:n,temperature:.7,customer_data_session_id:i,llm_model:s||"gemini-2.5-pro"},{timeout:6e5})).data.profiles,u=[],d=[],f=[];console.log(`📡 API call to complete-and-save-persona with model: ${s||"gemini-2.5-pro"}`);const h=l.map(g=>Le.post("/ai-personas/complete-and-save-persona",{basic_profile:g,temperature:r,customer_data_session_id:i,llm_model:s||"gemini-2.5-pro"},{timeout:6e5}));if((await Promise.allSettled(h)).forEach((g,m)=>{if(g.status==="fulfilled")u.push(g.value.data.persona),d.push(g.value.data.persona_id);else{const v=l[m],b={index:m,name:v.name||`Persona ${m+1}`,error:g.reason};f.push(b),console.error(`Failed to complete persona ${m+1} (${v.name||"unnamed"}):`,g.reason)}}),u.length===0&&f.length>0)throw new Error(`Failed to generate any personas. ${f.length} profile(s) failed.`);return{data:{message:`Generated and saved ${u.length} personas${f.length>0?` (${f.length} failed)`:""}`,personas:u,persona_ids:d,errors:f.length>0?f:void 0,partial_success:f.length>0&&u.length>0}}}catch(c){throw((o=c.response)==null?void 0:o.status)===504||c.code==="ECONNABORTED"?new Error("Timeout error: The server took too long to generate personas. Please try with fewer personas or try again later."):c}},enhanceAudienceBrief:(t,e,n=.7)=>Le.post("/ai-personas/enhance-audience-brief",{audience_brief:t,research_objective:e,temperature:n},{timeout:6e5}),batchGenerateSummaries:(t,e=.7,n)=>(console.log(`📡 Frontend: API call to batch-generate-summaries with model: ${n||"gemini-2.5-pro"}`),Le.post("/ai-personas/batch-generate-summaries",{persona_ids:t,temperature:e,llm_model:n||"gemini-2.5-pro"},{timeout:9e5})),uploadCustomerData:t=>{const e=new FormData;for(let n=0;nLe.delete(`/ai-personas/cleanup-customer-data/${t}`)},bt={getAll:()=>Le.get("/focus-groups"),getById:t=>Le.get(`/focus-groups/${t}`),create:t=>Le.post("/focus-groups",t),update:(t,e)=>Le.put(`/focus-groups/${t}`,e),delete:t=>Le.delete(`/focus-groups/${t}`),addParticipant:(t,e)=>Le.post(`/focus-groups/${t}/participants`,{persona_id:e}),removeParticipant:(t,e)=>Le.delete(`/focus-groups/${t}/participants/${e}`),sendMessage:(t,e)=>Le.post(`/focus-groups/${t}/messages`,e),getMessages:t=>Le.get(`/focus-groups/${t}/messages`),updateMessageHighlight:(t,e,n)=>Le.patch(`/focus-groups/${t}/messages/${e}`,{highlighted:n}),describeAsset:(t,e)=>Le.post(`/focus-groups/${t}/describe-asset`,{asset_filename:e},{timeout:12e4}),generateDiscussionGuide:t=>Le.post("/focus-groups/generate-discussion-guide",t,{timeout:6e5}),generateDiscussionGuideForGroup:(t,e)=>Le.post(`/focus-groups/${t}/generate-discussion-guide`,e,{timeout:6e5}),downloadDiscussionGuide:async t=>{try{const e=await Le.get(`/focus-groups/${t}/discussion-guide/download`,{responseType:"blob",timeout:3e4}),n=e.headers["content-disposition"];let r="discussion-guide.md";if(n){const c=n.match(/filename="([^"]+)"/);c&&(r=c[1])}const i=new Blob([e.data],{type:"text/markdown"}),s=URL.createObjectURL(i),o=document.createElement("a");return o.href=s,o.download=r,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s),{success:!0,filename:r}}catch(e){throw console.error("Error downloading discussion guide:",e),new Error("Failed to download discussion guide")}},createNote:(t,e)=>Le.post(`/focus-groups/${t}/notes`,e),getNotes:t=>Le.get(`/focus-groups/${t}/notes`),deleteNote:(t,e)=>Le.delete(`/focus-groups/${t}/notes/${e}`),uploadAssets:(t,e,n)=>(n===!0&&e.append("replace","true"),Le.post(`/focus-groups/${t}/assets`,e,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4})),getAssets:t=>Le.get(`/focus-groups/${t}/assets`),getAssetUrl:(t,e)=>`${F5}/focus-groups/${t}/assets/${e}`,updateAssetName:(t,e,n)=>Le.patch(`/focus-groups/${t}/assets/${e}`,{user_assigned_name:n}),deleteAsset:(t,e)=>Le.delete(`/focus-groups/${t}/assets/${e}`)},er={generateResponse:(t,e,n,r=.7)=>Le.post("/focus-group-ai/generate-response",{focus_group_id:t,persona_id:e,current_topic:n,temperature:r},{timeout:6e5}),generateKeyThemes:(t,e=.7)=>Le.post("/focus-group-ai/generate-key-themes",{focus_group_id:t,temperature:e},{timeout:6e5}),getKeyThemes:t=>Le.get(`/focus-group-ai/key-themes/${t}`),deleteKeyTheme:(t,e)=>Le.delete(`/focus-group-ai/key-themes/${t}/${e}`),getModeratorStatus:t=>Le.get(`/focus-group-ai/moderator/status/${t}`),advanceModeratorDiscussion:t=>Le.post(`/focus-group-ai/moderator/advance/${t}`,{},{timeout:6e5}),setModeratorPosition:(t,e,n)=>Le.put(`/focus-group-ai/moderator/position/${t}`,{section_id:e,item_id:n}),startAutonomousConversation:(t,e)=>Le.post(`/focus-group-ai/autonomous/start/${t}`,{initial_prompt:e},{timeout:6e5}),stopAutonomousConversation:(t,e)=>Le.post(`/focus-group-ai/autonomous/stop/${t}`,{reason:e}),getAutonomousConversationStatus:t=>Le.get(`/focus-group-ai/autonomous/status/${t}`),getConversationState:t=>Le.get(`/focus-group-ai/conversation/state/${t}`),getConversationAnalytics:t=>Le.get(`/focus-group-ai/conversation/analytics/${t}`),makeConversationDecision:(t,e=.7,n="ai")=>Le.post(`/focus-group-ai/conversation/decision/${t}`,{temperature:e,mode:n},{timeout:6e5}),getConversationInsights:t=>Le.get(`/focus-group-ai/conversation/insights/${t}`,{timeout:6e5}),manualIntervention:(t,e,n,r)=>Le.post(`/focus-group-ai/conversation/intervene/${t}`,{action:e,message:n,participant_id:r}),getReasoningHistory:t=>Le.get(`/focus-group-ai/conversation/reasoning-history/${t}`),endSession:(t,e)=>Le.post(`/focus-group-ai/moderator/end-session/${t}`,{reason:e||"session_ended"})},Po={getAll:()=>Le.get("/folders"),getById:t=>Le.get(`/folders/${t}`),create:t=>Le.post("/folders",t),update:(t,e)=>Le.put(`/folders/${t}`,e),delete:t=>Le.delete(`/folders/${t}`),addPersona:(t,e)=>Le.post(`/folders/${t}/personas`,{persona_id:e}),removePersona:(t,e)=>Le.delete(`/folders/${t}/personas/${e}`),addPersonasBatch:(t,e)=>Le.post(`/folders/${t}/personas/batch`,{persona_ids:e}),removePersonasBatch:(t,e)=>(console.log(`🌐 API removePersonasBatch: Sending POST to /folders/${t}/personas/remove-batch with persona_ids:`,e),Le.post(`/folders/${t}/personas/remove-batch`,{persona_ids:e})),addPersonaToMultipleFolders:(t,e)=>{const n=e.map(r=>Le.post(`/folders/${r}/personas`,{persona_id:t}));return Promise.all(n)},removePersonaFromAllFolders:t=>{throw new Error("Use removePersona for specific folders")}};/*! @azure/msal-common v15.10.0 2025-08-05 */const pe={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Sc={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,GONE:410,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},Ml={GET:"GET",POST:"POST"},xg=[pe.OPENID_SCOPE,pe.PROFILE_SCOPE,pe.OFFLINE_ACCESS_SCOPE],mI=[...xg,pe.EMAIL_SCOPE],hi={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},gI={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},Rc={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},dv={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},gi={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},GE={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},A0={QUERY:"query",FRAGMENT:"fragment"},qee={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},U5={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},fv={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},Jp={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},Gr={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},KE="appmetadata",Yee="client_info",Qy="1",Xy={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},zi={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Br={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},yn={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},lp={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},vI={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},Fu={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},LS={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},jl={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},Qee={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},B5=300;/*! @azure/msal-common v15.10.0 2025-08-05 */const Jy="unexpected_error",Xee="post_request_failed";/*! @azure/msal-common v15.10.0 2025-08-05 */const yI={[Jy]:"Unexpected error in authentication.",[Xee]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class Cn extends Error{constructor(e,n,r){const i=n?`${e}: ${n}`:e;super(i),Object.setPrototypeOf(this,Cn.prototype),this.errorCode=e||pe.EMPTY_STRING,this.errorMessage=n||pe.EMPTY_STRING,this.subError=r||pe.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function eA(t,e){return new Cn(t,e?`${yI[t]} ${e}`:yI[t])}/*! @azure/msal-common v15.10.0 2025-08-05 */const WE="client_info_decoding_error",H5="client_info_empty_error",qE="token_parsing_error",z5="null_or_empty_token",fa="endpoints_resolution_error",V5="network_error",G5="openid_config_error",K5="hash_not_deserialized",Jd="invalid_state",W5="state_mismatch",tA="state_not_found",q5="nonce_mismatch",YE="auth_time_not_found",Y5="max_age_transpired",Jee="multiple_matching_tokens",Zee="multiple_matching_accounts",Q5="multiple_matching_appMetadata",X5="request_cannot_be_made",J5="cannot_remove_empty_scope",Z5="cannot_append_scopeset",nA="empty_input_scopeset",ete="device_code_polling_cancelled",tte="device_code_expired",nte="device_code_unknown_error",QE="no_account_in_silent_request",eU="invalid_cache_record",XE="invalid_cache_environment",rA="no_account_found",iA="no_crypto_object",rte="unexpected_credential_type",ite="invalid_assertion",ste="invalid_client_credential",Mc="token_refresh_required",ote="user_timeout_reached",tU="token_claims_cnf_required_for_signedjwt",nU="authorization_code_missing_from_server_response",rU="binding_key_not_removed",iU="end_session_endpoint_not_supported",JE="key_id_missing",ate="no_network_connectivity",cte="user_canceled",lte="missing_tenant_id_error",Vt="method_not_implemented",ute="nested_app_auth_bridge_disabled";/*! @azure/msal-common v15.10.0 2025-08-05 */const xI={[WE]:"The client info could not be parsed/decoded correctly",[H5]:"The client info was empty",[qE]:"Token cannot be parsed",[z5]:"The token is null or empty",[fa]:"Endpoints cannot be resolved",[V5]:"Network request failed",[G5]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[K5]:"The hash parameters could not be deserialized",[Jd]:"State was not the expected format",[W5]:"State mismatch error",[tA]:"State not found",[q5]:"Nonce mismatch error",[YE]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Y5]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[Jee]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[Zee]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[Q5]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[X5]:"Token request cannot be made without authorization code or refresh token.",[J5]:"Cannot remove null or empty scope from ScopeSet",[Z5]:"Cannot append ScopeSet",[nA]:"Empty input ScopeSet cannot be processed",[ete]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[tte]:"Device code is expired.",[nte]:"Device code stopped polling for unknown reasons.",[QE]:"Please pass an account object, silent flow is not supported without account information",[eU]:"Cache record object was null or undefined.",[XE]:"Invalid environment when attempting to create cache entry",[rA]:"No account found in cache for given key.",[iA]:"No crypto object detected.",[rte]:"Unexpected credential type.",[ite]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[ste]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[Mc]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[ote]:"User defined timeout for device code polling reached",[tU]:"Cannot generate a POP jwt if the token_claims are not populated",[nU]:"Server response does not contain an authorization code to proceed",[rU]:"Could not remove the credential's binding key from storage.",[iU]:"The provided authority does not support logout",[JE]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[ate]:"No network connectivity. Check your internet connection.",[cte]:"User cancelled the flow.",[lte]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Vt]:"This method has not been implemented",[ute]:"The nested app auth bridge is disabled"};class ZE extends Cn{constructor(e,n){super(e,n?`${xI[e]}: ${n}`:xI[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,ZE.prototype)}}function Se(t,e){return new ZE(t,e)}/*! @azure/msal-common v15.10.0 2025-08-05 */const Zy={createNewGuid:()=>{throw Se(Vt)},base64Decode:()=>{throw Se(Vt)},base64Encode:()=>{throw Se(Vt)},base64UrlEncode:()=>{throw Se(Vt)},encodeKid:()=>{throw Se(Vt)},async getPublicKeyThumbprint(){throw Se(Vt)},async removeTokenBindingKey(){throw Se(Vt)},async clearKeystore(){throw Se(Vt)},async signJwt(){throw Se(Vt)},async hashString(){throw Se(Vt)}};/*! @azure/msal-common v15.10.0 2025-08-05 */var Rn;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(Rn||(Rn={}));class $a{constructor(e,n,r){this.level=Rn.Info;const i=()=>{},s=e||$a.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||i,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:Rn.Info,this.correlationId=s.correlationId||pe.EMPTY_STRING,this.packageName=n||pe.EMPTY_STRING,this.packageVersion=r||pe.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Rn.Info}}clone(e,n,r){return new $a({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,n)}logMessage(e,n){if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const s=`${`[${new Date().toUTCString()}] : [${n.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${Rn[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,s,n.containsPii||!1)}executeCallback(e,n,r){this.localCallback&&this.localCallback(e,n,r)}error(e,n){this.logMessage(e,{logLevel:Rn.Error,containsPii:!1,correlationId:n||pe.EMPTY_STRING})}errorPii(e,n){this.logMessage(e,{logLevel:Rn.Error,containsPii:!0,correlationId:n||pe.EMPTY_STRING})}warning(e,n){this.logMessage(e,{logLevel:Rn.Warning,containsPii:!1,correlationId:n||pe.EMPTY_STRING})}warningPii(e,n){this.logMessage(e,{logLevel:Rn.Warning,containsPii:!0,correlationId:n||pe.EMPTY_STRING})}info(e,n){this.logMessage(e,{logLevel:Rn.Info,containsPii:!1,correlationId:n||pe.EMPTY_STRING})}infoPii(e,n){this.logMessage(e,{logLevel:Rn.Info,containsPii:!0,correlationId:n||pe.EMPTY_STRING})}verbose(e,n){this.logMessage(e,{logLevel:Rn.Verbose,containsPii:!1,correlationId:n||pe.EMPTY_STRING})}verbosePii(e,n){this.logMessage(e,{logLevel:Rn.Verbose,containsPii:!0,correlationId:n||pe.EMPTY_STRING})}trace(e,n){this.logMessage(e,{logLevel:Rn.Trace,containsPii:!1,correlationId:n||pe.EMPTY_STRING})}tracePii(e,n){this.logMessage(e,{logLevel:Rn.Trace,containsPii:!0,correlationId:n||pe.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v15.10.0 2025-08-05 */const sU="@azure/msal-common",eN="15.10.0";/*! @azure/msal-common v15.10.0 2025-08-05 */const tN={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};/*! @azure/msal-common v15.10.0 2025-08-05 */const oU="redirect_uri_empty",dte="claims_request_parsing_error",aU="authority_uri_insecure",Vh="url_parse_error",cU="empty_url_error",lU="empty_input_scopes_error",nN="invalid_claims",uU="token_request_empty",dU="logout_request_empty",fte="invalid_code_challenge_method",rN="pkce_params_missing",iN="invalid_cloud_discovery_metadata",fU="invalid_authority_metadata",hU="untrusted_authority",j0="missing_ssh_jwk",pU="missing_ssh_kid",hte="missing_nonce_authentication_header",pte="invalid_authentication_header",mU="cannot_set_OIDCOptions",gU="cannot_allow_platform_broker",vU="authority_mismatch",yU="invalid_request_method_for_EAR",xU="invalid_authorize_post_body_parameters";/*! @azure/msal-common v15.10.0 2025-08-05 */const mte={[oU]:"A redirect URI is required for all calls, and none has been set.",[dte]:"Could not parse the given claims request object.",[aU]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Vh]:"URL could not be parsed into appropriate segments.",[cU]:"URL was empty or null.",[lU]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[nN]:"Given claims parameter must be a stringified JSON object.",[uU]:"Token request was empty and not found in cache.",[dU]:"The logout request was null or undefined.",[fte]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[rN]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[iN]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[fU]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[hU]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[j0]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[pU]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[hte]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[pte]:"Invalid authentication header provided",[mU]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[gU]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[vU]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",[xU]:"Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",[yU]:"Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST."};class sN extends Cn{constructor(e){super(e,mte[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,sN.prototype)}}function An(t){return new sN(t)}/*! @azure/msal-common v15.10.0 2025-08-05 */class Uo{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},r=e.split("&"),i=s=>decodeURIComponent(s.replace(/\+/g," "));return r.forEach(s=>{if(s.trim()){const[o,c]=s.split(/=(.+)/g,2);o&&c&&(n[i(o)]=i(c))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class Er{constructor(e){const n=e?Uo.trimArrayEntries([...e]):[],r=n?Uo.removeEmptyStringsFromArray(n):[];if(!r||!r.length)throw An(lU);this.scopes=new Set,r.forEach(i=>this.scopes.add(i))}static fromString(e){const r=(e||pe.EMPTY_STRING).split(" ");return new Er(r)}static createSearchScopes(e){const n=new Er(e);return n.containsOnlyOIDCScopes()?n.removeScope(pe.OFFLINE_ACCESS_SCOPE):n.removeOIDCScopes(),n}containsScope(e){const n=this.printScopesLowerCase().split(" "),r=new Er(n);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return mI.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw Se(Z5)}}removeScope(e){if(!e)throw Se(J5);this.scopes.delete(e.trim())}removeOIDCScopes(){mI.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Se(nA);const n=new Set;return e.scopes.forEach(r=>n.add(r.toLowerCase())),this.scopes.forEach(r=>n.add(r.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw Se(nA);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),r=e.getScopeCount(),i=this.getScopeCount();return n.sizee.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):pe.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v15.10.0 2025-08-05 */function bI(t,e){return!!t&&!!e&&t===e.split(".")[1]}function oN(t,e,n,r){if(r){const{oid:i,sub:s,tid:o,name:c,tfp:l,acr:u,preferred_username:d,upn:f,login_hint:h}=r,p=o||l||u||"";return{tenantId:p,localAccountId:i||s||"",name:c,username:d||f||"",loginHint:h,isHomeTenant:bI(p,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:bI(n,t)}}function aN(t,e,n,r){let i=t;if(e){const{isHomeTenant:s,...o}=e;i={...t,...o}}if(n){const{isHomeTenant:s,...o}=oN(t.homeAccountId,t.localAccountId,t.tenantId,n);return i={...i,...o,idTokenClaims:n,idToken:r},i}return i}/*! @azure/msal-common v15.10.0 2025-08-05 */function zf(t,e){const n=gte(t);try{const r=e(n);return JSON.parse(r)}catch{throw Se(qE)}}function gte(t){if(!t)throw Se(z5);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw Se(qE);return n[2]}function bU(t,e){if(e===0||Date.now()-3e5>t+e)throw Se(Y5)}/*! @azure/msal-common v15.10.0 2025-08-05 */function wU(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function ex(t){if(!t||t.indexOf("=")<0)return null;try{const e=wU(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw Se(K5)}return null}function Zp(t,e=!0,n){const r=new Array;return t.forEach((i,s)=>{!e&&n&&s in n?r.push(`${s}=${i}`):r.push(`${s}=${encodeURIComponent(i)}`)}),r.join("&")}/*! @azure/msal-common v15.10.0 2025-08-05 */class en{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw An(cU);e.includes("#")||(this._urlString=en.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return Uo.endsWith(n,"?")?n=n.slice(0,-1):Uo.endsWith(n,"?/")&&(n=n.slice(0,-2)),Uo.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw An(Vh)}if(!e.HostNameAndPort||!e.PathSegments)throw An(Vh);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw An(aU)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return en.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),r=n.PathSegments;return e&&r.length!==0&&(r[0]===Rc.COMMON||r[0]===Rc.ORGANIZATIONS)&&(r[0]=e),en.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw An(Vh);const r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let i=r.AbsolutePath.split("/");return i=i.filter(s=>s&&s.length>0),r.PathSegments=i,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(n);if(!r)throw An(Vh);return r[2]}static getAbsoluteUrl(e,n){if(e[0]===pe.FORWARD_SLASH){const i=new en(n).getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new en(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!ex(e)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const SU={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},wI=SU.endpointMetadata,cN=SU.instanceDiscoveryMetadata,CU=new Set;cN.metadata.forEach(t=>{t.aliases.forEach(e=>{CU.add(e)})});function vte(t,e){var i;let n;const r=t.canonicalAuthority;if(r){const s=new en(r).getUrlComponents().HostNameAndPort;n=SI(s,(i=t.cloudDiscoveryMetadata)==null?void 0:i.metadata,zi.CONFIG,e)||SI(s,cN.metadata,zi.HARDCODED_VALUES,e)||t.knownAuthorities}return n||[]}function SI(t,e,n,r){if(r==null||r.trace(`getAliasesFromMetadata called with source: ${n}`),t&&e){const i=tx(e,t);if(i)return r==null||r.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${n}, returning aliases`),i.aliases;r==null||r.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${n}`)}return null}function yte(t){return tx(cN.metadata,t)}function tx(t,e){for(let n=0;n1?r.sort(s=>s.idTokenClaims?-1:1)[0]:r.length===1?r[0]:null}getBaseAccountInfo(e,n){const r=this.getAccountsFilteredBy(e,n);return r.length>0?r[0].getAccountInfo():null}buildTenantProfiles(e,n,r){return e.flatMap(i=>this.getTenantProfilesFromAccountEntity(i,n,r==null?void 0:r.tenantId,r))}getTenantedAccountInfoByFilter(e,n,r,i,s){let o=null,c;if(s&&!this.tenantProfileMatchesFilter(r,s))return null;const l=this.getIdToken(e,i,n,r.tenantId);return l&&(c=zf(l.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(c,s))?null:(o=aN(e,r,c,l==null?void 0:l.secret),o)}getTenantProfilesFromAccountEntity(e,n,r,i){const s=e.getAccountInfo();let o=s.tenantProfiles||new Map;const c=this.getTokenKeys();if(r){const u=o.get(r);if(u)o=new Map([[r,u]]);else return[]}const l=[];return o.forEach(u=>{const d=this.getTenantedAccountInfoByFilter(s,c,u,n,i);d&&l.push(d)}),l}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,r){var i;if(!e)throw Se(eU);try{e.account&&await this.setAccount(e.account,n),e.idToken&&(r==null?void 0:r.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,n),e.accessToken&&(r==null?void 0:r.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,n),e.refreshToken&&(r==null?void 0:r.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(s){throw(i=this.commonLogger)==null||i.error("CacheManager.saveCacheRecord: failed"),s instanceof Cn?s:sA(s)}}async saveAccessToken(e,n){const r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),s=Er.fromString(e.target);i.accessToken.forEach(o=>{if(!this.accessTokenKeyMatchesFilter(o,r,!1))return;const c=this.getAccessTokenCredential(o,n);c&&this.credentialMatchesFilter(c,r)&&Er.fromString(c.target).intersectingScopeSets(s)&&this.removeAccessToken(o,n)}),await this.setAccessTokenCredential(e,n)}getAccountsFilteredBy(e,n){const r=this.getAccountKeys(),i=[];return r.forEach(s=>{var u;const o=this.getAccount(s,n);if(!o||e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId)||e.username&&!this.matchUsername(o.username,e.username)||e.environment&&!this.matchEnvironment(o,e.environment)||e.realm&&!this.matchRealm(o,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(o,e.authorityType))return;const c={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},l=(u=o.tenantProfiles)==null?void 0:u.filter(d=>this.tenantProfileMatchesFilter(d,c));l&&l.length===0||i.push(o)}),i}credentialMatchesFilter(e,n){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||(n.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==n.requestedClaimsHash||e.credentialType===Gr.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===yn.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e){const n=this.getKeys(),r={};return n.forEach(i=>{if(!this.isAppMetadata(i))return;const s=this.getAppMetadata(i);s&&(e.environment&&!this.matchEnvironment(s,e.environment)||e.clientId&&!this.matchClientId(s,e.clientId)||(r[i]=s))}),r}getAuthorityMetadataByAlias(e){const n=this.getAuthorityMetadataKeys();let r=null;return n.forEach(i=>{if(!this.isAuthorityMetadata(i)||i.indexOf(this.clientId)===-1)return;const s=this.getAuthorityMetadata(i);s&&s.aliases.indexOf(e)!==-1&&(r=s)}),r}removeAllAccounts(e){this.getAllAccounts({},e).forEach(r=>{this.removeAccount(r,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const r=this.getAccountKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.filter(i).forEach(s=>{this.removeItem(s,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const r=this.getTokenKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.idToken.filter(i).forEach(s=>{this.removeIdToken(s,n)}),r.accessToken.filter(i).forEach(s=>{this.removeAccessToken(s,n)}),r.refreshToken.filter(i).forEach(s=>{this.removeRefreshToken(s,n)})}removeAccessToken(e,n){const r=this.getAccessTokenCredential(e,n);if(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),!r||r.credentialType.toLowerCase()!==Gr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||r.tokenType!==yn.POP)return;const i=r.keyId;i&&this.cryptoImpl.removeTokenBindingKey(i).catch(()=>{var s;this.commonLogger.error(`Failed to remove token binding key ${i}`,n),(s=this.performanceClient)==null||s.incrementFields({removeTokenBindingKeyFailure:1},n)})}removeAppMetadata(e){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r,e)}),!0}getIdToken(e,n,r,i,s){this.commonLogger.trace("CacheManager - getIdToken called");const o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Gr.ID_TOKEN,clientId:this.clientId,realm:i},c=this.getIdTokensByFilter(o,n,r),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(l>1){let u=c;if(!i){const d=new Map;c.forEach((h,p)=>{h.realm===e.tenantId&&d.set(p,h)});const f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),u.forEach((d,f)=>{this.removeIdToken(f,n)}),s&&n&&s.addFields({multiMatchedID:c.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),c.values().next().value}getIdTokensByFilter(e,n,r){const i=r&&r.idToken||this.getTokenKeys().idToken,s=new Map;return i.forEach(o=>{if(!this.idTokenKeyMatchesFilter(o,{clientId:this.clientId,...e}))return;const c=this.getIdTokenCredential(o,n);c&&this.credentialMatchesFilter(c,e)&&s.set(o,c)}),s}idTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,r,i){const s=n.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);const o=Er.createSearchScopes(n.scopes),c=n.authenticationScheme||yn.BEARER,l=c&&c.toLowerCase()!==yn.BEARER.toLowerCase()?Gr.ACCESS_TOKEN_WITH_AUTH_SCHEME:Gr.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:l,clientId:this.clientId,realm:i||e.tenantId,target:o,tokenType:c,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},d=r&&r.accessToken||this.getTokenKeys().accessToken,f=[];d.forEach(p=>{if(this.accessTokenKeyMatchesFilter(p,u,!0)){const g=this.getAccessTokenCredential(p,s);g&&this.credentialMatchesFilter(g,u)&&f.push(g)}});const h=f.length;return h<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):h>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),f.forEach(p=>{this.removeAccessToken(this.generateCredentialKey(p),s)}),this.performanceClient.addFields({multiMatchedAT:f.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),f[0])}accessTokenKeyMatchesFilter(e,n,r){const i=e.toLowerCase();if(n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&i.indexOf(n.realm.toLowerCase())===-1||n.requestedClaimsHash&&i.indexOf(n.requestedClaimsHash.toLowerCase())===-1)return!1;if(n.target){const s=n.target.asArray();for(let o=0;o{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;const o=this.getAccessTokenCredential(s,n);o&&this.credentialMatchesFilter(o,e)&&i.push(o)}),i}getRefreshToken(e,n,r,i,s){this.commonLogger.trace("CacheManager - getRefreshToken called");const o=n?Qy:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Gr.REFRESH_TOKEN,clientId:this.clientId,familyId:o},l=i&&i.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){const h=this.getRefreshTokenCredential(f,r);h&&this.credentialMatchesFilter(h,c)&&u.push(h)}});const d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(d>1&&s&&r&&s.addFields({multiMatchedRT:d},r),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),u[0])}refreshTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.familyId&&r.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const n={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(n),i=Object.keys(r).map(o=>r[o]),s=i.length;if(s<1)return null;if(s>1)throw Se(Q5);return i[0]}isAppMetadataFOCI(e){const n=this.readAppMetadataFromCache(e);return!!(n&&n.familyId===Qy)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const r=e.oid||e.sub;return n===r}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){var r;return n.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,n){return!!(e&&typeof e=="string"&&(n==null?void 0:n.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n){if(this.staticAuthorityOptions){const i=vte(this.staticAuthorityOptions,this.commonLogger);if(i.includes(n)&&i.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(n);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==Gr.ACCESS_TOKEN&&e.credentialType!==Gr.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Er.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(KE)!==-1}isAuthorityMetadata(e){return e.indexOf(Xy.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${Xy.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,n){for(const r in n)e[r]=n[r];return e}}class xte extends oA{async setAccount(){throw Se(Vt)}getAccount(){throw Se(Vt)}async setIdTokenCredential(){throw Se(Vt)}getIdTokenCredential(){throw Se(Vt)}async setAccessTokenCredential(){throw Se(Vt)}getAccessTokenCredential(){throw Se(Vt)}async setRefreshTokenCredential(){throw Se(Vt)}getRefreshTokenCredential(){throw Se(Vt)}setAppMetadata(){throw Se(Vt)}getAppMetadata(){throw Se(Vt)}setServerTelemetry(){throw Se(Vt)}getServerTelemetry(){throw Se(Vt)}setAuthorityMetadata(){throw Se(Vt)}getAuthorityMetadata(){throw Se(Vt)}getAuthorityMetadataKeys(){throw Se(Vt)}setThrottlingCache(){throw Se(Vt)}getThrottlingCache(){throw Se(Vt)}removeItem(){throw Se(Vt)}getKeys(){throw Se(Vt)}getAccountKeys(){throw Se(Vt)}getTokenKeys(){throw Se(Vt)}generateCredentialKey(){throw Se(Vt)}generateAccountKey(){throw Se(Vt)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const Li={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v15.10.0 2025-08-05 */const K={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},bte={NotStarted:0,InProgress:1,Completed:2};/*! @azure/msal-common v15.10.0 2025-08-05 */class CI{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class _U{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:bte.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new CI}}startPerformanceMeasurement(){return new CI}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-common v15.10.0 2025-08-05 */const AU={tokenRenewalOffsetSeconds:B5,preventCorsPreflight:!1},wte={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Rn.Info,correlationId:pe.EMPTY_STRING},Ste={claimsBasedCachingEnabled:!1},Cte={async sendGetRequestAsync(){throw Se(Vt)},async sendPostRequestAsync(){throw Se(Vt)}},_te={sku:pe.SKU,version:eN,cpu:pe.EMPTY_STRING,os:pe.EMPTY_STRING},Ate={clientSecret:pe.EMPTY_STRING,clientAssertion:void 0},jte={azureCloudInstance:tN.None,tenant:`${pe.DEFAULT_COMMON_TENANT}`},Ete={application:{appName:"",appVersion:""}};function Nte({authOptions:t,systemOptions:e,loggerOptions:n,cacheOptions:r,storageInterface:i,networkInterface:s,cryptoInterface:o,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){const p={...wte,...n};return{authOptions:Tte(t),systemOptions:{...AU,...e},loggerOptions:p,cacheOptions:{...Ste,...r},storageInterface:i||new xte(t.clientId,Zy,new $a(p),new _U),networkInterface:s||Cte,cryptoInterface:o||Zy,clientCredentials:c||Ate,libraryInfo:{..._te,...l},telemetry:{...Ete,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}function Tte(t){return{clientCapabilities:[],azureCloudOptions:jte,skipAuthorityMetadataCache:!1,instanceAware:!1,encodeExtraQueryParams:!1,...t}}function jU(t){return t.authOptions.authority.options.protocolMode===Li.OIDC}/*! @azure/msal-common v15.10.0 2025-08-05 */const Ys={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v15.10.0 2025-08-05 */function rx(t,e){if(!t)throw Se(H5);try{const n=e(t);return JSON.parse(n)}catch{throw Se(WE)}}function _d(t){if(!t)throw Se(WE);const e=t.split(Jp.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?pe.EMPTY_STRING:e[1]}}/*! @azure/msal-common v15.10.0 2025-08-05 */const mu="client_id",EU="redirect_uri",Pte="response_type",kte="response_mode",Ote="grant_type",Ite="claims",Rte="scope",Mte="refresh_token",Dte="state",$te="nonce",Lte="prompt",Fte="code",Ute="code_challenge",Bte="code_challenge_method",Hte="code_verifier",zte="client-request-id",Vte="x-client-SKU",Gte="x-client-VER",Kte="x-client-OS",Wte="x-client-CPU",qte="x-client-current-telemetry",Yte="x-client-last-telemetry",Qte="x-ms-lib-capability",Xte="x-app-name",Jte="x-app-ver",Zte="post_logout_redirect_uri",ene="id_token_hint",tne="client_secret",nne="client_assertion",rne="client_assertion_type",NU="token_type",TU="req_cnf",_I="return_spa_code",ine="nativebroker",sne="logout_hint",one="sid",ane="login_hint",cne="domain_hint",lne="x-client-xtra-sku",ix="brk_client_id",sx="brk_redirect_uri",aA="instance_aware",une="ear_jwk",dne="ear_jwe_crypto";/*! @azure/msal-common v15.10.0 2025-08-05 */function E0(t,e,n){if(!e)return;const r=t.get(mu);r&&t.has(ix)&&(n==null||n.addFields({embeddedClientId:r,embeddedRedirectUri:t.get(EU)},e))}function uN(t,e){t.set(Pte,e)}function fne(t,e){t.set(kte,e||qee.QUERY)}function hne(t){t.set(ine,"1")}function dN(t,e,n=!0,r=xg){n&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const i=n?[...e||[],...r]:e||[],s=new Er(i);t.set(Rte,s.printScopes())}function fN(t,e){t.set(mu,e)}function hN(t,e){t.set(EU,e)}function pne(t,e){t.set(Zte,e)}function mne(t,e){t.set(ene,e)}function gne(t,e){t.set(cne,e)}function hv(t,e){t.set(ane,e)}function ox(t,e){t.set(hi.CCS_HEADER,`UPN:${e}`)}function up(t,e){t.set(hi.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function AI(t,e){t.set(one,e)}function pN(t,e,n){const r=Sne(e,n);try{JSON.parse(r)}catch{throw An(nN)}t.set(Ite,r)}function mN(t,e){t.set(zte,e)}function gN(t,e){t.set(Vte,e.sku),t.set(Gte,e.version),e.os&&t.set(Kte,e.os),e.cpu&&t.set(Wte,e.cpu)}function vN(t,e){e!=null&&e.appName&&t.set(Xte,e.appName),e!=null&&e.appVersion&&t.set(Jte,e.appVersion)}function vne(t,e){t.set(Lte,e)}function PU(t,e){e&&t.set(Dte,e)}function yne(t,e){t.set($te,e)}function kU(t,e,n){if(e&&n)t.set(Ute,e),t.set(Bte,n);else throw An(rN)}function xne(t,e){t.set(Fte,e)}function bne(t,e){t.set(Mte,e)}function wne(t,e){t.set(Hte,e)}function OU(t,e){t.set(tne,e)}function IU(t,e){e&&t.set(nne,e)}function RU(t,e){e&&t.set(rne,e)}function MU(t,e){t.set(Ote,e)}function yN(t){t.set(Yee,"1")}function DU(t){t.has(aA)||t.set(aA,"true")}function Dc(t,e){Object.entries(e).forEach(([n,r])=>{!t.has(n)&&r&&t.set(n,r)})}function Sne(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw An(nN)}return e&&e.length>0&&(n.hasOwnProperty(dv.ACCESS_TOKEN)||(n[dv.ACCESS_TOKEN]={}),n[dv.ACCESS_TOKEN][dv.XMS_CC]={values:e}),JSON.stringify(n)}function xN(t,e){e&&(t.set(NU,yn.POP),t.set(TU,e))}function $U(t,e){e&&(t.set(NU,yn.SSH),t.set(TU,e))}function LU(t,e){t.set(qte,e.generateCurrentRequestHeaderValue()),t.set(Yte,e.generateLastRequestHeaderValue())}function FU(t){t.set(Qte,lp.X_MS_LIB_CAPABILITY_VALUE)}function Cne(t,e){t.set(sne,e)}function N0(t,e,n){t.has(ix)||t.set(ix,e),t.has(sx)||t.set(sx,n)}function _ne(t,e){t.set(une,encodeURIComponent(e)),t.set(dne,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function Ane(t,e){Object.entries(e).forEach(([n,r])=>{r&&t.set(n,r)})}/*! @azure/msal-common v15.10.0 2025-08-05 */const zs={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v15.10.0 2025-08-05 */function jne(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v15.10.0 2025-08-05 */function Ene(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}/*! @azure/msal-common v15.10.0 2025-08-05 */function Nne(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}/*! @azure/msal-common v15.10.0 2025-08-05 */const ts=(t,e,n,r,i)=>(...s)=>{n.trace(`Executing function ${e}`);const o=r==null?void 0:r.startMeasurement(e,i);if(i){const c=e+"CallCount";r==null||r.incrementFields({[c]:1},i)}try{const c=t(...s);return o==null||o.end({success:!0}),n.trace(`Returning result from ${e}`),c}catch(c){n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(c))}catch{n.trace("Unable to print error message.")}throw o==null||o.end({success:!1},c),c}},fe=(t,e,n,r,i)=>(...s)=>{n.trace(`Executing function ${e}`);const o=r==null?void 0:r.startMeasurement(e,i);if(i){const c=e+"CallCount";r==null||r.incrementFields({[c]:1},i)}return r==null||r.setPreQueueTime(e,i),t(...s).then(c=>(n.trace(`Returning result from ${e}`),o==null||o.end({success:!0}),c)).catch(c=>{n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(c))}catch{n.trace("Unable to print error message.")}throw o==null||o.end({success:!1},c),c})};/*! @azure/msal-common v15.10.0 2025-08-05 */class T0{constructor(e,n,r,i){this.networkInterface=e,this.logger=n,this.performanceClient=r,this.correlationId=i}async detectRegion(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(K.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)n.region_source=Fu.ENVIRONMENT_VARIABLE;else{const s=T0.IMDS_OPTIONS;try{const o=await fe(this.getRegionFromIMDS.bind(this),K.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(pe.IMDS_VERSION,s);if(o.status===Sc.SUCCESS&&(r=o.body,n.region_source=Fu.IMDS),o.status===Sc.BAD_REQUEST){const c=await fe(this.getCurrentVersion.bind(this),K.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(s);if(!c)return n.region_source=Fu.FAILED_AUTO_DETECTION,null;const l=await fe(this.getRegionFromIMDS.bind(this),K.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(c,s);l.status===Sc.SUCCESS&&(r=l.body,n.region_source=Fu.IMDS)}}catch{return n.region_source=Fu.FAILED_AUTO_DETECTION,null}}return r||(n.region_source=Fu.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,n){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(K.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${pe.IMDS_ENDPOINT}?api-version=${e}&format=text`,n,pe.IMDS_TIMEOUT)}async getCurrentVersion(e){var n;(n=this.performanceClient)==null||n.addQueueMeasurement(K.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${pe.IMDS_ENDPOINT}?format=json`,e);return r.status===Sc.BAD_REQUEST&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}}T0.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v15.10.0 2025-08-05 */function Fi(){return Math.round(new Date().getTime()/1e3)}function jI(t){return t.getTime()/1e3}function Ad(t){return t?new Date(Number(t)*1e3):new Date}function ax(t,e){const n=Number(t)||0;return Fi()+e>n}function Tne(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function Pne(t){return Number(t)>Fi()}/*! @azure/msal-common v15.10.0 2025-08-05 */function P0(t,e,n,r,i){return{credentialType:Gr.ID_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,realm:i,lastUpdatedAt:Date.now().toString()}}function k0(t,e,n,r,i,s,o,c,l,u,d,f,h,p,g){var v,b;const m={homeAccountId:t,credentialType:Gr.ACCESS_TOKEN,secret:n,cachedAt:Fi().toString(),expiresOn:o.toString(),extendedExpiresOn:c.toString(),environment:e,clientId:r,realm:i,target:s,tokenType:d||yn.BEARER,lastUpdatedAt:Date.now().toString()};if(f&&(m.userAssertionHash=f),u&&(m.refreshOn=u.toString()),p&&(m.requestedClaims=p,m.requestedClaimsHash=g),((v=m.tokenType)==null?void 0:v.toLowerCase())!==yn.BEARER.toLowerCase())switch(m.credentialType=Gr.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case yn.POP:const x=zf(n,l);if(!((b=x==null?void 0:x.cnf)!=null&&b.kid))throw Se(tU);m.keyId=x.cnf.kid;break;case yn.SSH:m.keyId=h}return m}function UU(t,e,n,r,i,s,o){const c={credentialType:Gr.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,lastUpdatedAt:Date.now().toString()};return s&&(c.userAssertionHash=s),i&&(c.familyId=i),o&&(c.expiresOn=o.toString()),c}function bN(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function EI(t){return t?bN(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===Gr.ACCESS_TOKEN||t.credentialType===Gr.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function kne(t){return t?bN(t)&&t.hasOwnProperty("realm")&&t.credentialType===Gr.ID_TOKEN:!1}function NI(t){return t?bN(t)&&t.credentialType===Gr.REFRESH_TOKEN:!1}function One(t,e){const n=t.indexOf(Br.CACHE_KEY)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&r}function Ine(t,e){let n=!1;t&&(n=t.indexOf(lp.THROTTLING_PREFIX)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),n&&r}function Rne({environment:t,clientId:e}){return[KE,t,e].join(Jp.CACHE_KEY_SEPARATOR).toLowerCase()}function Mne(t,e){return e?t.indexOf(KE)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function Dne(t,e){return e?t.indexOf(Xy.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function TI(){return Fi()+Xy.REFRESH_TIME_SECONDS}function pv(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function US(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function PI(t){return t.expiresAt<=Fi()}/*! @azure/msal-common v15.10.0 2025-08-05 */class ti{constructor(e,n,r,i,s,o,c,l){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=r,this.authorityOptions=i,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=c,this.correlationId=o,this.managedIdentity=l||!1,this.regionDiscovery=new T0(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(pe.CIAM_AUTH_URL))return zs.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case pe.ADFS:return zs.Adfs;case pe.DSTS:return zs.Dsts}return zs.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new en(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Se(fa)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Se(fa)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Se(fa)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Se(iU);return this.replacePath(this.metadata.end_session_endpoint)}else throw Se(fa)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Se(fa)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Se(fa)}canReplaceTenant(e){return e.PathSegments.length===1&&!ti.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===zs.Default&&this.protocolMode!==Li.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const i=new en(this.metadata.canonical_authority).getUrlComponents(),s=i.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((c,l)=>{let u=s[l];if(l===0&&this.canReplaceTenant(i)){const d=new en(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];u!==d&&(this.logger.verbose(`Replacing tenant domain name ${u} with id ${d}`),u=d)}c!==u&&(n=n.replace(`/${u}/`,`/${c}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===zs.Adfs||this.protocolMode===Li.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var i,s;(i=this.performanceClient)==null||i.addQueueMeasurement(K.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),n=await fe(this.updateCloudDiscoveryMetadata.bind(this),K.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await fe(this.updateEndpointMetadata.bind(this),K.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:r}),(s=this.performanceClient)==null||s.addFields({cloudDiscoverySource:n,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:TI(),jwks_uri:""}),e}updateCachedMetadata(e,n,r){n!==zi.CACHE&&(r==null?void 0:r.source)!==zi.CACHE&&(e.expiresAt=TI(),e.canonical_authority=this.canonicalAuthority);const i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(i,e),this.metadata=e}async updateEndpointMetadata(e){var i,s,o;(i=this.performanceClient)==null||i.addQueueMeasurement(K.AuthorityUpdateEndpointMetadata,this.correlationId);const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===zi.HARDCODED_VALUES&&(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&n.metadata){const c=await fe(this.updateMetadataWithRegionalInformation.bind(this),K.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(n.metadata);pv(e,c,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let r=await fe(this.getEndpointMetadataFromNetwork.bind(this),K.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return(o=this.authorityOptions.azureRegionConfiguration)!=null&&o.azureRegion&&(r=await fe(this.updateMetadataWithRegionalInformation.bind(this),K.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),pv(e,r,!0),zi.NETWORK;throw Se(G5,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("Found endpoint metadata in authority configuration"),pv(e,n,!1),{source:zi.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const i=this.getEndpointMetadataFromHardcodedValues();if(i)return pv(e,i,!1),{source:zi.HARDCODED_VALUES,metadata:i};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=PI(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:zi.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new en(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw An(fU)}return null}async getEndpointMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(K.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${n}`);try{const i=await this.networkInterface.sendGetRequestAsync(n,e);return jne(i.body)?i.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(i){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${i}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in wI?wI[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,i,s;(r=this.performanceClient)==null||r.addQueueMeasurement(K.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const n=(i=this.authorityOptions.azureRegionConfiguration)==null?void 0:i.azureRegion;if(n){if(n!==pe.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=LS.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,ti.replaceWithRegionalInformation(e,n);const o=await fe(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),K.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((s=this.authorityOptions.azureRegionConfiguration)==null?void 0:s.environmentRegion,this.regionDiscoveryMetadata);if(o)return this.regionDiscoveryMetadata.region_outcome=LS.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=o,ti.replaceWithRegionalInformation(e,o);this.regionDiscoveryMetadata.region_outcome=LS.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(K.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const r=await fe(this.getCloudDiscoveryMetadataFromNetwork.bind(this),K.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return US(e,r,!0),zi.NETWORK;throw An(hU)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||pe.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||pe.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||pe.NOT_APPLICABLE}`);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),US(e,n,!1),zi.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const i=yte(this.hostnameAndPort);if(i)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),US(e,i,!1),zi.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const r=PI(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r?(this.logger.verbose("Found cloud discovery metadata in the cache."),zi.CACHE):(r&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===zs.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),ti.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=tx(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),n)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),n;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),An(iN)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),ti.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(K.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${pe.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let r=null;try{const s=await this.networkInterface.sendGetRequestAsync(e,n);let o,c;if(Ene(s.body))o=s.body,c=o.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${o.tenant_discovery_endpoint}`);else if(Nne(s.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${s.status}`),o=s.body,o.error===pe.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${o.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${o.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=tx(c,this.hostnameAndPort)}catch(s){if(s instanceof Cn)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. -Error: ${s.errorCode} -Error Description: ${s.errorMessage}`);else{const o=s;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. -Error: ${o.name} -Error Description: ${o.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=ti.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&en.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==tN.None){const i=n.tenant?n.tenant:pe.DEFAULT_COMMON_TENANT;r=`${n.azureCloudInstance}/${i}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return pe.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Se(fa)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return CU.has(e)}static isPublicCloudAuthority(e){return pe.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const i=new en(e);i.validateAsUri();const s=i.getUrlComponents();let o=`${n}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(o=`${n}.${pe.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const c=en.constructAuthorityUriFromObject({...i.getUrlComponents(),HostNameAndPort:o}).urlString;return r?`${c}?${r}`:c}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=ti.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=ti.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=ti.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const i=new en(e).getUrlComponents();if(i.PathSegments.length===0&&i.HostNameAndPort.endsWith(pe.CIAM_AUTH_URL)){const s=i.HostNameAndPort.split(".")[0];n=`${n}${s}${pe.AAD_TENANT_DOMAIN_SUFFIX}`}return n}}ti.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Rc.COMMON,Rc.CONSUMERS,Rc.ORGANIZATIONS]);function $ne(t){var i;const r=(i=new en(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:i.toLowerCase();switch(r){case Rc.COMMON:case Rc.ORGANIZATIONS:case Rc.CONSUMERS:return;default:return r}}function BU(t){return t.endsWith(pe.FORWARD_SLASH)?t:`${t}${pe.FORWARD_SLASH}`}function Lne(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw An(iN)}return{canonicalAuthority:t.authority?BU(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v15.10.0 2025-08-05 */async function HU(t,e,n,r,i,s,o){o==null||o.addQueueMeasurement(K.AuthorityFactoryCreateDiscoveredInstance,s);const c=ti.transformCIAMAuthority(BU(t)),l=new ti(c,e,n,r,i,s,o);try{return await fe(l.resolveEndpointsAsync.bind(l),K.AuthorityResolveEndpointsAsync,i,o,s)(),l}catch{throw Se(fa)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class ku extends Cn{constructor(e,n,r,i,s){super(e,n,r),this.name="ServerError",this.errorNo=i,this.status=s,Object.setPrototypeOf(this,ku.prototype)}}/*! @azure/msal-common v15.10.0 2025-08-05 */function O0(t,e,n){var r;return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.tokenBodyParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class Oo{static generateThrottlingStorageKey(e){return`${lp.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,r){var o;const i=Oo.generateThrottlingStorageKey(n),s=e.getThrottlingCache(i);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(hi.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||lp.DEFAULT_THROTTLE_TIME_SECONDS),r+lp.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,r,i){const s=O0(n,r,i),o=this.generateThrottlingStorageKey(s);e.removeItem(o,r.correlationId)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class I0 extends Cn{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,I0.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function Gh(t,e,n,r){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${r==null?void 0:r.name}, error.message:${r==null?void 0:r.message}`,new I0(t,e,n)}/*! @azure/msal-common v15.10.0 2025-08-05 */class wN{constructor(e,n){this.config=Nte(e),this.logger=new $a(this.config.loggerOptions,sU,eN),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){const n={};if(n[hi.CONTENT_TYPE]=pe.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Ys.HOME_ACCOUNT_ID:try{const r=_d(e.credential);n[hi.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Ys.UPN:n[hi.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,r,i,s,o){var l;o&&((l=this.performanceClient)==null||l.addQueueMeasurement(o,s));const c=await this.sendPostRequest(i,e,{body:n,headers:r},s);return this.config.serverTelemetryManager&&c.status<500&&c.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),c}async sendPostRequest(e,n,r,i){var o,c,l;Oo.preProcess(this.cacheManager,e,i);let s;try{s=await fe(this.networkClient.sendPostRequestAsync.bind(this.networkClient),K.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,i)(n,r);const u=s.headers||{};(c=this.performanceClient)==null||c.addFields({refreshTokenSize:((o=s.body.refresh_token)==null?void 0:o.length)||0,httpVerToken:u[hi.X_MS_HTTP_VERSION]||"",requestId:u[hi.X_MS_REQUEST_ID]||""},i)}catch(u){if(u instanceof I0){const d=u.responseHeaders;throw d&&((l=this.performanceClient)==null||l.addFields({httpVerToken:d[hi.X_MS_HTTP_VERSION]||"",requestId:d[hi.X_MS_REQUEST_ID]||"",contentTypeHeader:d[hi.CONTENT_TYPE]||void 0,contentLengthHeader:d[hi.CONTENT_LENGTH]||void 0,httpStatus:u.httpStatus},i)),u.error}throw u instanceof Cn?u:Se(V5)}return Oo.postProcess(this.cacheManager,e,s,i),s}async updateAuthority(e,n){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(K.UpdateTokenEndpointAuthority,n);const r=`https://${e}/${this.authority.tenant}/`,i=await HU(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=i}createTokenQueryParameters(e){const n=new Map;return e.embeddedClientId&&N0(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&Dc(n,e.tokenQueryParameters),mN(n,e.correlationId),E0(n,e.correlationId,this.performanceClient),Zp(n)}}/*! @azure/msal-common v15.10.0 2025-08-05 */function zU(t){return t&&(t.tid||t.tfp||t.acr)||null}/*! @azure/msal-common v15.10.0 2025-08-05 */class fo{getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,loginHint:this.loginHint,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e]))}}isSingleTenant(){return!this.tenantProfiles}static createAccount(e,n,r){var u,d,f,h,p,g,m;const i=new fo;n.authorityType===zs.Adfs?i.authorityType=fv.ADFS_ACCOUNT_TYPE:n.protocolMode===Li.OIDC?i.authorityType=fv.GENERIC_ACCOUNT_TYPE:i.authorityType=fv.MSSTS_ACCOUNT_TYPE;let s;e.clientInfo&&r&&(s=rx(e.clientInfo,r)),i.clientInfo=e.clientInfo,i.homeAccountId=e.homeAccountId,i.nativeAccountId=e.nativeAccountId;const o=e.environment||n&&n.getPreferredCache();if(!o)throw Se(XE);i.environment=o,i.realm=(s==null?void 0:s.utid)||zU(e.idTokenClaims)||"",i.localAccountId=(s==null?void 0:s.uid)||((u=e.idTokenClaims)==null?void 0:u.oid)||((d=e.idTokenClaims)==null?void 0:d.sub)||"";const c=((f=e.idTokenClaims)==null?void 0:f.preferred_username)||((h=e.idTokenClaims)==null?void 0:h.upn),l=(p=e.idTokenClaims)!=null&&p.emails?e.idTokenClaims.emails[0]:null;if(i.username=c||l||"",i.loginHint=(g=e.idTokenClaims)==null?void 0:g.login_hint,i.name=((m=e.idTokenClaims)==null?void 0:m.name)||"",i.cloudGraphHostName=e.cloudGraphHostName,i.msGraphHost=e.msGraphHost,e.tenantProfiles)i.tenantProfiles=e.tenantProfiles;else{const v=oN(e.homeAccountId,i.localAccountId,i.realm,e.idTokenClaims);i.tenantProfiles=[v]}return i}static createFromAccountInfo(e,n,r){var s;const i=new fo;return i.authorityType=e.authorityType||fv.GENERIC_ACCOUNT_TYPE,i.homeAccountId=e.homeAccountId,i.localAccountId=e.localAccountId,i.nativeAccountId=e.nativeAccountId,i.realm=e.tenantId,i.environment=e.environment,i.username=e.username,i.name=e.name,i.loginHint=e.loginHint,i.cloudGraphHostName=n,i.msGraphHost=r,i.tenantProfiles=Array.from(((s=e.tenantProfiles)==null?void 0:s.values())||[]),i}static generateHomeAccountId(e,n,r,i,s){if(!(n===zs.Adfs||n===zs.Dsts)){if(e)try{const o=rx(e,i.base64Decode);if(o.uid&&o.utid)return`${o.uid}.${o.utid}`}catch{}r.warning("No client info in response")}return(s==null?void 0:s.sub)||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,n,r){if(!e||!n)return!1;let i=!0;if(r){const s=e.idTokenClaims||{},o=n.idTokenClaims||{};i=s.iat===o.iat&&s.nonce===o.nonce}return e.homeAccountId===n.homeAccountId&&e.localAccountId===n.localAccountId&&e.username===n.username&&e.tenantId===n.tenantId&&e.loginHint===n.loginHint&&e.environment===n.environment&&e.nativeAccountId===n.nativeAccountId&&i}}/*! @azure/msal-common v15.10.0 2025-08-05 */const cx="no_tokens_found",VU="native_account_unavailable",SN="refresh_token_expired",CN="ux_not_allowed",Fne="interaction_required",Une="consent_required",Bne="login_required",R0="bad_token";/*! @azure/msal-common v15.10.0 2025-08-05 */const kI=[Fne,Une,Bne,R0,CN],Hne=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],zne={[cx]:"No refresh token found in the cache. Please sign-in.",[VU]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[SN]:"Refresh token has expired.",[R0]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[CN]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve."};class ho extends Cn{constructor(e,n,r,i,s,o,c,l){super(e,n,r),Object.setPrototypeOf(this,ho.prototype),this.timestamp=i||pe.EMPTY_STRING,this.traceId=s||pe.EMPTY_STRING,this.correlationId=o||pe.EMPTY_STRING,this.claims=c||pe.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=l}}function GU(t,e,n){const r=!!t&&kI.indexOf(t)>-1,i=!!n&&Hne.indexOf(n)>-1,s=!!e&&kI.some(o=>e.indexOf(o)>-1);return r||s||i}function lx(t){return new ho(t,zne[t])}/*! @azure/msal-common v15.10.0 2025-08-05 */class Vf{static setRequestState(e,n,r){const i=Vf.generateLibraryState(e,r);return n?`${i}${pe.RESOURCE_DELIM}${n}`:i}static generateLibraryState(e,n){if(!e)throw Se(iA);const r={id:e.createNewGuid()};n&&(r.meta=n);const i=JSON.stringify(r);return e.base64Encode(i)}static parseRequestState(e,n){if(!e)throw Se(iA);if(!n)throw Se(Jd);try{const r=n.split(pe.RESOURCE_DELIM),i=r[0],s=r.length>1?r.slice(1).join(pe.RESOURCE_DELIM):pe.EMPTY_STRING,o=e.base64Decode(i),c=JSON.parse(o);return{userRequestState:s||pe.EMPTY_STRING,libraryState:c}}catch{throw Se(Jd)}}}/*! @azure/msal-common v15.10.0 2025-08-05 */const Vne={SW:"sw"};class Zd{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(K.PopTokenGenerateCnf,e.correlationId);const r=await fe(this.generateKid.bind(this),K.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),i=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:i}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(K.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Vne.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,i){const{resourceRequestMethod:s,resourceRequestUri:o,shrClaims:c,shrNonce:l,shrOptions:u}=r,d=o?new en(o):void 0,f=d==null?void 0:d.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Fi(),m:s==null?void 0:s.toUpperCase(),u:f==null?void 0:f.HostNameAndPort,nonce:l||this.cryptoUtils.createNewGuid(),p:f==null?void 0:f.AbsolutePath,q:f!=null&&f.QueryString?[[],f.QueryString]:void 0,client_claims:c||void 0,...i},n,u,r.correlationId)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class Gne{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v15.10.0 2025-08-05 */class gu{constructor(e,n,r,i,s,o,c){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=i,this.serializableCache=s,this.persistencePlugin=o,this.performanceClient=c}validateTokenResponse(e,n){var r;if(e.error||e.error_description||e.suberror){const i=`Error(s): ${e.error_codes||pe.NOT_AVAILABLE} - Timestamp: ${e.timestamp||pe.NOT_AVAILABLE} - Description: ${e.error_description||pe.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||pe.NOT_AVAILABLE} - Trace ID: ${e.trace_id||pe.NOT_AVAILABLE}`,s=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,o=new ku(e.error,i,e.suberror,s,e.status);if(n&&e.status&&e.status>=Sc.SERVER_ERROR_RANGE_START&&e.status<=Sc.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. -${o}`);return}else if(n&&e.status&&e.status>=Sc.CLIENT_ERROR_RANGE_START&&e.status<=Sc.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${o}`);return}throw GU(e.error,e.error_description,e.suberror)?new ho(e.error,e.error_description,e.suberror,e.timestamp||pe.EMPTY_STRING,e.trace_id||pe.EMPTY_STRING,e.correlation_id||pe.EMPTY_STRING,e.claims||pe.EMPTY_STRING,s):o}}async handleServerTokenResponse(e,n,r,i,s,o,c,l,u){var g;(g=this.performanceClient)==null||g.addQueueMeasurement(K.HandleServerTokenResponse,e.correlation_id);let d;if(e.id_token){if(d=zf(e.id_token||pe.EMPTY_STRING,this.cryptoObj.base64Decode),s&&s.nonce&&d.nonce!==s.nonce)throw Se(q5);if(i.maxAge||i.maxAge===0){const m=d.auth_time;if(!m)throw Se(YE);bU(m,i.maxAge)}}this.homeAccountIdentifier=fo.generateHomeAccountId(e.client_info||pe.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,d);let f;s&&s.state&&(f=Vf.parseRequestState(this.cryptoObj,s.state)),e.key_id=e.key_id||i.sshKid||void 0;const h=this.generateCacheRecord(e,n,r,i,d,o,s);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),p=new Gne(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),c&&!l&&h.account){const m=this.cacheStorage.generateAccountKey(h.account.getAccountInfo());if(!this.cacheStorage.getAccount(m,i.correlationId))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await gu.generateAuthenticationResult(this.cryptoObj,n,h,!1,i,d,f,void 0,u)}await this.cacheStorage.saveCacheRecord(h,i.correlationId,i.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(p))}return gu.generateAuthenticationResult(this.cryptoObj,n,h,!1,i,d,f,e,u)}generateCacheRecord(e,n,r,i,s,o,c){const l=n.getPreferredCache();if(!l)throw Se(XE);const u=zU(s);let d,f;e.id_token&&s&&(d=P0(this.homeAccountIdentifier,l,e.id_token,this.clientId,u||""),f=_N(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,i.correlationId,s,e.client_info,l,u,c,void 0,this.logger));let h=null;if(e.access_token){const m=e.scope?Er.fromString(e.scope):new Er(i.scopes||[]),v=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,b=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,x=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,w=r+v,S=w+b,C=x&&x>0?r+x:void 0;h=k0(this.homeAccountIdentifier,l,e.access_token,this.clientId,u||n.tenant||"",m.printScopes(),w,S,this.cryptoObj.base64Decode,C,e.token_type,o,e.key_id,i.claims,i.requestedClaimsHash)}let p=null;if(e.refresh_token){let m;if(e.refresh_token_expires_in){const v=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;m=r+v}p=UU(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,o,m)}let g=null;return e.foci&&(g={clientId:this.clientId,environment:l,familyId:e.foci}),{account:f,idToken:d,accessToken:h,refreshToken:p,appMetadata:g}}static async generateAuthenticationResult(e,n,r,i,s,o,c,l,u){var w,S,C,_,A;let d=pe.EMPTY_STRING,f=[],h=null,p,g,m=pe.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===yn.POP&&!s.popKid){const j=new Zd(e),{secret:T,keyId:k}=r.accessToken;if(!k)throw Se(JE);d=await j.signPopToken(T,k,s)}else d=r.accessToken.secret;f=Er.fromString(r.accessToken.target).asArray(),h=Ad(r.accessToken.expiresOn),p=Ad(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(g=Ad(r.accessToken.refreshOn))}r.appMetadata&&(m=r.appMetadata.familyId===Qy?Qy:"");const v=(o==null?void 0:o.oid)||(o==null?void 0:o.sub)||"",b=(o==null?void 0:o.tid)||"";l!=null&&l.spa_accountid&&r.account&&(r.account.nativeAccountId=l==null?void 0:l.spa_accountid);const x=r.account?aN(r.account.getAccountInfo(),void 0,o,(w=r.idToken)==null?void 0:w.secret):null;return{authority:n.canonicalAuthority,uniqueId:v,tenantId:b,scopes:f,account:x,idToken:((S=r==null?void 0:r.idToken)==null?void 0:S.secret)||"",idTokenClaims:o||{},accessToken:d,fromCache:i,expiresOn:h,extExpiresOn:p,refreshOn:g,correlationId:s.correlationId,requestId:u||pe.EMPTY_STRING,familyId:m,tokenType:((C=r.accessToken)==null?void 0:C.tokenType)||pe.EMPTY_STRING,state:c?c.userRequestState:pe.EMPTY_STRING,cloudGraphHostName:((_=r.account)==null?void 0:_.cloudGraphHostName)||pe.EMPTY_STRING,msGraphHost:((A=r.account)==null?void 0:A.msGraphHost)||pe.EMPTY_STRING,code:l==null?void 0:l.spa_code,fromNativeBroker:!1}}}function _N(t,e,n,r,i,s,o,c,l,u,d,f){f==null||f.verbose("setCachedAccount called");const p=t.getAccountKeys().find(x=>x.startsWith(n));let g=null;p&&(g=t.getAccount(p,i));const m=g||fo.createAccount({homeAccountId:n,idTokenClaims:s,clientInfo:o,environment:c,cloudGraphHostName:u==null?void 0:u.cloud_graph_host_name,msGraphHost:u==null?void 0:u.msgraph_host,nativeAccountId:d},e,r),v=m.tenantProfiles||[],b=l||m.realm;if(b&&!v.find(x=>x.tenantId===b)){const x=oN(n,m.localAccountId,b,s);v.push(x)}return m.tenantProfiles=v,m}/*! @azure/msal-common v15.10.0 2025-08-05 */async function KU(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v15.10.0 2025-08-05 */class WU extends wN{constructor(e,n){var r;super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,n){var c,l;if((c=this.performanceClient)==null||c.addQueueMeasurement(K.AuthClientAcquireToken,e.correlationId),!e.code)throw Se(X5);const r=Fi(),i=await fe(this.executeTokenRequest.bind(this),K.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),s=(l=i.headers)==null?void 0:l[hi.X_MS_REQUEST_ID],o=new gu(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return o.validateTokenResponse(i.body),fe(o.handleServerTokenResponse.bind(o),K.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,r,e,n,void 0,void 0,void 0,s)}getLogoutUri(e){if(!e)throw An(dU);const n=this.createLogoutUrlQueryString(e);return en.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){var u;(u=this.performanceClient)==null||u.addQueueMeasurement(K.AuthClientExecuteTokenRequest,n.correlationId);const r=this.createTokenQueryParameters(n),i=en.appendQueryString(e.tokenEndpoint,r),s=await fe(this.createTokenRequestBody.bind(this),K.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n);let o;if(n.clientInfo)try{const d=rx(n.clientInfo,this.cryptoUtils.base64Decode);o={credential:`${d.uid}${Jp.CLIENT_INFO_SEPARATOR}${d.utid}`,type:Ys.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const c=this.createTokenRequestHeaders(o||n.ccsCredential),l=O0(this.config.authOptions.clientId,n);return fe(this.executePostToTokenEndpoint.bind(this),K.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(i,s,c,l,n.correlationId,K.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var i,s;(i=this.performanceClient)==null||i.addQueueMeasurement(K.AuthClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(fN(n,e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[mu])||this.config.authOptions.clientId),this.includeRedirectUri)hN(n,e.redirectUri);else if(!e.redirectUri)throw An(oU);if(dN(n,e.scopes,!0,this.oidcDefaultScopes),xne(n,e.code),gN(n,this.config.libraryInfo),vN(n,this.config.telemetry.application),FU(n),this.serverTelemetryManager&&!jU(this.config)&&LU(n,this.serverTelemetryManager),e.codeVerifier&&wne(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&OU(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const o=this.config.clientCredentials.clientAssertion;IU(n,await KU(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),RU(n,o.assertionType)}if(MU(n,U5.AUTHORIZATION_CODE_GRANT),yN(n),e.authenticationScheme===yn.POP){const o=new Zd(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await fe(o.generateCnf.bind(o),K.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,xN(n,c)}else if(e.authenticationScheme===yn.SSH)if(e.sshJwk)$U(n,e.sshJwk);else throw An(j0);(!Uo.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&pN(n,e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const o=rx(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${o.uid}${Jp.CLIENT_INFO_SEPARATOR}${o.utid}`,type:Ys.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose("Could not parse client info for CCS Header: "+o)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Ys.HOME_ACCOUNT_ID:try{const o=_d(r.credential);up(n,o)}catch(o){this.logger.verbose("Could not parse home account ID for CCS Header: "+o)}break;case Ys.UPN:ox(n,r.credential);break}return e.embeddedClientId&&N0(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Dc(n,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[_I])&&Dc(n,{[_I]:"1"}),E0(n,e.correlationId,this.performanceClient),Zp(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&pne(n,e.postLogoutRedirectUri),e.correlationId&&mN(n,e.correlationId),e.idTokenHint&&mne(n,e.idTokenHint),e.state&&PU(n,e.state),e.logoutHint&&Cne(n,e.logoutHint),e.extraQueryParameters&&Dc(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&DU(n),Zp(n,this.config.authOptions.encodeExtraQueryParams,e.extraQueryParameters)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const Kne=300;class Wne extends wN{constructor(e,n){super(e,n)}async acquireToken(e){var o,c;(o=this.performanceClient)==null||o.addQueueMeasurement(K.RefreshTokenClientAcquireToken,e.correlationId);const n=Fi(),r=await fe(this.executeTokenRequest.bind(this),K.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),i=(c=r.headers)==null?void 0:c[hi.X_MS_REQUEST_ID],s=new gu(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(r.body),fe(s.handleServerTokenResponse.bind(s),K.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,i)}async acquireTokenByRefreshToken(e){var r;if(!e)throw An(uU);if((r=this.performanceClient)==null||r.addQueueMeasurement(K.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Se(QE);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await fe(this.acquireTokenWithCachedRefreshToken.bind(this),K.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(i){const s=i instanceof ho&&i.errorCode===cx,o=i instanceof ku&&i.errorCode===vI.INVALID_GRANT_ERROR&&i.subError===vI.CLIENT_MISMATCH_ERROR;if(s||o)return fe(this.acquireTokenWithCachedRefreshToken.bind(this),K.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw i}return fe(this.acquireTokenWithCachedRefreshToken.bind(this),K.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){var s,o,c;(s=this.performanceClient)==null||s.addQueueMeasurement(K.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=ts(this.cacheManager.getRefreshToken.bind(this.cacheManager),K.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!r)throw lx(cx);if(r.expiresOn&&ax(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||Kne))throw(o=this.performanceClient)==null||o.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),lx(SN);const i={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||yn.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Ys.HOME_ACCOUNT_ID}};try{return await fe(this.acquireToken.bind(this),K.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(i)}catch(l){if(l instanceof ho&&((c=this.performanceClient)==null||c.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),l.subError===R0)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const u=this.cacheManager.generateCredentialKey(r);this.cacheManager.removeRefreshToken(u,e.correlationId)}throw l}}async executeTokenRequest(e,n){var l;(l=this.performanceClient)==null||l.addQueueMeasurement(K.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),i=en.appendQueryString(n.tokenEndpoint,r),s=await fe(this.createTokenRequestBody.bind(this),K.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),o=this.createTokenRequestHeaders(e.ccsCredential),c=O0(this.config.authOptions.clientId,e);return fe(this.executePostToTokenEndpoint.bind(this),K.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(i,s,o,c,e.correlationId,K.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,i,s;(r=this.performanceClient)==null||r.addQueueMeasurement(K.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(fN(n,e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[mu])||this.config.authOptions.clientId),e.redirectUri&&hN(n,e.redirectUri),dN(n,e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),MU(n,U5.REFRESH_TOKEN_GRANT),yN(n),gN(n,this.config.libraryInfo),vN(n,this.config.telemetry.application),FU(n),this.serverTelemetryManager&&!jU(this.config)&&LU(n,this.serverTelemetryManager),bne(n,e.refreshToken),this.config.clientCredentials.clientSecret&&OU(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const o=this.config.clientCredentials.clientAssertion;IU(n,await KU(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),RU(n,o.assertionType)}if(e.authenticationScheme===yn.POP){const o=new Zd(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await fe(o.generateCnf.bind(o),K.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,xN(n,c)}else if(e.authenticationScheme===yn.SSH)if(e.sshJwk)$U(n,e.sshJwk);else throw An(j0);if((!Uo.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&pN(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Ys.HOME_ACCOUNT_ID:try{const o=_d(e.ccsCredential.credential);up(n,o)}catch(o){this.logger.verbose("Could not parse home account ID for CCS Header: "+o)}break;case Ys.UPN:ox(n,e.ccsCredential.credential);break}return e.embeddedClientId&&N0(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Dc(n,e.tokenBodyParameters),E0(n,e.correlationId,this.performanceClient),Zp(n)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class qne extends wN{constructor(e,n){super(e,n)}async acquireCachedToken(e){var l;(l=this.performanceClient)==null||l.addQueueMeasurement(K.SilentFlowClientAcquireCachedToken,e.correlationId);let n=jl.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Uo.isEmptyObj(e.claims))throw this.setCacheOutcome(jl.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Se(Mc);if(!e.account)throw Se(QE);const r=e.account.tenantId||$ne(e.authority),i=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,i,r);if(s){if(Pne(s.cachedAt)||ax(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(jl.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Se(Mc);s.refreshOn&&ax(s.refreshOn,0)&&(n=jl.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(jl.NO_CACHED_ACCESS_TOKEN,e.correlationId),Se(Mc);const o=e.authority||this.authority.getPreferredCache(),c={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,i,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(o)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await fe(this.generateResultFromCacheRecord.bind(this),K.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(c,e),n]}setCacheOutcome(e,n){var r,i;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(i=this.performanceClient)==null||i.addFields({cacheOutcome:e},n),e!==jl.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(K.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let r;if(e.idToken&&(r=zf(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const s=r==null?void 0:r.auth_time;if(!s)throw Se(YE);bU(s,n.maxAge)}return gu.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,r)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const Yne={sendGetRequestAsync:()=>Promise.reject(Se(Vt)),sendPostRequestAsync:()=>Promise.reject(Se(Vt))};/*! @azure/msal-common v15.10.0 2025-08-05 */function Qne(t,e,n,r){var c,l;const i=e.correlationId,s=new Map;fN(s,e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[mu])||t.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(dN(s,o,!0,(l=t.authority.options.OIDCOptions)==null?void 0:l.defaultScopes),hN(s,e.redirectUri),mN(s,i),fne(s,e.responseMode),yN(s),e.prompt&&(vne(s,e.prompt),r==null||r.addFields({prompt:e.prompt},i)),e.domainHint&&(gne(s,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},i)),e.prompt!==gi.SELECT_ACCOUNT)if(e.sid&&e.prompt===gi.NONE)n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),AI(s,e.sid),r==null||r.addFields({sidFromRequest:!0},i);else if(e.account){const u=Zne(e.account);let d=ere(e.account);if(d&&e.domainHint&&(n.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),d=null),d){n.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),hv(s,d),r==null||r.addFields({loginHintFromClaim:!0},i);try{const f=_d(e.account.homeAccountId);up(s,f)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(u&&e.prompt===gi.NONE){n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),AI(s,u),r==null||r.addFields({sidFromClaim:!0},i);try{const f=_d(e.account.homeAccountId);up(s,f)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)n.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),hv(s,e.loginHint),ox(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i);else if(e.account.username){n.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),hv(s,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},i);try{const f=_d(e.account.homeAccountId);up(s,f)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(n.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),hv(s,e.loginHint),ox(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i));else n.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&yne(s,e.nonce),e.state&&PU(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&pN(s,e.claims,t.clientCapabilities),e.embeddedClientId&&N0(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(aA))&&DU(s),s}function AN(t,e,n,r){const i=Zp(e,n,r);return en.appendQueryString(t.authorizationEndpoint,i)}function Xne(t,e){if(qU(t,e),!t.code)throw Se(nU);return t}function qU(t,e){if(!t.state||!e)throw t.state?Se(tA,"Cached State"):Se(tA,"Server State");let n,r;try{n=decodeURIComponent(t.state)}catch{throw Se(Jd,t.state)}try{r=decodeURIComponent(e)}catch{throw Se(Jd,t.state)}if(n!==r)throw Se(W5);if(t.error||t.error_description||t.suberror){const i=Jne(t);throw GU(t.error,t.error_description,t.suberror)?new ho(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",i):new ku(t.error||"",t.error_description,t.suberror,i)}}function Jne(t){var r,i;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(i=t.error_uri)==null?void 0:i.substring(n+e.length):void 0}function Zne(t){var e;return((e=t.idTokenClaims)==null?void 0:e.sid)||null}function ere(t){var e;return t.loginHint||((e=t.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v15.10.0 2025-08-05 */const OI=",",YU="|";function tre(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:i,extensionVersion:s}=t,o=new Map([[0,[n,r]],[2,[i,s]]]);let c=[];if(e!=null&&e.length){if(c=e.split(OI),c.length<4)return e}else c=Array.from({length:4},()=>YU);return o.forEach((l,u)=>{var d,f;l.length===2&&((d=l[0])!=null&&d.length)&&((f=l[1])!=null&&f.length)&&nre({skuArr:c,index:u,skuName:l[0],skuVersion:l[1]})}),c.join(OI)}function nre(t){const{skuArr:e,index:n,skuName:r,skuVersion:i}=t;n>=e.length||(e[n]=[r,i].join(YU))}class em{constructor(e,n){this.cacheOutcome=jl.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||pe.EMPTY_STRING,this.wrapperVer=e.wrapperVer||pe.EMPTY_STRING,this.telemetryCacheKey=Br.CACHE_KEY+Jp.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Br.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const i=n.join(Br.VALUE_SEPARATOR),s=this.getRegionDiscoveryFields(),o=[e,s].join(Br.VALUE_SEPARATOR);return[Br.SCHEMA_VERSION,o,i].join(Br.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=em.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(Br.VALUE_SEPARATOR),i=e.errors.slice(0,n).join(Br.VALUE_SEPARATOR),s=e.errors.length,o=n=Br.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Cn?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(Br.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=em.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const i={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,i=0;const s=e.errors.length;for(n=0;nString.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v4.19.0 2025-08-05 */function to(t){return new TextDecoder().decode($c(t))}function $c(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw ze(CB)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const pre="RSASSA-PKCS1-v1_5",Gf="AES-GCM",TB="HKDF",RN="SHA-256",mre=2048,gre=new Uint8Array([1,0,1]),DI="0123456789abcdef",$I=new Uint32Array(1),MN="raw",PB="encrypt",DN="decrypt",vre="deriveKey",yre="crypto_subtle_undefined",$N={name:pre,hash:RN,modulusLength:mre,publicExponent:gre};function xre(t){if(!window)throw ze($0);if(!window.crypto)throw ze(cA);if(!t&&!window.crypto.subtle)throw ze(cA,yre)}async function kB(t,e,n){e==null||e.addQueueMeasurement(K.Sha256Digest,n);const i=new TextEncoder().encode(t);return window.crypto.subtle.digest(RN,i)}function bre(t){return window.crypto.getRandomValues(t)}function BS(){return window.crypto.getRandomValues($I),$I[0]}function po(){const t=Date.now(),e=BS()*1024+(BS()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),i=e&2**30-1,s=BS();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s;let o="";for(let c=0;c>>4),o+=DI.charAt(n[c]&15),(c===3||c===5||c===7||c===9)&&(o+="-");return o}async function wre(t,e){return window.crypto.subtle.generateKey($N,t,e)}async function HS(t){return window.crypto.subtle.exportKey(EB,t)}async function Sre(t,e,n){return window.crypto.subtle.importKey(EB,t,$N,e,n)}async function Cre(t,e){return window.crypto.subtle.sign($N,t,e)}async function LN(){const t=await OB(),n={alg:"dir",kty:"oct",k:Zc(new Uint8Array(t))};return nm(JSON.stringify(n))}async function _re(t){const e=to(t),r=JSON.parse(e).k,i=$c(r);return window.crypto.subtle.importKey(MN,i,Gf,!1,[DN])}async function Are(t,e){const n=e.split(".");if(n.length!==5)throw ze(ny,"jwe_length");const r=await _re(t).catch(()=>{throw ze(ny,"import_key")});try{const i=new TextEncoder().encode(n[0]),s=$c(n[2]),o=$c(n[3]),c=$c(n[4]),l=c.byteLength*8,u=new Uint8Array(o.length+c.length);u.set(o),u.set(c,o.length);const d=await window.crypto.subtle.decrypt({name:Gf,iv:s,tagLength:l,additionalData:i},r,u);return new TextDecoder().decode(d)}catch{throw ze(ny,"decrypt")}}async function OB(){const t=await window.crypto.subtle.generateKey({name:Gf,length:256},!0,[PB,DN]);return window.crypto.subtle.exportKey(MN,t)}async function LI(t){return window.crypto.subtle.importKey(MN,t,TB,!1,[vre])}async function IB(t,e,n){return window.crypto.subtle.deriveKey({name:TB,salt:e,hash:RN,info:new TextEncoder().encode(n)},t,{name:Gf,length:256},!1,[PB,DN])}async function jre(t,e,n){const r=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(16)),s=await IB(t,i,n),o=await window.crypto.subtle.encrypt({name:Gf,iv:new Uint8Array(12)},s,r);return{data:Zc(new Uint8Array(o)),nonce:Zc(i)}}async function FI(t,e,n,r){const i=$c(r),s=await IB(t,$c(e),n),o=await window.crypto.subtle.decrypt({name:Gf,iv:new Uint8Array(12)},s,i);return new TextDecoder().decode(o)}async function RB(t){const e=await kB(t),n=new Uint8Array(e);return Zc(n)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const rm="storage_not_supported",ur="stubbed_public_client_application_called",fx="in_mem_redirect_unavailable";/*! @azure/msal-browser v4.19.0 2025-08-05 */const ry={[rm]:"Given storage configuration option was not supported.",[ur]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[fx]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};ry[rm],ry[ur],ry[fx];class FN extends Cn{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,FN.prototype)}}function dr(t){return new FN(t,ry[t])}/*! @azure/msal-browser v4.19.0 2025-08-05 */function MB(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function Ere(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function UN(){return window.parent!==window}function Nre(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Ti.POPUP_NAME_PREFIX}.`)===0}function ba(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function Tre(){const e=new en(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Pre(){if(en.hashContainsKnownProperties(window.location.hash)&&UN())throw ze(cB)}function kre(t){if(UN()&&!t)throw ze(aB)}function Ore(){if(Nre())throw ze(lB)}function DB(){if(typeof window>"u")throw ze($0)}function $B(t){if(!t)throw ze(dp)}function BN(t){DB(),Pre(),Ore(),$B(t)}function UI(t,e){if(BN(t),kre(e.system.allowRedirectInIframe),e.cache.cacheLocation===Nr.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw dr(fx)}function LB(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function Ire(){return po()}/*! @azure/msal-browser v4.19.0 2025-08-05 */class hx{navigateInternal(e,n){return hx.defaultNavigateWindow(e,n)}navigateExternal(e,n){return hx.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((r,i)=>{setTimeout(()=>{i(ze(dx,"failed_to_redirect"))},n.timeout)})}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Rre{async sendGetRequestAsync(e,n){let r,i={},s=0;const o=BI(n);try{r=await fetch(e,{method:RI.GET,headers:o})}catch(c){throw Gh(ze(window.navigator.onLine?pB:ux),void 0,void 0,c)}i=HI(r.headers);try{return s=r.status,{headers:i,body:await r.json(),status:s}}catch(c){throw Gh(ze(lA),s,i,c)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",i=BI(n);let s,o=0,c={};try{s=await fetch(e,{method:RI.POST,headers:i,body:r})}catch(l){throw Gh(ze(window.navigator.onLine?hB:ux),void 0,void 0,l)}c=HI(s.headers);try{return o=s.status,{headers:c,body:await s.json(),status:o}}catch(l){throw Gh(ze(lA),o,c,l)}}}function BI(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,i])=>{e.append(r,i)}),e}catch(e){throw Gh(ze(AB),void 0,void 0,e)}}function HI(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw ze(jB)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Mre=6e4,dA=1e4,Dre=3e4,FB=2e3;function $re({auth:t,cache:e,system:n,telemetry:r},i){const s={clientId:pe.EMPTY_STRING,authority:`${pe.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:pe.EMPTY_STRING,authorityMetadata:pe.EMPTY_STRING,redirectUri:typeof window<"u"?ba():"",postLogoutRedirectUri:pe.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Li.AAD,OIDCOptions:{serverResponseType:A0.FRAGMENT,defaultScopes:[pe.OPENID_SCOPE,pe.PROFILE_SCOPE,pe.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:tN.None,tenant:pe.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1,encodeExtraQueryParams:!1},o={cacheLocation:Nr.SessionStorage,cacheRetentionDays:5,temporaryCacheLocation:Nr.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Nr.LocalStorage),claimsBasedCachingEnabled:!1},c={loggerCallback:()=>{},logLevel:Rn.Info,piiLoggingEnabled:!1},u={...{...AU,loggerOptions:c,networkClient:i?new Rre:Yne,navigationClient:new hx,loadFrameTimeout:0,windowHashTimeout:(n==null?void 0:n.loadFrameTimeout)||Mre,iframeHashTimeout:(n==null?void 0:n.loadFrameTimeout)||dA,navigateFrameWait:0,redirectNavigationTimeout:Dre,asyncPopups:!1,allowRedirectInIframe:!1,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||FB,pollIntervalMilliseconds:Ti.DEFAULT_POLL_INTERVAL_MS},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||c},d={application:{appName:pe.EMPTY_STRING,appVersion:pe.EMPTY_STRING},client:new _U};if((t==null?void 0:t.protocolMode)!==Li.OIDC&&(t!=null&&t.OIDCOptions)&&new $a(u.loggerOptions).warning(JSON.stringify(An(mU))),t!=null&&t.protocolMode&&t.protocolMode===Li.OIDC&&(u!=null&&u.allowPlatformBroker))throw An(gU);return{auth:{...s,...t,OIDCOptions:{...s.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...o,...e},system:u,telemetry:{...d,...r}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Lre="@azure/msal-browser",vu="4.19.0";/*! @azure/msal-browser v4.19.0 2025-08-05 */const Or="msal",HN="browser",zS="-",tc=1,fA=1,Fre=`${Or}.${HN}.log.level`,Ure=`${Or}.${HN}.log.pii`,Bre=`${Or}.${HN}.platform.auth.dom`,zI=`${Or}.version`,VI="account.keys",GI="token.keys";function Ao(t=fA){return t<1?`${Or}.${VI}`:`${Or}.${t}.${VI}`}function Dl(t,e=tc){return e<1?`${Or}.${GI}.${t}`:`${Or}.${e}.${GI}.${t}`}/*! @azure/msal-browser v4.19.0 2025-08-05 */class zN{static loggerCallback(e,n){switch(e){case Rn.Error:console.error(n);return;case Rn.Info:console.info(n);return;case Rn.Verbose:console.debug(n);return;case Rn.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var l;this.browserEnvironment=typeof window<"u",this.config=$re(e,this.browserEnvironment);let n;try{n=window[Nr.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(Fre),i=(l=n==null?void 0:n.getItem(Ure))==null?void 0:l.toLowerCase(),s=i==="true"?!0:i==="false"?!1:void 0,o={...this.config.system.loggerOptions},c=r&&Object.keys(Rn).includes(r)?Rn[r]:void 0;c&&(o.loggerCallback=zN.loggerCallback,o.logLevel=c),s!==void 0&&(o.piiLoggingEnabled=s),this.logger=new $a(o,Lre,vu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class yu extends zN{getModuleName(){return yu.MODULE_NAME}getId(){return yu.ID}async initialize(){return this.available=typeof window<"u",this.available}}yu.MODULE_NAME="";yu.ID="StandardOperatingContext";/*! @azure/msal-browser v4.19.0 2025-08-05 */class Hre{constructor(){this.dbName=uA,this.version=dre,this.tableName=fre,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",i=>{i.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",i=>{const s=i;this.db=s.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(ze(ON)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(ze(Yu));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);o.addEventListener("success",c=>{const l=c;this.closeConnection(),n(l.target.result)}),o.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,i)=>{if(!this.db)return i(ze(Yu));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);c.addEventListener("success",()=>{this.closeConnection(),r()}),c.addEventListener("error",l=>{this.closeConnection(),i(l)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(ze(Yu));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);o.addEventListener("success",()=>{this.closeConnection(),n()}),o.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(ze(Yu));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();s.addEventListener("success",o=>{const c=o;this.closeConnection(),e(c.target.result)}),s.addEventListener("error",o=>{this.closeConnection(),n(o)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(ze(Yu));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);o.addEventListener("success",c=>{const l=c;this.closeConnection(),n(l.target.result===1)}),o.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(uA),i=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(i),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(i),e(!0))),r.addEventListener("error",()=>(clearTimeout(i),n(!1)))})}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class L0{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class zre{constructor(e){this.inMemoryCache=new L0,this.indexedDBCache=new Hre,this.logger=e}handleDatabaseAccessError(e){if(e instanceof bg&&e.errorCode===ON)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const n=this.inMemoryCache.getItem(e);if(!n)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return n}async setItem(e,n){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(n){this.handleDatabaseAccessError(n)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(n){this.handleDatabaseAccessError(n)}return e}async containsKey(e){const n=this.inMemoryCache.containsKey(e);if(!n)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return n}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class La{constructor(e,n,r){this.logger=e,xre(r??!1),this.cache=new zre(this.logger),this.performanceClient=n}createNewGuid(){return po()}base64Encode(e){return nm(e)}base64Decode(e){return to(e)}base64UrlEncode(e){return gv(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var d;const n=(d=this.performanceClient)==null?void 0:d.startMeasurement(K.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await wre(La.EXTRACTABLE,La.POP_KEY_USAGES),i=await HS(r.publicKey),s={e:i.e,kty:i.kty,n:i.n},o=KI(s),c=await this.hashString(o),l=await HS(r.privateKey),u=await Sre(l,!1,["sign"]);return await this.cache.setItem(c,{privateKey:u,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),n&&n.end({success:!0}),c}async removeTokenBindingKey(e){if(await this.cache.removeItem(e),await this.cache.containsKey(e))throw Se(rU)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,n,r,i){var w;const s=(w=this.performanceClient)==null?void 0:w.startMeasurement(K.CryptoOptsSignJwt,i),o=await this.cache.getItem(n);if(!o)throw ze(kN);const c=await HS(o.publicKey),l=KI(c),u=gv(JSON.stringify({kid:n})),d=EN.getShrHeaderString({...r==null?void 0:r.header,alg:c.alg,kid:u}),f=gv(d);e.cnf={jwk:JSON.parse(l)};const h=gv(JSON.stringify(e)),p=`${f}.${h}`,m=new TextEncoder().encode(p),v=await Cre(o.privateKey,m),b=Zc(new Uint8Array(v)),x=`${p}.${b}`;return s&&s.end({success:!0}),x}async hashString(e){return RB(e)}}La.POP_KEY_USAGES=["sign","verify"];La.EXTRACTABLE=!0;function KI(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Vre=24*60*60*1e3,hA={Lax:"Lax",None:"None"};class UB{initialize(){return Promise.resolve()}getItem(e){const n=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let i=0;i{const i=decodeURIComponent(r).trim().split("=");n.push(i[0])}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function Gre(t){const e=new Date;return new Date(e.getTime()+t*Vre).toUTCString()}/*! @azure/msal-browser v4.19.0 2025-08-05 */function fp(t,e){const n=t.getItem(Ao(e));return n?JSON.parse(n):[]}function hp(t,e,n){const r=e.getItem(Dl(t,n));if(r){const i=JSON.parse(r);if(i&&i.hasOwnProperty("idToken")&&i.hasOwnProperty("accessToken")&&i.hasOwnProperty("refreshToken"))return i}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function pA(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}/*! @azure/msal-browser v4.19.0 2025-08-05 */const WI="msal.cache.encryption",Kre="msal.broadcast.cache";class Wre{constructor(e,n,r){if(!window.localStorage)throw dr(rm);this.memoryStorage=new L0,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=r,this.broadcast=new BroadcastChannel(Kre)}async initialize(e){const n=new UB,r=n.getItem(WI);let i={key:"",id:""};if(r)try{i=JSON.parse(r)}catch{}if(i.key&&i.id){const s=ts($c,K.Base64Decode,this.logger,this.performanceClient,e)(i.key);this.encryptionCookie={id:i.id,key:await fe(LI,K.GenerateHKDF,this.logger,this.performanceClient,e)(s)}}else{const s=po(),o=await fe(OB,K.GenerateBaseKey,this.logger,this.performanceClient,e)(),c=ts(Zc,K.UrlEncodeArr,this.logger,this.performanceClient,e)(new Uint8Array(o));this.encryptionCookie={id:s,key:await fe(LI,K.GenerateHKDF,this.logger,this.performanceClient,e)(o)};const l={id:s,key:c};n.setItem(WI,JSON.stringify(l),0,!0,hA.None)}await fe(this.importExistingCache.bind(this),K.ImportExistingCache,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",this.updateCache.bind(this)),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw ze(dp);return this.memoryStorage.getItem(e)}async decryptData(e,n,r){if(!this.initialized||!this.encryptionCookie)throw ze(dp);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const i=await fe(FI,K.Decrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!i)return null;try{return JSON.parse(i)}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,r,i){if(!this.initialized||!this.encryptionCookie)throw ze(dp);const{data:s,nonce:o}=await fe(jre,K.Encrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n,this.getContext(e)),c={id:this.encryptionCookie.id,nonce:o,data:s,lastUpdatedAt:i};this.memoryStorage.setItem(e,n),this.setItem(e,JSON.stringify(c)),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),fp(this).forEach(r=>this.removeItem(r));const n=hp(this.clientId,this);n.idToken.forEach(r=>this.removeItem(r)),n.accessToken.forEach(r=>this.removeItem(r)),n.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(Or)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=fp(this);n=await this.importArray(n,e),n.length?this.setItem(Ao(),JSON.stringify(n)):this.removeItem(Ao());const r=hp(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(Dl(this.clientId),JSON.stringify(r)):this.removeItem(Dl(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let i;try{i=JSON.parse(r)}catch{return null}return pA(i)?i.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):fe(FI,K.Decrypt,this.logger,this.performanceClient,n)(this.encryptionCookie.key,i.nonce,this.getContext(e),i.data):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),i)}async importArray(e,n){const r=[],i=[];return e.forEach(s=>{const o=this.getItemFromEncryptedCache(s,n).then(c=>{c?(this.memoryStorage.setItem(s,c),r.push(s)):this.removeItem(s)});i.push(o)}),await Promise.all(i),r}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e){this.logger.trace("Updating internal cache from broadcast event");const n=this.performanceClient.startMeasurement(K.LocalStorageUpdated);n.add({isBackground:!0});const{key:r,value:i,context:s}=e.data;if(!r){this.logger.error("Broadcast event missing key"),n.end({success:!1,errorCode:"noKey"});return}if(s&&s!==this.clientId){this.logger.trace(`Ignoring broadcast event from clientId: ${s}`),n.end({success:!1,errorCode:"contextMismatch"});return}i?(this.memoryStorage.setItem(r,i),this.logger.verbose("Updated item in internal cache")):(this.memoryStorage.removeItem(r),this.logger.verbose("Removed item from internal cache")),n.end({success:!0})}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class qre{constructor(){if(!window.sessionStorage)throw dr(rm)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const qe={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};/*! @azure/msal-browser v4.19.0 2025-08-05 */function qI(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class mA extends oA{constructor(e,n,r,i,s,o,c){super(e,r,i,s,c),this.cacheConfig=n,this.logger=i,this.internalStorage=new L0,this.browserStorage=YI(e,n.cacheLocation,i,s),this.temporaryCacheStorage=YI(e,n.temporaryCacheLocation,i,s),this.cookieStorage=new UB,this.eventHandler=o}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){const n=fp(this.browserStorage,0),r=hp(this.clientId,this.browserStorage,0);this.performanceClient.addFields({oldAccountCount:n.length,oldAccessCount:r.accessToken.length,oldIdCount:r.idToken.length,oldRefreshCount:r.refreshToken.length},e);const i=fp(this.browserStorage,1),s=hp(this.clientId,this.browserStorage,1);this.performanceClient.addFields({currAccountCount:i.length,currAccessCount:s.accessToken.length,currIdCount:s.idToken.length,currRefreshCount:s.refreshToken.length},e),await Promise.all([this.updateV0ToCurrent(fA,n,i,e),this.updateV0ToCurrent(tc,r.idToken,s.idToken,e),this.updateV0ToCurrent(tc,r.accessToken,s.accessToken,e),this.updateV0ToCurrent(tc,r.refreshToken,s.refreshToken,e)]),n.length>0?this.browserStorage.setItem(Ao(0),JSON.stringify(n)):this.browserStorage.removeItem(Ao(0)),i.length>0?this.browserStorage.setItem(Ao(1),JSON.stringify(i)):this.browserStorage.removeItem(Ao(1)),this.setTokenKeys(r,e,0),this.setTokenKeys(s,e,1)}async updateV0ToCurrent(e,n,r,i){const s=[];for(const o of[...n]){const c=this.browserStorage.getItem(o),l=this.validateAndParseJson(c||"");if(!l){qI(n,o);continue}l.lastUpdatedAt||(l.lastUpdatedAt=Date.now().toString(),this.setItem(o,JSON.stringify(l),i));const u=pA(l)?await this.browserStorage.decryptData(o,l,i):l;let d;if(u&&(EI(u)||NI(u))&&(d=u.expiresOn),!u||Tne(l.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)||d&&ax(d,B5)){this.browserStorage.removeItem(o),qI(n,o),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},i);continue}if(this.cacheConfig.cacheLocation!==Nr.LocalStorage||pA(l)){const f=`${Or}.${e}${zS}${o}`,h=this.browserStorage.getItem(f);if(h){const p=this.validateAndParseJson(h);if(Number(l.lastUpdatedAt)>Number(p.lastUpdatedAt)){s.push(this.setUserData(f,JSON.stringify(u),i,l.lastUpdatedAt).then(()=>{this.performanceClient.incrementFields({updatedCacheFromV0Count:1},i)}));continue}}else{s.push(this.setUserData(f,JSON.stringify(u),i,l.lastUpdatedAt).then(()=>{r.push(f),this.performanceClient.incrementFields({upgradedCacheCount:1},i)}));continue}}}return Promise.all(s)}trackVersionChanges(e){const n=this.browserStorage.getItem(zI);n&&(this.logger.info(`MSAL.js was last initialized by version: ${n}`),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==vu&&this.setItem(zI,vu,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,r){let i=0,s=[];const o=20;for(let c=0;c<=o;c++)try{this.browserStorage.setItem(e,n),c>0&&(c<=i?this.removeAccessTokenKeys(s.slice(0,c),r,0):(this.removeAccessTokenKeys(s.slice(0,i),r,0),this.removeAccessTokenKeys(s.slice(i,c),r)));break}catch(l){const u=sA(l);if(u.errorCode===nx&&c0&&(l<=s?this.removeAccessTokenKeys(o.slice(0,l),r,0):(this.removeAccessTokenKeys(o.slice(0,s),r,0),this.removeAccessTokenKeys(o.slice(s,l),r)));break}catch(u){const d=sA(u);if(d.errorCode===nx&&l-1){if(r.splice(i,1),r.length===0){this.removeItem(Ao());return}else this.setItem(Ao(),JSON.stringify(r),n);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}removeAccount(e,n){const r=this.getActiveAccount(n);(r==null?void 0:r.homeAccountId)===e.homeAccountId&&(r==null?void 0:r.environment)===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(i=>{i.includes(e.homeAccountId)&&i.includes(e.environment)&&this.browserStorage.removeItem(i)}),this.cacheConfig.cacheLocation===Nr.LocalStorage&&this.eventHandler.emitEvent(qe.ACCOUNT_REMOVED,void 0,e)}removeIdToken(e,n){super.removeIdToken(e,n);const r=this.getTokenKeys(),i=r.idToken.indexOf(e);i>-1&&(this.logger.info("idToken removed from tokenKeys map"),r.idToken.splice(i,1),this.setTokenKeys(r,n))}removeAccessToken(e,n,r=!0){super.removeAccessToken(e,n),r&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,r=tc){this.logger.trace("removeAccessTokenKey called");const i=this.getTokenKeys(r);let s=0;if(e.forEach(o=>{const c=i.accessToken.indexOf(o);c>-1&&(i.accessToken.splice(c,1),s++)}),s>0){this.logger.info(`removed ${s} accessToken keys from tokenKeys map`),this.setTokenKeys(i,n,r);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const r=this.getTokenKeys(),i=r.refreshToken.indexOf(e);i>-1&&(this.logger.info("refreshToken removed from tokenKeys map"),r.refreshToken.splice(i,1),this.setTokenKeys(r,n))}getTokenKeys(e=tc){return hp(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,r=tc){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(Dl(this.clientId,r));return}else this.setItem(Dl(this.clientId,r),JSON.stringify(e),n)}getIdTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!kne(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i)}async setIdTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(r,JSON.stringify(e),n,i);const s=this.getTokenKeys();s.idToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),s.idToken.push(r),this.setTokenKeys(s,n))}getAccessTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeAccessTokenKeys([e],n),null;const i=this.validateAndParseJson(r);return!i||!EI(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i)}async setAccessTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(r,JSON.stringify(e),n,i);const s=this.getTokenKeys(),o=s.accessToken.indexOf(r);o!==-1&&s.accessToken.splice(o,1),this.logger.trace(`access token ${o===-1?"added to":"updated in"} map`),s.accessToken.push(r),this.setTokenKeys(s,n)}getRefreshTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeRefreshToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!NI(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i)}async setRefreshTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(r,JSON.stringify(e),n,i);const s=this.getTokenKeys();s.refreshToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),s.refreshToken.push(r),this.setTokenKeys(s,n))}getAppMetadata(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Mne(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,n){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=Rne(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!One(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,n,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e){const n=this.internalStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return r&&Dne(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(mv.WRAPPER_SKU,e),this.internalStorage.setItem(mv.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(mv.WRAPPER_SKU)||pe.EMPTY_STRING,n=this.internalStorage.getItem(mv.WRAPPER_VER)||pe.EMPTY_STRING;return[e,n]}setAuthorityMetadata(e,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(gI.ACTIVE_ACCOUNT_FILTERS),r=this.browserStorage.getItem(n);if(!r)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found"),null;const i=this.validateAndParseJson(r);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId,tenantId:i.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,n){const r=this.generateCacheKey(gI.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:Fi().toString()};this.setItem(r,JSON.stringify(i),n)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(qe.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Ine(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,n,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n){const r=n?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const s=this.cookieStorage.getItem(r);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),s}const i=this.temporaryCacheStorage.getItem(r);if(!i){if(this.cacheConfig.cacheLocation===Nr.LocalStorage){const s=this.browserStorage.getItem(r);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),s}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),i}setTemporaryCache(e,n,r){const i=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(i,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(i,n,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(Or)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(Or)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}clearTokensAndKeysWithClaims(e){this.performanceClient.addQueueMeasurement(K.ClearTokensAndKeysWithClaims,e);const n=this.getTokenKeys();let r=0;n.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i,e);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(i,e),r++)}),r>0&&this.logger.warning(`${r} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return Uo.startsWith(e,Or)?e:`${Or}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===Gr.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==yn.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${Or}.${tc}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",e.requestedClaimsHash||"",r].join(zS).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${Or}.${fA}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(zS).toLowerCase()}resetRequestCache(){this.logger.trace("BrowserCacheManager.resetRequestCache called"),this.removeTemporaryItem(this.generateCacheKey(hr.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(hr.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(hr.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(hr.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(hr.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cacheAuthorizeRequest(e,n){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called");const r=nm(JSON.stringify(e));if(this.setTemporaryCache(hr.REQUEST_PARAMS,r,!0),n){const i=nm(n);this.setTemporaryCache(hr.VERIFIER,i,!0)}}getCachedRequest(){this.logger.trace("BrowserCacheManager.getCachedRequest called");const e=this.getTemporaryCache(hr.REQUEST_PARAMS,!0);if(!e)throw ze(dB);const n=this.getTemporaryCache(hr.VERIFIER,!0);let r,i="";try{r=JSON.parse(to(e)),n&&(i=to(n))}catch(s){throw this.logger.errorPii(`Attempted to parse: ${e}`),this.logger.error(`Parsing cached token request threw with error: ${s}`),ze(fB)}return[r,i]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(hr.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){var r;const n=(r=this.getInteractionInProgress())==null?void 0:r.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${Or}.${hr.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("Cannot parse interaction status. Removing temporary cache items and clearing url hash. Retrying interaction should fix the error"),this.removeTemporaryItem(e),this.resetRequestCache(),MB(window),null}}setInteractionInProgress(e,n=uc.SIGNIN){var i;const r=`${Or}.${hr.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw ze(rB);this.setTemporaryCache(r,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&((i=this.getInteractionInProgress())==null?void 0:i.clientId)===this.clientId&&this.removeTemporaryItem(r)}async hydrateCache(e,n){var c,l,u;const r=P0((c=e.account)==null?void 0:c.homeAccountId,(l=e.account)==null?void 0:l.environment,e.idToken,this.clientId,e.tenantId);let i;n.claims&&(i=await this.cryptoImpl.hashString(n.claims));const s=k0((u=e.account)==null?void 0:u.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?jI(e.expiresOn):0,e.extExpiresOn?jI(e.extExpiresOn):0,to,void 0,e.tokenType,void 0,n.sshKid,n.claims,i),o={idToken:r,accessToken:s};return this.saveCacheRecord(o,e.correlationId)}async saveCacheRecord(e,n,r){try{await super.saveCacheRecord(e,n,r)}catch(i){if(i instanceof Cd&&this.performanceClient&&n)try{const s=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:s.refreshToken.length,cacheIdCount:s.idToken.length,cacheAtCount:s.accessToken.length},n)}catch{}throw i}}}function YI(t,e,n,r){try{switch(e){case Nr.LocalStorage:return new Wre(t,n,r);case Nr.SessionStorage:return new qre;case Nr.MemoryStorage:default:break}}catch(i){n.error(i)}return new L0}const Yre=(t,e,n,r)=>{const i={cacheLocation:Nr.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Nr.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new mA(t,i,Zy,e,n,r)};/*! @azure/msal-browser v4.19.0 2025-08-05 */function Qre(t,e,n,r,i){return t.verbose("getAllAccounts called"),n?e.getAllAccounts(i||{},r):[]}function Xre(t,e,n,r){if(e.trace("getAccount called"),Object.keys(t).length===0)return e.warning("getAccount: No accountFilter provided"),null;const i=n.getAccountInfoFilteredBy(t,r);return i?(e.verbose("getAccount: Account matching provided filter found, returning"),i):(e.verbose("getAccount: No matching account found, returning null"),null)}function Jre(t,e,n,r){if(e.trace("getAccountByUsername called"),!t)return e.warning("getAccountByUsername: No username provided"),null;const i=n.getAccountInfoFilteredBy({username:t},r);return i?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${t}`),i):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function Zre(t,e,n,r){if(e.trace("getAccountByHomeId called"),!t)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const i=n.getAccountInfoFilteredBy({homeAccountId:t},r);return i?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${t}`),i):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function eie(t,e,n,r){if(e.trace("getAccountByLocalId called"),!t)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const i=n.getAccountInfoFilteredBy({localAccountId:t},r);return i?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${t}`),i):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function tie(t,e,n){e.setActiveAccount(t,n)}function nie(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const rie="msal.broadcast.event";class iie{constructor(e){this.eventCallbacks=new Map,this.logger=e||new $a({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(rie)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,r){if(typeof window<"u"){const i=r||Ire();return this.eventCallbacks.has(i)?(this.logger.error(`Event callback with id: ${i} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(i,[e,n||[]]),this.logger.verbose(`Event callback registered with id: ${i}`),i)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,n,r,i){var o;const s={eventType:e,interactionType:n||null,payload:r||null,error:i||null,timestamp:Date.now()};switch(e){case qe.ACCOUNT_ADDED:case qe.ACCOUNT_REMOVED:case qe.ACTIVE_ACCOUNT_CHANGED:(o=this.broadcastChannel)==null||o.postMessage(s);break;default:this.invokeCallbacks(s);break}}invokeCallbacks(e){this.eventCallbacks.forEach(([n,r],i)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback ${i}: ${e.eventType}`),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class BB{constructor(e,n,r,i,s,o,c,l,u){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=o,this.platformAuthProvider=l,this.correlationId=u||po(),this.logger=i.clone(Ti.MSAL_SKU,vu,this.correlationId),this.performanceClient=c}async clearCacheOnLogout(e,n){if(n)try{this.browserStorage.removeAccount(n,e),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),this.browserStorage.clear(e),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const n=e||this.config.auth.redirectUri;return en.getAbsoluteUrl(n,ba())}initializeServerTelemetryManager(e,n){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:n||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new em(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:n}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(K.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const i={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},s=e.requestAuthority||this.config.auth.authority,o=r!=null&&r.length?r==="true":this.config.auth.instanceAware,c=n&&o?this.config.auth.authority.replace(en.getDomainFromUrl(s),n.environment):s,l=ti.generateAuthority(c,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),u=await fe(HU,K.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(l,this.config.system.networkClient,this.browserStorage,i,this.logger,this.correlationId,this.performanceClient);if(n&&!u.isAlias(n.environment))throw An(vU);return u}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function VN(t,e,n,r){n.addQueueMeasurement(K.InitializeBaseRequest,t.correlationId);const i=t.authority||e.auth.authority,s=[...t&&t.scopes||[]],o={...t,correlationId:t.correlationId,authority:i,scopes:s};if(!o.authenticationScheme)o.authenticationScheme=yn.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(o.authenticationScheme===yn.SSH){if(!t.sshJwk)throw An(j0);if(!t.sshKid)throw An(pU)}r.verbose(`Authentication Scheme set to "${o.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&t.claims&&!Uo.isEmptyObj(t.claims)&&(o.requestedClaimsHash=await RB(t.claims)),o}async function sie(t,e,n,r,i){r.addQueueMeasurement(K.InitializeSilentRequest,t.correlationId);const s=await fe(VN,K.InitializeBaseRequest,i,r,t.correlationId)(t,n,r,i);return{...t,...s,account:e,forceRefresh:t.forceRefresh||!1}}function HB(t,e){let n;const r=t.httpMethod;if(e===Li.EAR){if(n=r||Ml.POST,n!==Ml.POST)throw An(yU)}else n=r||Ml.GET;if(t.authorizePostBodyParameters&&n!==Ml.POST)throw An(xU);return n}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Kf extends BB{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const n={correlationId:this.correlationId||po(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=en.getAbsoluteUrl(e.postLogoutRedirectUri,ba())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=en.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,ba())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=en.getAbsoluteUrl(ba(),ba())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(K.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const n=await fe(this.getClientConfiguration.bind(this),K.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new WU(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:o}=e;this.performanceClient.addQueueMeasurement(K.StandardInteractionClientGetClientConfiguration,this.correlationId);const c=await fe(this.getDiscoveredAuthority.bind(this),K.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:o}),l=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:c,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:l.loggerCallback,piiLoggingEnabled:l.piiLoggingEnabled,logLevel:l.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:Ti.MSAL_SKU,version:vu,cpu:pe.EMPTY_STRING,os:pe.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,n){this.performanceClient.addQueueMeasurement(K.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),i={interactionType:n},s=Vf.setRequestState(this.browserCrypto,e&&e.state||pe.EMPTY_STRING,i),c={...await fe(VN,K.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:s,nonce:e.nonce||po(),responseMode:this.config.auth.OIDCOptions.serverResponseType},l={...c,httpMethod:HB(c,this.config.auth.protocolMode)};if(e.loginHint||e.sid)return l;const u=e.account||this.browserStorage.getActiveAccount(this.correlationId);return u&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${u.homeAccountId}`,this.correlationId),l.account=u),l}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function oie(t,e){if(!e)return null;try{return Vf.parseRequestState(t,e).libraryState.meta}catch{throw Se(Jd)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function pp(t,e,n){const r=ex(t);if(!r)throw wU(t)?(n.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),n.errorPii(`The ${e} detected is: ${t}`),ze(eB)):(n.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),ze(ZU));return r}function aie(t,e,n){if(!t.state)throw ze(PN);const r=oie(e,t.state);if(!r)throw ze(tB);if(r.interactionType!==n)throw ze(nB)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class zB{constructor(e,n,r,i,s){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=i,this.performanceClient=s}async handleCodeResponse(e,n){this.performanceClient.addQueueMeasurement(K.HandleCodeResponse,n.correlationId);let r;try{r=Xne(e,n.state)}catch(i){throw i instanceof ku&&i.subError===tm?ze(tm):i}return fe(this.handleCodeResponseFromServer.bind(this),K.HandleCodeResponseFromServer,this.logger,this.performanceClient,n.correlationId)(r,n)}async handleCodeResponseFromServer(e,n,r=!0){if(this.performanceClient.addQueueMeasurement(K.HandleCodeResponseFromServer,n.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await fe(this.authModule.updateAuthority.bind(this.authModule),K.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,n.correlationId)(e.cloud_instance_host_name,n.correlationId),r&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const s=this.createCcsCredentials(n);s&&(this.authCodeRequest.ccsCredential=s)}return await fe(this.authModule.acquireToken.bind(this.authModule),K.AuthClientAcquireToken,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Ys.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Ys.UPN}:null}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const cie="ContentError",VB="user_switch";/*! @azure/msal-browser v4.19.0 2025-08-05 */const lie="USER_INTERACTION_REQUIRED",uie="USER_CANCEL",die="NO_NETWORK",fie="PERSISTENT_ERROR",hie="DISABLED",pie="ACCOUNT_UNAVAILABLE",mie="UX_NOT_ALLOWED";/*! @azure/msal-browser v4.19.0 2025-08-05 */const gie=-2147186943,vie={[VB]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Io extends Cn{constructor(e,n,r){super(e,n),Object.setPrototypeOf(this,Io.prototype),this.name="NativeAuthError",this.ext=r}}function Qu(t){if(t.ext&&t.ext.status&&(t.ext.status===fie||t.ext.status===hie)||t.ext&&t.ext.error&&t.ext.error===gie)return!0;switch(t.errorCode){case cie:return!0;default:return!1}}function px(t,e,n){if(n&&n.status)switch(n.status){case pie:return lx(VU);case lie:return new ho(t,e);case uie:return ze(tm);case die:return ze(ux);case mie:return lx(CN)}return new Io(t,vie[t]||e,n)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class GB extends Kf{async acquireToken(e){this.performanceClient.addQueueMeasurement(K.SilentCacheClientAcquireToken,e.correlationId);const n=this.initializeServerTelemetryManager(Sn.acquireTokenSilent_silentFlow),r=await fe(this.getClientConfiguration.bind(this),K.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),i=new qne(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const o=(await fe(i.acquireCachedToken.bind(i),K.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(s){throw s instanceof bg&&s.errorCode===kN&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),s}}logout(e){this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(n.correlationId,n==null?void 0:n.account)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class iy extends BB{constructor(e,n,r,i,s,o,c,l,u,d,f,h){super(e,n,r,i,s,o,l,u,h),this.apiId=c,this.accountId=d,this.platformAuthProvider=u,this.nativeStorageManager=f,this.silentCacheClient=new GB(e,this.nativeStorageManager,r,i,s,o,l,u,h);const p=this.platformAuthProvider.getExtensionName();this.skus=em.makeExtraSkuString({libraryName:Ti.MSAL_SKU,libraryVersion:vu,extensionName:p,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[lne]:this.skus}}async acquireToken(e,n){this.performanceClient.addQueueMeasurement(K.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const r=this.performanceClient.startMeasurement(K.NativeInteractionClientAcquireToken,e.correlationId),i=Fi(),s=this.initializeServerTelemetryManager(this.apiId);try{const o=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch(l){if(n===ui.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy"),l;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const c=await this.platformAuthProvider.sendMessage(o);return await this.handleNativeResponse(c,o,i).then(l=>(r.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),s.clearNativeBrokerErrorCode(),l)).catch(l=>{throw r.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}catch(o){throw o instanceof Io&&s.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:Er.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),Se(rA);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},this.correlationId);if(!r)throw Se(rA);try{const i=this.createSilentCacheRequest(n,r),s=await this.silentCacheClient.acquireToken(i),o={...r,idTokenClaims:s==null?void 0:s.idTokenClaims,idToken:s==null?void 0:s.idToken};return{...s,account:o}}catch(i){throw i}}async acquireTokenRedirect(e,n){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const i=await this.initializeNativeRequest(r);try{await this.platformAuthProvider.sendMessage(i)}catch(c){if(c instanceof Io&&(this.initializeServerTelemetryManager(this.apiId).setNativeBrokerErrorCode(c.errorCode),Qu(c)))throw c}this.browserStorage.setTemporaryCache(hr.NATIVE_REQUEST,JSON.stringify(i),!0);const s={apiId:Sn.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);n.end({success:!0}),await this.navigationClient.navigateExternal(o,s)}async handleRedirectPromise(e,n){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&n&&(e==null||e.addFields({errorCode:"no_cached_request"},n)),null;const{prompt:i,...s}=r;i&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(hr.NATIVE_REQUEST));const o=Fi();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.platformAuthProvider.sendMessage(s),l=await this.handleNativeResponse(c,s,o);return this.initializeServerTelemetryManager(this.apiId).clearNativeBrokerErrorCode(),l}catch(c){throw c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var d,f;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const i=zf(e.id_token,to),s=this.createHomeAccountIdentifier(e,i),o=(d=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:d.homeAccountId;if((f=n.extraParameters)!=null&&f.child_client_id&&e.account.id!==n.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch");else if(s!==o&&e.account.id!==n.accountId)throw px(VB);const c=await this.getDiscoveredAuthority({requestAuthority:n.authority}),l=_N(this.browserStorage,c,s,to,this.correlationId,i,e.client_info,void 0,i.tid,void 0,e.account.id,this.logger);e.expires_in=Number(e.expires_in);const u=await this.generateAuthenticationResult(e,n,i,l,c.canonicalAuthority,r);return await this.cacheAccount(l,this.correlationId),await this.cacheNativeTokens(e,n,s,i,e.access_token,u.tenantId,r),u}createHomeAccountIdentifier(e,n){return fo.generateHomeAccountId(e.client_info||pe.EMPTY_STRING,zs.Default,this.logger,this.browserCrypto,n)}generateScopes(e,n){return n?Er.fromString(n):Er.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===yn.POP&&n.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Zd(this.browserCrypto),i={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce};if(!n.keyId)throw Se(JE);return r.signPopToken(e.access_token,n.keyId,i)}else return e.access_token}async generateAuthenticationResult(e,n,r,i,s,o){const c=this.addTelemetryFromNativeResponse(e.properties.MATS),l=this.generateScopes(n.scope,e.scope),u=e.account.properties||{},d=u.UID||r.oid||r.sub||pe.EMPTY_STRING,f=u.TenantId||r.tid||pe.EMPTY_STRING,h=aN(i.getAccountInfo(),void 0,r,e.id_token);h.nativeAccountId!==e.account.id&&(h.nativeAccountId=e.account.id);const p=await this.generatePopAccessToken(e,n),g=n.tokenType===yn.POP?yn.POP:yn.BEARER;return{authority:s,uniqueId:d,tenantId:f,scopes:l.asArray(),account:h,idToken:e.id_token,idTokenClaims:r,accessToken:p,fromCache:c?this.isResponseFromCache(c):!1,expiresOn:Ad(o+e.expires_in),tokenType:g,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}async cacheAccount(e,n){await this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e.getAccountInfo(),n)}cacheNativeTokens(e,n,r,i,s,o,c){const l=P0(r,n.authority,e.id_token||"",n.clientId,i.tid||""),u=n.tokenType===yn.POP?pe.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,d=c+u,f=this.generateScopes(e.scope,n.scope),h=k0(r,n.authority,s,n.clientId,i.tid||o,f.printScopes(),d,0,to,void 0,n.tokenType,void 0,n.keyId),p={idToken:l,accessToken:h};return this.nativeStorageManager.saveCacheRecord(p,this.correlationId,n.storeInCache)}getExpiresInValue(e,n){return e===yn.POP?pe.SHR_NONCE_VALIDITY:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const n=await this.getCanonicalAuthority(e),{scopes:r,...i}=e,s=new Er(r||[]);s.appendScopes(xg);const o={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(o.signPopToken&&e.popKid)throw ze(_B);if(this.handleExtraBrokerParams(o),o.extraParameters=o.extraParameters||{},o.extraParameters.telemetry=ys.MATS_TELEMETRY,e.authenticationScheme===yn.POP){const c={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},l=new Zd(this.browserCrypto);let u;if(o.keyId)u=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:o.keyId})),o.signPopToken=!1;else{const d=await fe(l.generateCnf.bind(l),K.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(c,this.logger);u=d.reqCnfString,o.keyId=d.kid,o.signPopToken=!0}o.reqCnf=u}return this.addRequestSKUs(o),o}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:n,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new en(n);return r.validateAsUri(),r}getPrompt(e){switch(this.apiId){case Sn.ssoSilent:case Sn.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),gi.NONE}if(!e){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e){case gi.NONE:case gi.CONSENT:case gi.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e} is not compatible with native flow`),ze(SB)}}handleExtraBrokerParams(e){var s;const n=e.extraParameters&&e.extraParameters.hasOwnProperty(ix)&&e.extraParameters.hasOwnProperty(sx)&&e.extraParameters.hasOwnProperty(mu);if(!e.embeddedClientId&&!n)return;let r="";const i=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[sx],r=e.extraParameters[mu]),e.extraParameters={child_client_id:r,child_redirect_uri:i},(s=this.performanceClient)==null||s.addFields({embeddedClientId:r,embeddedRedirectUri:i},e.correlationId)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function GN(t,e,n,r,i){const s=Qne({...t.auth,authority:e},n,r,i);if(gN(s,{sku:Ti.MSAL_SKU,version:vu,os:"",cpu:""}),t.auth.protocolMode!==Li.OIDC&&vN(s,t.telemetry.application),n.platformBroker&&(hne(s),n.authenticationScheme===yn.POP)){const o=new La(r,i),c=new Zd(o);let l;n.popKid?l=o.encodeKid(n.popKid):l=(await fe(c.generateCnf.bind(c),K.PopTokenGenerateCnf,r,i,n.correlationId)(n,r)).reqCnfString,xN(s,l)}return E0(s,n.correlationId,i),s}async function KN(t,e,n,r,i){if(!n.codeChallenge)throw An(rN);const s=await fe(GN,K.GetStandardParams,r,i,n.correlationId)(t,e,n,r,i);return uN(s,GE.CODE),kU(s,n.codeChallenge,pe.S256_CODE_CHALLENGE_METHOD),Dc(s,n.extraQueryParameters||{}),AN(e,s,t.auth.encodeExtraQueryParams,n.extraQueryParameters)}async function WN(t,e,n,r,i,s){if(!r.earJwk)throw ze(TN);const o=await GN(e,n,r,i,s);uN(o,GE.IDTOKEN_TOKEN_REFRESHTOKEN),_ne(o,r.earJwk);const c=new Map;Dc(c,r.extraQueryParameters||{});const l=AN(n,c,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return KB(t,l,o)}async function qN(t,e,n,r,i,s){const o=await GN(e,n,r,i,s);uN(o,GE.CODE),kU(o,r.codeChallenge,r.codeChallengeMethod||pe.S256_CODE_CHALLENGE_METHOD),Ane(o,r.authorizePostBodyParameters||{});const c=new Map;Dc(c,r.extraQueryParameters||{});const l=AN(n,c,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return KB(t,l,o)}function KB(t,e,n){const r=t.createElement("form");return r.method="post",r.action=e,n.forEach((i,s)=>{const o=t.createElement("input");o.hidden=!0,o.name=s,o.value=i,r.appendChild(o)}),t.body.appendChild(r),r}async function WB(t,e,n,r,i,s,o,c,l,u){if(c.verbose("Account id found, calling WAM for token"),!u)throw ze(IN);const d=new La(c,l),f=new iy(r,i,d,c,o,r.system.navigationClient,n,l,u,e,s,t.correlationId),{userRequestState:h}=Vf.parseRequestState(d,t.state);return fe(f.acquireToken.bind(f),K.NativeInteractionClientAcquireToken,c,l,t.correlationId)({...t,state:h,prompt:void 0})}async function mx(t,e,n,r,i,s,o,c,l,u,d,f){if(Oo.removeThrottle(o,i.auth.clientId,t),e.accountId)return fe(WB,K.HandleResponsePlatformBroker,u,d,t.correlationId)(t,e.accountId,r,i,o,c,l,u,d,f);const h={...t,code:e.code||"",codeVerifier:n},p=new zB(s,o,h,u,d);return await fe(p.handleCodeResponse.bind(p),K.HandleCodeResponse,u,d,t.correlationId)(e,t)}async function YN(t,e,n,r,i,s,o,c,l,u,d){if(Oo.removeThrottle(s,r.auth.clientId,t),qU(e,t.state),!e.ear_jwe)throw ze(JU);if(!t.earJwk)throw ze(TN);const f=JSON.parse(await fe(Are,K.DecryptEarResponse,l,u,t.correlationId)(t.earJwk,e.ear_jwe));if(f.accountId)return fe(WB,K.HandleResponsePlatformBroker,l,u,t.correlationId)(t,f.accountId,n,r,s,o,c,l,u,d);const h=new gu(r.auth.clientId,s,new La(l,u),l,null,null,u);h.validateTokenResponse(f);const p={code:"",state:t.state,nonce:t.nonce,client_info:f.client_info,cloud_graph_host_name:f.cloud_graph_host_name,cloud_instance_host_name:f.cloud_instance_host_name,cloud_instance_name:f.cloud_instance_name,msgraph_host:f.msgraph_host};return await fe(h.handleServerTokenResponse.bind(h),K.HandleServerTokenResponse,l,u,t.correlationId)(f,i,Fi(),t,p,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const yie=32;async function F0(t,e,n){t.addQueueMeasurement(K.GeneratePkceCodes,n);const r=ts(xie,K.GenerateCodeVerifier,e,t,n)(t,e,n),i=await fe(bie,K.GenerateCodeChallengeFromVerifier,e,t,n)(r,t,e,n);return{verifier:r,challenge:i}}function xie(t,e,n){try{const r=new Uint8Array(yie);return ts(bre,K.GetRandomValues,e,t,n)(r),Zc(r)}catch{throw ze(NN)}}async function bie(t,e,n,r){e.addQueueMeasurement(K.GenerateCodeChallengeFromVerifier,r);try{const i=await fe(kB,K.Sha256Digest,n,e,r)(t,e,r);return Zc(new Uint8Array(i))}catch{throw ze(NN)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class gx{constructor(e,n,r,i){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(K.NativeMessageHandlerHandshake),this.platformAuthType=ys.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace(this.platformAuthType+" - sendMessage called.");const n={method:Ah.GetToken,request:e},r={channel:ys.CHANNEL_ID,extensionId:this.extensionId,responseId:po(),body:n};this.logger.trace(this.platformAuthType+" - Sending request to browser extension"),this.logger.tracePii(this.platformAuthType+` - Sending request to browser extension: ${JSON.stringify(r)}`),this.messageChannel.port1.postMessage(r);const i=await new Promise((o,c)=>{this.resolvers.set(r.responseId,{resolve:o,reject:c})});return this.validatePlatformBrokerResponse(i)}static async createProvider(e,n,r){e.trace("PlatformAuthExtensionHandler - createProvider called.");try{const i=new gx(e,n,r,ys.PREFERRED_EXTENSION_ID);return await i.sendHandshakeRequest(),i}catch{const s=new gx(e,n,r);return await s.sendHandshakeRequest(),s}}async sendHandshakeRequest(){this.logger.trace(this.platformAuthType+" - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ys.CHANNEL_ID,extensionId:this.extensionId,responseId:po(),body:{method:Ah.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=n=>{this.onChannelMessage(n)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((n,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:n,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(ze(bB)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace(this.platformAuthType+" - onWindowMessage called"),e.source!==window)return;const n=e.data;if(!(!n.channel||n.channel!==ys.CHANNEL_ID)&&!(n.extensionId&&n.extensionId!==this.extensionId)&&n.body.method===Ah.HandshakeRequest){const r=this.handshakeResolvers.get(n.responseId);if(!r){this.logger.trace(this.platformAuthType+`.onWindowMessage - resolver can't be found for request ${n.responseId}`);return}this.logger.verbose(n.extensionId?`Extension with id: ${n.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(ze(wB))}}onChannelMessage(e){this.logger.trace(this.platformAuthType+" - onChannelMessage called.");const n=e.data,r=this.resolvers.get(n.responseId),i=this.handshakeResolvers.get(n.responseId);try{const s=n.body.method;if(s===Ah.Response){if(!r)return;const o=n.body.response;if(this.logger.trace(this.platformAuthType+" - Received response from browser extension"),this.logger.tracePii(this.platformAuthType+` - Received response from browser extension: ${JSON.stringify(o)}`),o.status!=="Success")r.reject(px(o.code,o.description,o.ext));else if(o.result)o.result.code&&o.result.description?r.reject(px(o.result.code,o.result.description,o.result.ext)):r.resolve(o.result);else throw eA(Jy,"Event does not contain result.");this.resolvers.delete(n.responseId)}else if(s===Ah.HandshakeResponse){if(!i){this.logger.trace(this.platformAuthType+`.onChannelMessage - resolver can't be found for request ${n.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=n.extensionId,this.extensionVersion=n.body.version,this.logger.verbose(this.platformAuthType+` - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),i.resolve(),this.handshakeResolvers.delete(n.responseId)}}catch(s){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${s}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(s):i&&i.reject(s)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw eA(Jy,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){var e;return this.getExtensionId()===ys.PREFERRED_EXTENSION_ID?"chrome":(e=this.getExtensionId())!=null&&e.length?"unknown":void 0}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class QN{constructor(e,n,r){this.logger=e,this.performanceClient=n,this.correlationId=r,this.platformAuthType=ys.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,r){var i;if(e.trace("PlatformAuthDOMHandler: createProvider called"),(i=window.navigator)!=null&&i.platformAuthentication){const s=await window.navigator.platformAuthentication.getSupportedContracts(ys.MICROSOFT_ENTRA_BROKERID);if(s!=null&&s.includes(ys.PLATFORM_DOM_APIS))return e.trace("Platform auth api available in DOM"),new QN(e,n,r)}}getExtensionId(){return ys.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return ys.DOM_API_NAME}async sendMessage(e){this.logger.trace(this.platformAuthType+" - Sending request to browser DOM API");try{const n=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(r)}catch(n){throw this.logger.error(this.platformAuthType+" - executeGetToken DOM API error"),n}}initializePlatformDOMRequest(e){this.logger.trace(this.platformAuthType+" - initializeNativeDOMRequest called");const{accountId:n,clientId:r,authority:i,scope:s,redirectUri:o,correlationId:c,state:l,storeInCache:u,embeddedClientId:d,extraParameters:f,...h}=e,p=this.getDOMExtraParams(h);return{accountId:n,brokerId:this.getExtensionId(),authority:i,clientId:r,correlationId:c||this.correlationId,extraParameters:{...f,...p},isSecurityTokenService:!1,redirectUri:o,scope:s,state:l,storeInCache:u,embeddedClientId:d}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace(this.platformAuthType+" - platform broker returned successful and valid response"),this.convertToPlatformBrokerResponse(e);if(e.hasOwnProperty("error")){const n=e;if(n.isSuccess===!1&&n.error&&n.error.code)throw this.logger.trace(this.platformAuthType+" - platform broker returned error response"),px(n.error.code,n.error.description,{error:parseInt(n.error.errorCode),protocol_error:n.error.protocolError,status:n.error.status,properties:n.error.properties})}}throw eA(Jy,"Response missing expected properties.")}convertToPlatformBrokerResponse(e){return this.logger.trace(this.platformAuthType+" - convertToNativeResponse called"),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){return{...Object.entries(e).reduce((i,[s,o])=>(i[s]=String(o),i),{})}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function wie(t,e,n,r){t.trace("getPlatformAuthProvider called",n);const i=Sie();t.trace("Has client allowed platform auth via DOM API: "+i);let s;try{i&&(s=await QN.createProvider(t,e,n)),s||(t.trace("Platform auth via DOM API not available, checking for extension"),s=await gx.createProvider(t,r||FB,e))}catch(o){t.trace("Platform auth not available",o)}return s}function Sie(){let t;try{return t=window[Nr.SessionStorage],(t==null?void 0:t.getItem(Bre))==="true"}catch{return!1}}function im(t,e,n,r){if(e.trace("isPlatformAuthAllowed called"),!t.system.allowPlatformBroker)return e.trace("isPlatformAuthAllowed: allowPlatformBroker is not enabled, returning false"),!1;if(!n)return e.trace("isPlatformAuthAllowed: Platform auth provider is not initialized, returning false"),!1;if(r)switch(r){case yn.BEARER:case yn.POP:return e.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true"),!0;default:return e.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false"),!1}return!0}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Cie extends Kf{constructor(e,n,r,i,s,o,c,l,u,d){super(e,n,r,i,s,o,c,u,d),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=l,this.eventHandler=s}acquireToken(e,n){let r;try{if(r={popupName:this.generatePopupName(e.scopes||xg,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:this.config.system.asyncPopups},this.correlationId),this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r,n);{const s={...e,httpMethod:HB(e,this.config.auth.protocolMode)};return this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(s,r,n)}}catch(i){return Promise.reject(i)}}logout(e){try{this.logger.verbose("logoutPopup called");const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},i=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,r,i,s)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,i,s))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,r){this.logger.verbose("acquireTokenPopupAsync called");const i=await fe(this.initializeAuthorizationRequest.bind(this),K.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,xt.Popup);n.popup&&LB(i.authority);const s=im(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);return i.platformBroker=s,this.config.auth.protocolMode===Li.EAR?this.executeEarFlow(i,n):this.executeCodeFlow(i,n,r)}async executeCodeFlow(e,n,r){var l;const i=e.correlationId,s=this.initializeServerTelemetryManager(Sn.acquireTokenPopup),o=r||await fe(F0,K.GeneratePkceCodes,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),c={...e,codeChallenge:o.challenge};try{const u=await fe(this.createAuthCodeClient.bind(this),K.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,i)({serverTelemetryManager:s,requestAuthority:c.authority,requestAzureCloudOptions:c.azureCloudOptions,requestExtraQueryParameters:c.extraQueryParameters,account:c.account});if(c.httpMethod===Ml.POST)return await this.executeCodeFlowWithPost(c,n,u,o.verifier);{const d=await fe(KN,K.GetAuthCodeUrl,this.logger,this.performanceClient,i)(this.config,u.authority,c,this.logger,this.performanceClient),f=this.initiateAuthRequest(d,n);this.eventHandler.emitEvent(qe.POPUP_OPENED,xt.Popup,{popupWindow:f},null);const h=await this.monitorPopupForHash(f,n.popupWindowParent),p=ts(pp,K.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);return await fe(mx,K.HandleResponseCode,this.logger,this.performanceClient,i)(e,p,o.verifier,Sn.acquireTokenPopup,this.config,u,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(u){throw(l=n.popup)==null||l.close(),u instanceof Cn&&(u.setCorrelationId(this.correlationId),s.cacheFailedRequest(u)),u}}async executeEarFlow(e,n){const r=e.correlationId,i=await fe(this.getDiscoveredAuthority.bind(this),K.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,r)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),s=await fe(LN,K.GenerateEarKey,this.logger,this.performanceClient,r)(),o={...e,earJwk:s},c=n.popup||this.openPopup("about:blank",n);(await WN(c.document,this.config,i,o,this.logger,this.performanceClient)).submit();const u=await fe(this.monitorPopupForHash.bind(this),K.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(c,n.popupWindowParent),d=ts(pp,K.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(u,this.config.auth.OIDCOptions.serverResponseType,this.logger);return fe(YN,K.HandleResponseEar,this.logger,this.performanceClient,r)(o,d,Sn.acquireTokenPopup,this.config,i,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,r,i){const s=e.correlationId,o=await fe(this.getDiscoveredAuthority.bind(this),K.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,s)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),c=n.popup||this.openPopup("about:blank",n);(await qN(c.document,this.config,o,e,this.logger,this.performanceClient)).submit();const u=await fe(this.monitorPopupForHash.bind(this),K.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,s)(c,n.popupWindowParent),d=ts(pp,K.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(u,this.config.auth.OIDCOptions.serverResponseType,this.logger);return fe(mx,K.HandleResponseCode,this.logger,this.performanceClient,s)(e,d,i,Sn.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,r,i){var o,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(qe.LOGOUT_START,xt.Popup,e);const s=this.initializeServerTelemetryManager(Sn.logoutPopup);try{await this.clearCacheOnLogout(this.correlationId,e.account);const u=await fe(this.createAuthCodeClient.bind(this),K.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:r,account:e.account||void 0});try{u.authority.endSessionEndpoint}catch{if((o=e.account)!=null&&o.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===Li.OIDC){if(this.eventHandler.emitEvent(qe.LOGOUT_SUCCESS,xt.Popup,e),i){const h={apiId:Sn.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=en.getAbsoluteUrl(i,ba());await this.navigationClient.navigateInternal(p,h)}(c=n.popup)==null||c.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(qe.LOGOUT_SUCCESS,xt.Popup,e);const f=this.openPopup(d,n);if(this.eventHandler.emitEvent(qe.POPUP_OPENED,xt.Popup,{popupWindow:f},null),await this.monitorPopupForHash(f,n.popupWindowParent).catch(()=>{}),i){const h={apiId:Sn.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=en.getAbsoluteUrl(i,ba());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${p}`),await this.navigationClient.navigateInternal(p,h)}else this.logger.verbose("No main window navigation requested")}catch(u){throw(l=n.popup)==null||l.close(),u instanceof Cn&&(u.setCorrelationId(this.correlationId),s.cacheFailedRequest(u)),this.eventHandler.emitEvent(qe.LOGOUT_FAILURE,xt.Popup,null,u),this.eventHandler.emitEvent(qe.LOGOUT_END,xt.Popup),u}this.eventHandler.emitEvent(qe.LOGOUT_END,xt.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,n);throw this.logger.error("Navigate url is empty"),ze(M0)}monitorPopupForHash(e,n){return new Promise((r,i)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(s),i(ze(tm));return}let o="";try{o=e.location.href}catch{}if(!o||o==="about:blank")return;clearInterval(s);let c="";const l=this.config.auth.OIDCOptions.serverResponseType;e&&(l===A0.QUERY?c=e.location.search:c=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(c)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,n)})}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,n)),!r)throw ze(sB);return r.focus&&r.focus(),this.currentWindow=r,n.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),ze(iB)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:i}){var p,g,m,v;const s=i.screenLeft?i.screenLeft:i.screenX,o=i.screenTop?i.screenTop:i.screenY,c=i.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=i.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let u=(p=r.popupSize)==null?void 0:p.width,d=(g=r.popupSize)==null?void 0:g.height,f=(m=r.popupPosition)==null?void 0:m.top,h=(v=r.popupPosition)==null?void 0:v.left;return(!u||u<0||u>c)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),u=Ti.POPUP_WIDTH),(!d||d<0||d>l)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),d=Ti.POPUP_HEIGHT),(!f||f<0||f>l)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),f=Math.max(0,l/2-Ti.POPUP_HEIGHT/2+o)),(!h||h<0||h>c)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),h=Math.max(0,c/2-Ti.POPUP_WIDTH/2+s)),i.open(e,n,`width=${u}, height=${d}, top=${f}, left=${h}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,n){e.close(),n.removeEventListener("beforeunload",this.unloadWindow)}generatePopupName(e,n){return`${Ti.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${Ti.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function _ie(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class Aie extends Kf{constructor(e,n,r,i,s,o,c,l,u,d){super(e,n,r,i,s,o,c,u,d),this.nativeStorage=l}async acquireToken(e){const n=await fe(this.initializeAuthorizationRequest.bind(this),K.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,xt.Redirect);n.platformBroker=im(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);const r=s=>{s.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.resetRequestCache(),this.eventHandler.emitEvent(qe.RESTORE_FROM_BFCACHE,xt.Redirect))},i=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii(`Redirect start page: ${i}`),this.browserStorage.setTemporaryCache(hr.ORIGIN_URI,i,!0),window.addEventListener("pageshow",r);try{this.config.auth.protocolMode===Li.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n,e.onRedirectNavigate)}catch(s){throw s instanceof Cn&&s.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),s}}async executeCodeFlow(e,n){const r=e.correlationId,i=this.initializeServerTelemetryManager(Sn.acquireTokenRedirect),s=await fe(F0,K.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),o={...e,codeChallenge:s.challenge};this.browserStorage.cacheAuthorizeRequest(o,s.verifier);try{if(o.httpMethod===Ml.POST)return await this.executeCodeFlowWithPost(o);{const c=await fe(this.createAuthCodeClient.bind(this),K.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),l=await fe(KN,K.GetAuthCodeUrl,this.logger,this.performanceClient,e.correlationId)(this.config,c.authority,o,this.logger,this.performanceClient);return await this.initiateAuthRequest(l,n)}}catch(c){throw c instanceof Cn&&(c.setCorrelationId(this.correlationId),i.cacheFailedRequest(c)),c}}async executeEarFlow(e){const n=e.correlationId,r=await fe(this.getDiscoveredAuthority.bind(this),K.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),i=await fe(LN,K.GenerateEarKey,this.logger,this.performanceClient,n)(),s={...e,earJwk:i};return this.browserStorage.cacheAuthorizeRequest(s),(await WN(document,this.config,r,s,this.logger,this.performanceClient)).submit(),new Promise((c,l)=>{setTimeout(()=>{l(ze(dx,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,r=await fe(this.getDiscoveredAuthority.bind(this),K.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return this.browserStorage.cacheAuthorizeRequest(e),(await qN(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise((s,o)=>{setTimeout(()=>{o(ze(dx,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e="",n,r,i){const s=this.initializeServerTelemetryManager(Sn.handleRedirectPromise);try{const[o,c]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.resetRequestCache(),_ie()!=="back_forward"?i.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const l=this.browserStorage.getTemporaryCache(hr.ORIGIN_URI,!0)||pe.EMPTY_STRING,u=en.removeHashFromUrl(l),d=en.removeHashFromUrl(window.location.href);if(u===d&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),l.indexOf("#")>-1&&Ere(l),await this.handleResponse(o,n,r,s);if(this.config.auth.navigateToLoginRequestUrl){if(!UN()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(hr.URL_HASH,c,!0);const f={apiId:Sn.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let h=!0;if(!l||l==="null"){const p=Tre();this.browserStorage.setTemporaryCache(hr.ORIGIN_URI,p,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),h=await this.navigationClient.navigateInternal(p,f)}else this.logger.verbose(`Navigating to loginRequestUrl: ${l}`),h=await this.navigationClient.navigateInternal(l,f);if(!h)return await this.handleResponse(o,n,r,s)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,n,r,s);return null}catch(o){throw o instanceof Cn&&(o.setCorrelationId(this.correlationId),s.cacheFailedRequest(o)),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let n=e;n||(this.config.auth.OIDCOptions.serverResponseType===A0.QUERY?n=window.location.search:n=window.location.hash);let r=ex(n);if(r){try{aie(r,this.browserCrypto,xt.Redirect)}catch(s){return s instanceof Cn&&this.logger.error(`Interaction type validation failed due to ${s.errorCode}: ${s.errorMessage}`),[null,""]}return MB(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,n]}const i=this.browserStorage.getTemporaryCache(hr.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(hr.URL_HASH)),i&&(r=ex(i),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,i]):[null,""]}async handleResponse(e,n,r,i){if(!e.state)throw ze(PN);if(e.ear_jwe){const c=await fe(this.getDiscoveredAuthority.bind(this),K.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n.correlationId)({requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account});return fe(YN,K.HandleResponseEar,this.logger,this.performanceClient,n.correlationId)(n,e,Sn.acquireTokenRedirect,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const o=await fe(this.createAuthCodeClient.bind(this),K.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:n.authority});return fe(mx,K.HandleResponseCode,this.logger,this.performanceClient,n.correlationId)(n,e,r,Sn.acquireTokenRedirect,this.config,o,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e,n){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:Sn.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},i=n||this.config.auth.onRedirectNavigate;if(typeof i=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),i(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await this.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await this.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),ze(M0)}async logout(e){var i;this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(Sn.logout);try{this.eventHandler.emitEvent(qe.LOGOUT_START,xt.Redirect,e),await this.clearCacheOnLogout(this.correlationId,n.account);const s={apiId:Sn.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=await fe(this.createAuthCodeClient.bind(this),K.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(o.authority.protocolMode===Li.OIDC)try{o.authority.endSessionEndpoint}catch{if((i=n.account)!=null&&i.homeAccountId){this.eventHandler.emitEvent(qe.LOGOUT_SUCCESS,xt.Redirect,n);return}}const c=o.getLogoutUri(n);if(this.eventHandler.emitEvent(qe.LOGOUT_SUCCESS,xt.Redirect,n),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,uc.SIGNOUT),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,uc.SIGNOUT),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof Cn&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(qe.LOGOUT_FAILURE,xt.Redirect,null,s),this.eventHandler.emitEvent(qe.LOGOUT_END,xt.Redirect),s}this.eventHandler.emitEvent(qe.LOGOUT_END,xt.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return en.getAbsoluteUrl(n,ba())}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function jie(t,e,n,r,i){if(e.addQueueMeasurement(K.SilentHandlerInitiateAuthRequest,r),!t)throw n.info("Navigate url is empty"),ze(M0);return i?fe(Tie,K.SilentHandlerLoadFrame,n,e,r)(t,i,e,r):ts(Pie,K.SilentHandlerLoadFrameSync,n,e,r)(t)}async function Eie(t,e,n,r,i){const s=U0();if(!s.contentDocument)throw"No document associated with iframe!";return(await qN(s.contentDocument,t,e,n,r,i)).submit(),s}async function Nie(t,e,n,r,i){const s=U0();if(!s.contentDocument)throw"No document associated with iframe!";return(await WN(s.contentDocument,t,e,n,r,i)).submit(),s}async function QI(t,e,n,r,i,s,o){return r.addQueueMeasurement(K.SilentHandlerMonitorIframeForHash,s),new Promise((c,l)=>{e{window.clearInterval(d),l(ze(oB))},e),d=window.setInterval(()=>{let f="";const h=t.contentWindow;try{f=h?h.location.href:""}catch{}if(!f||f==="about:blank")return;let p="";h&&(o===A0.QUERY?p=h.location.search:p=h.location.hash),window.clearTimeout(u),window.clearInterval(d),c(p)},n)}).finally(()=>{ts(kie,K.RemoveHiddenIframe,i,r,s)(t)})}function Tie(t,e,n,r){return n.addQueueMeasurement(K.SilentHandlerLoadFrame,r),new Promise((i,s)=>{const o=U0();window.setTimeout(()=>{if(!o){s("Unable to load iframe");return}o.src=t,i(o)},e)})}function Pie(t){const e=U0();return e.src=t,e}function U0(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(t),t}function kie(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Oie extends Kf{constructor(e,n,r,i,s,o,c,l,u,d,f){super(e,n,r,i,s,o,l,d,f),this.apiId=c,this.nativeStorage=u}async acquireToken(e){this.performanceClient.addQueueMeasurement(K.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const n={...e};n.prompt?n.prompt!==gi.NONE&&n.prompt!==gi.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${n.prompt} with ${gi.NONE}`),n.prompt=gi.NONE):n.prompt=gi.NONE;const r=await fe(this.initializeAuthorizationRequest.bind(this),K.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,xt.Silent);return r.platformBroker=im(this.config,this.logger,this.platformAuthProvider,r.authenticationScheme),LB(r.authority),this.config.auth.protocolMode===Li.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let n;const r=this.initializeServerTelemetryManager(this.apiId);try{return n=await fe(this.createAuthCodeClient.bind(this),K.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await fe(this.silentTokenHelper.bind(this),K.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(i){if(i instanceof Cn&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),!n||!(i instanceof Cn)||i.errorCode!==Ti.INVALID_GRANT_ERROR)throw i;return this.performanceClient.addFields({retryError:i.errorCode},this.correlationId),await fe(this.silentTokenHelper.bind(this),K.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const n=e.correlationId,r=await fe(this.getDiscoveredAuthority.bind(this),K.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),i=await fe(LN,K.GenerateEarKey,this.logger,this.performanceClient,n)(),s={...e,earJwk:i},o=await fe(Nie,K.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,n)(this.config,r,s,this.logger,this.performanceClient),c=this.config.auth.OIDCOptions.serverResponseType,l=await fe(QI,K.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,n)(o,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,n,c),u=ts(pp,K.DeserializeResponse,this.logger,this.performanceClient,n)(l,c,this.logger);return fe(YN,K.HandleResponseEar,this.logger,this.performanceClient,n)(s,u,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}logout(){return Promise.reject(ze(D0))}async silentTokenHelper(e,n){const r=n.correlationId;this.performanceClient.addQueueMeasurement(K.SilentIframeClientTokenHelper,r);const i=await fe(F0,K.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...n,codeChallenge:i.challenge};let o;if(n.httpMethod===Ml.POST)o=await fe(Eie,K.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);else{const d=await fe(KN,K.GetAuthCodeUrl,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);o=await fe(jie,K.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(d,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait)}const c=this.config.auth.OIDCOptions.serverResponseType,l=await fe(QI,K.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(o,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),u=ts(pp,K.DeserializeResponse,this.logger,this.performanceClient,r)(l,c,this.logger);return fe(mx,K.HandleResponseCode,this.logger,this.performanceClient,r)(n,u,i.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Iie extends Kf{async acquireToken(e){this.performanceClient.addQueueMeasurement(K.SilentRefreshClientAcquireToken,e.correlationId);const n=await fe(VN,K.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...n};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const i=this.initializeServerTelemetryManager(Sn.acquireTokenSilent_silentFlow),s=await this.createRefreshTokenClient({serverTelemetryManager:i,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return fe(s.acquireTokenByRefreshToken.bind(s),K.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(o=>{throw o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o),o})}logout(){return Promise.reject(ze(D0))}async createRefreshTokenClient(e){const n=await fe(this.getClientConfiguration.bind(this),K.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Wne(n,this.performanceClient)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Rie{constructor(e,n,r,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=n,this.logger=r,this.cryptoObj=i}async loadExternalTokens(e,n,r){if(!this.isBrowserEnvironment)throw ze($0);const i=e.correlationId||po(),s=n.id_token?zf(n.id_token,to):void 0,o={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new ti(ti.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,o,this.logger,e.correlationId||po()):void 0,l=await this.loadAccount(e,r.clientInfo||n.client_info||"",i,s,c),u=await this.loadIdToken(n,l.homeAccountId,l.environment,l.realm,i),d=await this.loadAccessToken(e,n,l.homeAccountId,l.environment,l.realm,r,i),f=await this.loadRefreshToken(n,l.homeAccountId,l.environment,i);return this.generateAuthenticationResult(e,{account:l,idToken:u,accessToken:d,refreshToken:f},s,c)}async loadAccount(e,n,r,i,s){if(this.logger.verbose("TokenCache - loading account"),e.account){const u=fo.createFromAccountInfo(e.account);return await this.storage.setAccount(u,r),u}else if(!s||!n&&!i)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),ze(mB);const o=fo.generateHomeAccountId(n,s.authorityType,this.logger,this.cryptoObj,i),c=i==null?void 0:i.tid,l=_N(this.storage,s,o,to,r,i,n,s.hostnameAndPort,c,void 0,void 0,this.logger);return await this.storage.setAccount(l,r),l}async loadIdToken(e,n,r,i,s){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const o=P0(n,r,e.id_token,this.config.auth.clientId,i);return await this.storage.setIdTokenCredential(o,s),o}async loadAccessToken(e,n,r,i,s,o,c){if(n.access_token)if(n.expires_in){if(!n.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const l=n.scope?Er.fromString(n.scope):new Er(e.scopes),u=o.expiresOn||n.expires_in+Fi(),d=o.extendedExpiresOn||(n.ext_expires_in||n.expires_in)+Fi(),f=k0(r,i,n.access_token,this.config.auth.clientId,s,l.printScopes(),u,d,to);return await this.storage.setAccessTokenCredential(f,c),f}async loadRefreshToken(e,n,r,i){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const s=UU(n,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return await this.storage.setRefreshTokenCredential(s,i),s}generateAuthenticationResult(e,n,r,i){var d,f,h;let s="",o=[],c=null,l;n!=null&&n.accessToken&&(s=n.accessToken.secret,o=Er.fromString(n.accessToken.target).asArray(),c=Ad(n.accessToken.expiresOn),l=Ad(n.accessToken.extendedExpiresOn));const u=n.account;return{authority:i?i.canonicalAuthority:"",uniqueId:n.account.localAccountId,tenantId:n.account.realm,scopes:o,account:u.getAccountInfo(),idToken:((d=n.idToken)==null?void 0:d.secret)||"",idTokenClaims:r||{},accessToken:s,fromCache:!0,expiresOn:c,correlationId:e.correlationId||"",requestId:"",extExpiresOn:l,familyId:((f=n.refreshToken)==null?void 0:f.familyId)||"",tokenType:((h=n==null?void 0:n.accessToken)==null?void 0:h.tokenType)||"",state:e.state||"",cloudGraphHostName:u.cloudGraphHostName||"",msGraphHost:u.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Mie extends WU{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Die extends Kf{constructor(e,n,r,i,s,o,c,l,u,d){super(e,n,r,i,s,o,l,u,d),this.apiId=c}async acquireToken(e){if(!e.code)throw ze(gB);const n=await fe(this.initializeAuthorizationRequest.bind(this),K.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,xt.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const i={...n,code:e.code},s=await fe(this.getClientConfiguration.bind(this),K.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),o=new Mie(s);this.logger.verbose("Auth code client created");const c=new zB(o,this.browserStorage,i,this.logger,this.performanceClient);return await fe(c.handleCodeResponseFromServer.bind(c),K.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,!1)}catch(i){throw i instanceof Cn&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),i}}logout(){return Promise.reject(ze(D0))}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function $ie(t,e,n){var o;const r=((o=window.msal)==null?void 0:o.clientIds)||[],i=r.length,s=r.filter(c=>c===t).length;s>1&&n.warning("There is already an instance of MSAL.js in the window with the same client id."),e.add({msalInstanceCount:i,sameClientIdInstanceCount:s})}/*! @azure/msal-browser v4.19.0 2025-08-05 */function Co(t){const e=t==null?void 0:t.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function vv(t,e){try{BN(t)}catch(n){throw e.end({success:!1},n),n}}class B0{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new La(this.logger,this.performanceClient):Zy,this.eventHandler=new iie(this.logger),this.browserStorage=this.isBrowserEnvironment?new mA(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,Lne(this.config.auth)):Yre(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:Nr.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Nr.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new mA(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.tokenCache=new Rie(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,n){const r=new B0(e);return await r.initialize(n),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e,n){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(qe.INITIALIZE_END);return}const r=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),i=this.config.system.allowPlatformBroker,s=this.performanceClient.startMeasurement(K.InitializeClientApplication,r);if(this.eventHandler.emitEvent(qe.INITIALIZE_START),!n)try{this.logMultipleInstances(s)}catch{}if(await fe(this.browserStorage.initialize.bind(this.browserStorage),K.InitializeCache,this.logger,this.performanceClient,r)(r),i)try{this.platformAuthProvider=await wie(this.logger,this.performanceClient,r,this.config.system.nativeBrokerHandshakeTimeout)}catch(o){this.logger.verbose(o)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),ts(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),K.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,r)(r)),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(r),this.initialized=!0,this.eventHandler.emitEvent(qe.INITIALIZE_END),s.end({allowPlatformBroker:i,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),$B(this.initialized),this.isBrowserEnvironment){const n=e||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){var l;if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;if(((l=this.browserStorage.getInteractionInProgress())==null?void 0:l.type)===uc.SIGNOUT)return this.logger.verbose("handleRedirectPromise removing interaction_in_progress flag and returning null after sign-out"),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const r=this.getAllAccounts(),i=this.browserStorage.getCachedNativeRequest(),s=i&&this.platformAuthProvider&&!e;let o;this.eventHandler.emitEvent(qe.HANDLE_REDIRECT_START,xt.Redirect);let c;try{if(s&&this.platformAuthProvider){o=this.performanceClient.startMeasurement(K.AcquireTokenRedirect,(i==null?void 0:i.correlationId)||""),this.logger.trace("handleRedirectPromise - acquiring token from native platform");const u=new iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,i.accountId,this.nativeInternalStorage,i.correlationId);c=fe(u.handleRedirectPromise.bind(u),K.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,o.event.correlationId)(this.performanceClient,o.event.correlationId)}else{const[u,d]=this.browserStorage.getCachedRequest(),f=u.correlationId;o=this.performanceClient.startMeasurement(K.AcquireTokenRedirect,f),this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(f);c=fe(h.handleRedirectPromise.bind(h),K.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,o.event.correlationId)(e,u,d,o)}}catch(u){throw this.browserStorage.resetRequestCache(),u}return c.then(u=>(u?(this.browserStorage.resetRequestCache(),r.length{this.browserStorage.resetRequestCache();const d=u;throw r.length>0?this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_FAILURE,xt.Redirect,null,d):this.eventHandler.emitEvent(qe.LOGIN_FAILURE,xt.Redirect,null,d),this.eventHandler.emitEvent(qe.HANDLE_REDIRECT_END,xt.Redirect),o.end({success:!1},d),u})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",n);const r=this.performanceClient.startMeasurement(K.AcquireTokenPreRedirect,n);r.add({accountType:Co(e.account),scenarioId:e.scenarioId});const i=e.onRedirectNavigate;if(i)e.onRedirectNavigate=o=>{const c=typeof i=="function"?i(o):void 0;return c!==!1?r.end({success:!0}):r.discard(),c};else{const o=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=c=>{const l=typeof o=="function"?o(c):void 0;return l!==!1?r.end({success:!0}):r.discard(),l}}const s=this.getAllAccounts().length>0;try{UI(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,uc.SIGNIN),s?this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_START,xt.Redirect,e):this.eventHandler.emitEvent(qe.LOGIN_START,xt.Redirect,e);let o;return this.platformAuthProvider&&this.canUsePlatformBroker(e)?o=new iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,r).catch(l=>{if(l instanceof Io&&Qu(l))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(l instanceof ho)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(n).acquireToken(e);throw l}):o=this.createRedirectClient(n).acquireToken(e),await o}catch(o){throw this.browserStorage.resetRequestCache(),r.end({success:!1},o),s?this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_FAILURE,xt.Redirect,null,o):this.eventHandler.emitEvent(qe.LOGIN_FAILURE,xt.Redirect,null,o),o}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(K.AcquireTokenPopup,n);r.add({scenarioId:e.scenarioId,accountType:Co(e.account)});try{this.logger.verbose("acquireTokenPopup called",n),vv(this.initialized,r),this.browserStorage.setInteractionInProgress(!0,uc.SIGNIN)}catch(c){return Promise.reject(c)}const i=this.getAllAccounts();i.length>0?this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_START,xt.Popup,e):this.eventHandler.emitEvent(qe.LOGIN_START,xt.Popup,e);let s;const o=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?s=this.acquireTokenNative({...e,correlationId:n},Sn.acquireTokenPopup).then(c=>(r.end({success:!0,isNativeBroker:!0,accountType:Co(c.account)}),c)).catch(c=>{if(c instanceof Io&&Qu(c))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,o);if(c instanceof ho)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(n).acquireToken(e,o);throw c}):s=this.createPopupClient(n).acquireToken(e,o),s.then(c=>(i.length(i.length>0?this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_FAILURE,xt.Popup,null,c):this.eventHandler.emitEvent(qe.LOGIN_FAILURE,xt.Popup,null,c),r.end({success:!1},c),Promise.reject(c))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(n)})}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var s,o;const n=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(K.SsoSilent,n),(s=this.ssoSilentMeasurement)==null||s.add({scenarioId:e.scenarioId,accountType:Co(e.account)}),vv(this.initialized,this.ssoSilentMeasurement),(o=this.ssoSilentMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(qe.SSO_SILENT_START,xt.Silent,r);let i;return this.canUsePlatformBroker(r)?i=this.acquireTokenNative(r,Sn.ssoSilent).catch(c=>{if(c instanceof Io&&Qu(c))return this.platformAuthProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw c}):i=this.createSilentIframeClient(r.correlationId).acquireToken(r),i.then(c=>{var l;return this.eventHandler.emitEvent(qe.SSO_SILENT_SUCCESS,xt.Silent,c),(l=this.ssoSilentMeasurement)==null||l.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Co(c.account)}),c}).catch(c=>{var l;throw this.eventHandler.emitEvent(qe.SSO_SILENT_FAILURE,xt.Silent,null,c),(l=this.ssoSilentMeasurement)==null||l.end({success:!1},c),c}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",n);const r=this.performanceClient.startMeasurement(K.AcquireTokenByCode,n);vv(this.initialized,r),this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_BY_CODE_START,xt.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw ze(yB);if(e.code){const i=e.code;let s=this.hybridAuthCodeResponses.get(i);return s?(this.logger.verbose("Existing acquireTokenByCode request found",n),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",n),s=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(o=>(this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_BY_CODE_SUCCESS,xt.Silent,o),this.hybridAuthCodeResponses.delete(i),r.end({success:!0,isNativeBroker:o.fromNativeBroker,accessTokenSize:o.accessToken.length,idTokenSize:o.idToken.length,accountType:Co(o.account)}),o)).catch(o=>{throw this.hybridAuthCodeResponses.delete(i),this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_BY_CODE_FAILURE,xt.Silent,null,o),r.end({success:!1},o),o}),this.hybridAuthCodeResponses.set(i,s)),await s}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){const i=await this.acquireTokenNative({...e,correlationId:n},Sn.acquireTokenByCode,e.nativeAccountId).catch(s=>{throw s instanceof Io&&Qu(s)&&(this.platformAuthProvider=void 0),s});return r.end({accountType:Co(i.account),success:!0}),i}else throw ze(xB);else throw ze(vB)}catch(i){throw this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_BY_CODE_FAILURE,xt.Silent,null,i),r.end({success:!1},i),i}}async acquireTokenByCodeAsync(e){var i;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(K.AcquireTokenByCodeAsync,e.correlationId),(i=this.acquireTokenByCodeAsyncMeasurement)==null||i.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(s=>{var o;return(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.end({success:!0,fromCache:s.fromCache,isNativeBroker:s.fromNativeBroker}),s}).catch(s=>{var o;throw(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.end({success:!1},s),s}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,n){switch(this.performanceClient.addQueueMeasurement(K.AcquireTokenFromCache,e.correlationId),n){case ui.Default:case ui.AccessToken:case ui.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return fe(r.acquireToken.bind(r),K.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Se(Mc)}}async acquireTokenByRefreshToken(e,n){switch(this.performanceClient.addQueueMeasurement(K.AcquireTokenByRefreshToken,e.correlationId),n){case ui.Default:case ui.AccessTokenAndRefreshToken:case ui.RefreshToken:case ui.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return fe(r.acquireToken.bind(r),K.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Se(Mc)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(K.AcquireTokenBySilentIframe,e.correlationId);const n=this.createSilentIframeClient(e.correlationId);return fe(n.acquireToken.bind(n),K.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const n=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",n),this.logoutRedirect({correlationId:n,...e})}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return UI(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,uc.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return BN(this.initialized),this.browserStorage.setInteractionInProgress(!0,uc.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){const n=this.getRequestCorrelationId();return Qre(this.logger,this.browserStorage,this.isBrowserEnvironment,n,e)}getAccount(e){const n=this.getRequestCorrelationId();return Xre(e,this.logger,this.browserStorage,n)}getAccountByUsername(e){const n=this.getRequestCorrelationId();return Jre(e,this.logger,this.browserStorage,n)}getAccountByHomeId(e){const n=this.getRequestCorrelationId();return Zre(e,this.logger,this.browserStorage,n)}getAccountByLocalId(e){const n=this.getRequestCorrelationId();return eie(e,this.logger,this.browserStorage,n)}setActiveAccount(e){const n=this.getRequestCorrelationId();tie(e,this.browserStorage,n)}getActiveAccount(){const e=this.getRequestCorrelationId();return nie(this.browserStorage,e)}async hydrateCache(e,n){this.logger.verbose("hydrateCache called");const r=fo.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r,i){if(this.logger.trace("acquireTokenNative called"),!this.platformAuthProvider)throw ze(IN);return new iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e,i)}canUsePlatformBroker(e,n){if(this.logger.trace("canUsePlatformBroker called"),!this.platformAuthProvider)return this.logger.trace("canUsePlatformBroker: platform broker unavilable, returning false"),!1;if(!im(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isBrokerAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case gi.NONE:case gi.CONSENT:case gi.LOGIN:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");break;default:return this.logger.trace(`canUsePlatformBroker: prompt = ${e.prompt} is not compatible with platform broker flow, returning false`),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new Cie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createRedirectClient(e){return new Aie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentIframeClient(e){return new Oie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentCacheClient(e){return new GB(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentRefreshClient(e){return new Iie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentAuthCodeClient(e){return new Die(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.acquireTokenByCode,this.performanceClient,this.platformAuthProvider,e)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return DB(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Nr.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.subscribeCrossTab()}disableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Nr.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.unsubscribeCrossTab()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?po():pe.EMPTY_STRING}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",n),this.acquireTokenRedirect({correlationId:n,...e||MI})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup({correlationId:n,...e||MI})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(K.AcquireTokenSilent,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),vv(this.initialized,r),this.logger.verbose("acquireTokenSilent called",n);const i=e.account||this.getActiveAccount();if(!i)throw ze(uB);return r.add({accountType:Co(i)}),this.acquireTokenSilentDeduped(e,i,n).then(s=>(r.end({success:!0,fromCache:s.fromCache,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),{...s,state:e.state,correlationId:n})).catch(s=>{throw s instanceof Cn&&s.setCorrelationId(n),r.end({success:!1},s),s})}async acquireTokenSilentDeduped(e,n,r){const i=O0(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority,correlationId:r},n.homeAccountId),s=JSON.stringify(i),o=this.activeSilentTokenRequests.get(s);if(typeof o>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const c=fe(this.acquireTokenSilentAsync.bind(this),K.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},n);return this.activeSilentTokenRequests.set(s,c),c.finally(()=>{this.activeSilentTokenRequests.delete(s)})}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),o}async acquireTokenSilentAsync(e,n){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(K.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_START,xt.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const i=await fe(sie,K.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||ui.Default;return this.acquireTokenSilentNoIframe(i,s).catch(async c=>{if(Lie(c,s))if(this.activeIframeRequest)if(s!==ui.Skip){const[u,d]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${d}`,i.correlationId);const f=this.performanceClient.startMeasurement(K.AwaitConcurrentIframe,i.correlationId);f.add({awaitIframeCorrelationId:d});const h=await u;if(f.end({success:h}),h)return this.logger.verbose(`Parallel iframe request with correlationId: ${d} succeeded. Retrying cache and/or RT redemption`,i.correlationId),this.acquireTokenSilentNoIframe(i,s);throw this.logger.info(`Iframe request with correlationId: ${d} failed. Interaction is required.`),c}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",i.correlationId),fe(this.acquireTokenBySilentIframe.bind(this),K.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i);else{let u;return this.activeIframeRequest=[new Promise(d=>{u=d}),i.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",i.correlationId),fe(this.acquireTokenBySilentIframe.bind(this),K.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i).then(d=>(u(!0),d)).catch(d=>{throw u(!1),d}).finally(()=>{this.activeIframeRequest=void 0})}else throw c}).then(c=>(this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_SUCCESS,xt.Silent,c),e.correlationId&&this.performanceClient.addFields({fromCache:c.fromCache,isNativeBroker:c.fromNativeBroker},e.correlationId),c)).catch(c=>{throw this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_FAILURE,xt.Silent,null,c),c}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,n){return im(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,Sn.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async r=>{throw r instanceof Io&&Qu(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.platformAuthProvider=void 0,Se(Mc)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),n===ui.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache"),fe(this.acquireTokenFromCache.bind(this),K.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===ui.AccessToken)throw r;return this.eventHandler.emitEvent(qe.ACQUIRE_TOKEN_NETWORK_START,xt.Silent,e),fe(this.acquireTokenByRefreshToken.bind(this),K.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes"),this.pkceCode=await fe(F0,K.GeneratePkceCodes,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes");const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`${n?"Found":"Did not find"} pre-generated PKCE codes`),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e){const n=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("There is already an instance of MSAL.js in the window."),window.msal.clientIds.push(n),$ie(n,e,this.logger)}}function Lie(t,e){const n=!(t instanceof ho&&t.subError!==R0),r=t.errorCode===Ti.INVALID_GRANT_ERROR||t.errorCode===Mc,i=n&&r||t.errorCode===cx||t.errorCode===SN,s=hre.includes(e);return i&&s}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function Fie(t,e){const n=new yu(t);return await n.initialize(),B0.createController(n,e)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class XN{static async createPublicClientApplication(e){const n=await Fie(e);return new XN(e,n)}constructor(e,n){this.isBroker=!1,this.controller=n||new B0(new yu(e))}async initialize(e){return this.controller.initialize(e,this.isBroker)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Uie={initialize:()=>Promise.reject(dr(ur)),acquireTokenPopup:()=>Promise.reject(dr(ur)),acquireTokenRedirect:()=>Promise.reject(dr(ur)),acquireTokenSilent:()=>Promise.reject(dr(ur)),acquireTokenByCode:()=>Promise.reject(dr(ur)),getAllAccounts:()=>[],getAccount:()=>null,getAccountByHomeId:()=>null,getAccountByUsername:()=>null,getAccountByLocalId:()=>null,handleRedirectPromise:()=>Promise.reject(dr(ur)),loginPopup:()=>Promise.reject(dr(ur)),loginRedirect:()=>Promise.reject(dr(ur)),logout:()=>Promise.reject(dr(ur)),logoutRedirect:()=>Promise.reject(dr(ur)),logoutPopup:()=>Promise.reject(dr(ur)),ssoSilent:()=>Promise.reject(dr(ur)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,enableAccountStorageEvents:()=>{},disableAccountStorageEvents:()=>{},getTokenCache:()=>{throw dr(ur)},getLogger:()=>{throw dr(ur)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw dr(ur)},hydrateCache:()=>Promise.reject(dr(ur)),clearCache:()=>Promise.reject(dr(ur))};/*! @azure/msal-browser v4.19.0 2025-08-05 */class Bie{static getInteractionStatusFromEvent(e,n){switch(e.eventType){case qe.LOGIN_START:return wr.Login;case qe.SSO_SILENT_START:return wr.SsoSilent;case qe.ACQUIRE_TOKEN_START:if(e.interactionType===xt.Redirect||e.interactionType===xt.Popup)return wr.AcquireToken;break;case qe.HANDLE_REDIRECT_START:return wr.HandleRedirect;case qe.LOGOUT_START:return wr.Logout;case qe.SSO_SILENT_SUCCESS:case qe.SSO_SILENT_FAILURE:if(n&&n!==wr.SsoSilent)break;return wr.None;case qe.LOGOUT_END:if(n&&n!==wr.Logout)break;return wr.None;case qe.HANDLE_REDIRECT_END:if(n&&n!==wr.HandleRedirect)break;return wr.None;case qe.LOGIN_SUCCESS:case qe.LOGIN_FAILURE:case qe.ACQUIRE_TOKEN_SUCCESS:case qe.ACQUIRE_TOKEN_FAILURE:case qe.RESTORE_FROM_BFCACHE:if(e.interactionType===xt.Redirect||e.interactionType===xt.Popup){if(n&&n!==wr.Login&&n!==wr.AcquireToken)break;return wr.None}break}return null}}const Hie="modulepreload",zie=function(t){return"/semblance/"+t},XI={},Vie=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=zie(l),l in XI)return;XI[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Hie,u||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};/*! @azure/msal-react v3.0.17 2025-08-05 */const Gie={instance:Uie,inProgress:wr.None,accounts:[],logger:new $a({})},JN=y.createContext(Gie);JN.Consumer;/*! @azure/msal-react v3.0.17 2025-08-05 */function JI(t,e){if(t.length!==e.length)return!1;const n=[...e];return t.every(r=>{const i=n.shift();return!r||!i?!1:r.homeAccountId===i.homeAccountId&&r.localAccountId===i.localAccountId&&r.username===i.username})}/*! @azure/msal-react v3.0.17 2025-08-05 */const Kie="@azure/msal-react",ZI="3.0.17";/*! @azure/msal-react v3.0.17 2025-08-05 */const vx={UNBLOCK_INPROGRESS:"UNBLOCK_INPROGRESS",EVENT:"EVENT"},Wie=(t,e)=>{const{type:n,payload:r}=e;let i=t.inProgress;switch(n){case vx.UNBLOCK_INPROGRESS:t.inProgress===wr.Startup&&(i=wr.None,r.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case vx.EVENT:const o=r.message,c=Bie.getInteractionStatusFromEvent(o,t.inProgress);c&&(r.logger.info(`MsalProvider - ${o.eventType} results in setting inProgress from ${t.inProgress} to ${c}`),i=c);break;default:throw new Error(`Unknown action type: ${n}`)}if(i===wr.Startup)return t;const s=r.instance.getAllAccounts();return i!==t.inProgress&&!JI(s,t.accounts)?{...t,inProgress:i,accounts:s}:i!==t.inProgress?{...t,inProgress:i}:JI(s,t.accounts)?t:{...t,accounts:s}};function qie({instance:t,children:e}){y.useEffect(()=>{t.initializeWrapperLibrary(ure.React,ZI)},[t]);const n=y.useMemo(()=>t.getLogger().clone(Kie,ZI),[t]),[r,i]=y.useReducer(Wie,void 0,()=>({inProgress:wr.Startup,accounts:[]}));y.useEffect(()=>{const o=t.addEventCallback(c=>{i({payload:{instance:t,logger:n,message:c},type:vx.EVENT})});return n.verbose(`MsalProvider - Registered event callback with id: ${o}`),t.initialize().then(()=>{t.handleRedirectPromise().catch(()=>{}).finally(()=>{i({payload:{instance:t,logger:n},type:vx.UNBLOCK_INPROGRESS})})}).catch(()=>{}),()=>{o&&(n.verbose(`MsalProvider - Removing event callback ${o}`),t.removeEventCallback(o))}},[t,n]);const s={instance:t,inProgress:r.inProgress,accounts:r.accounts,logger:n};return P.createElement(JN.Provider,{value:s},e)}/*! @azure/msal-react v3.0.17 2025-08-05 */const Yie=()=>y.useContext(JN),Qie={auth:{clientId:"7e9b250a-d984-4fba-8e1c-a0622242a595",authority:"https://login.microsoftonline.com/e519c2e6-bc6d-4fdf-8d9c-923c2f002385",redirectUri:"https://ai-sandbox.oliver.solutions/semblance",postLogoutRedirectUri:"https://ai-sandbox.oliver.solutions/semblance"},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(t,e,n)=>{n||console.log(e)},logLevel:Rn.Verbose,piiLoggingEnabled:!1},allowNativeBroker:!1}},Xie={scopes:["openid","profile","email"],prompt:"select_account",extraQueryParameters:{code_challenge_method:"S256"}},qB=y.createContext(void 0);function Jie({children:t}){const[e,n]=y.useState(null),[r,i]=y.useState(null),[s,o]=y.useState(!0),[c,l]=y.useState(!1),u=lr(),{instance:d,accounts:f,inProgress:h}=Yie();y.useEffect(()=>{const w=S=>{const _=S.detail||{};if(_.isPersonaCreation){console.log("Ignoring auth error from persona creation",_);return}i(null),n(null),ne.error("Session expired",{description:"Please log in again"}),u("/login")};return window.addEventListener(Z_,w),()=>{window.removeEventListener(Z_,w)}},[u]),y.useEffect(()=>{const w=localStorage.getItem("auth_token"),S=localStorage.getItem("user");if(console.log("AuthContext initializing - stored data check:",{hasToken:!!w,hasUser:!!S}),w&&S)try{i(w),n(JSON.parse(S)),console.log("User session restored from localStorage")}catch(C){console.error("Failed to parse stored user data:",C),localStorage.removeItem("auth_token"),localStorage.removeItem("user")}else console.log("No stored authentication data found");o(!1)},[]),y.useEffect(()=>{if(r){console.log("Verifying token...");const w=`token_validated_${r.substring(0,10)}`;if(sessionStorage.getItem(w)==="true"&&e){console.log("Token already validated this session, skipping validation");return}ty.getProfile().then(C=>{C&&"data"in C&&(console.log("Profile verified successfully"),n(C.data),sessionStorage.setItem(w,"true"))}).catch(C=>{C.response&&C.response.status===401?(console.error("Token invalid (401):",C),localStorage.removeItem("auth_token"),localStorage.removeItem("user"),i(null),n(null)):(console.warn("Profile validation error (not clearing token):",C),sessionStorage.setItem(w,"true"))})}else console.log("No token available, not validating profile")},[r,e]);const p=async(w,S)=>{var C,_;o(!0),console.log("Attempting login for user:",w);try{const A=await ty.login(w,S);if(console.log("Login API response received"),!A.data.access_token)throw new Error("No access token received from server");return localStorage.setItem("auth_token",A.data.access_token),localStorage.setItem("user",JSON.stringify(A.data.user)),i(A.data.access_token),n(A.data.user),console.log("Authentication state updated"),ne.success("Login successful!"),A.data.access_token}catch(A){throw console.error("Login failed:",A),ne.error("Login failed",{description:((_=(C=A.response)==null?void 0:C.data)==null?void 0:_.message)||"Invalid username or password"}),A}finally{o(!1)}},g=async()=>{l(!0);try{console.log("Starting Microsoft authentication...");const w=await d.loginPopup(Xie);if(w&&w.account&&w.idToken){console.log("Microsoft authentication successful",w.account);const S=await ty.loginWithMicrosoft(w.idToken);S.data.access_token&&(localStorage.setItem("auth_token",S.data.access_token),localStorage.setItem("user",JSON.stringify(S.data.user)),localStorage.setItem("auth_type","microsoft"),i(S.data.access_token),n(S.data.user),console.log("Microsoft user authenticated and stored"),ne.success("Successfully signed in with Microsoft!"))}}catch(w){throw console.error("Microsoft login failed:",w),w.name==="BrowserAuthError"&&w.errorCode==="popup_window_error"?ne.error("Sign-in cancelled",{description:"The sign-in popup was closed before completing authentication."}):w.name==="InteractionRequiredAuthError"?ne.error("Authentication required",{description:"Please complete the authentication process."}):ne.error("Microsoft sign-in failed",{description:w.message||"An error occurred during authentication"}),w}finally{l(!1)}},m=async()=>{const w=localStorage.getItem("auth_type");if(localStorage.removeItem("auth_token"),localStorage.removeItem("user"),localStorage.removeItem("auth_type"),i(null),n(null),w==="microsoft"&&f.length>0)try{await d.logoutPopup({account:f[0],postLogoutRedirectUri:window.location.origin+"/semblance/"})}catch(S){console.error("Microsoft logout error:",S)}ne.info("You have been logged out")},v=!!localStorage.getItem("auth_token"),x={user:e,token:r,isLoading:s,login:p,loginWithMicrosoft:g,logout:m,isAuthenticated:!!r||v,isMsalLoading:c};return a.jsx(qB.Provider,{value:x,children:t})}function Zo(){const t=y.useContext(qB);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}function ja(){const[t,e]=y.useState(!1),n=Bi(),r=lr(),{isAuthenticated:i,logout:s}=Zo(),o=[{name:"Home",href:"/",icon:Ky},{name:"Synthetic Personas",href:"/synthetic-users",icon:Fr},{name:"Focus Groups",href:"/focus-groups",icon:Wo},{name:"Dashboard",href:"/dashboard",icon:G_}],c=()=>{e(!t)},l=d=>n.pathname===d,u=d=>{if(d==="/synthetic-users"){const f=new CustomEvent("syntheticUsersNavigation");window.dispatchEvent(f)}r(d)};return a.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-md border-b border-slate-200/80",children:[a.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex h-16 items-center justify-between",children:[a.jsx("div",{className:"flex items-center",children:a.jsx(bs,{to:"/",className:"flex items-center",children:a.jsx("span",{className:"font-sf text-2xl font-semibold text-gradient",children:"Semblance"})})}),a.jsx("nav",{className:"hidden md:block",children:a.jsxs("ul",{className:"flex items-center space-x-8",children:[o.map(d=>a.jsx("li",{children:d.href==="/"?a.jsxs(bs,{to:d.href,className:Pe("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",l(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[a.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]}):a.jsxs("button",{onClick:()=>u(d.href),className:Pe("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",l(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[a.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]})},d.name)),a.jsx("li",{children:i?a.jsxs("button",{onClick:()=>{s(),r("/login")},className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[a.jsx(eI,{className:"mr-1 h-4 w-4"}),"Logout"]}):a.jsxs(bs,{to:"/login",className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[a.jsx(ZO,{className:"mr-1 h-4 w-4"}),"Login"]})})]})}),a.jsx("div",{className:"flex md:hidden",children:a.jsxs("button",{type:"button",className:"inline-flex items-center justify-center rounded-md p-2 text-slate-700 hover:bg-slate-100 hover:text-slate-900 button-transition",onClick:c,children:[a.jsx("span",{className:"sr-only",children:"Open main menu"}),t?a.jsx(Mi,{className:"block h-6 w-6","aria-hidden":"true"}):a.jsx(iZ,{className:"block h-6 w-6","aria-hidden":"true"})]})})]})}),t&&a.jsx("div",{className:"md:hidden glass-panel animate-fade-in",children:a.jsxs("div",{className:"space-y-1 px-4 pb-3 pt-2",children:[o.map(d=>a.jsx("div",{children:d.href==="/"?a.jsxs(bs,{to:d.href,className:Pe("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition",l(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>e(!1),children:[a.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]}):a.jsxs("button",{className:Pe("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition w-full text-left",l(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>{e(!1),u(d.href)},children:[a.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]})},d.name)),i?a.jsxs("button",{onClick:()=>{s(),e(!1),r("/login")},className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900 w-full",children:[a.jsx(eI,{className:"mr-3 h-5 w-5"}),"Logout"]}):a.jsxs(bs,{to:"/login",className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900",onClick:()=>e(!1),children:[a.jsx(ZO,{className:"mr-3 h-5 w-5"}),"Login"]})]})})]})}const eR=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,tR=It,ZN=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return tR(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],f=s==null?void 0:s[u];if(d===null)return null;const h=eR(d)||eR(f);return i[u][h]}),c=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[m,v]=g;return Array.isArray(v)?v.includes({...s,...c}[m]):{...s,...c}[m]===v})?[...u,f,h]:u},[]);return tR(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},eT=ZN("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),X=y.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const o=r?Go:"button";return a.jsx(o,{className:Pe(eT({variant:e,size:n,className:t})),ref:s,...i})});X.displayName="Button";function Zie(){return a.jsxs("div",{className:"relative isolate overflow-hidden",children:[a.jsx("div",{className:"absolute inset-x-0 top-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[-20rem]","aria-hidden":"true",children:a.jsx("div",{className:"relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-primary to-blue-400 opacity-20 sm:left-[calc(50%-30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})}),a.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-24 sm:py-32 lg:flex lg:items-center lg:gap-x-10 lg:px-8 lg:py-40",children:[a.jsxs("div",{className:"mx-auto max-w-2xl lg:mx-0 lg:flex-auto",children:[a.jsx("div",{className:"flex",children:a.jsxs("div",{className:"relative flex items-center gap-x-4 rounded-full px-4 py-1 text-sm leading-6 text-gray-600 ring-1 ring-gray-900/10 hover:ring-gray-900/20",children:[a.jsx("span",{className:"font-semibold text-primary",children:"New"}),a.jsx("span",{className:"h-4 w-px bg-gray-900/10","aria-hidden":"true"}),a.jsx("span",{children:"Introducing AI-driven focus groups"})]})}),a.jsxs("h1",{className:"mt-10 max-w-lg text-4xl font-sf font-bold tracking-tight text-gray-900 sm:text-6xl",children:["Research with ",a.jsx("span",{className:"text-gradient",children:"synthetic personas"})]}),a.jsx("p",{className:"mt-6 text-lg leading-8 text-gray-600",children:"Conduct research using AI-powered synthetic personas and autonomous focus groups. Gain valuable insights without the limitations of traditional research methods."}),a.jsxs("div",{className:"mt-10 flex items-center gap-x-6",children:[a.jsx(bs,{to:"/synthetic-users",children:a.jsxs(X,{className:"px-6 py-6 text-base hover:shadow-lg hover:translate-y-[-2px] button-transition",children:["Create synthetic personas",a.jsx(fs,{className:"ml-2 h-4 w-4"})]})}),a.jsxs(bs,{to:"/focus-groups",className:"text-sm font-semibold leading-6 text-gray-900 hover:text-primary button-transition",children:["Set up focus groups ",a.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]}),a.jsx("div",{className:"mt-16 sm:mt-24 lg:mt-0 lg:flex-shrink-0 lg:flex-grow",children:a.jsxs("div",{className:"relative glass-card mx-auto w-[350px] h-[450px] rounded-2xl shadow-xl overflow-hidden animate-float",children:[a.jsxs("div",{className:"absolute top-4 left-4 right-4 h-12 bg-white/70 backdrop-blur-sm rounded-lg flex items-center px-4",children:[a.jsx("div",{className:"h-3 w-3 rounded-full bg-red-400 mr-2"}),a.jsx("div",{className:"h-3 w-3 rounded-full bg-yellow-400 mr-2"}),a.jsx("div",{className:"h-3 w-3 rounded-full bg-green-400 mr-2"}),a.jsx("div",{className:"text-xs text-gray-500 ml-2",children:"Shampoo Brand Perception"})]}),a.jsx("div",{className:"absolute top-20 left-4 right-4 bottom-4 bg-gray-50 rounded-lg overflow-hidden",children:[1,2,3,4].map(t=>a.jsx("div",{className:`flex ${t%2===0?"justify-end":"justify-start"} px-3 py-2`,children:a.jsxs("div",{className:`max-w-[70%] rounded-lg px-3 py-2 text-xs ${t%2===0?"bg-primary text-white":"bg-gray-200 text-gray-800"}`,children:[t===1&&"What qualities do you look for in a premium shampoo brand?",t===2&&"I value natural ingredients and a brand that feels luxurious but still eco-friendly.",t===3&&"How important is fragrance in your shampoo selection?",t===4&&"Very important - it affects my mood and how I feel about the product throughout the day."]})},t))})]})})]}),a.jsx("div",{className:"absolute inset-x-0 bottom-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:bottom-[-20rem]","aria-hidden":"true",children:a.jsx("div",{className:"relative left-[calc(50%+11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-blue-400 to-primary opacity-20 sm:left-[calc(50%+30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})})]})}function Uu({title:t,description:e,icon:n,className:r}){return a.jsxs("div",{className:Pe("relative group glass-card rounded-xl overflow-hidden p-6 hover:shadow-lg hover:translate-y-[-4px] button-transition",r),children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/5 to-blue-400/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-12 h-12 flex items-center justify-center mb-4",children:a.jsx(n,{className:"h-6 w-6 text-primary"})}),a.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:t}),a.jsx("p",{className:"text-gray-600 text-sm",children:e})]})]})}const ese=()=>(Zo(),lr(),a.jsxs("div",{className:"min-h-screen overflow-hidden bg-background",children:[a.jsx(ja,{}),a.jsx("main",{children:a.jsxs("div",{className:"pt-16",children:[a.jsx(Zie,{}),a.jsx("section",{className:"py-20 px-6 bg-white",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"Why Synthetic Personas?"}),a.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Our platform combines advanced AI with intuitive design to help researchers gain deeper insights faster than traditional methods."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[a.jsx(Uu,{title:"Scalable Research",description:"Create and test with thousands of synthetic personas, each with unique demographic profiles and behaviors.",icon:Fr}),a.jsx(Uu,{title:"AI-Driven Focus Groups",description:"Run autonomous focus groups moderated by AI that adapts to participant responses in real-time.",icon:Wo}),a.jsx(Uu,{title:"Instant Analysis",description:"Generate comprehensive reports and visualizations that highlight key insights and patterns.",icon:G_}),a.jsx(Uu,{title:"Diverse Perspectives",description:"Access synthetic personas from various backgrounds, ensuring representation across age, gender, and location.",icon:Fr}),a.jsx(Uu,{title:"Dynamic Discussions",description:"AI moderators guide conversations naturally, following up on interesting points without bias.",icon:dZ}),a.jsx(Uu,{title:"Comprehensive Reporting",description:"Export detailed reports with sentiment analysis, key themes, and actionable recommendations.",icon:G_})]})]})}),a.jsx("section",{className:"py-20 px-6 bg-gradient-to-b from-white to-slate-50",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"How It Works"}),a.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Just three simple steps to gather valuable insights from synthetic personas."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"text-center p-6",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-primary",children:"1"})}),a.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Create Synthetic Personas"}),a.jsx("p",{className:"text-gray-600",children:"Define your target audience with customizable demographic profiles and personality traits."})]}),a.jsxs("div",{className:"text-center p-6",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-primary",children:"2"})}),a.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Set Up Focus Groups"}),a.jsx("p",{className:"text-gray-600",children:"Configure your research objectives, topics, and parameters for the AI moderator."})]}),a.jsxs("div",{className:"text-center p-6",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-primary",children:"3"})}),a.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Analyze Results"}),a.jsx("p",{className:"text-gray-600",children:"Review comprehensive visual reports and actionable insights from your synthetic research."})]})]}),a.jsx("div",{className:"text-center mt-12",children:a.jsx(bs,{to:"synthetic-users",className:"inline-flex items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-primary hover:bg-primary/90 button-transition",children:"Get Started"})})]})}),a.jsxs("footer",{className:"bg-white py-12 px-6",children:[a.jsxs("div",{className:"max-w-7xl mx-auto flex flex-col md:flex-row justify-between items-center",children:[a.jsxs("div",{className:"mb-6 md:mb-0",children:[a.jsx("span",{className:"text-xl font-sf font-semibold text-gradient",children:"Semblance"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"AI-powered synthetic persona research"})]}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Platform"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx(bs,{to:"/",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Home"})}),a.jsx("li",{children:a.jsx(bs,{to:"/synthetic-users",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Synthetic Personas"})}),a.jsx("li",{children:a.jsx(bs,{to:"/focus-groups",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Focus Groups"})}),a.jsx("li",{children:a.jsx(bs,{to:"/dashboard",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Dashboard"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Company"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"About"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Blog"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Careers"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Contact"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Legal"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Privacy"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Terms"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Security"})})]})]})]})]}),a.jsx("div",{className:"max-w-7xl mx-auto mt-8 pt-8 border-t border-gray-200",children:a.jsxs("p",{className:"text-sm text-gray-500 text-center",children:["© ",new Date().getFullYear()," Semblance. All rights reserved."]})})]})]})})]})),tse=()=>{const t=Bi(),e=lr();y.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]);const n=t.pathname.startsWith("/synthetic-users/"),i=new URLSearchParams(t.search).get("fromReview")==="true";return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:a.jsxs("div",{className:"text-center p-8 max-w-md bg-white rounded-lg shadow-md",children:[a.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),n?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Persona Not Found"}),a.jsx("p",{className:"text-gray-500 mb-6",children:"The persona you're looking for may have been removed or doesn't exist."}),i?a.jsx(X,{onClick:()=>e("/synthetic-users?mode=create&tab=ai&step=review"),className:"mb-2 w-full",children:"Return to Review Page"}):a.jsx(X,{onClick:()=>e("/synthetic-users"),className:"mb-2 w-full",children:"View All Personas"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),a.jsx("p",{className:"text-gray-500 mb-6",children:"The page you're looking for doesn't exist or has been moved."})]}),a.jsx(X,{variant:"outline",onClick:()=>e("/"),className:"w-full",children:"Return to Home"})]})})};function nse(t,e=[]){let n=[];function r(s,o){const c=y.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,v=y.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:v,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=y.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>y.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return y.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,rse(i,...e)]}function rse(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var tT="Progress",nT=100,[ise,lFe]=nse(tT),[sse,ose]=ise(tT),YB=y.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:s=ase,...o}=t;(i||i===0)&&!nR(i)&&console.error(cse(`${i}`,"Progress"));const c=nR(i)?i:nT;r!==null&&!rR(r,c)&&console.error(lse(`${r}`,"Progress"));const l=rR(r,c)?r:null,u=yx(l)?s(l,c):void 0;return a.jsx(sse,{scope:n,value:l,max:c,children:a.jsx(it.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":yx(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":JB(l,c),"data-value":l??void 0,"data-max":c,...o,ref:e})})});YB.displayName=tT;var QB="ProgressIndicator",XB=y.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,i=ose(QB,n);return a.jsx(it.div,{"data-state":JB(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:e})});XB.displayName=QB;function ase(t,e){return`${Math.round(t/e*100)}%`}function JB(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function yx(t){return typeof t=="number"}function nR(t){return yx(t)&&!isNaN(t)&&t>0}function rR(t,e){return yx(t)&&!isNaN(t)&&t<=e&&t>=0}function cse(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${nT}\`.`}function lse(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${nT} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var ZB=YB,use=XB;const $l=y.forwardRef(({className:t,value:e,...n},r)=>a.jsx(ZB,{ref:r,className:Pe("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:a.jsx(use,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));$l.displayName=ZB.displayName;var wg=t=>t.type==="checkbox",Ll=t=>t instanceof Date,pi=t=>t==null;const e3=t=>typeof t=="object";var cr=t=>!pi(t)&&!Array.isArray(t)&&e3(t)&&!Ll(t),t3=t=>cr(t)&&t.target?wg(t.target)?t.target.checked:t.target.value:t,dse=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,n3=(t,e)=>t.has(dse(e)),fse=t=>{const e=t.constructor&&t.constructor.prototype;return cr(e)&&e.hasOwnProperty("isPrototypeOf")},rT=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ai(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(rT&&(t instanceof Blob||t instanceof FileList))&&(n||cr(t)))if(e=n?[]:{},!n&&!fse(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=Ai(t[r]));else return t;return e}var H0=t=>Array.isArray(t)?t.filter(Boolean):[],tr=t=>t===void 0,Me=(t,e,n)=>{if(!e||!cr(t))return n;const r=H0(e.split(/[,[\].]+?/)).reduce((i,s)=>pi(i)?i:i[s],t);return tr(r)||r===t?tr(t[e])?n:t[e]:r},ps=t=>typeof t=="boolean",iT=t=>/^\w*$/.test(t),r3=t=>H0(t.replace(/["|']|\]/g,"").split(/\.|\[/)),mn=(t,e,n)=>{let r=-1;const i=iT(e)?[e]:r3(e),s=i.length,o=s-1;for(;++rP.useContext(i3),hse=t=>{const{children:e,...n}=t;return P.createElement(i3.Provider,{value:n},e)};var s3=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(i,s,{get:()=>{const o=s;return e._proxyFormState[o]!==Ws.all&&(e._proxyFormState[o]=!r||Ws.all),n&&(n[o]=!0),t[o]}});return i},ji=t=>cr(t)&&!Object.keys(t).length,o3=(t,e,n,r)=>{n(t);const{name:i,...s}=t;return ji(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(o=>e[o]===(!r||Ws.all))},mp=t=>Array.isArray(t)?t:[t],a3=(t,e,n)=>!t||!e||t===e||mp(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function sT(t){const e=P.useRef(t);e.current=t,P.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function pse(t){const e=z0(),{control:n=e.control,disabled:r,name:i,exact:s}=t||{},[o,c]=P.useState(n._formState),l=P.useRef(!0),u=P.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=P.useRef(i);return d.current=i,sT({disabled:r,next:f=>l.current&&a3(d.current,f.name,s)&&o3(f,u.current,n._updateFormState)&&c({...n._formState,...f}),subject:n._subjects.state}),P.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),s3(o,n,u.current,!1)}var Mo=t=>typeof t=="string",c3=(t,e,n,r,i)=>Mo(t)?(r&&e.watch.add(t),Me(n,t,i)):Array.isArray(t)?t.map(s=>(r&&e.watch.add(s),Me(n,s))):(r&&(e.watchAll=!0),n);function mse(t){const e=z0(),{control:n=e.control,name:r,defaultValue:i,disabled:s,exact:o}=t||{},c=P.useRef(r);c.current=r,sT({disabled:s,subject:n._subjects.values,next:d=>{a3(c.current,d.name,o)&&u(Ai(c3(c.current,n._names,d.values||n._formValues,!1,i)))}});const[l,u]=P.useState(n._getWatch(r,i));return P.useEffect(()=>n._removeUnmounted()),l}function gse(t){const e=z0(),{name:n,disabled:r,control:i=e.control,shouldUnregister:s}=t,o=n3(i._names.array,n),c=mse({control:i,name:n,defaultValue:Me(i._formValues,n,Me(i._defaultValues,n,t.defaultValue)),exact:!0}),l=pse({control:i,name:n,exact:!0}),u=P.useRef(i.register(n,{...t.rules,value:c,...ps(t.disabled)?{disabled:t.disabled}:{}}));return P.useEffect(()=>{const d=i._options.shouldUnregister||s,f=(h,p)=>{const g=Me(i._fields,h);g&&g._f&&(g._f.mount=p)};if(f(n,!0),d){const h=Ai(Me(i._options.defaultValues,n));mn(i._defaultValues,n,h),tr(Me(i._formValues,n))&&mn(i._formValues,n,h)}return()=>{(o?d&&!i._state.action:d)?i.unregister(n):f(n,!1)}},[n,i,o,s]),P.useEffect(()=>{Me(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:Me(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:c,...ps(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:P.useCallback(d=>u.current.onChange({target:{value:t3(d),name:n},type:xx.CHANGE}),[n]),onBlur:P.useCallback(()=>u.current.onBlur({target:{value:Me(i._formValues,n),name:n},type:xx.BLUR}),[n,i]),ref:P.useCallback(d=>{const f=Me(i._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:h=>d.setCustomValidity(h),reportValidity:()=>d.reportValidity()})},[i._fields,n])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Me(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Me(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Me(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Me(l.validatingFields,n)},error:{enumerable:!0,get:()=>Me(l.errors,n)}})}}const vse=t=>t.render(gse(t));var l3=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},iR=t=>({isOnSubmit:!t||t===Ws.onSubmit,isOnBlur:t===Ws.onBlur,isOnChange:t===Ws.onChange,isOnAll:t===Ws.all,isOnTouch:t===Ws.onTouched}),sR=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const gp=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const s=Me(t,i);if(s){const{_f:o,...c}=s;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(gp(c,e))break}else if(cr(c)&&gp(c,e))break}}};var yse=(t,e,n)=>{const r=mp(Me(t,n));return mn(r,"root",e[n]),mn(t,n,r),t},oT=t=>t.type==="file",wa=t=>typeof t=="function",bx=t=>{if(!rT)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},sy=t=>Mo(t),aT=t=>t.type==="radio",wx=t=>t instanceof RegExp;const oR={value:!1,isValid:!1},aR={value:!0,isValid:!0};var u3=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!tr(t[0].attributes.value)?tr(t[0].value)||t[0].value===""?aR:{value:t[0].value,isValid:!0}:aR:oR}return oR};const cR={isValid:!1,value:null};var d3=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,cR):cR;function lR(t,e,n="validate"){if(sy(t)||Array.isArray(t)&&t.every(sy)||ps(t)&&!t)return{type:n,message:sy(t)?t:"",ref:e}}var Bu=t=>cr(t)&&!wx(t)?t:{value:t,message:""},uR=async(t,e,n,r,i)=>{const{ref:s,refs:o,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:h,validate:p,name:g,valueAsNumber:m,mount:v,disabled:b}=t._f,x=Me(e,g);if(!v||b)return{};const w=o?o[0]:s,S=E=>{r&&w.reportValidity&&(w.setCustomValidity(ps(E)?"":E||""),w.reportValidity())},C={},_=aT(s),A=wg(s),j=_||A,T=(m||oT(s))&&tr(s.value)&&tr(x)||bx(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,k=l3.bind(null,g,n,C),I=(E,O,M,U=oa.maxLength,D=oa.minLength)=>{const B=E?O:M;C[g]={type:E?U:D,message:B,ref:s,...k(E?U:D,B)}};if(i?!Array.isArray(x)||!x.length:c&&(!j&&(T||pi(x))||ps(x)&&!x||A&&!u3(o).isValid||_&&!d3(o).isValid)){const{value:E,message:O}=sy(c)?{value:!!c,message:c}:Bu(c);if(E&&(C[g]={type:oa.required,message:O,ref:w,...k(oa.required,O)},!n))return S(O),C}if(!T&&(!pi(d)||!pi(f))){let E,O;const M=Bu(f),U=Bu(d);if(!pi(x)&&!isNaN(x)){const D=s.valueAsNumber||x&&+x;pi(M.value)||(E=D>M.value),pi(U.value)||(O=Dnew Date(new Date().toDateString()+" "+Y),R=s.type=="time",L=s.type=="week";Mo(M.value)&&x&&(E=R?B(x)>B(M.value):L?x>M.value:D>new Date(M.value)),Mo(U.value)&&x&&(O=R?B(x)+E.value,U=!pi(O.value)&&x.length<+O.value;if((M||U)&&(I(M,E.message,O.message),!n))return S(C[g].message),C}if(h&&!T&&Mo(x)){const{value:E,message:O}=Bu(h);if(wx(E)&&!x.match(E)&&(C[g]={type:oa.pattern,message:O,ref:s,...k(oa.pattern,O)},!n))return S(O),C}if(p){if(wa(p)){const E=await p(x,e),O=lR(E,w);if(O&&(C[g]={...O,...k(oa.validate,O.message)},!n))return S(O.message),C}else if(cr(p)){let E={};for(const O in p){if(!ji(E)&&!n)break;const M=lR(await p[O](x,e),w,O);M&&(E={...M,...k(O,M.message)},S(M.message),n&&(C[g]=E))}if(!ji(E)&&(C[g]={ref:w,...E},!n))return C}}return S(!0),C};function xse(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{let t=[];return{get observers(){return t},next:i=>{for(const s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}},gA=t=>pi(t)||!e3(t);function dc(t,e){if(gA(t)||gA(e))return t===e;if(Ll(t)&&Ll(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const s=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=e[i];if(Ll(s)&&Ll(o)||cr(s)&&cr(o)||Array.isArray(s)&&Array.isArray(o)?!dc(s,o):s!==o)return!1}}return!0}var f3=t=>t.type==="select-multiple",wse=t=>aT(t)||wg(t),GS=t=>bx(t)&&t.isConnected,h3=t=>{for(const e in t)if(wa(t[e]))return!0;return!1};function Sx(t,e={}){const n=Array.isArray(t);if(cr(t)||n)for(const r in t)Array.isArray(t[r])||cr(t[r])&&!h3(t[r])?(e[r]=Array.isArray(t[r])?[]:{},Sx(t[r],e[r])):pi(t[r])||(e[r]=!0);return e}function p3(t,e,n){const r=Array.isArray(t);if(cr(t)||r)for(const i in t)Array.isArray(t[i])||cr(t[i])&&!h3(t[i])?tr(e)||gA(n[i])?n[i]=Array.isArray(t[i])?Sx(t[i],[]):{...Sx(t[i])}:p3(t[i],pi(e)?{}:e[i],n[i]):n[i]=!dc(t[i],e[i]);return n}var jh=(t,e)=>p3(t,e,Sx(e)),m3=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>tr(t)?t:e?t===""?NaN:t&&+t:n&&Mo(t)?new Date(t):r?r(t):t;function KS(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return oT(e)?e.files:aT(e)?d3(t.refs).value:f3(e)?[...e.selectedOptions].map(({value:n})=>n):wg(e)?u3(t.refs).value:m3(tr(e.value)?t.ref.value:e.value,t)}var Sse=(t,e,n,r)=>{const i={};for(const s of t){const o=Me(e,s);o&&mn(i,s,o._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Eh=t=>tr(t)?t:wx(t)?t.source:cr(t)?wx(t.value)?t.value.source:t.value:t;const dR="AsyncFunction";var Cse=t=>(!t||!t.validate)&&!!(wa(t.validate)&&t.validate.constructor.name===dR||cr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===dR)),_se=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function fR(t,e,n){const r=Me(t,n);if(r||iT(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=Me(e,s),c=Me(t,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};i.pop()}return{name:n}}var Ase=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,jse=(t,e)=>!H0(Me(t,e)).length&&br(t,e);const Ese={mode:Ws.onSubmit,reValidateMode:Ws.onChange,shouldFocusError:!0};function Nse(t={}){let e={...Ese,...t},n={submitCount:0,isDirty:!1,isLoading:wa(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=cr(e.defaultValues)||cr(e.values)?Ai(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:Ai(i),o={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:VS(),array:VS(),state:VS()},h=iR(e.mode),p=iR(e.reValidateMode),g=e.criteriaMode===Ws.all,m=N=>$=>{clearTimeout(u),u=setTimeout(N,$)},v=async N=>{if(!t.disabled&&(d.isValid||N)){const $=e.resolver?ji((await j()).errors):await k(r,!0);$!==n.isValid&&f.state.next({isValid:$})}},b=(N,$)=>{!t.disabled&&(d.isValidating||d.validatingFields)&&((N||Array.from(c.mount)).forEach(z=>{z&&($?mn(n.validatingFields,z,$):br(n.validatingFields,z))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ji(n.validatingFields)}))},x=(N,$=[],z,G,Q=!0,H=!0)=>{if(G&&z&&!t.disabled){if(o.action=!0,H&&Array.isArray(Me(r,N))){const Z=z(Me(r,N),G.argA,G.argB);Q&&mn(r,N,Z)}if(H&&Array.isArray(Me(n.errors,N))){const Z=z(Me(n.errors,N),G.argA,G.argB);Q&&mn(n.errors,N,Z),jse(n.errors,N)}if(d.touchedFields&&H&&Array.isArray(Me(n.touchedFields,N))){const Z=z(Me(n.touchedFields,N),G.argA,G.argB);Q&&mn(n.touchedFields,N,Z)}d.dirtyFields&&(n.dirtyFields=jh(i,s)),f.state.next({name:N,isDirty:E(N,$),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else mn(s,N,$)},w=(N,$)=>{mn(n.errors,N,$),f.state.next({errors:n.errors})},S=N=>{n.errors=N,f.state.next({errors:n.errors,isValid:!1})},C=(N,$,z,G)=>{const Q=Me(r,N);if(Q){const H=Me(s,N,tr(z)?Me(i,N):z);tr(H)||G&&G.defaultChecked||$?mn(s,N,$?H:KS(Q._f)):U(N,H),o.mount&&v()}},_=(N,$,z,G,Q)=>{let H=!1,Z=!1;const he={name:N};if(!t.disabled){const xe=!!(Me(r,N)&&Me(r,N)._f&&Me(r,N)._f.disabled);if(!z||G){d.isDirty&&(Z=n.isDirty,n.isDirty=he.isDirty=E(),H=Z!==he.isDirty);const Oe=xe||dc(Me(i,N),$);Z=!!(!xe&&Me(n.dirtyFields,N)),Oe||xe?br(n.dirtyFields,N):mn(n.dirtyFields,N,!0),he.dirtyFields=n.dirtyFields,H=H||d.dirtyFields&&Z!==!Oe}if(z){const Oe=Me(n.touchedFields,N);Oe||(mn(n.touchedFields,N,z),he.touchedFields=n.touchedFields,H=H||d.touchedFields&&Oe!==z)}H&&Q&&f.state.next(he)}return H?he:{}},A=(N,$,z,G)=>{const Q=Me(n.errors,N),H=d.isValid&&ps($)&&n.isValid!==$;if(t.delayError&&z?(l=m(()=>w(N,z)),l(t.delayError)):(clearTimeout(u),l=null,z?mn(n.errors,N,z):br(n.errors,N)),(z?!dc(Q,z):Q)||!ji(G)||H){const Z={...G,...H&&ps($)?{isValid:$}:{},errors:n.errors,name:N};n={...n,...Z},f.state.next(Z)}},j=async N=>{b(N,!0);const $=await e.resolver(s,e.context,Sse(N||c.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return b(N),$},T=async N=>{const{errors:$}=await j(N);if(N)for(const z of N){const G=Me($,z);G?mn(n.errors,z,G):br(n.errors,z)}else n.errors=$;return $},k=async(N,$,z={valid:!0})=>{for(const G in N){const Q=N[G];if(Q){const{_f:H,...Z}=Q;if(H){const he=c.array.has(H.name),xe=Q._f&&Cse(Q._f);xe&&d.validatingFields&&b([G],!0);const Oe=await uR(Q,s,g,e.shouldUseNativeValidation&&!$,he);if(xe&&d.validatingFields&&b([G]),Oe[H.name]&&(z.valid=!1,$))break;!$&&(Me(Oe,H.name)?he?yse(n.errors,Oe,H.name):mn(n.errors,H.name,Oe[H.name]):br(n.errors,H.name))}!ji(Z)&&await k(Z,$,z)}}return z.valid},I=()=>{for(const N of c.unMount){const $=Me(r,N);$&&($._f.refs?$._f.refs.every(z=>!GS(z)):!GS($._f.ref))&&se(N)}c.unMount=new Set},E=(N,$)=>!t.disabled&&(N&&$&&mn(s,N,$),!dc(q(),i)),O=(N,$,z)=>c3(N,c,{...o.mount?s:tr($)?i:Mo(N)?{[N]:$}:$},z,$),M=N=>H0(Me(o.mount?s:i,N,t.shouldUnregister?Me(i,N,[]):[])),U=(N,$,z={})=>{const G=Me(r,N);let Q=$;if(G){const H=G._f;H&&(!H.disabled&&mn(s,N,m3($,H)),Q=bx(H.ref)&&pi($)?"":$,f3(H.ref)?[...H.ref.options].forEach(Z=>Z.selected=Q.includes(Z.value)):H.refs?wg(H.ref)?H.refs.length>1?H.refs.forEach(Z=>(!Z.defaultChecked||!Z.disabled)&&(Z.checked=Array.isArray(Q)?!!Q.find(he=>he===Z.value):Q===Z.value)):H.refs[0]&&(H.refs[0].checked=!!Q):H.refs.forEach(Z=>Z.checked=Z.value===Q):oT(H.ref)?H.ref.value="":(H.ref.value=Q,H.ref.type||f.values.next({name:N,values:{...s}})))}(z.shouldDirty||z.shouldTouch)&&_(N,Q,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&Y(N)},D=(N,$,z)=>{for(const G in $){const Q=$[G],H=`${N}.${G}`,Z=Me(r,H);(c.array.has(N)||cr(Q)||Z&&!Z._f)&&!Ll(Q)?D(H,Q,z):U(H,Q,z)}},B=(N,$,z={})=>{const G=Me(r,N),Q=c.array.has(N),H=Ai($);mn(s,N,H),Q?(f.array.next({name:N,values:{...s}}),(d.isDirty||d.dirtyFields)&&z.shouldDirty&&f.state.next({name:N,dirtyFields:jh(i,s),isDirty:E(N,H)})):G&&!G._f&&!pi(H)?D(N,H,z):U(N,H,z),sR(N,c)&&f.state.next({...n}),f.values.next({name:o.mount?N:void 0,values:{...s}})},R=async N=>{o.mount=!0;const $=N.target;let z=$.name,G=!0;const Q=Me(r,z),H=()=>$.type?KS(Q._f):t3(N),Z=he=>{G=Number.isNaN(he)||Ll(he)&&isNaN(he.getTime())||dc(he,Me(s,z,he))};if(Q){let he,xe;const Oe=H(),be=N.type===xx.BLUR||N.type===xx.FOCUS_OUT,We=!_se(Q._f)&&!e.resolver&&!Me(n.errors,z)&&!Q._f.deps||Ase(be,Me(n.touchedFields,z),n.isSubmitted,p,h),ot=sR(z,c,be);mn(s,z,Oe),be?(Q._f.onBlur&&Q._f.onBlur(N),l&&l(0)):Q._f.onChange&&Q._f.onChange(N);const Rt=_(z,Oe,be,!1),Ke=!ji(Rt)||ot;if(!be&&f.values.next({name:z,type:N.type,values:{...s}}),We)return d.isValid&&(t.mode==="onBlur"?be&&v():v()),Ke&&f.state.next({name:z,...ot?{}:Rt});if(!be&&ot&&f.state.next({...n}),e.resolver){const{errors:Ze}=await j([z]);if(Z(Oe),G){const _t=fR(n.errors,r,z),Kt=fR(Ze,r,_t.name||z);he=Kt.error,z=Kt.name,xe=ji(Ze)}}else b([z],!0),he=(await uR(Q,s,g,e.shouldUseNativeValidation))[z],b([z]),Z(Oe),G&&(he?xe=!1:d.isValid&&(xe=await k(r,!0)));G&&(Q._f.deps&&Y(Q._f.deps),A(z,xe,he,Rt))}},L=(N,$)=>{if(Me(n.errors,$)&&N.focus)return N.focus(),1},Y=async(N,$={})=>{let z,G;const Q=mp(N);if(e.resolver){const H=await T(tr(N)?N:Q);z=ji(H),G=N?!Q.some(Z=>Me(H,Z)):z}else N?(G=(await Promise.all(Q.map(async H=>{const Z=Me(r,H);return await k(Z&&Z._f?{[H]:Z}:Z)}))).every(Boolean),!(!G&&!n.isValid)&&v()):G=z=await k(r);return f.state.next({...!Mo(N)||d.isValid&&z!==n.isValid?{}:{name:N},...e.resolver||!N?{isValid:z}:{},errors:n.errors}),$.shouldFocus&&!G&&gp(r,L,N?Q:c.mount),G},q=N=>{const $={...o.mount?s:i};return tr(N)?$:Mo(N)?Me($,N):N.map(z=>Me($,z))},J=(N,$)=>({invalid:!!Me(($||n).errors,N),isDirty:!!Me(($||n).dirtyFields,N),error:Me(($||n).errors,N),isValidating:!!Me(n.validatingFields,N),isTouched:!!Me(($||n).touchedFields,N)}),me=N=>{N&&mp(N).forEach($=>br(n.errors,$)),f.state.next({errors:N?n.errors:{}})},F=(N,$,z)=>{const G=(Me(r,N,{_f:{}})._f||{}).ref,Q=Me(n.errors,N)||{},{ref:H,message:Z,type:he,...xe}=Q;mn(n.errors,N,{...xe,...$,ref:G}),f.state.next({name:N,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&G&&G.focus&&G.focus()},oe=(N,$)=>wa(N)?f.values.subscribe({next:z=>N(O(void 0,$),z)}):O(N,$,!0),se=(N,$={})=>{for(const z of N?mp(N):c.mount)c.mount.delete(z),c.array.delete(z),$.keepValue||(br(r,z),br(s,z)),!$.keepError&&br(n.errors,z),!$.keepDirty&&br(n.dirtyFields,z),!$.keepTouched&&br(n.touchedFields,z),!$.keepIsValidating&&br(n.validatingFields,z),!e.shouldUnregister&&!$.keepDefaultValue&&br(i,z);f.values.next({values:{...s}}),f.state.next({...n,...$.keepDirty?{isDirty:E()}:{}}),!$.keepIsValid&&v()},le=({disabled:N,name:$,field:z,fields:G,value:Q})=>{if(ps(N)&&o.mount||N){const H=N?void 0:tr(Q)?KS(z?z._f:Me(G,$)._f):Q;mn(s,$,H),_($,H,!1,!1,!0)}},ke=(N,$={})=>{let z=Me(r,N);const G=ps($.disabled)||ps(t.disabled);return mn(r,N,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:N}},name:N,mount:!0,...$}}),c.mount.add(N),z?le({field:z,disabled:ps($.disabled)?$.disabled:t.disabled,name:N,value:$.value}):C(N,!0,$.value),{...G?{disabled:$.disabled||t.disabled}:{},...e.progressive?{required:!!$.required,min:Eh($.min),max:Eh($.max),minLength:Eh($.minLength),maxLength:Eh($.maxLength),pattern:Eh($.pattern)}:{},name:N,onChange:R,onBlur:R,ref:Q=>{if(Q){ke(N,$),z=Me(r,N);const H=tr(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,Z=wse(H),he=z._f.refs||[];if(Z?he.find(xe=>xe===H):H===z._f.ref)return;mn(r,N,{_f:{...z._f,...Z?{refs:[...he.filter(GS),H,...Array.isArray(Me(i,N))?[{}]:[]],ref:{type:H.type,name:N}}:{ref:H}}}),C(N,!1,void 0,H)}else z=Me(r,N,{}),z._f&&(z._f.mount=!1),(e.shouldUnregister||$.shouldUnregister)&&!(n3(c.array,N)&&o.action)&&c.unMount.add(N)}}},ue=()=>e.shouldFocusError&&gp(r,L,c.mount),we=N=>{ps(N)&&(f.state.next({disabled:N}),gp(r,($,z)=>{const G=Me(r,z);G&&($.disabled=G._f.disabled||N,Array.isArray(G._f.refs)&&G._f.refs.forEach(Q=>{Q.disabled=G._f.disabled||N}))},0,!1))},Ae=(N,$)=>async z=>{let G;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let Q=Ai(s);if(f.state.next({isSubmitting:!0}),e.resolver){const{errors:H,values:Z}=await j();n.errors=H,Q=Z}else await k(r);if(br(n.errors,"root"),ji(n.errors)){f.state.next({errors:{}});try{await N(Q,z)}catch(H){G=H}}else $&&await $({...n.errors},z),ue(),setTimeout(ue);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ji(n.errors)&&!G,submitCount:n.submitCount+1,errors:n.errors}),G)throw G},ee=(N,$={})=>{Me(r,N)&&(tr($.defaultValue)?B(N,Ai(Me(i,N))):(B(N,$.defaultValue),mn(i,N,Ai($.defaultValue))),$.keepTouched||br(n.touchedFields,N),$.keepDirty||(br(n.dirtyFields,N),n.isDirty=$.defaultValue?E(N,Ai(Me(i,N))):E()),$.keepError||(br(n.errors,N),d.isValid&&v()),f.state.next({...n}))},wt=(N,$={})=>{const z=N?Ai(N):i,G=Ai(z),Q=ji(N),H=Q?i:G;if($.keepDefaultValues||(i=z),!$.keepValues){if($.keepDirtyValues){const Z=new Set([...c.mount,...Object.keys(jh(i,s))]);for(const he of Array.from(Z))Me(n.dirtyFields,he)?mn(H,he,Me(s,he)):B(he,Me(H,he))}else{if(rT&&tr(N))for(const Z of c.mount){const he=Me(r,Z);if(he&&he._f){const xe=Array.isArray(he._f.refs)?he._f.refs[0]:he._f.ref;if(bx(xe)){const Oe=xe.closest("form");if(Oe){Oe.reset();break}}}}r={}}s=t.shouldUnregister?$.keepDefaultValues?Ai(i):{}:Ai(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}c={mount:$.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!$.keepIsValid||!!$.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:$.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:$.keepDirty?n.isDirty:!!($.keepDefaultValues&&!dc(N,i)),isSubmitted:$.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:$.keepDirtyValues?$.keepDefaultValues&&s?jh(i,s):n.dirtyFields:$.keepDefaultValues&&N?jh(i,N):$.keepDirty?n.dirtyFields:{},touchedFields:$.keepTouched?n.touchedFields:{},errors:$.keepErrors?n.errors:{},isSubmitSuccessful:$.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},et=(N,$)=>wt(wa(N)?N(s):N,$);return{control:{register:ke,unregister:se,getFieldState:J,handleSubmit:Ae,setError:F,_executeSchema:j,_getWatch:O,_getDirty:E,_updateValid:v,_removeUnmounted:I,_updateFieldArray:x,_updateDisabledField:le,_getFieldArray:M,_reset:wt,_resetDefaultValues:()=>wa(e.defaultValues)&&e.defaultValues().then(N=>{et(N,e.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:N=>{n={...n,...N}},_disableForm:we,_subjects:f,_proxyFormState:d,_setErrors:S,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(N){o=N},get _defaultValues(){return i},get _names(){return c},set _names(N){c=N},get _formState(){return n},set _formState(N){n=N},get _options(){return e},set _options(N){e={...e,...N}}},trigger:Y,register:ke,handleSubmit:Ae,watch:oe,setValue:B,getValues:q,reset:et,resetField:ee,clearErrors:me,unregister:se,setError:F,setFocus:(N,$={})=>{const z=Me(r,N),G=z&&z._f;if(G){const Q=G.refs?G.refs[0]:G.ref;Q.focus&&(Q.focus(),$.shouldSelect&&Q.select())}},getFieldState:J}}function V0(t={}){const e=P.useRef(),n=P.useRef(),[r,i]=P.useState({isDirty:!1,isValidating:!1,isLoading:wa(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:wa(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...Nse(t),formState:r});const s=e.current.control;return s._options=t,sT({subject:s._subjects.state,next:o=>{o3(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),P.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),P.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),P.useEffect(()=>{t.values&&!dc(t.values,n.current)?(s._reset(t.values,s._options.resetOptions),n.current=t.values,i(o=>({...o}))):s._resetDefaultValues()},[t.values,s]),P.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),P.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),P.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),P.useEffect(()=>{e.current&&(e.current.watch=e.current.watch.bind({}))},[r]),e.current.formState=s3(r,s),e.current}const hR=(t,e,n)=>{if(t&&"reportValidity"in t){const r=Me(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},g3=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?hR(r.ref,n,t):r.refs&&r.refs.forEach(i=>hR(i,n,t))}},Tse=(t,e)=>{e.shouldUseNativeValidation&&g3(t,e);const n={};for(const r in t){const i=Me(e.fields,r),s=Object.assign(t[r]||{},{ref:i&&i.ref});if(Pse(e.names||Object.keys(t),r)){const o=Object.assign({},Me(n,r));mn(o,"root",s),mn(n,r,o)}else mn(n,r,s)}return n},Pse=(t,e)=>t.some(n=>n.startsWith(e+"."));var kse=function(t,e){for(var n={};t.length;){var r=t[0],i=r.code,s=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[o]={message:c.message,type:c.code}}else n[o]={message:s,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return t.push(f)})}),e){var l=n[o].types,u=l&&l[r.code];n[o]=l3(o,e,n,i,u?[].concat(u,r.message):r.message)}t.shift()}return n},G0=function(t,e,n){return n===void 0&&(n={}),function(r,i,s){try{return Promise.resolve(function(o,c){try{var l=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(u){return s.shouldUseNativeValidation&&g3({},s),{errors:{},values:n.raw?r:u}})}catch(u){return c(u)}return l&&l.then?l.then(void 0,c):l}(0,function(o){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(o))return{values:{},errors:Tse(kse(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}},tn;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),o={};for(const c of s)o[c]=i[c];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(tn||(tn={}));var vA;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(vA||(vA={}));const Ge=tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fc=t=>{switch(typeof t){case"undefined":return Ge.undefined;case"string":return Ge.string;case"number":return isNaN(t)?Ge.nan:Ge.number;case"boolean":return Ge.boolean;case"function":return Ge.function;case"bigint":return Ge.bigint;case"symbol":return Ge.symbol;case"object":return Array.isArray(t)?Ge.array:t===null?Ge.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ge.promise:typeof Map<"u"&&t instanceof Map?Ge.map:typeof Set<"u"&&t instanceof Set?Ge.set:typeof Date<"u"&&t instanceof Date?Ge.date:Ge.object;default:return Ge.unknown}},_e=tn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ose=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class ns extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let c=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ns.create=t=>new ns(t);const ef=(t,e)=>{let n;switch(t.code){case _e.invalid_type:t.received===Ge.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case _e.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,tn.jsonStringifyReplacer)}`;break;case _e.unrecognized_keys:n=`Unrecognized key(s) in object: ${tn.joinValues(t.keys,", ")}`;break;case _e.invalid_union:n="Invalid input";break;case _e.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${tn.joinValues(t.options)}`;break;case _e.invalid_enum_value:n=`Invalid enum value. Expected ${tn.joinValues(t.options)}, received '${t.received}'`;break;case _e.invalid_arguments:n="Invalid function arguments";break;case _e.invalid_return_type:n="Invalid function return type";break;case _e.invalid_date:n="Invalid date";break;case _e.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:tn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case _e.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case _e.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case _e.custom:n="Invalid input";break;case _e.invalid_intersection_types:n="Intersection results could not be merged";break;case _e.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case _e.not_finite:n="Number must be finite";break;default:n=e.defaultError,tn.assertNever(t)}return{message:n}};let v3=ef;function Ise(t){v3=t}function Cx(){return v3}const _x=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let c="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)c=u(o,{data:e,defaultError:c}).message;return{...i,path:s,message:c}},Rse=[];function He(t,e){const n=Cx(),r=_x({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ef?void 0:ef].filter(i=>!!i)});t.common.issues.push(r)}class ai{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Tt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return ai.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Tt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const Tt=Object.freeze({status:"aborted"}),ud=t=>({status:"dirty",value:t}),wi=t=>({status:"valid",value:t}),yA=t=>t.status==="aborted",xA=t=>t.status==="dirty",sm=t=>t.status==="valid",om=t=>typeof Promise<"u"&&t instanceof Promise;function Ax(t,e,n,r){if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function y3(t,e,n,r,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var ct;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ct||(ct={}));var Kh,Wh;class qo{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pR=(t,e)=>{if(sm(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ns(t.common.issues);return this._error=n,this._error}}};function Lt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,c)=>{var l,u;const{message:d}=t;return o.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:(l=d??r)!==null&&l!==void 0?l:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:c.defaultError}},description:i}}class Gt{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return fc(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:fc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ai,ctx:{common:e.parent.common,data:e.data,parsedType:fc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(om(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fc(e)},s=this._parseSync({data:e,path:i.path,parent:i});return pR(i,s)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fc(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(om(i)?i:Promise.resolve(i));return pR(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),c=()=>s.addIssue({code:_e.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new mo({schema:this,typeName:Et.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bo.create(this,this._def)}nullable(){return rl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return no.create(this,this._def)}promise(){return nf.create(this,this._def)}or(e){return um.create([this,e],this._def)}and(e){return dm.create(this,e,this._def)}transform(e){return new mo({...Lt(this._def),schema:this,typeName:Et.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new gm({...Lt(this._def),innerType:this,defaultValue:n,typeName:Et.ZodDefault})}brand(){return new cT({typeName:Et.ZodBranded,type:this,...Lt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new vm({...Lt(this._def),innerType:this,catchValue:n,typeName:Et.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Sg.create(this,e)}readonly(){return ym.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Mse=/^c[^\s-]{8,}$/i,Dse=/^[0-9a-z]+$/,$se=/^[0-9A-HJKMNP-TV-Z]{26}$/,Lse=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Fse=/^[a-z0-9_-]{21}$/i,Use=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Bse=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hse="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let WS;const zse=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vse=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Gse=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Kse=new RegExp(`^${x3}$`);function b3(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Wse(t){return new RegExp(`^${b3(t)}$`)}function w3(t){let e=`${x3}T${b3(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function qse(t,e){return!!((e==="v4"||!e)&&zse.test(t)||(e==="v6"||!e)&&Vse.test(t))}class Qs extends Gt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ge.string){const s=this._getOrReturnCtx(e);return He(s,{code:_e.invalid_type,expected:Ge.string,received:s.parsedType}),Tt}const r=new ai;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:_e.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,c=e.data.lengthe.test(i),{validation:n,code:_e.invalid_string,...ct.errToObj(r)})}_addCheck(e){return new Qs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ct.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ct.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ct.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ct.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ct.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ct.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ct.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ct.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ct.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ct.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...ct.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ct.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ct.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ct.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ct.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ct.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ct.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ct.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ct.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ct.errToObj(n)})}nonempty(e){return this.min(1,ct.errToObj(e))}trim(){return new Qs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Qs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Qs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value{var e;return new Qs({checks:[],typeName:Et.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Lt(t)})};function Yse(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class el extends Gt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ge.number){const s=this._getOrReturnCtx(e);return He(s,{code:_e.invalid_type,expected:Ge.number,received:s.parsedType}),Tt}let r;const i=new ai;for(const s of this._def.checks)s.kind==="int"?tn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),He(r,{code:_e.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:_e.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Yse(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),He(r,{code:_e.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),He(r,{code:_e.not_finite,message:s.message}),i.dirty()):tn.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ct.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ct.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ct.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ct.toString(n))}setLimit(e,n,r,i){return new el({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ct.toString(i)}]})}_addCheck(e){return new el({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ct.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ct.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ct.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ct.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ct.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ct.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&tn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.valuenew el({checks:[],typeName:Et.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Lt(t)});class tl extends Gt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Ge.bigint){const s=this._getOrReturnCtx(e);return He(s,{code:_e.invalid_type,expected:Ge.bigint,received:s.parsedType}),Tt}let r;const i=new ai;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:_e.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),He(r,{code:_e.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):tn.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ct.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ct.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ct.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ct.toString(n))}setLimit(e,n,r,i){return new tl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ct.toString(i)}]})}_addCheck(e){return new tl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ct.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ct.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value{var e;return new tl({checks:[],typeName:Et.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Lt(t)})};class am extends Gt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ge.boolean){const r=this._getOrReturnCtx(e);return He(r,{code:_e.invalid_type,expected:Ge.boolean,received:r.parsedType}),Tt}return wi(e.data)}}am.create=t=>new am({typeName:Et.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Lt(t)});class xu extends Gt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ge.date){const s=this._getOrReturnCtx(e);return He(s,{code:_e.invalid_type,expected:Ge.date,received:s.parsedType}),Tt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return He(s,{code:_e.invalid_date}),Tt}const r=new ai;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:_e.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):tn.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xu({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ct.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ct.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xu({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Et.ZodDate,...Lt(t)});class jx extends Gt{_parse(e){if(this._getType(e)!==Ge.symbol){const r=this._getOrReturnCtx(e);return He(r,{code:_e.invalid_type,expected:Ge.symbol,received:r.parsedType}),Tt}return wi(e.data)}}jx.create=t=>new jx({typeName:Et.ZodSymbol,...Lt(t)});class cm extends Gt{_parse(e){if(this._getType(e)!==Ge.undefined){const r=this._getOrReturnCtx(e);return He(r,{code:_e.invalid_type,expected:Ge.undefined,received:r.parsedType}),Tt}return wi(e.data)}}cm.create=t=>new cm({typeName:Et.ZodUndefined,...Lt(t)});class lm extends Gt{_parse(e){if(this._getType(e)!==Ge.null){const r=this._getOrReturnCtx(e);return He(r,{code:_e.invalid_type,expected:Ge.null,received:r.parsedType}),Tt}return wi(e.data)}}lm.create=t=>new lm({typeName:Et.ZodNull,...Lt(t)});class tf extends Gt{constructor(){super(...arguments),this._any=!0}_parse(e){return wi(e.data)}}tf.create=t=>new tf({typeName:Et.ZodAny,...Lt(t)});class Zl extends Gt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wi(e.data)}}Zl.create=t=>new Zl({typeName:Et.ZodUnknown,...Lt(t)});class Fa extends Gt{_parse(e){const n=this._getOrReturnCtx(e);return He(n,{code:_e.invalid_type,expected:Ge.never,received:n.parsedType}),Tt}}Fa.create=t=>new Fa({typeName:Et.ZodNever,...Lt(t)});class Ex extends Gt{_parse(e){if(this._getType(e)!==Ge.undefined){const r=this._getOrReturnCtx(e);return He(r,{code:_e.invalid_type,expected:Ge.void,received:r.parsedType}),Tt}return wi(e.data)}}Ex.create=t=>new Ex({typeName:Et.ZodVoid,...Lt(t)});class no extends Gt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ge.array)return He(n,{code:_e.invalid_type,expected:Ge.array,received:n.parsedType}),Tt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,c=n.data.lengthi.maxLength.value&&(He(n,{code:_e.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>i.type._parseAsync(new qo(n,o,n.path,c)))).then(o=>ai.mergeArray(r,o));const s=[...n.data].map((o,c)=>i.type._parseSync(new qo(n,o,n.path,c)));return ai.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new no({...this._def,minLength:{value:e,message:ct.toString(n)}})}max(e,n){return new no({...this._def,maxLength:{value:e,message:ct.toString(n)}})}length(e,n){return new no({...this._def,exactLength:{value:e,message:ct.toString(n)}})}nonempty(e){return this.min(1,e)}}no.create=(t,e)=>new no({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Et.ZodArray,...Lt(e)});function Xu(t){if(t instanceof Kn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Bo.create(Xu(r))}return new Kn({...t._def,shape:()=>e})}else return t instanceof no?new no({...t._def,type:Xu(t.element)}):t instanceof Bo?Bo.create(Xu(t.unwrap())):t instanceof rl?rl.create(Xu(t.unwrap())):t instanceof Yo?Yo.create(t.items.map(e=>Xu(e))):t}class Kn extends Gt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=tn.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Ge.object){const u=this._getOrReturnCtx(e);return He(u,{code:_e.invalid_type,expected:Ge.object,received:u.parsedType}),Tt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof Fa&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||c.push(u);const l=[];for(const u of o){const d=s[u],f=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new qo(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Fa){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")c.length>0&&(He(i,{code:_e.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of c){const f=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new qo(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>ai.mergeObjectSync(r,u)):ai.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ct.errToObj,new Kn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,c;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=ct.errToObj(e).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}strip(){return new Kn({...this._def,unknownKeys:"strip"})}passthrough(){return new Kn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Kn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Kn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Et.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Kn({...this._def,catchall:e})}pick(e){const n={};return tn.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Kn({...this._def,shape:()=>n})}omit(e){const n={};return tn.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Kn({...this._def,shape:()=>n})}deepPartial(){return Xu(this)}partial(e){const n={};return tn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new Kn({...this._def,shape:()=>n})}required(e){const n={};return tn.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Bo;)s=s._def.innerType;n[r]=s}}),new Kn({...this._def,shape:()=>n})}keyof(){return S3(tn.objectKeys(this.shape))}}Kn.create=(t,e)=>new Kn({shape:()=>t,unknownKeys:"strip",catchall:Fa.create(),typeName:Et.ZodObject,...Lt(e)});Kn.strictCreate=(t,e)=>new Kn({shape:()=>t,unknownKeys:"strict",catchall:Fa.create(),typeName:Et.ZodObject,...Lt(e)});Kn.lazycreate=(t,e)=>new Kn({shape:t,unknownKeys:"strip",catchall:Fa.create(),typeName:Et.ZodObject,...Lt(e)});class um extends Gt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new ns(c.ctx.common.issues));return He(n,{code:_e.invalid_union,unionErrors:o}),Tt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(l=>new ns(l));return He(n,{code:_e.invalid_union,unionErrors:c}),Tt}}get options(){return this._def.options}}um.create=(t,e)=>new um({options:t,typeName:Et.ZodUnion,...Lt(e)});const la=t=>t instanceof hm?la(t.schema):t instanceof mo?la(t.innerType()):t instanceof pm?[t.value]:t instanceof nl?t.options:t instanceof mm?tn.objectValues(t.enum):t instanceof gm?la(t._def.innerType):t instanceof cm?[void 0]:t instanceof lm?[null]:t instanceof Bo?[void 0,...la(t.unwrap())]:t instanceof rl?[null,...la(t.unwrap())]:t instanceof cT||t instanceof ym?la(t.unwrap()):t instanceof vm?la(t._def.innerType):[];class K0 extends Gt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ge.object)return He(n,{code:_e.invalid_type,expected:Ge.object,received:n.parsedType}),Tt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(He(n,{code:_e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Tt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=la(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(i.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);i.set(c,s)}}return new K0({typeName:Et.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Lt(r)})}}function bA(t,e){const n=fc(t),r=fc(e);if(t===e)return{valid:!0,data:t};if(n===Ge.object&&r===Ge.object){const i=tn.objectKeys(e),s=tn.objectKeys(t).filter(c=>i.indexOf(c)!==-1),o={...t,...e};for(const c of s){const l=bA(t[c],e[c]);if(!l.valid)return{valid:!1};o[c]=l.data}return{valid:!0,data:o}}else if(n===Ge.array&&r===Ge.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s{if(yA(s)||yA(o))return Tt;const c=bA(s.value,o.value);return c.valid?((xA(s)||xA(o))&&n.dirty(),{status:n.value,value:c.data}):(He(r,{code:_e.invalid_intersection_types}),Tt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}dm.create=(t,e,n)=>new dm({left:t,right:e,typeName:Et.ZodIntersection,...Lt(n)});class Yo extends Gt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ge.array)return He(r,{code:_e.invalid_type,expected:Ge.array,received:r.parsedType}),Tt;if(r.data.lengththis._def.items.length&&(He(r,{code:_e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,c)=>{const l=this._def.items[c]||this._def.rest;return l?l._parse(new qo(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ai.mergeArray(n,o)):ai.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Yo({...this._def,rest:e})}}Yo.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yo({items:t,typeName:Et.ZodTuple,rest:null,...Lt(e)})};class fm extends Gt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ge.object)return He(r,{code:_e.invalid_type,expected:Ge.object,received:r.parsedType}),Tt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const c in r.data)i.push({key:s._parse(new qo(r,c,r.path,c)),value:o._parse(new qo(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?ai.mergeObjectAsync(n,i):ai.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Gt?new fm({keyType:e,valueType:n,typeName:Et.ZodRecord,...Lt(r)}):new fm({keyType:Qs.create(),valueType:e,typeName:Et.ZodRecord,...Lt(n)})}}class Nx extends Gt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ge.map)return He(r,{code:_e.invalid_type,expected:Ge.map,received:r.parsedType}),Tt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([c,l],u)=>({key:i._parse(new qo(r,c,r.path,[u,"key"])),value:s._parse(new qo(r,l,r.path,[u,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Tt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(u.value,d.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Tt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(u.value,d.value)}return{status:n.value,value:c}}}}Nx.create=(t,e,n)=>new Nx({valueType:e,keyType:t,typeName:Et.ZodMap,...Lt(n)});class bu extends Gt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ge.set)return He(r,{code:_e.invalid_type,expected:Ge.set,received:r.parsedType}),Tt;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(He(r,{code:_e.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return Tt;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const c=[...r.data.values()].map((l,u)=>s._parse(new qo(r,l,r.path,u)));return r.common.async?Promise.all(c).then(l=>o(l)):o(c)}min(e,n){return new bu({...this._def,minSize:{value:e,message:ct.toString(n)}})}max(e,n){return new bu({...this._def,maxSize:{value:e,message:ct.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}bu.create=(t,e)=>new bu({valueType:t,minSize:null,maxSize:null,typeName:Et.ZodSet,...Lt(e)});class jd extends Gt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ge.function)return He(n,{code:_e.invalid_type,expected:Ge.function,received:n.parsedType}),Tt;function r(c,l){return _x({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cx(),ef].filter(u=>!!u),issueData:{code:_e.invalid_arguments,argumentsError:l}})}function i(c,l){return _x({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cx(),ef].filter(u=>!!u),issueData:{code:_e.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof nf){const c=this;return wi(async function(...l){const u=new ns([]),d=await c._def.args.parseAsync(l,s).catch(p=>{throw u.addIssue(r(l,p)),u}),f=await Reflect.apply(o,this,d);return await c._def.returns._def.type.parseAsync(f,s).catch(p=>{throw u.addIssue(i(f,p)),u})})}else{const c=this;return wi(function(...l){const u=c._def.args.safeParse(l,s);if(!u.success)throw new ns([r(l,u.error)]);const d=Reflect.apply(o,this,u.data),f=c._def.returns.safeParse(d,s);if(!f.success)throw new ns([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new jd({...this._def,args:Yo.create(e).rest(Zl.create())})}returns(e){return new jd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new jd({args:e||Yo.create([]).rest(Zl.create()),returns:n||Zl.create(),typeName:Et.ZodFunction,...Lt(r)})}}class hm extends Gt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}hm.create=(t,e)=>new hm({getter:t,typeName:Et.ZodLazy,...Lt(e)});class pm extends Gt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return He(n,{received:n.data,code:_e.invalid_literal,expected:this._def.value}),Tt}return{status:"valid",value:e.data}}get value(){return this._def.value}}pm.create=(t,e)=>new pm({value:t,typeName:Et.ZodLiteral,...Lt(e)});function S3(t,e){return new nl({values:t,typeName:Et.ZodEnum,...Lt(e)})}class nl extends Gt{constructor(){super(...arguments),Kh.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return He(n,{expected:tn.joinValues(r),received:n.parsedType,code:_e.invalid_type}),Tt}if(Ax(this,Kh)||y3(this,Kh,new Set(this._def.values)),!Ax(this,Kh).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return He(n,{received:n.data,code:_e.invalid_enum_value,options:r}),Tt}return wi(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return nl.create(e,{...this._def,...n})}exclude(e,n=this._def){return nl.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Kh=new WeakMap;nl.create=S3;class mm extends Gt{constructor(){super(...arguments),Wh.set(this,void 0)}_parse(e){const n=tn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ge.string&&r.parsedType!==Ge.number){const i=tn.objectValues(n);return He(r,{expected:tn.joinValues(i),received:r.parsedType,code:_e.invalid_type}),Tt}if(Ax(this,Wh)||y3(this,Wh,new Set(tn.getValidEnumValues(this._def.values))),!Ax(this,Wh).has(e.data)){const i=tn.objectValues(n);return He(r,{received:r.data,code:_e.invalid_enum_value,options:i}),Tt}return wi(e.data)}get enum(){return this._def.values}}Wh=new WeakMap;mm.create=(t,e)=>new mm({values:t,typeName:Et.ZodNativeEnum,...Lt(e)});class nf extends Gt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ge.promise&&n.common.async===!1)return He(n,{code:_e.invalid_type,expected:Ge.promise,received:n.parsedType}),Tt;const r=n.parsedType===Ge.promise?n.data:Promise.resolve(n.data);return wi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}nf.create=(t,e)=>new nf({type:t,typeName:Et.ZodPromise,...Lt(e)});class mo extends Gt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Et.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{He(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return Tt;const l=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return l.status==="aborted"?Tt:l.status==="dirty"||n.value==="dirty"?ud(l.value):l});{if(n.value==="aborted")return Tt;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?Tt:c.status==="dirty"||n.value==="dirty"?ud(c.value):c}}if(i.type==="refinement"){const o=c=>{const l=i.refinement(c,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?Tt:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?Tt:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!sm(o))return o;const c=i.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>sm(o)?Promise.resolve(i.transform(o.value,s)).then(c=>({status:n.value,value:c})):o);tn.assertNever(i)}}mo.create=(t,e,n)=>new mo({schema:t,typeName:Et.ZodEffects,effect:e,...Lt(n)});mo.createWithPreprocess=(t,e,n)=>new mo({schema:e,effect:{type:"preprocess",transform:t},typeName:Et.ZodEffects,...Lt(n)});class Bo extends Gt{_parse(e){return this._getType(e)===Ge.undefined?wi(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bo.create=(t,e)=>new Bo({innerType:t,typeName:Et.ZodOptional,...Lt(e)});class rl extends Gt{_parse(e){return this._getType(e)===Ge.null?wi(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rl.create=(t,e)=>new rl({innerType:t,typeName:Et.ZodNullable,...Lt(e)});class gm extends Gt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ge.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}gm.create=(t,e)=>new gm({innerType:t,typeName:Et.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Lt(e)});class vm extends Gt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return om(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ns(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ns(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}vm.create=(t,e)=>new vm({innerType:t,typeName:Et.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Lt(e)});class Tx extends Gt{_parse(e){if(this._getType(e)!==Ge.nan){const r=this._getOrReturnCtx(e);return He(r,{code:_e.invalid_type,expected:Ge.nan,received:r.parsedType}),Tt}return{status:"valid",value:e.data}}}Tx.create=t=>new Tx({typeName:Et.ZodNaN,...Lt(t)});const Qse=Symbol("zod_brand");class cT extends Gt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Sg extends Gt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Tt:s.status==="dirty"?(n.dirty(),ud(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Tt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Sg({in:e,out:n,typeName:Et.ZodPipeline})}}class ym extends Gt{_parse(e){const n=this._def.innerType._parse(e),r=i=>(sm(i)&&(i.value=Object.freeze(i.value)),i);return om(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}ym.create=(t,e)=>new ym({innerType:t,typeName:Et.ZodReadonly,...Lt(e)});function C3(t,e={},n){return t?tf.create().superRefine((r,i)=>{var s,o;if(!t(r)){const c=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(o=(s=c.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof c=="string"?{message:c}:c;i.addIssue({code:"custom",...u,fatal:l})}}):tf.create()}const Xse={object:Kn.lazycreate};var Et;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Et||(Et={}));const Jse=(t,e={message:`Input not instance of ${t.name}`})=>C3(n=>n instanceof t,e),_3=Qs.create,A3=el.create,Zse=Tx.create,eoe=tl.create,j3=am.create,toe=xu.create,noe=jx.create,roe=cm.create,ioe=lm.create,soe=tf.create,ooe=Zl.create,aoe=Fa.create,coe=Ex.create,loe=no.create,uoe=Kn.create,doe=Kn.strictCreate,foe=um.create,hoe=K0.create,poe=dm.create,moe=Yo.create,goe=fm.create,voe=Nx.create,yoe=bu.create,xoe=jd.create,boe=hm.create,woe=pm.create,Soe=nl.create,Coe=mm.create,_oe=nf.create,mR=mo.create,Aoe=Bo.create,joe=rl.create,Eoe=mo.createWithPreprocess,Noe=Sg.create,Toe=()=>_3().optional(),Poe=()=>A3().optional(),koe=()=>j3().optional(),Ooe={string:t=>Qs.create({...t,coerce:!0}),number:t=>el.create({...t,coerce:!0}),boolean:t=>am.create({...t,coerce:!0}),bigint:t=>tl.create({...t,coerce:!0}),date:t=>xu.create({...t,coerce:!0})},Ioe=Tt;var Re=Object.freeze({__proto__:null,defaultErrorMap:ef,setErrorMap:Ise,getErrorMap:Cx,makeIssue:_x,EMPTY_PATH:Rse,addIssueToContext:He,ParseStatus:ai,INVALID:Tt,DIRTY:ud,OK:wi,isAborted:yA,isDirty:xA,isValid:sm,isAsync:om,get util(){return tn},get objectUtil(){return vA},ZodParsedType:Ge,getParsedType:fc,ZodType:Gt,datetimeRegex:w3,ZodString:Qs,ZodNumber:el,ZodBigInt:tl,ZodBoolean:am,ZodDate:xu,ZodSymbol:jx,ZodUndefined:cm,ZodNull:lm,ZodAny:tf,ZodUnknown:Zl,ZodNever:Fa,ZodVoid:Ex,ZodArray:no,ZodObject:Kn,ZodUnion:um,ZodDiscriminatedUnion:K0,ZodIntersection:dm,ZodTuple:Yo,ZodRecord:fm,ZodMap:Nx,ZodSet:bu,ZodFunction:jd,ZodLazy:hm,ZodLiteral:pm,ZodEnum:nl,ZodNativeEnum:mm,ZodPromise:nf,ZodEffects:mo,ZodTransformer:mo,ZodOptional:Bo,ZodNullable:rl,ZodDefault:gm,ZodCatch:vm,ZodNaN:Tx,BRAND:Qse,ZodBranded:cT,ZodPipeline:Sg,ZodReadonly:ym,custom:C3,Schema:Gt,ZodSchema:Gt,late:Xse,get ZodFirstPartyTypeKind(){return Et},coerce:Ooe,any:soe,array:loe,bigint:eoe,boolean:j3,date:toe,discriminatedUnion:hoe,effect:mR,enum:Soe,function:xoe,instanceof:Jse,intersection:poe,lazy:boe,literal:woe,map:voe,nan:Zse,nativeEnum:Coe,never:aoe,null:ioe,nullable:joe,number:A3,object:uoe,oboolean:koe,onumber:Poe,optional:Aoe,ostring:Toe,pipeline:Noe,preprocess:Eoe,promise:_oe,record:goe,set:yoe,strictObject:doe,string:_3,symbol:noe,transformer:mR,tuple:moe,undefined:roe,union:foe,unknown:ooe,void:coe,NEVER:Ioe,ZodIssueCode:_e,quotelessJson:Ose,ZodError:ns}),Roe="Label",E3=y.forwardRef((t,e)=>a.jsx(it.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));E3.displayName=Roe;var N3=E3;const Moe=ZN("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ms=y.forwardRef(({className:t,...e},n)=>a.jsx(N3,{ref:n,className:Pe(Moe(),t),...e}));ms.displayName=N3.displayName;const W0=hse,T3=y.createContext({}),yt=({...t})=>a.jsx(T3.Provider,{value:{name:t.name},children:a.jsx(vse,{...t})}),q0=()=>{const t=y.useContext(T3),e=y.useContext(P3),{getFieldState:n,formState:r}=z0(),i=n(t.name,r);if(!t)throw new Error("useFormField should be used within ");const{id:s}=e;return{id:s,name:t.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},P3=y.createContext({}),pt=y.forwardRef(({className:t,...e},n)=>{const r=y.useId();return a.jsx(P3.Provider,{value:{id:r},children:a.jsx("div",{ref:n,className:Pe("space-y-2",t),...e})})});pt.displayName="FormItem";const mt=y.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:i}=q0();return a.jsx(ms,{ref:n,className:Pe(r&&"text-destructive",t),htmlFor:i,...e})});mt.displayName="FormLabel";const gt=y.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:s}=q0();return a.jsx(Go,{ref:e,id:r,"aria-describedby":n?`${i} ${s}`:`${i}`,"aria-invalid":!!n,...t})});gt.displayName="FormControl";const Mn=y.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=q0();return a.jsx("p",{ref:n,id:r,className:Pe("text-sm text-muted-foreground",t),...e})});Mn.displayName="FormDescription";const vt=y.forwardRef(({className:t,children:e,...n},r)=>{const{error:i,formMessageId:s}=q0(),o=i?String(i==null?void 0:i.message):e;return o?a.jsx("p",{ref:r,id:s,className:Pe("text-sm font-medium text-destructive",t),...n,children:o}):null});vt.displayName="FormMessage";const Ht=y.forwardRef(({className:t,type:e,...n},r)=>a.jsx("input",{type:e,className:Pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Ht.displayName="Input";const ht=y.forwardRef(({className:t,...e},n)=>a.jsx("textarea",{className:Pe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));ht.displayName="Textarea";function xm(t,[e,n]){return Math.min(n,Math.max(e,t))}function Doe(t,e=[]){let n=[];function r(s,o){const c=y.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,v=y.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:v,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=y.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>y.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return y.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,$oe(i,...e)]}function $oe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Y0(t){const e=t+"CollectionProvider",[n,r]=Doe(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:m}=p,v=P.useRef(null),b=P.useRef(new Map).current;return a.jsx(i,{scope:g,itemMap:b,collectionRef:v,children:m})};o.displayName=e;const c=t+"CollectionSlot",l=P.forwardRef((p,g)=>{const{scope:m,children:v}=p,b=s(c,m),x=Pt(g,b.collectionRef);return a.jsx(Go,{ref:x,children:v})});l.displayName=c;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=P.forwardRef((p,g)=>{const{scope:m,children:v,...b}=p,x=P.useRef(null),w=Pt(g,x),S=s(u,m);return P.useEffect(()=>(S.itemMap.set(x,{ref:x,...b}),()=>void S.itemMap.delete(x))),a.jsx(Go,{[d]:"",ref:w,children:v})});f.displayName=u;function h(p){const g=s(t+"CollectionConsumer",p);return P.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const b=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((S,C)=>b.indexOf(S.ref.current)-b.indexOf(C.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:f},h,r]}var Loe=y.createContext(void 0);function Ou(t){const e=y.useContext(Loe);return t||e||"ltr"}var qS=0;function lT(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??gR()),document.body.insertAdjacentElement("beforeend",t[1]??gR()),qS++,()=>{qS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),qS--}},[])}function gR(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var YS="focusScope.autoFocusOnMount",QS="focusScope.autoFocusOnUnmount",vR={bubbles:!1,cancelable:!0},Foe="FocusScope",Q0=y.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[c,l]=y.useState(null),u=Ar(i),d=Ar(s),f=y.useRef(null),h=Pt(e,m=>l(m)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let m=function(w){if(p.paused||!c)return;const S=w.target;c.contains(S)?f.current=S:nc(f.current,{select:!0})},v=function(w){if(p.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||nc(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&nc(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(b);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[r,c,p.paused]),y.useEffect(()=>{if(c){xR.add(p);const m=document.activeElement;if(!c.contains(m)){const b=new CustomEvent(YS,vR);c.addEventListener(YS,u),c.dispatchEvent(b),b.defaultPrevented||(Uoe(Goe(k3(c)),{select:!0}),document.activeElement===m&&nc(c))}return()=>{c.removeEventListener(YS,u),setTimeout(()=>{const b=new CustomEvent(QS,vR);c.addEventListener(QS,d),c.dispatchEvent(b),b.defaultPrevented||nc(m??document.body,{select:!0}),c.removeEventListener(QS,d),xR.remove(p)},0)}}},[c,u,d,p]);const g=y.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const x=m.currentTarget,[w,S]=Boe(x);w&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&nc(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&nc(S,{select:!0})):b===x&&m.preventDefault()}},[n,r,p.paused]);return a.jsx(it.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});Q0.displayName=Foe;function Uoe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(nc(r,{select:e}),document.activeElement!==n)return}function Boe(t){const e=k3(t),n=yR(e,t),r=yR(e.reverse(),t);return[n,r]}function k3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function yR(t,e){for(const n of t)if(!Hoe(n,{upTo:e}))return n}function Hoe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function zoe(t){return t instanceof HTMLInputElement&&"select"in t}function nc(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&zoe(t)&&e&&t.select()}}var xR=Voe();function Voe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=bR(t,e),t.unshift(e)},remove(e){var n;t=bR(t,e),(n=t[0])==null||n.resume()}}}function bR(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Goe(t){return t.filter(e=>e.tagName!=="A")}function Cg(t){const e=y.useRef({value:t,previous:t});return y.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Koe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Hu=new WeakMap,yv=new WeakMap,xv={},XS=0,O3=function(t){return t&&(t.host||O3(t.parentNode))},Woe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=O3(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},qoe=function(t,e,n,r){var i=Woe(e,Array.isArray(t)?t:[t]);xv[n]||(xv[n]=new WeakMap);var s=xv[n],o=[],c=new Set,l=new Set(i),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};i.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(c.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",m=(Hu.get(h)||0)+1,v=(s.get(h)||0)+1;Hu.set(h,m),s.set(h,v),o.push(h),m===1&&g&&yv.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return d(e),c.clear(),XS++,function(){o.forEach(function(f){var h=Hu.get(f)-1,p=s.get(f)-1;Hu.set(f,h),s.set(f,p),h||(yv.has(f)||f.removeAttribute(r),yv.delete(f)),p||f.removeAttribute(n)}),XS--,XS||(Hu=new WeakMap,Hu=new WeakMap,yv=new WeakMap,xv={})}},uT=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=Koe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),qoe(r,i,n,"aria-hidden")):function(){return null}},Ro=function(){return Ro=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return dae;var e=fae(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},pae=D3(),Ed="data-scroll-locked",mae=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,c=t.gap;return n===void 0&&(n="margin"),` - .`.concat(Qoe,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(c,"px ").concat(r,`; - } - body[`).concat(Ed,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(s,`px; - padding-right: `).concat(o,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(c,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(oy,` { - right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(ay,` { - margin-right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(oy," .").concat(oy,` { - right: 0 `).concat(r,`; - } - - .`).concat(ay," .").concat(ay,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Ed,`] { - `).concat(Xoe,": ").concat(c,`px; - } -`)},SR=function(){var t=parseInt(document.body.getAttribute(Ed)||"0",10);return isFinite(t)?t:0},gae=function(){y.useEffect(function(){return document.body.setAttribute(Ed,(SR()+1).toString()),function(){var t=SR()-1;t<=0?document.body.removeAttribute(Ed):document.body.setAttribute(Ed,t.toString())}},[])},vae=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;gae();var s=y.useMemo(function(){return hae(i)},[i]);return y.createElement(pae,{styles:mae(s,!e,i,n?"":"!important")})},wA=!1;if(typeof window<"u")try{var bv=Object.defineProperty({},"passive",{get:function(){return wA=!0,!0}});window.addEventListener("test",bv,bv),window.removeEventListener("test",bv,bv)}catch{wA=!1}var zu=wA?{passive:!1}:!1,yae=function(t){return t.tagName==="TEXTAREA"},$3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!yae(t)&&n[e]==="visible")},xae=function(t){return $3(t,"overflowY")},bae=function(t){return $3(t,"overflowX")},CR=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=L3(t,r);if(i){var s=F3(t,r),o=s[1],c=s[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wae=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Sae=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},L3=function(t,e){return t==="v"?xae(e):bae(e)},F3=function(t,e){return t==="v"?wae(e):Sae(e)},Cae=function(t,e){return t==="h"&&e==="rtl"?-1:1},_ae=function(t,e,n,r,i){var s=Cae(t,window.getComputedStyle(e).direction),o=s*r,c=n.target,l=e.contains(c),u=!1,d=o>0,f=0,h=0;do{var p=F3(t,c),g=p[0],m=p[1],v=p[2],b=m-v-s*g;(g||b)&&L3(t,c)&&(f+=b,h+=g),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!l&&c!==document.body||l&&(e.contains(c)||e===c));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(h)<1||!i))&&(u=!0),u},wv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_R=function(t){return[t.deltaX,t.deltaY]},AR=function(t){return t&&"current"in t?t.current:t},Aae=function(t,e){return t[0]===e[0]&&t[1]===e[1]},jae=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Eae=0,Vu=[];function Nae(t){var e=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Eae++)[0],s=y.useState(D3)[0],o=y.useRef(t);y.useEffect(function(){o.current=t},[t]),y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=Yoe([t.lockRef.current],(t.shards||[]).map(AR),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var c=y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var b=wv(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-b[0],S="deltaY"in m?m.deltaY:x[1]-b[1],C,_=m.target,A=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&A==="h"&&_.type==="range")return!1;var j=CR(A,_);if(!j)return!0;if(j?C=A:(C=A==="v"?"h":"v",j=CR(A,_)),!j)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=C),!C)return!0;var T=r.current||C;return _ae(T,v,m,T==="h"?w:S,!0)},[]),l=y.useCallback(function(m){var v=m;if(!(!Vu.length||Vu[Vu.length-1]!==s)){var b="deltaY"in v?_R(v):wv(v),x=e.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Aae(C.delta,b)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(AR).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=w.length>0?c(v,w[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=y.useCallback(function(m,v,b,x){var w={name:m,delta:v,target:b,should:x,shadowParent:Tae(b)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(S){return S!==w})},1)},[]),d=y.useCallback(function(m){n.current=wv(m),r.current=void 0},[]),f=y.useCallback(function(m){u(m.type,_R(m),m.target,c(m,t.lockRef.current))},[]),h=y.useCallback(function(m){u(m.type,wv(m),m.target,c(m,t.lockRef.current))},[]);y.useEffect(function(){return Vu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,zu),document.addEventListener("touchmove",l,zu),document.addEventListener("touchstart",d,zu),function(){Vu=Vu.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,zu),document.removeEventListener("touchmove",l,zu),document.removeEventListener("touchstart",d,zu)}},[]);var p=t.removeScrollBar,g=t.inert;return y.createElement(y.Fragment,null,g?y.createElement(s,{styles:jae(i)}):null,p?y.createElement(vae,{gapMode:t.gapMode}):null)}function Tae(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Pae=iae(M3,Nae);var J0=y.forwardRef(function(t,e){return y.createElement(X0,Ro({},t,{ref:e,sideCar:Pae}))});J0.classNames=X0.classNames;var kae=[" ","Enter","ArrowUp","ArrowDown"],Oae=[" ","Enter"],_g="Select",[Z0,ew,Iae]=Y0(_g),[Wf,uFe]=Ui(_g,[Iae,$f]),tw=$f(),[Rae,dl]=Wf(_g),[Mae,Dae]=Wf(_g),U3=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:g}=t,m=tw(e),[v,b]=y.useState(null),[x,w]=y.useState(null),[S,C]=y.useState(!1),_=Ou(u),[A=!1,j]=lo({prop:r,defaultProp:i,onChange:s}),[T,k]=lo({prop:o,defaultProp:c,onChange:l}),I=y.useRef(null),E=v?g||!!v.closest("form"):!0,[O,M]=y.useState(new Set),U=Array.from(O).map(D=>D.props.value).join(";");return a.jsx(O4,{...m,children:a.jsxs(Rae,{required:p,scope:e,trigger:v,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Zs(),value:T,onValueChange:k,open:A,onOpenChange:j,dir:_,triggerPointerDownPosRef:I,disabled:h,children:[a.jsx(Z0.Provider,{scope:e,children:a.jsx(Mae,{scope:t.__scopeSelect,onNativeOptionAdd:y.useCallback(D=>{M(B=>new Set(B).add(D))},[]),onNativeOptionRemove:y.useCallback(D=>{M(B=>{const R=new Set(B);return R.delete(D),R})},[]),children:n})}),E?a.jsxs(d6,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:T,onChange:D=>k(D.target.value),disabled:h,form:g,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(O)]},U):null]})})};U3.displayName=_g;var B3="SelectTrigger",H3=y.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,s=tw(n),o=dl(B3,n),c=o.disabled||r,l=Pt(e,o.onTriggerChange),u=ew(n),d=y.useRef("touch"),[f,h,p]=f6(m=>{const v=u().filter(w=>!w.disabled),b=v.find(w=>w.value===o.value),x=h6(v,m,b);x!==void 0&&o.onValueChange(x.value)}),g=m=>{c||(o.onOpenChange(!0),p()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return a.jsx(SE,{asChild:!0,...s,children:a.jsx(it.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":u6(o.value)?"":void 0,...i,ref:l,onClick:Ne(i.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:Ne(i.onPointerDown,m=>{d.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:Ne(i.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(v&&m.key===" ")&&kae.includes(m.key)&&(g(),m.preventDefault())})})})});H3.displayName=B3;var z3="SelectValue",V3=y.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:o="",...c}=t,l=dl(z3,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,f=Pt(e,l.onValueNodeChange);return qr(()=>{u(d)},[u,d]),a.jsx(it.span,{...c,ref:f,style:{pointerEvents:"none"},children:u6(l.value)?a.jsx(a.Fragment,{children:o}):s})});V3.displayName=z3;var $ae="SelectIcon",G3=y.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return a.jsx(it.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});G3.displayName=$ae;var Lae="SelectPortal",K3=t=>a.jsx(f0,{asChild:!0,...t});K3.displayName=Lae;var wu="SelectContent",W3=y.forwardRef((t,e)=>{const n=dl(wu,t.__scopeSelect),[r,i]=y.useState();if(qr(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?Rf.createPortal(a.jsx(q3,{scope:t.__scopeSelect,children:a.jsx(Z0.Slot,{scope:t.__scopeSelect,children:a.jsx("div",{children:t.children})})}),s):null}return a.jsx(Y3,{...t,ref:e})});W3.displayName=wu;var Ls=10,[q3,fl]=Wf(wu),Fae="SelectContentImpl",Y3=y.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v,...b}=t,x=dl(wu,n),[w,S]=y.useState(null),[C,_]=y.useState(null),A=Pt(e,le=>S(le)),[j,T]=y.useState(null),[k,I]=y.useState(null),E=ew(n),[O,M]=y.useState(!1),U=y.useRef(!1);y.useEffect(()=>{if(w)return uT(w)},[w]),lT();const D=y.useCallback(le=>{const[ke,...ue]=E().map(ee=>ee.ref.current),[we]=ue.slice(-1),Ae=document.activeElement;for(const ee of le)if(ee===Ae||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===ke&&C&&(C.scrollTop=0),ee===we&&C&&(C.scrollTop=C.scrollHeight),ee==null||ee.focus(),document.activeElement!==Ae))return},[E,C]),B=y.useCallback(()=>D([j,w]),[D,j,w]);y.useEffect(()=>{O&&B()},[O,B]);const{onOpenChange:R,triggerPointerDownPosRef:L}=x;y.useEffect(()=>{if(w){let le={x:0,y:0};const ke=we=>{var Ae,ee;le={x:Math.abs(Math.round(we.pageX)-(((Ae=L.current)==null?void 0:Ae.x)??0)),y:Math.abs(Math.round(we.pageY)-(((ee=L.current)==null?void 0:ee.y)??0))}},ue=we=>{le.x<=10&&le.y<=10?we.preventDefault():w.contains(we.target)||R(!1),document.removeEventListener("pointermove",ke),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",ke),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ke),document.removeEventListener("pointerup",ue,{capture:!0})}}},[w,R,L]),y.useEffect(()=>{const le=()=>R(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[R]);const[Y,q]=f6(le=>{const ke=E().filter(Ae=>!Ae.disabled),ue=ke.find(Ae=>Ae.ref.current===document.activeElement),we=h6(ke,le,ue);we&&setTimeout(()=>we.ref.current.focus())}),J=y.useCallback((le,ke,ue)=>{const we=!U.current&&!ue;(x.value!==void 0&&x.value===ke||we)&&(T(le),we&&(U.current=!0))},[x.value]),me=y.useCallback(()=>w==null?void 0:w.focus(),[w]),F=y.useCallback((le,ke,ue)=>{const we=!U.current&&!ue;(x.value!==void 0&&x.value===ke||we)&&I(le)},[x.value]),oe=r==="popper"?SA:Q3,se=oe===SA?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v}:{};return a.jsx(q3,{scope:n,content:w,viewport:C,onViewportChange:_,itemRefCallback:J,selectedItem:j,onItemLeave:me,itemTextRefCallback:F,focusSelectedItem:B,selectedItemText:k,position:r,isPositioned:O,searchRef:Y,children:a.jsx(J0,{as:Go,allowPinchZoom:!0,children:a.jsx(Q0,{asChild:!0,trapped:x.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Ne(i,le=>{var ke;(ke=x.trigger)==null||ke.focus({preventScroll:!0}),le.preventDefault()}),children:a.jsx(pg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:a.jsx(oe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:le=>le.preventDefault(),...b,...se,onPlaced:()=>M(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ne(b.onKeyDown,le=>{const ke=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!ke&&le.key.length===1&&q(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let we=E().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(le.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const Ae=le.target,ee=we.indexOf(Ae);we=we.slice(ee+1)}setTimeout(()=>D(we)),le.preventDefault()}})})})})})})});Y3.displayName=Fae;var Uae="SelectItemAlignedPosition",Q3=y.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,s=dl(wu,n),o=fl(wu,n),[c,l]=y.useState(null),[u,d]=y.useState(null),f=Pt(e,A=>d(A)),h=ew(n),p=y.useRef(!1),g=y.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=o,w=y.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&m&&v&&b){const A=s.trigger.getBoundingClientRect(),j=u.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),k=b.getBoundingClientRect();if(s.dir!=="rtl"){const Ae=k.left-j.left,ee=T.left-Ae,wt=A.left-ee,et=A.width+wt,Ct=Math.max(et,j.width),Xe=window.innerWidth-Ls,nn=xm(ee,[Ls,Math.max(Ls,Xe-Ct)]);c.style.minWidth=et+"px",c.style.left=nn+"px"}else{const Ae=j.right-k.right,ee=window.innerWidth-T.right-Ae,wt=window.innerWidth-A.right-ee,et=A.width+wt,Ct=Math.max(et,j.width),Xe=window.innerWidth-Ls,nn=xm(ee,[Ls,Math.max(Ls,Xe-Ct)]);c.style.minWidth=et+"px",c.style.right=nn+"px"}const I=h(),E=window.innerHeight-Ls*2,O=m.scrollHeight,M=window.getComputedStyle(u),U=parseInt(M.borderTopWidth,10),D=parseInt(M.paddingTop,10),B=parseInt(M.borderBottomWidth,10),R=parseInt(M.paddingBottom,10),L=U+D+O+R+B,Y=Math.min(v.offsetHeight*5,L),q=window.getComputedStyle(m),J=parseInt(q.paddingTop,10),me=parseInt(q.paddingBottom,10),F=A.top+A.height/2-Ls,oe=E-F,se=v.offsetHeight/2,le=v.offsetTop+se,ke=U+D+le,ue=L-ke;if(ke<=F){const Ae=I.length>0&&v===I[I.length-1].ref.current;c.style.bottom="0px";const ee=u.clientHeight-m.offsetTop-m.offsetHeight,wt=Math.max(oe,se+(Ae?me:0)+ee+B),et=ke+wt;c.style.height=et+"px"}else{const Ae=I.length>0&&v===I[0].ref.current;c.style.top="0px";const wt=Math.max(F,U+m.offsetTop+(Ae?J:0)+se)+ue;c.style.height=wt+"px",m.scrollTop=ke-F+m.offsetTop}c.style.margin=`${Ls}px 0`,c.style.minHeight=Y+"px",c.style.maxHeight=E+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,c,u,m,v,b,s.dir,r]);qr(()=>w(),[w]);const[S,C]=y.useState();qr(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const _=y.useCallback(A=>{A&&g.current===!0&&(w(),x==null||x(),g.current=!1)},[w,x]);return a.jsx(Hae,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:_,children:a.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:a.jsx(it.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Q3.displayName=Uae;var Bae="SelectPopperPosition",SA=y.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ls,...s}=t,o=tw(n);return a.jsx(CE,{...o,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});SA.displayName=Bae;var[Hae,dT]=Wf(wu,{}),CA="SelectViewport",X3=y.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,s=fl(CA,n),o=dT(CA,n),c=Pt(e,s.onViewportChange),l=y.useRef(0);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(Z0.Slot,{scope:n,children:a.jsx(it.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ne(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const p=Math.abs(l.current-d.scrollTop);if(p>0){const g=window.innerHeight-Ls*2,m=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),b=Math.max(m,v);if(b0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});X3.displayName=CA;var J3="SelectGroup",[zae,Vae]=Wf(J3),Gae=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Zs();return a.jsx(zae,{scope:n,id:i,children:a.jsx(it.div,{role:"group","aria-labelledby":i,...r,ref:e})})});Gae.displayName=J3;var Z3="SelectLabel",e6=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Vae(Z3,n);return a.jsx(it.div,{id:i.id,...r,ref:e})});e6.displayName=Z3;var Px="SelectItem",[Kae,t6]=Wf(Px),n6=y.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...o}=t,c=dl(Px,n),l=fl(Px,n),u=c.value===r,[d,f]=y.useState(s??""),[h,p]=y.useState(!1),g=Pt(e,x=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,x,r,i)}),m=Zs(),v=y.useRef("touch"),b=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A 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 a.jsx(Kae,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:y.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:a.jsx(Z0.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:a.jsx(it.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:Ne(o.onFocus,()=>p(!0)),onBlur:Ne(o.onBlur,()=>p(!1)),onClick:Ne(o.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:Ne(o.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:Ne(o.onPointerDown,x=>{v.current=x.pointerType}),onPointerMove:Ne(o.onPointerMove,x=>{var w;v.current=x.pointerType,i?(w=l.onItemLeave)==null||w.call(l):v.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ne(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:Ne(o.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(Oae.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});n6.displayName=Px;var qh="SelectItemText",r6=y.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...s}=t,o=dl(qh,n),c=fl(qh,n),l=t6(qh,n),u=Dae(qh,n),[d,f]=y.useState(null),h=Pt(e,b=>f(b),l.onItemTextChange,b=>{var x;return(x=c.itemTextRefCallback)==null?void 0:x.call(c,b,l.value,l.disabled)}),p=d==null?void 0:d.textContent,g=y.useMemo(()=>a.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return qr(()=>(m(g),()=>v(g)),[m,v,g]),a.jsxs(a.Fragment,{children:[a.jsx(it.span,{id:l.textId,...s,ref:h}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Rf.createPortal(s.children,o.valueNode):null]})});r6.displayName=qh;var i6="SelectItemIndicator",s6=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return t6(i6,n).isSelected?a.jsx(it.span,{"aria-hidden":!0,...r,ref:e}):null});s6.displayName=i6;var _A="SelectScrollUpButton",o6=y.forwardRef((t,e)=>{const n=fl(_A,t.__scopeSelect),r=dT(_A,t.__scopeSelect),[i,s]=y.useState(!1),o=Pt(e,r.onScrollButtonChange);return qr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?a.jsx(c6,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});o6.displayName=_A;var AA="SelectScrollDownButton",a6=y.forwardRef((t,e)=>{const n=fl(AA,t.__scopeSelect),r=dT(AA,t.__scopeSelect),[i,s]=y.useState(!1),o=Pt(e,r.onScrollButtonChange);return qr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?a.jsx(c6,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});a6.displayName=AA;var c6=y.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,s=fl("SelectScrollButton",n),o=y.useRef(null),c=ew(n),l=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),qr(()=>{var d;const u=c().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),a.jsx(it.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Ne(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ne(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ne(i.onPointerLeave,()=>{l()})})}),Wae="SelectSeparator",l6=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return a.jsx(it.div,{"aria-hidden":!0,...r,ref:e})});l6.displayName=Wae;var jA="SelectArrow",qae=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=tw(n),s=dl(jA,n),o=fl(jA,n);return s.open&&o.position==="popper"?a.jsx(_E,{...i,...r,ref:e}):null});qae.displayName=jA;function u6(t){return t===""||t===void 0}var d6=y.forwardRef((t,e)=>{const{value:n,...r}=t,i=y.useRef(null),s=Pt(e,i),o=Cg(n);return y.useEffect(()=>{const c=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==n&&d){const f=new Event("change",{bubbles:!0});d.call(c,n),c.dispatchEvent(f)}},[o,n]),a.jsx(AE,{asChild:!0,children:a.jsx("select",{...r,ref:s,defaultValue:n})})});d6.displayName="BubbleSelect";function f6(t){const e=Ar(t),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(o=>{const c=n.current+o;e(c),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(c)},[e]),s=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function h6(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=Yae(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Yae(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Qae=U3,p6=H3,Xae=V3,Jae=G3,Zae=K3,m6=W3,ece=X3,g6=e6,v6=n6,tce=r6,nce=s6,y6=o6,x6=a6,b6=l6;const Bn=Qae,Hn=Xae,$n=y.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(p6,{ref:r,className:Pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,a.jsx(Jae,{asChild:!0,children:a.jsx(Da,{className:"h-4 w-4 opacity-50"})})]}));$n.displayName=p6.displayName;const w6=y.forwardRef(({className:t,...e},n)=>a.jsx(y6,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",t),...e,children:a.jsx(fu,{className:"h-4 w-4"})}));w6.displayName=y6.displayName;const S6=y.forwardRef(({className:t,...e},n)=>a.jsx(x6,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",t),...e,children:a.jsx(Da,{className:"h-4 w-4"})}));S6.displayName=x6.displayName;const Ln=y.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>a.jsx(Zae,{children:a.jsxs(m6,{ref:i,className:Pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[a.jsx(w6,{}),a.jsx(ece,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),a.jsx(S6,{})]})}));Ln.displayName=m6.displayName;const rce=y.forwardRef(({className:t,...e},n)=>a.jsx(g6,{ref:n,className:Pe("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));rce.displayName=g6.displayName;const ie=y.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(v6,{ref:r,className:Pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(nce,{children:a.jsx(uo,{className:"h-4 w-4"})})}),a.jsx(tce,{children:e})]}));ie.displayName=v6.displayName;const ice=y.forwardRef(({className:t,...e},n)=>a.jsx(b6,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",t),...e}));ice.displayName=b6.displayName;const sce=Re.object({audienceBrief:Re.string().min(10,{message:"Audience brief must be at least 10 characters."}),researchObjective:Re.string().optional(),personaCount:Re.string().min(1,{message:"Number of personas is required."}),dataFile:Re.instanceof(FileList).optional(),llm_model:Re.string().optional()});function oce({onSubmit:t,isGenerating:e}){const[n,r]=y.useState(!1),[i,s]=y.useState(!1),[o,c]=y.useState({audience_brief:[],research_objective:[]}),[l,u]=y.useState(!1),[d,f]=y.useState(null),h=V0({resolver:G0(sce),defaultValues:{audienceBrief:"",researchObjective:"",personaCount:"5",llm_model:"gemini-2.5-pro"}}),p=h.watch("audienceBrief"),g=h.watch("researchObjective"),m=async()=>{var w,S,C,_,A,j,T,k,I,E,O;const b=p==null?void 0:p.trim(),x=g==null?void 0:g.trim();if(!b||b.length<10){ne.error("Audience brief too short",{description:"Please enter at least 10 characters in the audience brief"});return}if(!x||x.length<10){ne.error("Research objective too short",{description:"Please enter at least 10 characters in the research objective"});return}u(!0),f(null);try{const M=await da.enhanceAudienceBrief(b,x);c(M.data.suggestions||{audience_brief:[],research_objective:[]}),r(!0),s(!1);const U=(((S=(w=M.data.suggestions)==null?void 0:w.audience_brief)==null?void 0:S.length)||0)+(((_=(C=M.data.suggestions)==null?void 0:C.research_objective)==null?void 0:_.length)||0);ne.success("Enhancement suggestions generated",{description:`Generated ${U} suggestions to improve your research inputs`})}catch(M){console.error("Error enhancing audience brief:",M);let U="Please try again or modify your brief",D="Failed to generate suggestions";if(M&&typeof M=="object"){const B=M;B.code==="ECONNABORTED"||(A=B.message)!=null&&A.includes("timeout")?(D="Request timeout",U="The AI took too long to analyze your brief. Please try again."):((j=B.response)==null?void 0:j.status)===500?(D="Server error",U=((k=(T=B.response)==null?void 0:T.data)==null?void 0:k.message)||"The server encountered an error. Please try again later."):((I=B.response)==null?void 0:I.status)===400?(D="Invalid brief",U=((O=(E=B.response)==null?void 0:E.data)==null?void 0:O.message)||"Please check your audience brief and try again."):B.message&&(U=B.message)}else M instanceof Error&&(U=M.message);f(U),ne.error(D,{description:U,duration:5e3})}finally{u(!1)}},v=()=>{s(!i)};return a.jsx(W0,{...h,children:a.jsxs("form",{onSubmit:h.handleSubmit(t),className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-6",children:[a.jsx(yt,{control:h.control,name:"audienceBrief",render:({field:b})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Audience Brief"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Describe your target audience and research goals...",className:"h-40",...b})}),a.jsx(Mn,{children:"Provide details about the demographics, behaviors, and attitudes you want to explore"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:h.control,name:"researchObjective",render:({field:b})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Research Objective"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"What is the main research topic or objective you want to explore?",className:"h-32",...b})}),a.jsx(Mn,{children:"Specify your research focus to generate more targeted persona goals, frustrations, and scenarios"}),a.jsx(vt,{})]})}),a.jsx("div",{className:"space-y-3",children:a.jsx(X,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:!p||p.trim().length<10||!g||g.trim().length<10||l||e,className:"flex items-center gap-2 hover-transition",children:l?a.jsxs(a.Fragment,{children:[a.jsx(Xl,{className:"h-4 w-4 animate-spin"}),"Analyzing Research Inputs..."]}):a.jsxs(a.Fragment,{children:[a.jsx(hu,{className:"h-4 w-4"}),"Enhance Brief"]})})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(yt,{control:h.control,name:"dataFile",render:({field:{value:b,onChange:x,...w}})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Customer Data (Optional)"}),a.jsx(gt,{children:a.jsxs("div",{className:"border-2 border-dashed border-slate-200 rounded-lg p-6 flex flex-col items-center justify-center bg-slate-50 hover:bg-slate-100 transition cursor-pointer",children:[a.jsx(H_,{className:"h-10 w-10 text-slate-400 mb-2"}),a.jsx("p",{className:"text-sm text-slate-600 mb-1",children:"Upload customer data for more accurate personas"}),a.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Supports PDF, Office docs, images, and more"}),a.jsx(Ht,{...w,type:"file",multiple:!0,accept:".pdf,.docx,.pptx,.xlsx,.html,.xml,.rtf,.pages,.key,.epub,.txt,.csv,.jpg,.jpeg,.png",onChange:S=>{x(S.target.files)},className:"hidden",id:"data-file-input"}),a.jsxs(X,{type:"button",variant:"outline",size:"sm",onClick:()=>{var S;return(S=document.getElementById("data-file-input"))==null?void 0:S.click()},children:[a.jsx(h5,{className:"mr-2 h-4 w-4"}),"Select Files"]}),b&&b.length>0&&a.jsx("p",{className:"text-xs text-primary mt-2",children:b.length===1?b[0].name:`${b.length} files selected`})]})}),a.jsx(Mn,{children:"Upload existing customer data to create more realistic personas"}),a.jsx(vt,{})]})}),a.jsxs("div",{className:"bg-muted/30 p-4 rounded-lg border border-border",children:[a.jsxs("div",{className:"flex items-center mb-2",children:[a.jsx(Yp,{className:"h-5 w-5 text-muted-foreground mr-2"}),a.jsx("h3",{className:"font-sf font-medium",children:"What's included?"})]}),a.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[a.jsxs("li",{className:"flex items-center",children:[a.jsx(zh,{className:"h-4 w-4 text-green-500 mr-2"}),"Demographic profiles based on your brief"]}),a.jsxs("li",{className:"flex items-center",children:[a.jsx(zh,{className:"h-4 w-4 text-green-500 mr-2"}),"Personality traits and behavioral patterns"]}),a.jsxs("li",{className:"flex items-center",children:[a.jsx(zh,{className:"h-4 w-4 text-green-500 mr-2"}),"Consumer preferences and interests"]}),a.jsxs("li",{className:"flex items-center",children:[a.jsx(zh,{className:"h-4 w-4 text-green-500 mr-2"}),"Review and refine capabilities"]})]})]})]})]}),n&&a.jsxs("div",{className:"glass-panel rounded-lg p-4 border border-border bg-muted/30",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("h3",{className:"font-sf font-medium text-sm flex items-center gap-2",children:[a.jsx(hu,{className:"h-4 w-4 text-primary"}),"Enhancement Suggestions:"]}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",onClick:v,className:"h-6 w-6 p-0 hover:bg-slate-200",title:i?"Expand suggestions":"Collapse suggestions",children:i?a.jsx(Da,{className:"h-4 w-4"}):a.jsx(fu,{className:"h-4 w-4"})})]}),!i&&a.jsx(a.Fragment,{children:d?a.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-md",children:d}):a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{children:o.audience_brief.length>0?a.jsxs("div",{children:[a.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[a.jsx(Fr,{className:"h-4 w-4 text-blue-600"}),"Suggestions for your Audience Brief:"]}),a.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.audience_brief.map((b,x)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-blue-600 mt-1.5 text-xs",children:"•"}),a.jsx("span",{className:"flex-1",children:b})]},x))})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"No audience brief suggestions available"})}),a.jsx("div",{children:o.research_objective.length>0?a.jsxs("div",{children:[a.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[a.jsx(Yp,{className:"h-4 w-4 text-green-600"}),"Suggestions for your Research Objective:"]}),a.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.research_objective.map((b,x)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-green-600 mt-1.5 text-xs",children:"•"}),a.jsx("span",{className:"flex-1",children:b})]},x))})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"No research objective suggestions available"})}),o.audience_brief.length===0&&o.research_objective.length===0&&a.jsx("div",{className:"col-span-full text-sm text-muted-foreground text-center",children:"No suggestions available"})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(yt,{control:h.control,name:"llm_model",render:({field:b})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"AI Model"}),a.jsxs(Bn,{onValueChange:b.onChange,defaultValue:b.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select AI model"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),a.jsx(ie,{value:"gpt-4.1",children:"GPT-4.1"}),a.jsx(ie,{value:"gpt-5",children:"GPT-5"})]})]}),a.jsx(Mn,{children:"Choose which AI model to use for generating personas"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:h.control,name:"personaCount",render:({field:b})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Number of Personas to Generate"}),a.jsx(gt,{children:a.jsx(Ht,{type:"number",min:"1",max:"20",...b})}),a.jsx(Mn,{children:"How many synthetic users do you need for your research?"}),a.jsx(vt,{})]})})]}),a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsx(X,{type:"submit",disabled:e,className:"min-w-36",children:e?a.jsxs(a.Fragment,{children:[a.jsx(Xl,{className:"mr-2 h-4 w-4 animate-spin"}),"AI Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Fr,{className:"mr-2 h-4 w-4"}),"Generate Personas"]})}),e&&a.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:"Generating multiple personas in parallel. This may take 1-2 minutes..."})]})]})})}const lt=y.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));lt.displayName="Card";const Ei=y.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",t),...e}));Ei.displayName="CardHeader";const Yi=y.forwardRef(({className:t,...e},n)=>a.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",t),...e}));Yi.displayName="CardTitle";const fT=y.forwardRef(({className:t,...e},n)=>a.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));fT.displayName="CardDescription";const Ot=y.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("p-6 pt-0",t),...e}));Ot.displayName="CardContent";const hT=y.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",t),...e}));hT.displayName="CardFooter";const ace=t=>{const e=t==null?void 0:t.toLowerCase(),n="/semblance/";switch(e){case"male":return`${n}male_avatar.png`;case"female":return`${n}female_avatar.png`;case"non-binary":case"nonbinary":case"non binary":return`${n}nonbinary_avatar.png`;default:return`${n}male_avatar.png`}},Ag=t=>t.avatar||ace(t.gender);function pT({user:t,selected:e=!1,onClick:n,showDetailedDialog:r=!1,onSelectionToggle:i,showAddToFolderButton:s=!1,onAddToFolder:o,onViewDetails:c,folders:l=[]}){const u=lr();y.useState(!1);const[d,f]=y.useState(t),h=t._id||t.id,p=v=>{v.stopPropagation(),u(`/synthetic-users/${h}`)};d.oceanTraits&&(d.oceanTraits.openness,d.oceanTraits.conscientiousness,d.oceanTraits.extraversion,d.oceanTraits.agreeableness,d.oceanTraits.neuroticism);const g=v=>{var w,S;const b=v.target;b.closest("button")&&((S=(w=b.closest("button"))==null?void 0:w.textContent)!=null&&S.includes("View Details"))||(i?i(v):n&&n(v))},m=v=>{v.stopPropagation(),c?c(d):p(v)};return a.jsxs("div",{className:Pe("persona-card glass-card rounded-xl p-4 cursor-pointer hover:shadow-md button-transition",e&&"selected ring-2 ring-primary"),onClick:g,children:[a.jsx("div",{className:"persona-card-overlay"}),a.jsx("div",{className:"persona-card-checkmark",children:a.jsx(uo,{className:"h-4 w-4 text-primary"})}),a.jsx("div",{className:"relative z-10",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center",children:a.jsx("img",{src:Ag(d),alt:`${d.name} avatar`,className:"h-12 w-12 rounded-full object-cover"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsx("h3",{className:"text-sm font-medium truncate flex-1",children:d.name})}),a.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[d.age," • ",d.gender]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d.occupation}),a.jsx("p",{className:"text-xs text-muted-foreground",children:d.location}),a.jsx("div",{className:"mt-2",children:d.aiSynthesizedBio?a.jsxs("p",{className:"text-xs text-slate-700 line-clamp-3 leading-relaxed",children:[d.aiSynthesizedBio,d.aiSynthesizedBio.length>150&&"..."]}):a.jsxs("p",{className:"text-xs text-muted-foreground italic line-clamp-3",children:['"',d.personality,'"']})}),d.qualitativeAttributes&&d.qualitativeAttributes.length>0&&a.jsx("div",{className:"mt-3",children:a.jsx("div",{className:"flex flex-wrap gap-1",children:d.qualitativeAttributes.slice(0,3).map((v,b)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded-full",children:[a.jsx(pZ,{className:"h-3 w-3"}),v]},b))})}),d.folder_ids&&d.folder_ids.length>0&&a.jsx("div",{className:"mt-2",children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[d.folder_ids.slice(0,2).map(v=>{const b=l.find(x=>x._id===v);return b?a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 text-xs rounded-full",title:`In folder: ${b.name}`,children:[a.jsx(hs,{className:"h-3 w-3"}),b.name]},v):null}),d.folder_ids.length>2&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 text-xs rounded-full",children:[a.jsx(Vr,{className:"h-3 w-3"}),d.folder_ids.length-2," more"]})]})}),d.topPersonalityTraits&&d.topPersonalityTraits.length>0&&a.jsx("div",{className:"mt-2",children:a.jsx("div",{className:"flex flex-wrap gap-1",children:d.topPersonalityTraits.slice(0,3).map((v,b)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-purple-50 text-purple-700 text-xs rounded-full",children:[a.jsx(du,{className:"h-3 w-3"}),v]},b))})}),a.jsx("div",{className:"mt-3 flex justify-end",children:a.jsx(X,{variant:"ghost",size:"sm",onClick:m,children:"View Details"})})]})]})})]})}var mT="Collapsible",[cce,dFe]=Ui(mT),[lce,gT]=cce(mT),C6=y.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...c}=t,[l=!1,u]=lo({prop:r,defaultProp:i,onChange:o});return a.jsx(lce,{scope:n,disabled:s,contentId:Zs(),open:l,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),children:a.jsx(it.div,{"data-state":yT(l),"data-disabled":s?"":void 0,...c,ref:e})})});C6.displayName=mT;var _6="CollapsibleTrigger",A6=y.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=gT(_6,n);return a.jsx(it.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":yT(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Ne(t.onClick,i.onOpenToggle)})});A6.displayName=_6;var vT="CollapsibleContent",j6=y.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=gT(vT,t.__scopeCollapsible);return a.jsx(Yr,{present:n||i.open,children:({present:s})=>a.jsx(uce,{...r,ref:e,present:s})})});j6.displayName=vT;var uce=y.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=t,o=gT(vT,n),[c,l]=y.useState(r),u=y.useRef(null),d=Pt(e,u),f=y.useRef(0),h=f.current,p=y.useRef(0),g=p.current,m=o.open||c,v=y.useRef(m),b=y.useRef();return y.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),qr(()=>{const x=u.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,p.current=w.width,v.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),l(r)}},[o.open,r]),a.jsx(it.div,{"data-state":yT(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:m&&i})});function yT(t){return t?"open":"closed"}var dce=C6;const jg=dce,Eg=A6,Ng=j6;function fce({generatedPersonas:t,selectedPersonas:e,isGenerating:n,onPersonaSelection:r,onRefinePersonas:i,onApprovePersonas:s,onBackToGenerator:o}){const c=lr(),[l,u]=y.useState(""),[d,f]=y.useState(!1),h=p=>{c(`/synthetic-users/${p}?fromReview=true`)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Review Generated Personas"}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.length," of ",t.length," selected"]})]}),a.jsx("div",{className:"space-y-4",children:t.map(p=>a.jsx(lt,{className:`border ${e.includes(p.id)?"border-primary/50 bg-primary/5":""} cursor-pointer`,onClick:()=>h(p.id),children:a.jsx(Ot,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("div",{className:"flex-1",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",id:`persona-${p.id}`,checked:e.includes(p.id),onChange:g=>{g.stopPropagation(),r(p.id)},className:"mr-3 h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium",children:p.name}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[p.age," • ",p.gender," • ",p.occupation]})]})]})}),a.jsx(pT,{user:p,showDetailedDialog:!1,onClick:g=>{g.stopPropagation(),h(p.id)}})]})})},p.id))}),a.jsx("div",{className:"space-y-4 pt-4 border-t",children:a.jsxs("div",{children:[a.jsx("div",{className:"flex justify-between items-start mb-4",children:a.jsxs(X,{variant:"outline",onClick:o,children:[a.jsx(Wp,{className:"mr-2 h-4 w-4"}),"Back to Generator"]})}),a.jsxs(jg,{open:d,onOpenChange:f,className:"w-full space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx(Eg,{asChild:!0,children:a.jsxs(X,{variant:"outline",className:"flex items-center gap-2",children:[a.jsx(Xl,{className:"h-4 w-4"}),"Refine Personas",a.jsx(Da,{className:"h-4 w-4 ml-1 transition-transform duration-200",style:{transform:d?"rotate(180deg)":"rotate(0deg)"}})]})}),a.jsxs(X,{onClick:s,disabled:e.length===0,children:[a.jsx(zh,{className:"mr-2 h-4 w-4"}),"Approve Selected (",e.length,")"]})]}),a.jsx(Ng,{children:a.jsx(lt,{className:"border shadow-sm w-full mt-4",children:a.jsx(Ot,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"refinement-prompt",className:"text-sm font-medium block mb-2",children:"Refinement Instructions"}),a.jsx(ht,{id:"refinement-prompt",placeholder:"Example: Make all personas 5 years younger, or ensure everyone is from different locations...",value:l,onChange:p=>u(p.target.value),className:"min-h-[100px] w-full resize-y"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Use natural language to describe how you'd like to refine the selected personas."})]}),a.jsxs(X,{onClick:()=>i(l),disabled:n||l.trim()==="",className:"w-full",children:[n?a.jsx(Xl,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(Xl,{className:"mr-2 h-4 w-4"}),"Apply Refinements"]})]})})})})]})]})})]})}async function hce(t,e,n,r,i,s){console.log(`generateSyntheticPersonas called with targetFolderId: ${i||"none"}`),console.log(`🔄 generateSyntheticPersonas using model: ${s||"gemini-2.5-pro"}`);try{if(console.log(`Generating ${n} synthetic personas using two-stage approach...`),t.trim().length<10)throw new Error("Audience brief is too short. Please provide more context for better persona generation.");let o;if(r&&r.length>0){console.log(`Uploading ${r.length} customer data files...`);try{o=(await da.uploadCustomerData(r)).data.session_id,console.log(`Customer data uploaded with session ID: ${o}`)}catch(l){throw console.error("Failed to upload customer data:",l),new Error("Failed to upload customer data files. Please try again.")}}const c=await da.batchGenerateWithStages(t,e,n,.8,o,s);if(c.data){const l=c.data.partial_success===!0,u=c.data.personas&&c.data.personas.length>0,d=c.data.errors&&c.data.errors.length>0;if(u){if(console.log(`Generated ${c.data.personas.length} personas with two-stage process${d?` (${c.data.errors.length} failed)`:""}`),i){const f=c.data.personas,h=f.map(p=>p._id||p.id).filter(Boolean);console.log(`Adding ${h.length} newly generated personas to folder: ${i}`);try{await Po.addPersonasBatch(i,h),console.log(`Added ${h.length} newly generated personas to folder: ${i}`)}catch(p){console.error("Error adding personas to folder:",p)}if(o)try{await da.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(p){console.warn("Failed to cleanup customer data:",p)}return l||d?{...c.data,length:f.length}:{...c.data,personas:f}}if(o)try{await da.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}if(l||d)return{...c.data.personas,length:c.data.personas.length,partial_success:l,errors:c.data.errors};if(o)try{await da.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}return c.data.personas}else if(d){if(o)try{await da.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}throw new Error(`Failed to generate personas: ${c.data.errors.length} generation attempts failed.`)}else throw new Error("No personas returned from API")}else throw new Error("Invalid response format from API")}catch(o){if(customerDataSessionId)try{await da.cleanupCustomerData(customerDataSessionId),console.log(`Cleaned up customer data for session: ${customerDataSessionId}`)}catch(c){console.warn("Failed to cleanup customer data:",c)}throw console.error("Error generating AI personas:",o),o}}function E6(){const[t,e]=y.useState([]),n=async s=>{const o=[];for(const c of s){const l={...c};l._id&&typeof l._id=="string"&&l._id.startsWith("local-")&&delete l._id;const u=await $r.create(l);console.log("Persona saved to database:",u.data),o.push({...c,id:u.data._id||u.data.id,_id:u.data._id||u.data.id,isDbPersona:!0})}e(o)},r=async()=>{const s=await $r.getAll();return s&&s.data&&Array.isArray(s.data)?(console.log("Personas loaded from database:",s.data.length),s.data.map(o=>({...o,id:o._id||o.id,isDbPersona:!0}))):[]};return y.useEffect(()=>{(async()=>{const o=await r();e(o)})()},[]),{storedPersonas:t,savePersonas:n,loadPersonas:r,clearPersonas:async()=>{const s=await r();for(const o of s)o._id&&await $r.delete(o._id);e([])}}}function pce({targetFolderId:t,targetFolderName:e}){const n=Bi(),r=lr(),{loadPersonas:i,savePersonas:s}=E6(),[o,c]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState([]),[h,p]=y.useState(!1),[g,m]=y.useState(0);y.useEffect(()=>{const C=new URLSearchParams(n.search),_=C.get("mode"),A=C.get("tab"),j=C.get("step");if(_==="create"&&A==="ai"&&j==="review"){const T=i();T.length>0&&(u(T),f(T.map(k=>k.id)),p(!0))}},[n,i]);async function v(C){var _,A,j,T,k,I,E,O,M,U;try{c(!0),m(0);const D=parseInt(C.personaCount);if(isNaN(D)||D<1||D>10){ne.error("Invalid number of personas",{description:"Please enter a number between 1 and 10"}),c(!1);return}m(5);const B=setInterval(()=>{m(q=>q<90?q+Math.random()*5:q)},500),R=D<=2?"30-60 seconds":D<=4?"1-2 minutes":D<=6?"2-3 minutes":"3-5 minutes";D>4&&ne.info("Generation may take longer",{description:`Generating ${D} personas at once may result in some timeouts. If this happens, the successfully created personas will still be saved.`,duration:8e3}),ne.info("Generating AI personas in parallel",{description:`Creating ${D} synthetic personas based on your brief. This may take ${R}. Please be patient.`,duration:1e4}),t&&e?(console.log(`Target folder for new personas: ID=${t}, Name=${e}`),ne.info(`Creating personas in "${e}" folder`,{duration:3e3})):console.log("No target folder specified for new personas"),console.log(`🤖 Starting persona generation with model: ${C.llm_model||"gemini-2.5-pro"}`);const L=await hce(C.audienceBrief,C.researchObjective,D,C.dataFile,t,C.llm_model),Y=L.personas||L;if(clearInterval(B),m(100),Y&&Y.length>0)console.log(`✅ Successfully generated ${Y.length} personas using model: ${C.llm_model||"gemini-2.5-pro"}`),L.partial_success||L.errors&&L.errors.length>0?(ne.success("Some personas generated successfully",{description:`${Y.length} synthetic personas were created using ${C.llm_model||"Gemini 2.5 Pro"}. ${((_=L.errors)==null?void 0:_.length)||0} failed due to timeout or other errors.`,duration:8e3}),L.errors&&L.errors.length>0&&setTimeout(()=>{ne.error("Some personas failed to generate",{description:`${L.errors.length} personas timed out. The server took too long to generate them. The successfully generated personas have been saved${t?" in the selected folder":""}.`,duration:1e4})},1e3)):ne.success("Personas generated and saved successfully",{description:`${Y.length} synthetic personas have been created using ${C.llm_model||"Gemini 2.5 Pro"} and saved ${t?`to the "${e}" folder`:"to the database"}.`}),r("/synthetic-users?mode=view");else throw new Error("No personas were generated")}catch(D){console.error(`❌ Error generating personas using model: ${C.llm_model||"gemini-2.5-pro"}:`,D);let B="Please try again or adjust your parameters",R="Failed to generate personas";D.code==="ECONNABORTED"||(A=D.message)!=null&&A.includes("timeout")||((j=D.response)==null?void 0:j.status)===504?(R="Generation timeout",B="AI persona generation timed out. This often happens when generating multiple complex personas. Try generating fewer personas (2-3) or try again later."):((T=D.response)==null?void 0:T.status)===500?(R="Server error",(I=(k=D.response)==null?void 0:k.data)!=null&&I.message?B=D.response.data.message:(O=(E=D.response)==null?void 0:E.data)!=null&&O.error?B=D.response.data.error:B="The server encountered an error processing your request. Please try again later."):((M=D.response)==null?void 0:M.status)===401?(R="Authentication required",B="Please log in to generate personas."):(U=D.message)!=null&&U.includes("504 Deadline Exceeded")?(R="Generation timeout",B="The AI model took too long to generate personas. Try generating fewer personas or simplify your brief."):D instanceof Error&&(B=D.message),ne.error(R,{description:B,duration:6e3})}finally{setTimeout(()=>{c(!1),m(0)},500)}}const b=C=>{f(_=>_.includes(C)?_.filter(A=>A!==C):[..._,C])},x=(C,_)=>{const A=_.toLowerCase();return C.map(j=>{const T={...j};if(A.includes("younger")){const k=parseInt(T.age);T.age=(k-5).toString()}else if(A.includes("older")){const k=parseInt(T.age);T.age=(k+5).toString()}if(A.includes("different locations")&&(T.location=`${T.location} (Diversified)`),A.includes("more extroverted")?T.personality=`Extroverted, ${T.personality.toLowerCase()}`:A.includes("more introverted")&&(T.personality=`Introverted, ${T.personality.toLowerCase()}`),A.includes("diverse")){const k=["tech-savvy","traditional","innovative","conservative","creative"],I=k[Math.floor(Math.random()*k.length)];T.personality=`${I}, ${T.personality}`}return T})},w=C=>{if(!C.trim()){ne.error("Please provide refinement instructions");return}c(!0),setTimeout(()=>{try{const _=l.filter(T=>d.includes(T.id)),A=x(_,C),j=l.map(T=>A.find(I=>I.id===T.id)||T);u(j),c(!1),s(j),ne.success("Personas refined based on your instructions",{description:"Review the updated profiles"})}catch(_){console.error("Error refining personas:",_),ne.error("Failed to refine personas",{description:"Please try different instructions"}),c(!1)}},1500)},S=()=>{const C=l.filter(_=>d.includes(_.id));ne.success(`${C.length} personas approved`,{description:"Added to your synthetic persona library"}),s(C),r("/synthetic-users?mode=view")};return a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Fr,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Persona Recruiter"})]}),o&&a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("span",{className:"text-sm font-medium",children:"Generating personas in parallel..."}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[Math.round(g),"%"]})]}),a.jsx($l,{value:g,className:"h-2"})]}),h?a.jsx(fce,{generatedPersonas:l,selectedPersonas:d,isGenerating:o,onPersonaSelection:b,onRefinePersonas:w,onApprovePersonas:S,onBackToGenerator:()=>p(!1)}):a.jsx(oce,{onSubmit:v,isGenerating:o})]})}const il=new Map;function N6(t){const{id:e,title:n,description:r,type:i="default",duration:s}=t;let o;switch(i){case"success":o=ne.success(n,{description:r,duration:s});break;case"error":o=ne.error(n,{description:r,duration:s});break;case"warning":o=ne.warning(n,{description:r,duration:s});break;case"info":o=ne.info(n,{description:r,duration:s});break;default:o=ne(n,{description:r,duration:s});break}return il.set(e,o.toString()),e}function mce(t,e){const n=il.get(t);if(!n)return console.warn(`Toast with ID "${t}" not found. Creating new toast instead.`),N6({id:t,...e,title:e.title||"Updated"}),!1;const{title:r,description:i,type:s="default",duration:o}=e;ne.dismiss(n);let c;switch(s){case"success":c=ne.success(r,{description:i,duration:o});break;case"error":c=ne.error(r,{description:i,duration:o});break;case"warning":c=ne.warning(r,{description:i,duration:o});break;case"info":c=ne.info(r,{description:i,duration:o});break;default:c=ne(r,{description:i,duration:o});break}return il.set(t,c.toString()),!0}function gce(t){const e=il.get(t);return e?(ne.dismiss(e),il.delete(t),!0):(console.warn(`Toast with ID "${t}" not found.`),!1)}function vce(t){return il.has(t)}function yce(){il.forEach(t=>{ne.dismiss(t)}),il.clear()}const Fe={success:ne.success,error:ne.error,warning:ne.warning,info:ne.info,loading:ne.loading,dismiss:ne.dismiss,createPersistent:N6,updatePersistent:mce,dismissPersistent:gce,hasPersistent:vce,dismissAllPersistent:yce};var T6=["PageUp","PageDown"],P6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],k6={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},qf="Slider",[EA,xce,bce]=Y0(qf),[O6,fFe]=Ui(qf,[bce]),[wce,nw]=O6(qf),I6=y.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:g,...m}=t,v=y.useRef(new Set),b=y.useRef(0),w=o==="horizontal"?Sce:Cce,[S=[],C]=lo({prop:d,defaultProp:u,onChange:I=>{var O;(O=[...v.current][b.current])==null||O.focus(),f(I)}}),_=y.useRef(S);function A(I){const E=Nce(S,I);k(I,E)}function j(I){k(I,b.current)}function T(){const I=_.current[b.current];S[b.current]!==I&&h(S)}function k(I,E,{commit:O}={commit:!1}){const M=Oce(s),U=Ice(Math.round((I-r)/s)*s+r,M),D=xm(U,[r,i]);C((B=[])=>{const R=jce(B,D,E);if(kce(R,l*s)){b.current=R.indexOf(D);const L=String(R)!==String(B);return L&&O&&h(R),L?R:B}else return B})}return a.jsx(wce,{scope:t.__scopeSlider,name:n,disabled:c,min:r,max:i,valueIndexToChangeRef:b,thumbs:v.current,values:S,orientation:o,form:g,children:a.jsx(EA.Provider,{scope:t.__scopeSlider,children:a.jsx(EA.Slot,{scope:t.__scopeSlider,children:a.jsx(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...m,ref:e,onPointerDown:Ne(m.onPointerDown,()=>{c||(_.current=S)}),min:r,max:i,inverted:p,onSlideStart:c?void 0:A,onSlideMove:c?void 0:j,onSlideEnd:c?void 0:T,onHomeKeyDown:()=>!c&&k(r,0,{commit:!0}),onEndKeyDown:()=>!c&&k(i,S.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:E})=>{if(!c){const U=T6.includes(I.key)||I.shiftKey&&P6.includes(I.key)?10:1,D=b.current,B=S[D],R=s*U*E;k(B+R,D,{commit:!0})}}})})})})});I6.displayName=qf;var[R6,M6]=O6(qf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Sce=y.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=t,[f,h]=y.useState(null),p=Pt(e,w=>h(w)),g=y.useRef(),m=Ou(i),v=m==="ltr",b=v&&!s||!v&&s;function x(w){const S=g.current||f.getBoundingClientRect(),C=[0,S.width],A=xT(C,b?[n,r]:[r,n]);return g.current=S,A(w-S.left)}return a.jsx(R6,{scope:t.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:a.jsx(D6,{dir:m,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=x(w.clientX);o==null||o(S)},onSlideMove:w=>{const S=x(w.clientX);c==null||c(S)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:w=>{const C=k6[b?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:C?-1:1})}})})}),Cce=y.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:c,onStepKeyDown:l,...u}=t,d=y.useRef(null),f=Pt(e,d),h=y.useRef(),p=!i;function g(m){const v=h.current||d.current.getBoundingClientRect(),b=[0,v.height],w=xT(b,p?[r,n]:[n,r]);return h.current=v,w(m-v.top)}return a.jsx(R6,{scope:t.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:a.jsx(D6,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const v=g(m.clientY);s==null||s(v)},onSlideMove:m=>{const v=g(m.clientY);o==null||o(v)},onSlideEnd:()=>{h.current=void 0,c==null||c()},onStepKeyDown:m=>{const b=k6[p?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:b?-1:1})}})})}),D6=y.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:l,...u}=t,d=nw(qf,n);return a.jsx(it.span,{...u,ref:e,onKeyDown:Ne(t.onKeyDown,f=>{f.key==="Home"?(o(f),f.preventDefault()):f.key==="End"?(c(f),f.preventDefault()):T6.concat(P6).includes(f.key)&&(l(f),f.preventDefault())}),onPointerDown:Ne(t.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:Ne(t.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:Ne(t.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),$6="SliderTrack",L6=y.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=nw($6,n);return a.jsx(it.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});L6.displayName=$6;var NA="SliderRange",F6=y.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=nw(NA,n),s=M6(NA,n),o=y.useRef(null),c=Pt(e,o),l=i.values.length,u=i.values.map(h=>B6(h,i.min,i.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return a.jsx(it.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:c,style:{...t.style,[s.startEdge]:d+"%",[s.endEdge]:f+"%"}})});F6.displayName=NA;var TA="SliderThumb",U6=y.forwardRef((t,e)=>{const n=xce(t.__scopeSlider),[r,i]=y.useState(null),s=Pt(e,c=>i(c)),o=y.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return a.jsx(_ce,{...t,ref:s,index:o})}),_ce=y.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=nw(TA,n),c=M6(TA,n),[l,u]=y.useState(null),d=Pt(e,x=>u(x)),f=l?o.form||!!l.closest("form"):!0,h=gg(l),p=o.values[r],g=p===void 0?0:B6(p,o.min,o.max),m=Ece(r,o.values.length),v=h==null?void 0:h[c.size],b=v?Tce(v,g,c.direction):0;return y.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${g}% + ${b}px)`},children:[a.jsx(EA.ItemSlot,{scope:t.__scopeSlider,children:a.jsx(it.span,{role:"slider","aria-label":t["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:d,style:p===void 0?{display:"none"}:t.style,onFocus:Ne(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),f&&a.jsx(Ace,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},r)]})});U6.displayName=TA;var Ace=t=>{const{value:e,...n}=t,r=y.useRef(null),i=Cg(e);return y.useEffect(()=>{const s=r.current,o=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(o,"value").set;if(i!==e&&l){const u=new Event("input",{bubbles:!0});l.call(s,e),s.dispatchEvent(u)}},[i,e]),a.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function jce(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function B6(t,e,n){const s=100/(n-e)*(t-e);return xm(s,[0,100])}function Ece(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Nce(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function Tce(t,e,n){const r=t/2,s=xT([0,50],[0,r]);return(r-s(e)*n)*n}function Pce(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function kce(t,e){if(e>0){const n=Pce(t);return Math.min(...n)>=e}return!0}function xT(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Oce(t){return(String(t).split(".")[1]||"").length}function Ice(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var H6=I6,Rce=L6,Mce=F6,Dce=U6;const Sr=y.forwardRef(({className:t,...e},n)=>a.jsxs(H6,{ref:n,className:Pe("relative flex w-full touch-none select-none items-center",t),...e,children:[a.jsx(Rce,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(Mce,{className:"absolute h-full bg-primary"})}),a.jsx(Dce,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Sr.displayName=H6.displayName;var bT="Switch",[$ce,hFe]=Ui(bT),[Lce,Fce]=$ce(bT),z6=y.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:o,disabled:c,value:l="on",onCheckedChange:u,form:d,...f}=t,[h,p]=y.useState(null),g=Pt(e,w=>p(w)),m=y.useRef(!1),v=h?d||!!h.closest("form"):!0,[b=!1,x]=lo({prop:i,defaultProp:s,onChange:u});return a.jsxs(Lce,{scope:n,checked:b,disabled:c,children:[a.jsx(it.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":K6(b),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:g,onClick:Ne(t.onClick,w=>{x(S=>!S),v&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),v&&a.jsx(Uce,{control:h,bubbles:!m.current,name:r,value:l,checked:b,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});z6.displayName=bT;var V6="SwitchThumb",G6=y.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Fce(V6,n);return a.jsx(it.span,{"data-state":K6(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});G6.displayName=V6;var Uce=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=y.useRef(null),o=Cg(n),c=gg(e);return y.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[o,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function K6(t){return t?"checked":"unchecked"}var W6=z6,Bce=G6;const bm=y.forwardRef(({className:t,...e},n)=>a.jsx(W6,{className:Pe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:a.jsx(Bce,{className:Pe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));bm.displayName=W6.displayName;function Hce(t,e=[]){let n=[];function r(s,o){const c=y.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,v=y.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:v,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=y.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>y.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return y.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,zce(i,...e)]}function zce(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var tC="rovingFocusGroup.onEntryFocus",Vce={bubbles:!1,cancelable:!0},rw="RovingFocusGroup",[PA,q6,Gce]=Y0(rw),[Kce,Yf]=Hce(rw,[Gce]),[Wce,qce]=Kce(rw),Y6=y.forwardRef((t,e)=>a.jsx(PA.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(PA.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(Yce,{...t,ref:e})})}));Y6.displayName=rw;var Yce=y.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,h=y.useRef(null),p=Pt(e,h),g=Ou(s),[m=null,v]=lo({prop:o,defaultProp:c,onChange:l}),[b,x]=y.useState(!1),w=Ar(u),S=q6(n),C=y.useRef(!1),[_,A]=y.useState(0);return y.useEffect(()=>{const j=h.current;if(j)return j.addEventListener(tC,w),()=>j.removeEventListener(tC,w)},[w]),a.jsx(Wce,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:m,onItemFocus:y.useCallback(j=>v(j),[v]),onItemShiftTab:y.useCallback(()=>x(!0),[]),onFocusableItemAdd:y.useCallback(()=>A(j=>j+1),[]),onFocusableItemRemove:y.useCallback(()=>A(j=>j-1),[]),children:a.jsx(it.div,{tabIndex:b||_===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...t.style},onMouseDown:Ne(t.onMouseDown,()=>{C.current=!0}),onFocus:Ne(t.onFocus,j=>{const T=!C.current;if(j.target===j.currentTarget&&T&&!b){const k=new CustomEvent(tC,Vce);if(j.currentTarget.dispatchEvent(k),!k.defaultPrevented){const I=S().filter(D=>D.focusable),E=I.find(D=>D.active),O=I.find(D=>D.id===m),U=[E,O,...I].filter(Boolean).map(D=>D.ref.current);J6(U,d)}}C.current=!1}),onBlur:Ne(t.onBlur,()=>x(!1))})})}),Q6="RovingFocusGroupItem",X6=y.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=t,c=Zs(),l=s||c,u=qce(Q6,n),d=u.currentTabStopId===l,f=q6(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=u;return y.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),a.jsx(PA.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:a.jsx(it.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:e,onMouseDown:Ne(t.onMouseDown,g=>{r?u.onItemFocus(l):g.preventDefault()}),onFocus:Ne(t.onFocus,()=>u.onItemFocus(l)),onKeyDown:Ne(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=Jce(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(x=>x.focusable).map(x=>x.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const x=b.indexOf(g.currentTarget);b=u.loop?Zce(b,x+1):b.slice(x+1)}setTimeout(()=>J6(b))}})})})});X6.displayName=Q6;var Qce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Xce(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Jce(t,e,n){const r=Xce(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Qce[r]}function J6(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Zce(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var wT=Y6,ST=X6,CT="Tabs",[ele,pFe]=Ui(CT,[Yf]),Z6=Yf(),[tle,_T]=ele(CT),eH=y.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:c,activationMode:l="automatic",...u}=t,d=Ou(c),[f,h]=lo({prop:r,onChange:i,defaultProp:s});return a.jsx(tle,{scope:n,baseId:Zs(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:l,children:a.jsx(it.div,{dir:d,"data-orientation":o,...u,ref:e})})});eH.displayName=CT;var tH="TabsList",nH=y.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,s=_T(tH,n),o=Z6(n);return a.jsx(wT,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:r,children:a.jsx(it.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});nH.displayName=tH;var rH="TabsTrigger",iH=y.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=t,o=_T(rH,n),c=Z6(n),l=aH(o.baseId,r),u=cH(o.baseId,r),d=r===o.value;return a.jsx(ST,{asChild:!0,...c,focusable:!i,active:d,children:a.jsx(it.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:e,onMouseDown:Ne(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:Ne(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:Ne(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!i&&f&&o.onValueChange(r)})})})});iH.displayName=rH;var sH="TabsContent",oH=y.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...o}=t,c=_T(sH,n),l=aH(c.baseId,r),u=cH(c.baseId,r),d=r===c.value,f=y.useRef(d);return y.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),a.jsx(Yr,{present:i||d,children:({present:h})=>a.jsx(it.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});oH.displayName=sH;function aH(t,e){return`${t}-trigger-${e}`}function cH(t,e){return`${t}-content-${e}`}var nle=eH,lH=nH,uH=iH,dH=oH;const hl=nle,Ka=y.forwardRef(({className:t,...e},n)=>a.jsx(lH,{ref:n,className:Pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));Ka.displayName=lH.displayName;const gn=y.forwardRef(({className:t,...e},n)=>a.jsx(uH,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...e}));gn.displayName=uH.displayName;const vn=y.forwardRef(({className:t,...e},n)=>a.jsx(dH,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));vn.displayName=dH.displayName;const rle=Re.object({name:Re.string().min(2,{message:"Name must be at least 2 characters."}),age:Re.string().min(1,{message:"Age is required."}),gender:Re.string().min(1,{message:"Gender is required."}),occupation:Re.string().min(2,{message:"Occupation is required."}),education:Re.string().min(1,{message:"Education is required."}),location:Re.string().min(2,{message:"Location is required."}),ethnicity:Re.string().optional(),personality:Re.string(),interests:Re.string(),hasPurchasingPower:Re.boolean().optional(),hasChildren:Re.boolean().optional(),techSavviness:Re.number().min(0).max(100),brandLoyalty:Re.number().min(0).max(100),priceConsciousness:Re.number().min(0).max(100),environmentalConcern:Re.number().min(0).max(100),socialGrade:Re.string().optional(),householdIncome:Re.string().optional(),householdComposition:Re.string().optional(),livingSituation:Re.string().optional(),goals:Re.array(Re.string()).optional(),frustrations:Re.array(Re.string()).optional(),motivations:Re.array(Re.string()).optional(),scenarios:Re.array(Re.string()).optional(),scenarioType:Re.string().optional(),oceanTraits:Re.object({openness:Re.number().min(0).max(100),conscientiousness:Re.number().min(0).max(100),extraversion:Re.number().min(0).max(100),agreeableness:Re.number().min(0).max(100),neuroticism:Re.number().min(0).max(100)}).optional(),thinkFeelDo:Re.object({thinks:Re.array(Re.string()),feels:Re.array(Re.string()),does:Re.array(Re.string())}).optional(),mediaConsumption:Re.string().optional(),deviceUsage:Re.string().optional(),shoppingHabits:Re.string().optional(),brandPreferences:Re.string().optional(),communicationPreferences:Re.string().optional(),paymentMethods:Re.string().optional(),purchaseBehaviour:Re.string().optional(),coreValues:Re.string().optional(),lifestyleChoices:Re.string().optional(),socialActivities:Re.string().optional(),categoryKnowledge:Re.string().optional(),decisionInfluences:Re.string().optional(),painPoints:Re.string().optional(),journeyContext:Re.string().optional(),keyTouchpoints:Re.string().optional(),selfDeterminationNeeds:Re.object({autonomy:Re.string(),competence:Re.string(),relatedness:Re.string()}).optional(),fears:Re.array(Re.string()).optional(),narrative:Re.string().optional(),additionalInformation:Re.string().optional()});function ile({targetFolderId:t,targetFolderName:e}){const[n,r]=y.useState(1),[i,s]=y.useState(!1),[o,c]=y.useState(!1),[l,u]=y.useState(0),d=lr(),{isAuthenticated:f,login:h}=Zo();y.useEffect(()=>{u(0)},[]),y.useEffect(()=>{(async()=>{if(!f&&!o){c(!0);try{console.log("Attempting auto login with default credentials"),await h("user","pass"),console.log("Auto login successful");const A=localStorage.getItem("auth_token");A?(console.log("Token successfully stored:",A.substring(0,10)+"..."),Fe.success("Logged in automatically with default account")):(console.error("Token not stored after successful login"),Fe.error("Authentication problem, token not stored"))}catch(A){console.error("Auto login failed:",A)}finally{c(!1)}}})()},[]);const p=V0({resolver:G0(rle),defaultValues:{name:"",age:"",gender:"",occupation:"",education:"",location:"",ethnicity:"",personality:"",interests:"",hasPurchasingPower:!1,hasChildren:!1,techSavviness:50,brandLoyalty:50,priceConsciousness:50,environmentalConcern:50,socialGrade:"",householdIncome:"",householdComposition:"",livingSituation:"",goals:[],frustrations:[],motivations:[],scenarios:[],scenarioType:"",oceanTraits:{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:{thinks:[],feels:[],does:[]},mediaConsumption:"",deviceUsage:"",shoppingHabits:"",brandPreferences:"",communicationPreferences:"",paymentMethods:"",purchaseBehaviour:"",coreValues:"",lifestyleChoices:"",socialActivities:"",categoryKnowledge:"",decisionInfluences:"",painPoints:"",journeyContext:"",keyTouchpoints:"",selfDeterminationNeeds:{autonomy:"",competence:"",relatedness:""},fears:[],narrative:"",additionalInformation:""}}),g=_=>{const A=p.getValues(_)||[];p.setValue(_,[...A,""])},m=(_,A,j)=>{const k=[...p.getValues(_)||[]];k[A]=j,p.setValue(_,k)},v=(_,A)=>{const T=[...p.getValues(_)||[]];T.splice(A,1),p.setValue(_,T)},b=_=>{const A=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},j={...A,[_]:[...A[_]||[],""]};p.setValue("thinkFeelDo",j)},x=(_,A,j)=>{const T=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},k=[...T[_]||[]];k[A]=j;const I={...T,[_]:k};p.setValue("thinkFeelDo",I)},w=(_,A)=>{const j=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},T=[...j[_]||[]];T.splice(A,1);const k={...j,[_]:T};p.setValue("thinkFeelDo",k)},S=(_,A)=>{const T={...p.getValues("oceanTraits")||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},[_]:A};p.setValue("oceanTraits",T)};async function C(_,A=!1){var j,T,k,I,E;if(A&&l>=1){console.log("Max retry attempts reached, stopping retry loop"),Fe.error("Authentication failed after multiple attempts",{description:"Please try logging in manually (user/pass)"}),d("/login",{state:{from:"/synthetic-users"}}),s(!1);return}A?(u(O=>O+1),console.log(`Retry attempt ${l+1}`)):u(0),s(!0);try{if(!f)try{console.log("Not authenticated, attempting login with default credentials before submission"),await h("user","pass"),console.log("Login successful before persona creation")}catch(L){console.error("Login failed before persona creation:",L),Fe.error("Authentication required",{description:"Please log in before creating personas. Default: user/pass"}),d("/login",{state:{from:"/synthetic-users"}}),s(!1);return}const O=`persona-generation-${Date.now()}`,M=t&&e?` in "${e}" folder`:"",U=n>1?`${n} personas`:"persona";console.log(`UserCreator - Creating ${U}${M}`),Fe.createPersistent({id:O,title:`Generating ${U}...`,description:`Creating synthetic user profile${n>1?"s":""}${M}`,type:"info"});const D={..._,oceanTraits:_.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:_.thinkFeelDo||{thinks:[],feels:[],does:[]},folderId:t||void 0},B={id:`temp-${Date.now()}`,...D},R=JSON.parse(localStorage.getItem("tempPersonas")||"[]");if(R.push(B),localStorage.setItem("tempPersonas",JSON.stringify(R)),n===1)try{if(!localStorage.getItem("auth_token")){console.error("No authentication token found"),Fe.error("Authentication required",{description:"No valid token found. Please log in again."});try{console.log("No token found, attempting new login"),await h("user","pass"),console.log("Login successful, token:",((j=localStorage.getItem("auth_token"))==null?void 0:j.substring(0,10))+"...")}catch(q){throw console.error("Login retry failed:",q),new Error("Authentication failed after retry")}}console.log("Sending persona creation request to API with auth token");const Y=await $r.create(D);console.log("Persona created successfully:",Y),Fe.updatePersistent(O,{title:"Synthetic user created successfully",description:`Created profile for ${_.name}`,type:"success"})}catch(L){throw console.error("Error creating persona via API:",L),L.response&&L.response.status===401&&Fe.error("Authentication error",{description:"Failed to authenticate with server. Please try again."}),L}else{const L=[];L.push(D);for(let Y=1;Y{d("/synthetic-users?mode=view")},300)}catch(O){if(console.error("Error creating personas:",O),O.response&&O.response.status===401||O.message&&O.message.includes("Authentication failed")&&l<1)try{console.log("Got auth error, attempting login retry with default credentials"),localStorage.removeItem("auth_token");const M=await ty.login("user","pass");if((k=M==null?void 0:M.data)!=null&&k.access_token){localStorage.setItem("auth_token",M.data.access_token),localStorage.setItem("user",JSON.stringify(M.data.user)),console.log("Manual login successful, got new token:",M.data.access_token.substring(0,10)+"..."),Fe.info("Logged in with default account, retrying submission..."),setTimeout(()=>{C(_,!0)},500);return}else throw new Error("No access token received")}catch(M){console.error("Login retry failed:",M),Fe.error("Authentication error",{description:"Cannot authenticate with server. Please contact support."})}else Fe.updatePersistent(generationToastId,{title:"Failed to create synthetic users",description:((E=(I=O.response)==null?void 0:I.data)==null?void 0:E.message)||O.message||"An unexpected error occurred",type:"error"})}finally{s(!1)}}return a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h2",{className:"text-2xl font-sf font-semibold",children:"Create Synthetic Users"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(X,{variant:"outline",size:"sm",onClick:()=>r(Math.max(1,n-1)),children:"-"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Fr,{size:16,className:"text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:n})]}),a.jsx(X,{variant:"outline",size:"sm",onClick:()=>r(n+1),children:"+"})]})]}),a.jsx(W0,{...p,children:a.jsxs("form",{onSubmit:p.handleSubmit(C),className:"space-y-6",children:[a.jsxs(hl,{defaultValue:"basic",children:[a.jsxs(Ka,{className:"grid w-full grid-cols-6",children:[a.jsx(gn,{value:"basic",children:"Basic"}),a.jsx(gn,{value:"cooper",children:"Cooper"}),a.jsx(gn,{value:"personality",children:"Personality"}),a.jsx(gn,{value:"demographics",children:"Demographics"}),a.jsx(gn,{value:"lifestyle",children:"Lifestyle"}),a.jsx(gn,{value:"extended",children:"Extended"})]}),a.jsx(vn,{value:"basic",className:"mt-6",children:a.jsx(lt,{children:a.jsx(Ot,{className:"p-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"name",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Name"}),a.jsx(gt,{children:a.jsx(Ht,{placeholder:"Jane Smith",..._})}),a.jsx(vt,{})]})}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(yt,{control:p.control,name:"age",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Age Range"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select age range"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"18-24",children:"18-24"}),a.jsx(ie,{value:"25-34",children:"25-34"}),a.jsx(ie,{value:"35-44",children:"35-44"}),a.jsx(ie,{value:"45-54",children:"45-54"}),a.jsx(ie,{value:"55-64",children:"55-64"}),a.jsx(ie,{value:"65+",children:"65+"})]})]}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"gender",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Gender"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select gender"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Male",children:"Male"}),a.jsx(ie,{value:"Female",children:"Female"}),a.jsx(ie,{value:"Non-binary",children:"Non-binary"}),a.jsx(ie,{value:"Other",children:"Other"})]})]}),a.jsx(vt,{})]})})]}),a.jsx(yt,{control:p.control,name:"occupation",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Occupation"}),a.jsx(gt,{children:a.jsx(Ht,{placeholder:"Software Engineer",..._})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"education",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Education"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select education level"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"High School",children:"High School"}),a.jsx(ie,{value:"Some College",children:"Some College"}),a.jsx(ie,{value:"Associate's Degree",children:"Associate's Degree"}),a.jsx(ie,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),a.jsx(ie,{value:"Master's Degree",children:"Master's Degree"}),a.jsx(ie,{value:"PhD",children:"PhD"})]})]}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"location",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Location"}),a.jsx(gt,{children:a.jsx(Ht,{placeholder:"New York, USA",..._})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"ethnicity",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Ethnicity (Optional)"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select ethnicity"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"white",children:"White"}),a.jsx(ie,{value:"black",children:"Black"}),a.jsx(ie,{value:"asian",children:"Asian"}),a.jsx(ie,{value:"hispanic",children:"Hispanic/Latino"}),a.jsx(ie,{value:"native-american",children:"Native American"}),a.jsx(ie,{value:"middle-eastern",children:"Middle Eastern"}),a.jsx(ie,{value:"mixed",children:"Mixed"}),a.jsx(ie,{value:"other",children:"Other"}),a.jsx(ie,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]}),a.jsx(vt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"personality",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Personality Traits"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Curious, analytical, detail-oriented",..._,rows:3})}),a.jsx(Mn,{children:"Describe key personality traits that define this user"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"interests",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Interests"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Technology, fitness, cooking, travel",..._,rows:3})}),a.jsx(Mn,{children:"List interests, hobbies and activities this user enjoys"}),a.jsx(vt,{})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-medium text-sm",children:"Behavioral Attributes"}),a.jsx(yt,{control:p.control,name:"techSavviness",render:({field:_})=>a.jsxs(pt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(mt,{children:"Tech Savviness"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(gt,{children:a.jsx(Sr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"brandLoyalty",render:({field:_})=>a.jsxs(pt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(mt,{children:"Brand Loyalty"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(gt,{children:a.jsx(Sr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"priceConsciousness",render:({field:_})=>a.jsxs(pt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(mt,{children:"Price Consciousness"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(gt,{children:a.jsx(Sr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"environmentalConcern",render:({field:_})=>a.jsxs(pt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(mt,{children:"Environmental Concern"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(gt,{children:a.jsx(Sr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(vt,{})]})}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[a.jsx(yt,{control:p.control,name:"hasPurchasingPower",render:({field:_})=>a.jsxs(pt,{className:"flex items-center justify-between",children:[a.jsx(mt,{children:"Purchasing Power"}),a.jsx(gt,{children:a.jsx(bm,{checked:_.value,onCheckedChange:_.onChange})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"hasChildren",render:({field:_})=>a.jsxs(pt,{className:"flex items-center justify-between",children:[a.jsx(mt,{children:"Has Children"}),a.jsx(gt,{children:a.jsx(bm,{checked:_.value,onCheckedChange:_.onChange})}),a.jsx(vt,{})]})})]})]})]})]})})})}),a.jsxs(vn,{value:"cooper",className:"mt-6 space-y-6",children:[a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(p.watch("goals")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:_,onChange:j=>m("goals",A,j.target.value),placeholder:"Enter a goal"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>v("goals",A),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>g("goals"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(p.watch("frustrations")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:_,onChange:j=>m("frustrations",A,j.target.value),placeholder:"Enter a frustration"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>v("frustrations",A),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>g("frustrations"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(p.watch("motivations")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:_,onChange:j=>m("motivations",A,j.target.value),placeholder:"Enter a motivation"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>v("motivations",A),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>g("motivations"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).thinks||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:_,onChange:j=>x("thinks",A,j.target.value),placeholder:"What they think"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("thinks",A),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>b("thinks"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).feels||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:_,onChange:j=>x("feels",A,j.target.value),placeholder:"What they feel"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("feels",A),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>b("feels"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).does||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:_,onChange:j=>x("does",A,j.target.value),placeholder:"What they do"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("does",A),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>b("does"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),a.jsx(lt,{children:a.jsx(Ot,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"scenarioType",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Scenario Section Title"}),a.jsx(gt,{children:a.jsx(Ht,{placeholder:"Life Scenarios",..._})}),a.jsx(Mn,{children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'}),a.jsx(vt,{})]})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(p.watch("scenarios")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[a.jsx(ht,{value:_,onChange:j=>m("scenarios",A,j.target.value),rows:2,placeholder:"Describe a usage scenario"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>v("scenarios",A),className:"mt-2",children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>g("scenarios"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})]})})})]}),a.jsx(vn,{value:"personality",className:"mt-6",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{openness:50}).openness||50,"%"]})]}),a.jsx(Sr,{value:[(p.watch("oceanTraits")||{openness:50}).openness||50],onValueChange:_=>S("openness",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50,"%"]})]}),a.jsx(Sr,{value:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50],onValueChange:_=>S("conscientiousness",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50,"%"]})]}),a.jsx(Sr,{value:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50],onValueChange:_=>S("extraversion",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50,"%"]})]}),a.jsx(Sr,{value:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50],onValueChange:_=>S("agreeableness",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50,"%"]})]}),a.jsx(Sr,{value:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50],onValueChange:_=>S("neuroticism",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),a.jsx(vn,{value:"demographics",className:"mt-6",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"socialGrade",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Social Grade"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select social grade"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"A",children:"A - Higher managerial"}),a.jsx(ie,{value:"B",children:"B - Intermediate managerial"}),a.jsx(ie,{value:"C1",children:"C1 - Supervisory or clerical"}),a.jsx(ie,{value:"C2",children:"C2 - Skilled manual workers"}),a.jsx(ie,{value:"D",children:"D - Semi and unskilled manual workers"}),a.jsx(ie,{value:"E",children:"E - State pensioners, unemployed"})]})]}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"householdIncome",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Household Income"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select income range"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Under $25k",children:"Under $25,000"}),a.jsx(ie,{value:"$25k-$50k",children:"$25,000 - $50,000"}),a.jsx(ie,{value:"$50k-$75k",children:"$50,000 - $75,000"}),a.jsx(ie,{value:"$75k-$100k",children:"$75,000 - $100,000"}),a.jsx(ie,{value:"$100k-$150k",children:"$100,000 - $150,000"}),a.jsx(ie,{value:"$150k-$250k",children:"$150,000 - $250,000"}),a.jsx(ie,{value:"Over $250k",children:"Over $250,000"}),a.jsx(ie,{value:"Prefer not to say",children:"Prefer not to say"})]})]}),a.jsx(vt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"householdComposition",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Household Composition"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select household type"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Single person",children:"Single person"}),a.jsx(ie,{value:"Couple without children",children:"Couple without children"}),a.jsx(ie,{value:"Couple with children",children:"Couple with children"}),a.jsx(ie,{value:"Single parent",children:"Single parent"}),a.jsx(ie,{value:"Multi-generational",children:"Multi-generational"}),a.jsx(ie,{value:"Shared housing",children:"Shared housing"}),a.jsx(ie,{value:"Other",children:"Other"})]})]}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"livingSituation",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Living Situation"}),a.jsxs(Bn,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select living situation"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Own home",children:"Own home"}),a.jsx(ie,{value:"Rent apartment",children:"Rent apartment"}),a.jsx(ie,{value:"Rent house",children:"Rent house"}),a.jsx(ie,{value:"Live with family",children:"Live with family"}),a.jsx(ie,{value:"Student housing",children:"Student housing"}),a.jsx(ie,{value:"Assisted living",children:"Assisted living"}),a.jsx(ie,{value:"Other",children:"Other"})]})]}),a.jsx(vt,{})]})})]})]})]})})}),a.jsx(vn,{value:"lifestyle",className:"mt-6",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"mediaConsumption",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Media Consumption"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"TV shows, podcasts, news sources, social media platforms",..._,rows:3})}),a.jsx(Mn,{children:"Describe media consumption habits and preferences"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"deviceUsage",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Device Usage"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Smartphone, laptop, tablet, smart TV, gaming console",..._,rows:3})}),a.jsx(Mn,{children:"Primary devices and usage patterns"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"shoppingHabits",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Shopping Habits"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Online vs in-store, frequency, preferred retailers",..._,rows:3})}),a.jsx(Mn,{children:"Shopping behavior and preferences"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"brandPreferences",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Brand Preferences"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Favorite brands, brand values alignment",..._,rows:3})}),a.jsx(Mn,{children:"Preferred brands and reasoning"}),a.jsx(vt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"communicationPreferences",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Communication Preferences"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Email, phone, text, video calls, in-person",..._,rows:3})}),a.jsx(Mn,{children:"Preferred communication methods and channels"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"paymentMethods",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Payment Methods"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Credit cards, digital wallets, cash, BNPL",..._,rows:3})}),a.jsx(Mn,{children:"Preferred payment methods and financial tools"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"purchaseBehaviour",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Purchase Behavior"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Research habits, decision factors, impulse vs planned buying",..._,rows:3})}),a.jsx(Mn,{children:"How they approach making purchase decisions"}),a.jsx(vt,{})]})})]})]})]})})}),a.jsxs(vn,{value:"extended",className:"mt-6 space-y-6",children:[a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"coreValues",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Core Values"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Key principles and values that guide decisions",..._,rows:3})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"lifestyleChoices",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Lifestyle Choices"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Health, fitness, diet, work-life balance preferences",..._,rows:3})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"socialActivities",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Social Activities"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Social hobbies, community involvement, networking",..._,rows:3})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"categoryKnowledge",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Category Knowledge"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Expertise in specific product/service categories",..._,rows:3})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"decisionInfluences",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Decision Influences"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"What factors most influence their decisions",..._,rows:3})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"painPoints",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Pain Points"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Common challenges and friction points",..._,rows:3})}),a.jsx(vt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(yt,{control:p.control,name:"journeyContext",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Journey Context"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Current life stage and contextual factors",..._,rows:3})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"keyTouchpoints",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Key Touchpoints"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Important interaction points and channels",..._,rows:3})}),a.jsx(vt,{})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),a.jsx(yt,{control:p.control,name:"selfDeterminationNeeds.autonomy",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Autonomy"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Need for independence and self-direction",..._,rows:2})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"selfDeterminationNeeds.competence",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Competence"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Need to feel capable and effective",..._,rows:2})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"selfDeterminationNeeds.relatedness",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Relatedness"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Need for connection and belonging",..._,rows:2})}),a.jsx(vt,{})]})})]})]})]})]})}),a.jsx(lt,{children:a.jsx(Ot,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(p.watch("fears")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:_,onChange:j=>m("fears",A,j.target.value),placeholder:"Enter a fear or concern"}),a.jsx(X,{variant:"ghost",size:"icon",type:"button",onClick:()=>v("fears",A),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(X,{variant:"outline",size:"sm",type:"button",onClick:()=>g("fears"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),a.jsx(yt,{control:p.control,name:"narrative",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Personal Narrative"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Personal story, background, key life experiences",..._,rows:4})}),a.jsx(Mn,{children:"A brief narrative that captures their personal story"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:p.control,name:"additionalInformation",render:({field:_})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Additional Information"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Any other relevant details or context",..._,rows:4})}),a.jsx(Mn,{children:"Additional context or details not covered elsewhere"}),a.jsx(vt,{})]})})]})})})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(X,{variant:"outline",type:"button",onClick:()=>p.reset(),children:"Reset"}),a.jsxs(X,{type:"submit",disabled:i,children:[i?a.jsx(nZ,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(LE,{className:"mr-2 h-4 w-4"}),i?"Creating...":`Create ${n>1?`${n} Users`:"User"}`]})]})]})})]})}var kA=["Enter"," "],sle=["ArrowDown","PageUp","Home"],fH=["ArrowUp","PageDown","End"],ole=[...sle,...fH],ale={ltr:[...kA,"ArrowRight"],rtl:[...kA,"ArrowLeft"]},cle={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tg="Menu",[wm,lle,ule]=Y0(Tg),[Iu,hH]=Ui(Tg,[ule,$f,Yf]),iw=$f(),pH=Yf(),[dle,Ru]=Iu(Tg),[fle,Pg]=Iu(Tg),mH=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,c=iw(e),[l,u]=y.useState(null),d=y.useRef(!1),f=Ar(s),h=Ou(i);return y.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),a.jsx(O4,{...c,children:a.jsx(dle,{scope:e,open:n,onOpenChange:f,content:l,onContentChange:u,children:a.jsx(fle,{scope:e,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};mH.displayName=Tg;var hle="MenuAnchor",AT=y.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=iw(n);return a.jsx(SE,{...i,...r,ref:e})});AT.displayName=hle;var jT="MenuPortal",[ple,gH]=Iu(jT,{forceMount:void 0}),vH=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Ru(jT,e);return a.jsx(ple,{scope:e,forceMount:n,children:a.jsx(Yr,{present:n||s.open,children:a.jsx(f0,{asChild:!0,container:i,children:r})})})};vH.displayName=jT;var As="MenuContent",[mle,ET]=Iu(As),yH=y.forwardRef((t,e)=>{const n=gH(As,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ru(As,t.__scopeMenu),o=Pg(As,t.__scopeMenu);return a.jsx(wm.Provider,{scope:t.__scopeMenu,children:a.jsx(Yr,{present:r||s.open,children:a.jsx(wm.Slot,{scope:t.__scopeMenu,children:o.modal?a.jsx(gle,{...i,ref:e}):a.jsx(vle,{...i,ref:e})})})})}),gle=y.forwardRef((t,e)=>{const n=Ru(As,t.__scopeMenu),r=y.useRef(null),i=Pt(e,r);return y.useEffect(()=>{const s=r.current;if(s)return uT(s)},[]),a.jsx(NT,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ne(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vle=y.forwardRef((t,e)=>{const n=Ru(As,t.__scopeMenu);return a.jsx(NT,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),NT=y.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...m}=t,v=Ru(As,n),b=Pg(As,n),x=iw(n),w=pH(n),S=lle(n),[C,_]=y.useState(null),A=y.useRef(null),j=Pt(e,A,v.onContentChange),T=y.useRef(0),k=y.useRef(""),I=y.useRef(0),E=y.useRef(null),O=y.useRef("right"),M=y.useRef(0),U=g?J0:y.Fragment,D=g?{as:Go,allowPinchZoom:!0}:void 0,B=L=>{var le,ke;const Y=k.current+L,q=S().filter(ue=>!ue.disabled),J=document.activeElement,me=(le=q.find(ue=>ue.ref.current===J))==null?void 0:le.textValue,F=q.map(ue=>ue.textValue),oe=Tle(F,Y,me),se=(ke=q.find(ue=>ue.textValue===oe))==null?void 0:ke.ref.current;(function ue(we){k.current=we,window.clearTimeout(T.current),we!==""&&(T.current=window.setTimeout(()=>ue(""),1e3))})(Y),se&&setTimeout(()=>se.focus())};y.useEffect(()=>()=>window.clearTimeout(T.current),[]),lT();const R=y.useCallback(L=>{var q,J;return O.current===((q=E.current)==null?void 0:q.side)&&kle(L,(J=E.current)==null?void 0:J.area)},[]);return a.jsx(mle,{scope:n,searchRef:k,onItemEnter:y.useCallback(L=>{R(L)&&L.preventDefault()},[R]),onItemLeave:y.useCallback(L=>{var Y;R(L)||((Y=A.current)==null||Y.focus(),_(null))},[R]),onTriggerLeave:y.useCallback(L=>{R(L)&&L.preventDefault()},[R]),pointerGraceTimerRef:I,onPointerGraceIntentChange:y.useCallback(L=>{E.current=L},[]),children:a.jsx(U,{...D,children:a.jsx(Q0,{asChild:!0,trapped:i,onMountAutoFocus:Ne(s,L=>{var Y;L.preventDefault(),(Y=A.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:a.jsx(pg,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:a.jsx(wT,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:Ne(l,L=>{b.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(CE,{role:"menu","aria-orientation":"vertical","data-state":RH(v.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:j,style:{outline:"none",...m.style},onKeyDown:Ne(m.onKeyDown,L=>{const q=L.target.closest("[data-radix-menu-content]")===L.currentTarget,J=L.ctrlKey||L.altKey||L.metaKey,me=L.key.length===1;q&&(L.key==="Tab"&&L.preventDefault(),!J&&me&&B(L.key));const F=A.current;if(L.target!==F||!ole.includes(L.key))return;L.preventDefault();const se=S().filter(le=>!le.disabled).map(le=>le.ref.current);fH.includes(L.key)&&se.reverse(),Ele(se)}),onBlur:Ne(t.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(T.current),k.current="")}),onPointerMove:Ne(t.onPointerMove,Sm(L=>{const Y=L.target,q=M.current!==L.clientX;if(L.currentTarget.contains(Y)&&q){const J=L.clientX>M.current?"right":"left";O.current=J,M.current=L.clientX}}))})})})})})})});yH.displayName=As;var yle="MenuGroup",TT=y.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(it.div,{role:"group",...r,ref:e})});TT.displayName=yle;var xle="MenuLabel",xH=y.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(it.div,{...r,ref:e})});xH.displayName=xle;var kx="MenuItem",jR="menu.itemSelect",sw=y.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=y.useRef(null),o=Pg(kx,t.__scopeMenu),c=ET(kx,t.__scopeMenu),l=Pt(e,s),u=y.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(jR,{bubbles:!0,cancelable:!0});f.addEventListener(jR,p=>r==null?void 0:r(p),{once:!0}),d4(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return a.jsx(bH,{...i,ref:l,disabled:n,onClick:Ne(t.onClick,d),onPointerDown:f=>{var h;(h=t.onPointerDown)==null||h.call(t,f),u.current=!0},onPointerUp:Ne(t.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:Ne(t.onKeyDown,f=>{const h=c.searchRef.current!=="";n||h&&f.key===" "||kA.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});sw.displayName=kx;var bH=y.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=ET(kx,n),c=pH(n),l=y.useRef(null),u=Pt(e,l),[d,f]=y.useState(!1),[h,p]=y.useState("");return y.useEffect(()=>{const g=l.current;g&&p((g.textContent??"").trim())},[s.children]),a.jsx(wm.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:a.jsx(ST,{asChild:!0,...c,focusable:!r,children:a.jsx(it.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:Ne(t.onPointerMove,Sm(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(t.onPointerLeave,Sm(g=>o.onItemLeave(g))),onFocus:Ne(t.onFocus,()=>f(!0)),onBlur:Ne(t.onBlur,()=>f(!1))})})})}),ble="MenuCheckboxItem",wH=y.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return a.jsx(jH,{scope:t.__scopeMenu,checked:n,children:a.jsx(sw,{role:"menuitemcheckbox","aria-checked":Ox(n)?"mixed":n,...i,ref:e,"data-state":kT(n),onSelect:Ne(i.onSelect,()=>r==null?void 0:r(Ox(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wH.displayName=ble;var SH="MenuRadioGroup",[wle,Sle]=Iu(SH,{value:void 0,onValueChange:()=>{}}),CH=y.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Ar(r);return a.jsx(wle,{scope:t.__scopeMenu,value:n,onValueChange:s,children:a.jsx(TT,{...i,ref:e})})});CH.displayName=SH;var _H="MenuRadioItem",AH=y.forwardRef((t,e)=>{const{value:n,...r}=t,i=Sle(_H,t.__scopeMenu),s=n===i.value;return a.jsx(jH,{scope:t.__scopeMenu,checked:s,children:a.jsx(sw,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":kT(s),onSelect:Ne(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});AH.displayName=_H;var PT="MenuItemIndicator",[jH,Cle]=Iu(PT,{checked:!1}),EH=y.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=Cle(PT,n);return a.jsx(Yr,{present:r||Ox(s.checked)||s.checked===!0,children:a.jsx(it.span,{...i,ref:e,"data-state":kT(s.checked)})})});EH.displayName=PT;var _le="MenuSeparator",NH=y.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(it.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});NH.displayName=_le;var Ale="MenuArrow",TH=y.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=iw(n);return a.jsx(_E,{...i,...r,ref:e})});TH.displayName=Ale;var jle="MenuSub",[mFe,PH]=Iu(jle),Yh="MenuSubTrigger",kH=y.forwardRef((t,e)=>{const n=Ru(Yh,t.__scopeMenu),r=Pg(Yh,t.__scopeMenu),i=PH(Yh,t.__scopeMenu),s=ET(Yh,t.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,u={__scopeMenu:t.__scopeMenu},d=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),l(null)}},[c,l]),a.jsx(AT,{asChild:!0,...u,children:a.jsx(bH,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":RH(n.open),...t,ref:c0(e,i.onTriggerChange),onClick:f=>{var h;(h=t.onClick)==null||h.call(t,f),!(t.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ne(t.onPointerMove,Sm(f=>{s.onItemEnter(f),!f.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ne(t.onPointerLeave,Sm(f=>{var p,g;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const m=(g=n.content)==null?void 0:g.dataset.side,v=m==="right",b=v?-5:5,x=h[v?"left":"right"],w=h[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x,y:h.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ne(t.onKeyDown,f=>{var p;const h=s.searchRef.current!=="";t.disabled||h&&f.key===" "||ale[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});kH.displayName=Yh;var OH="MenuSubContent",IH=y.forwardRef((t,e)=>{const n=gH(As,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ru(As,t.__scopeMenu),o=Pg(As,t.__scopeMenu),c=PH(OH,t.__scopeMenu),l=y.useRef(null),u=Pt(e,l);return a.jsx(wm.Provider,{scope:t.__scopeMenu,children:a.jsx(Yr,{present:r||s.open,children:a.jsx(wm.Slot,{scope:t.__scopeMenu,children:a.jsx(NT,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ne(t.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ne(t.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:Ne(t.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=cle[o.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(p=c.trigger)==null||p.focus(),d.preventDefault())})})})})})});IH.displayName=OH;function RH(t){return t?"open":"closed"}function Ox(t){return t==="indeterminate"}function kT(t){return Ox(t)?"indeterminate":t?"checked":"unchecked"}function Ele(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Nle(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Tle(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=Nle(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Ple(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function kle(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Ple(n,e)}function Sm(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Ole=mH,Ile=AT,Rle=vH,Mle=yH,Dle=TT,$le=xH,Lle=sw,Fle=wH,Ule=CH,Ble=AH,Hle=EH,zle=NH,Vle=TH,Gle=kH,Kle=IH,OT="DropdownMenu",[Wle,gFe]=Ui(OT,[hH]),_i=hH(),[qle,MH]=Wle(OT),DH=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:c=!0}=t,l=_i(e),u=y.useRef(null),[d=!1,f]=lo({prop:i,defaultProp:s,onChange:o});return a.jsx(qle,{scope:e,triggerId:Zs(),triggerRef:u,contentId:Zs(),open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),modal:c,children:a.jsx(Ole,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};DH.displayName=OT;var $H="DropdownMenuTrigger",LH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=MH($H,n),o=_i(n);return a.jsx(Ile,{asChild:!0,...o,children:a.jsx(it.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:c0(e,s.triggerRef),onPointerDown:Ne(t.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:Ne(t.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});LH.displayName=$H;var Yle="DropdownMenuPortal",FH=t=>{const{__scopeDropdownMenu:e,...n}=t,r=_i(e);return a.jsx(Rle,{...r,...n})};FH.displayName=Yle;var UH="DropdownMenuContent",BH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=MH(UH,n),s=_i(n),o=y.useRef(!1);return a.jsx(Mle,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:Ne(t.onCloseAutoFocus,c=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Ne(t.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!i.modal||d)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BH.displayName=UH;var Qle="DropdownMenuGroup",Xle=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Dle,{...i,...r,ref:e})});Xle.displayName=Qle;var Jle="DropdownMenuLabel",HH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx($le,{...i,...r,ref:e})});HH.displayName=Jle;var Zle="DropdownMenuItem",zH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Lle,{...i,...r,ref:e})});zH.displayName=Zle;var eue="DropdownMenuCheckboxItem",VH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Fle,{...i,...r,ref:e})});VH.displayName=eue;var tue="DropdownMenuRadioGroup",nue=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Ule,{...i,...r,ref:e})});nue.displayName=tue;var rue="DropdownMenuRadioItem",GH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Ble,{...i,...r,ref:e})});GH.displayName=rue;var iue="DropdownMenuItemIndicator",KH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Hle,{...i,...r,ref:e})});KH.displayName=iue;var sue="DropdownMenuSeparator",WH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(zle,{...i,...r,ref:e})});WH.displayName=sue;var oue="DropdownMenuArrow",aue=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Vle,{...i,...r,ref:e})});aue.displayName=oue;var cue="DropdownMenuSubTrigger",qH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Gle,{...i,...r,ref:e})});qH.displayName=cue;var lue="DropdownMenuSubContent",YH=y.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_i(n);return a.jsx(Kle,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});YH.displayName=lue;var uue=DH,due=LH,fue=FH,QH=BH,XH=HH,JH=zH,ZH=VH,ez=GH,tz=KH,nz=WH,rz=qH,iz=YH;const OA=uue,IA=due,hue=y.forwardRef(({className:t,inset:e,children:n,...r},i)=>a.jsxs(rz,{ref:i,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,a.jsx(fs,{className:"ml-auto h-4 w-4"})]}));hue.displayName=rz.displayName;const pue=y.forwardRef(({className:t,...e},n)=>a.jsx(iz,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));pue.displayName=iz.displayName;const Ix=y.forwardRef(({className:t,sideOffset:e=4,...n},r)=>a.jsx(fue,{children:a.jsx(QH,{ref:r,sideOffset:e,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Ix.displayName=QH.displayName;const oc=y.forwardRef(({className:t,inset:e,...n},r)=>a.jsx(JH,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));oc.displayName=JH.displayName;const mue=y.forwardRef(({className:t,children:e,checked:n,...r},i)=>a.jsxs(ZH,{ref:i,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(tz,{children:a.jsx(uo,{className:"h-4 w-4"})})}),e]}));mue.displayName=ZH.displayName;const gue=y.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(ez,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(tz,{children:a.jsx(DE,{className:"h-2 w-2 fill-current"})})}),e]}));gue.displayName=ez.displayName;const vue=y.forwardRef(({className:t,inset:e,...n},r)=>a.jsx(XH,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));vue.displayName=XH.displayName;const yue=y.forwardRef(({className:t,...e},n)=>a.jsx(nz,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",t),...e}));yue.displayName=nz.displayName;var IT="Dialog",[sz,oz]=Ui(IT),[xue,yo]=sz(IT),az=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,c=y.useRef(null),l=y.useRef(null),[u=!1,d]=lo({prop:r,defaultProp:i,onChange:s});return a.jsx(xue,{scope:e,triggerRef:c,contentRef:l,contentId:Zs(),titleId:Zs(),descriptionId:Zs(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};az.displayName=IT;var cz="DialogTrigger",lz=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=yo(cz,n),s=Pt(e,i.triggerRef);return a.jsx(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":DT(i.open),...r,ref:s,onClick:Ne(t.onClick,i.onOpenToggle)})});lz.displayName=cz;var RT="DialogPortal",[bue,uz]=sz(RT,{forceMount:void 0}),dz=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=yo(RT,e);return a.jsx(bue,{scope:e,forceMount:n,children:y.Children.map(r,o=>a.jsx(Yr,{present:n||s.open,children:a.jsx(f0,{asChild:!0,container:i,children:o})}))})};dz.displayName=RT;var Rx="DialogOverlay",fz=y.forwardRef((t,e)=>{const n=uz(Rx,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=yo(Rx,t.__scopeDialog);return s.modal?a.jsx(Yr,{present:r||s.open,children:a.jsx(wue,{...i,ref:e})}):null});fz.displayName=Rx;var wue=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=yo(Rx,n);return a.jsx(J0,{as:Go,allowPinchZoom:!0,shards:[i.contentRef],children:a.jsx(it.div,{"data-state":DT(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Su="DialogContent",hz=y.forwardRef((t,e)=>{const n=uz(Su,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=yo(Su,t.__scopeDialog);return a.jsx(Yr,{present:r||s.open,children:s.modal?a.jsx(Sue,{...i,ref:e}):a.jsx(Cue,{...i,ref:e})})});hz.displayName=Su;var Sue=y.forwardRef((t,e)=>{const n=yo(Su,t.__scopeDialog),r=y.useRef(null),i=Pt(e,n.contentRef,r);return y.useEffect(()=>{const s=r.current;if(s)return uT(s)},[]),a.jsx(pz,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ne(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&s.preventDefault()}),onFocusOutside:Ne(t.onFocusOutside,s=>s.preventDefault())})}),Cue=y.forwardRef((t,e)=>{const n=yo(Su,t.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return a.jsx(pz,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,c;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),pz=y.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,c=yo(Su,n),l=y.useRef(null),u=Pt(e,l);return lT(),a.jsxs(a.Fragment,{children:[a.jsx(Q0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:a.jsx(pg,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":DT(c.open),...o,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Aue,{titleId:c.titleId}),a.jsx(Eue,{contentRef:l,descriptionId:c.descriptionId})]})]})}),MT="DialogTitle",mz=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=yo(MT,n);return a.jsx(it.h2,{id:i.titleId,...r,ref:e})});mz.displayName=MT;var gz="DialogDescription",vz=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=yo(gz,n);return a.jsx(it.p,{id:i.descriptionId,...r,ref:e})});vz.displayName=gz;var yz="DialogClose",xz=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=yo(yz,n);return a.jsx(it.button,{type:"button",...r,ref:e,onClick:Ne(t.onClick,()=>i.onOpenChange(!1))})});xz.displayName=yz;function DT(t){return t?"open":"closed"}var bz="DialogTitleWarning",[_ue,wz]=V9(bz,{contentName:Su,titleName:MT,docsSlug:"dialog"}),Aue=({titleId:t})=>{const e=wz(bz),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},jue="DialogDescriptionWarning",Eue=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wz(jue).contentName}}.`;return y.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Sz=az,Nue=lz,Cz=dz,$T=fz,LT=hz,FT=mz,UT=vz,BT=xz,_z="AlertDialog",[Tue,vFe]=Ui(_z,[oz]),Wa=oz(),Az=t=>{const{__scopeAlertDialog:e,...n}=t,r=Wa(e);return a.jsx(Sz,{...r,...n,modal:!0})};Az.displayName=_z;var Pue="AlertDialogTrigger",kue=y.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Wa(n);return a.jsx(Nue,{...i,...r,ref:e})});kue.displayName=Pue;var Oue="AlertDialogPortal",jz=t=>{const{__scopeAlertDialog:e,...n}=t,r=Wa(e);return a.jsx(Cz,{...r,...n})};jz.displayName=Oue;var Iue="AlertDialogOverlay",Ez=y.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Wa(n);return a.jsx($T,{...i,...r,ref:e})});Ez.displayName=Iue;var Nd="AlertDialogContent",[Rue,Mue]=Tue(Nd),Nz=y.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,s=Wa(n),o=y.useRef(null),c=Pt(e,o),l=y.useRef(null);return a.jsx(_ue,{contentName:Nd,titleName:Tz,docsSlug:"alert-dialog",children:a.jsx(Rue,{scope:n,cancelRef:l,children:a.jsxs(LT,{role:"alertdialog",...s,...i,ref:c,onOpenAutoFocus:Ne(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(hE,{children:r}),a.jsx($ue,{contentRef:o})]})})})});Nz.displayName=Nd;var Tz="AlertDialogTitle",Pz=y.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Wa(n);return a.jsx(FT,{...i,...r,ref:e})});Pz.displayName=Tz;var kz="AlertDialogDescription",Oz=y.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Wa(n);return a.jsx(UT,{...i,...r,ref:e})});Oz.displayName=kz;var Due="AlertDialogAction",Iz=y.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Wa(n);return a.jsx(BT,{...i,...r,ref:e})});Iz.displayName=Due;var Rz="AlertDialogCancel",Mz=y.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=Mue(Rz,n),s=Wa(n),o=Pt(e,i);return a.jsx(BT,{...s,...r,ref:o})});Mz.displayName=Rz;var $ue=({contentRef:t})=>{const e=`\`${Nd}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${Nd}\` by passing a \`${kz}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -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 \`${Nd}\`. 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. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Lue=Az,Fue=jz,Dz=Ez,$z=Nz,Lz=Iz,Fz=Mz,Uz=Pz,Bz=Oz;const RA=Lue,Uue=Fue,Hz=y.forwardRef(({className:t,...e},n)=>a.jsx(Dz,{className:Pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Hz.displayName=Dz.displayName;const Mx=y.forwardRef(({className:t,...e},n)=>a.jsxs(Uue,{children:[a.jsx(Hz,{}),a.jsx($z,{ref:n,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Mx.displayName=$z.displayName;const Dx=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col space-y-2 text-center sm:text-left",t),...e});Dx.displayName="AlertDialogHeader";const $x=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});$x.displayName="AlertDialogFooter";const Lx=y.forwardRef(({className:t,...e},n)=>a.jsx(Uz,{ref:n,className:Pe("text-lg font-semibold",t),...e}));Lx.displayName=Uz.displayName;const Fx=y.forwardRef(({className:t,...e},n)=>a.jsx(Bz,{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));Fx.displayName=Bz.displayName;const Ux=y.forwardRef(({className:t,...e},n)=>a.jsx(Lz,{ref:n,className:Pe(eT(),t),...e}));Ux.displayName=Lz.displayName;const Bx=y.forwardRef(({className:t,...e},n)=>a.jsx(Fz,{ref:n,className:Pe(eT({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Bx.displayName=Fz.displayName;const eu=Sz,Bue=Cz,zz=y.forwardRef(({className:t,...e},n)=>a.jsx($T,{ref:n,className:Pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));zz.displayName=$T.displayName;const Lc=y.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(Bue,{children:[a.jsx(zz,{}),a.jsxs(LT,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,a.jsxs(BT,{className:"absolute right-4 top-4 z-[100] rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Mi,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Lc.displayName=LT.displayName;const Fc=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Fc.displayName="DialogHeader";const Uc=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Uc.displayName="DialogFooter";const Bc=y.forwardRef(({className:t,...e},n)=>a.jsx(FT,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",t),...e}));Bc.displayName=FT.displayName;const tu=y.forwardRef(({className:t,...e},n)=>a.jsx(UT,{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));tu.displayName=UT.displayName;var HT="Radio",[Hue,Vz]=Ui(HT),[zue,Vue]=Hue(HT),Gz=y.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:o,value:c="on",onCheck:l,form:u,...d}=t,[f,h]=y.useState(null),p=Pt(e,v=>h(v)),g=y.useRef(!1),m=f?u||!!f.closest("form"):!0;return a.jsxs(zue,{scope:n,checked:i,disabled:o,children:[a.jsx(it.button,{type:"button",role:"radio","aria-checked":i,"data-state":qz(i),"data-disabled":o?"":void 0,disabled:o,value:c,...d,ref:p,onClick:Ne(t.onClick,v=>{i||l==null||l(),m&&(g.current=v.isPropagationStopped(),g.current||v.stopPropagation())})}),m&&a.jsx(Gue,{control:f,bubbles:!g.current,name:r,value:c,checked:i,required:s,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});Gz.displayName=HT;var Kz="RadioIndicator",Wz=y.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,s=Vue(Kz,n);return a.jsx(Yr,{present:r||s.checked,children:a.jsx(it.span,{"data-state":qz(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});Wz.displayName=Kz;var Gue=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=y.useRef(null),o=Cg(n),c=gg(e);return y.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[o,n,r]),a.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function qz(t){return t?"checked":"unchecked"}var Kue=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zT="RadioGroup",[Wue,yFe]=Ui(zT,[Yf,Vz]),Yz=Yf(),Qz=Vz(),[que,Yue]=Wue(zT),Xz=y.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:o=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...h}=t,p=Yz(n),g=Ou(u),[m,v]=lo({prop:s,defaultProp:i,onChange:f});return a.jsx(que,{scope:n,name:r,required:o,disabled:c,value:m,onValueChange:v,children:a.jsx(wT,{asChild:!0,...p,orientation:l,dir:g,loop:d,children:a.jsx(it.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:g,...h,ref:e})})})});Xz.displayName=zT;var Jz="RadioGroupItem",Zz=y.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,s=Yue(Jz,n),o=s.disabled||r,c=Yz(n),l=Qz(n),u=y.useRef(null),d=Pt(e,u),f=s.value===i.value,h=y.useRef(!1);return y.useEffect(()=>{const p=m=>{Kue.includes(m.key)&&(h.current=!0)},g=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),a.jsx(ST,{asChild:!0,...c,focusable:!o,active:f,children:a.jsx(Gz,{disabled:o,required:s.required,checked:f,...l,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:Ne(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ne(i.onFocus,()=>{var p;h.current&&((p=u.current)==null||p.click())})})})});Zz.displayName=Jz;var Que="RadioGroupIndicator",eV=y.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=Qz(n);return a.jsx(Wz,{...i,...r,ref:e})});eV.displayName=Que;var tV=Xz,nV=Zz,Xue=eV;const MA=y.forwardRef(({className:t,...e},n)=>a.jsx(tV,{className:Pe("grid gap-2",t),...e,ref:n}));MA.displayName=tV.displayName;const Qh=y.forwardRef(({className:t,...e},n)=>a.jsx(nV,{ref:n,className:Pe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:a.jsx(Xue,{className:"flex items-center justify-center",children:a.jsx(DE,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Qh.displayName=nV.displayName;var VT="Checkbox",[Jue,xFe]=Ui(VT),[Zue,ede]=Jue(VT),rV=y.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:o,disabled:c,value:l="on",onCheckedChange:u,form:d,...f}=t,[h,p]=y.useState(null),g=Pt(e,S=>p(S)),m=y.useRef(!1),v=h?d||!!h.closest("form"):!0,[b=!1,x]=lo({prop:i,defaultProp:s,onChange:u}),w=y.useRef(b);return y.useEffect(()=>{const S=h==null?void 0:h.form;if(S){const C=()=>x(w.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[h,x]),a.jsxs(Zue,{scope:n,state:b,disabled:c,children:[a.jsx(it.button,{type:"button",role:"checkbox","aria-checked":Hc(b)?"mixed":b,"aria-required":o,"data-state":oV(b),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:g,onKeyDown:Ne(t.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ne(t.onClick,S=>{x(C=>Hc(C)?!0:!C),v&&(m.current=S.isPropagationStopped(),m.current||S.stopPropagation())})}),v&&a.jsx(tde,{control:h,bubbles:!m.current,name:r,value:l,checked:b,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"},defaultChecked:Hc(s)?!1:s})]})});rV.displayName=VT;var iV="CheckboxIndicator",sV=y.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,s=ede(iV,n);return a.jsx(Yr,{present:r||Hc(s.state)||s.state===!0,children:a.jsx(it.span,{"data-state":oV(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});sV.displayName=iV;var tde=t=>{const{control:e,checked:n,bubbles:r=!0,defaultChecked:i,...s}=t,o=y.useRef(null),c=Cg(n),l=gg(e);y.useEffect(()=>{const d=o.current,f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});d.indeterminate=Hc(n),p.call(d,Hc(n)?!1:n),d.dispatchEvent(g)}},[c,n,r]);const u=y.useRef(Hc(n)?!1:n);return a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??u.current,...s,tabIndex:-1,ref:o,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Hc(t){return t==="indeterminate"}function oV(t){return Hc(t)?"indeterminate":t?"checked":"unchecked"}var aV=rV,nde=sV;const Fl=y.forwardRef(({className:t,...e},n)=>a.jsx(aV,{ref:n,className:Pe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:a.jsx(nde,{className:Pe("flex items-center justify-center text-current"),children:a.jsx(uo,{className:"h-4 w-4"})})}));Fl.displayName=aV.displayName;const GT=({isActive:t,isComplete:e,hasError:n,label:r,onComplete:i,className:s})=>{const[o,c]=y.useState(0),[l,u]=y.useState("progressing"),[d,f]=y.useState(!1),h=y.useRef(null),p=y.useRef(null),g=()=>{h.current&&(clearInterval(h.current),h.current=null),p.current&&(clearTimeout(p.current),p.current=null)},m=()=>{g(),c(0),u("progressing"),f(!1)},v=S=>{g(),u("completing");const C=100-S,_=50,A=500/_,j=C/A;let T=0;h.current=setInterval(()=>{T++;const k=S+j*T;k>=100||T>=A?(c(100),u("completed"),g(),p.current=setTimeout(()=>{u("hiding"),setTimeout(()=>{m(),i==null||i()},300)},2e3)):c(k)},_)},b=()=>{l==="progressing"&&v(o)},x=()=>{l==="waiting"&&v(90)},w=()=>{g()};return y.useEffect(()=>{if(t&&!d){f(!0),c(0),u("progressing");const S=90/540;let C=0;h.current=setInterval(()=>{C+=S,C>=90?(c(90),u("waiting"),g()):c(C)},100)}return e&&l==="progressing"&&b(),e&&l==="waiting"&&x(),n&&(l==="progressing"||l==="waiting")&&w(),!t&&d&&m(),()=>{t||g()}},[t,e,n,l,d]),y.useEffect(()=>()=>{g()},[]),d?a.jsxs("div",{className:Pe("w-full space-y-2",s),children:[r&&a.jsxs("div",{className:"flex justify-between items-center text-sm text-muted-foreground",children:[a.jsx("span",{children:l==="waiting"?`${r} - finalizing...`:r}),a.jsxs("span",{children:[Math.round(o),"%"]})]}),a.jsx($l,{value:o,className:Pe("w-full transition-all duration-200",n&&"opacity-75",l==="completed"&&"bg-green-100")}),n&&a.jsx("div",{className:"text-sm text-red-600",children:"Generation failed. Please try again."}),l==="completed"&&!n&&a.jsx("div",{className:"text-sm text-green-600",children:"Generation completed successfully!"})]}):null},rr="all",rde=()=>{var Je,fn,Is,ra;const t=y.useCallback(()=>{document.body.style.pointerEvents==="none"&&(console.log("ensureBodyInteractive: Fixing body pointer-events..."),document.body.style.pointerEvents="auto")},[]),e=lr(),[n]=FJ(),{loadPersonas:r}=E6(),[i,s]=y.useState("view"),[o,c]=y.useState("ai"),[l,u]=y.useState("");y.useState(null);const[d,f]=y.useState(rr),[h,p]=y.useState(!1),[g,m]=y.useState("");y.useEffect(()=>{const W=n.get("mode");(W==="view"||W==="create")&&s(W)},[n]);const[v,b]=y.useState([]),[x,w]=y.useState([]),[S,C]=y.useState(!0);y.useState(null);const[_,A]=y.useState(new Set),[j,T]=y.useState(!1),[k,I]=y.useState(null),[E,O]=y.useState(""),[M,U]=y.useState(!1),[D,B]=y.useState(null),[R,L]=y.useState(!1),[Y,q]=y.useState(null),[J,me]=y.useState(!1),[F,oe]=y.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[se,le]=y.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[ke,ue]=y.useState(!1),[we,Ae]=y.useState(!1),[ee,wt]=y.useState(!1),[et,Ct]=y.useState(!1),[Xe,nn]=y.useState("gemini-2.5-pro"),N=()=>{ue(!1),Ae(!1),wt(!1)},$=W=>{const Ie={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return W.forEach(Ve=>{if(Ve.age&&Ie.age.add(Ve.age),Ve.gender&&Ie.gender.add(Ve.gender),Ve.occupation&&Ie.occupation.add(Ve.occupation),Ve.location&&Ie.location.add(Ve.location),Ve.techSavviness!==void 0){const ut=Ve.techSavviness<30?"Low (0-30)":Ve.techSavviness<70?"Medium (31-70)":"High (71-100)";Ie.techSavviness.add(ut)}Ve.ethnicity&&Ie.ethnicity.add(Ve.ethnicity)}),{age:Array.from(Ie.age).sort(),gender:Array.from(Ie.gender).sort(),occupation:Array.from(Ie.occupation).sort(),location:Array.from(Ie.location).sort(),techSavviness:Array.from(Ie.techSavviness).sort((Ve,ut)=>{const tt=["Low (0-30)","Medium (31-70)","High (71-100)"];return tt.indexOf(Ve)-tt.indexOf(ut)}),ethnicity:Array.from(Ie.ethnicity).sort()}},z=()=>{me(!1),setTimeout(()=>{oe({...se})},0)},G=()=>{le({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]})},Q=(W,Ie)=>{le(Ve=>{const ut={...Ve};return ut[W].includes(Ie)?ut[W]=ut[W].filter(tt=>tt!==Ie):ut[W]=[...ut[W],Ie],ut})},H=async()=>{try{const Ve=(await Po.getAll()).data.map(ut=>({...ut,id:ut._id}));return w(Ve),Ve}catch(W){return console.error("Error fetching folders:",W),Fe.error("Failed to load folders"),w([]),[]}},Z=async()=>{C(!0);try{const Ve=(await $r.getAll()).data;{const tt=[...Ve.map(St=>({...St,id:St.id||St._id}))];try{(async()=>{const on=await r();console.log("Loaded stored personas (for debugging only):",on?on.length:0)})()}catch(St){console.warn("Error loading stored personas:",St)}b(tt)}}catch(Ie){console.error("Error fetching personas:",Ie),Fe.error("Failed to load personas"),b([])}finally{C(!1)}};y.useEffect(()=>((async()=>{try{const[,]=await Promise.all([H(),Z()])}catch(Ie){console.error("Error loading data:",Ie)}})(),()=>{}),[t]),y.useEffect(()=>{var W;if(i==="view")Z();else if(i==="create"&&(console.log(`Switching to create mode with folder: ${d}, ${d!==rr?"NOT default":"IS default"}`),d!==rr)){const Ie=(W=x.find(Ve=>Ve.id===d))==null?void 0:W.name;console.log(`Selected folder for creation: ${d} (${Ie})`)}},[i]),y.useEffect(()=>{Z();const W=()=>{window.location.pathname.includes("/synthetic-users")&&!window.location.pathname.includes("/synthetic-users/")&&(console.log("Navigation to synthetic users page detected, refreshing data"),Z())},Ie=()=>{console.log("Synthetic users navigation event detected, refreshing data"),Z()};console.log("Setting up MutationObserver for body style");const Ve=new MutationObserver(ut=>{ut.forEach(tt=>{tt.type==="attributes"&&tt.attributeName==="style"&&document.body.style.pointerEvents==="none"&&(console.log("MutationObserver detected pointer-events: none, fixing..."),t())})});return Ve.observe(document.body,{attributes:!0,attributeFilter:["style"]}),t(),window.addEventListener("popstate",W),window.addEventListener("syntheticUsersNavigation",Ie),()=>{window.removeEventListener("popstate",W),window.removeEventListener("syntheticUsersNavigation",Ie),console.log("Disconnecting MutationObserver"),Ve.disconnect()}},[]);const he=async()=>{if(!g.trim()){Fe.error("Please enter a folder name");return}try{const W=await Po.create({name:g.trim(),persona_ids:[]});await H(),m(""),p(!1),Fe.success(`Folder "${g}" created`)}catch(W){console.error("Error creating folder:",W),Fe.error("Failed to create folder")}},xe=()=>{m(""),p(!1)},Oe=W=>{I(W),O(W.name)},be=async()=>{if(!k||!E.trim()){I(null);return}try{await Po.update(k._id,{name:E.trim()}),await H(),I(null),Fe.success(`Folder renamed to "${E}"`)}catch(W){console.error("Error renaming folder:",W),Fe.error("Failed to rename folder"),I(null)}},We=()=>{I(null),O("")},ot=W=>{B(W),U(!0)},Rt=async()=>{if(D)try{await Po.delete(D._id),await H(),(d===D._id||d===D.id)&&f(rr),U(!1),B(null),Fe.success(`Folder "${D.name}" deleted`)}catch(W){console.error("Error deleting folder:",W),Fe.error("Failed to delete folder")}},Ke=async(W,Ie)=>{var on;const Ve=W||_,ut=Ie||Y;if(!ut||Ve.size===0)return;const tt=Array.from(Ve),St=tt.map(dt=>{const _n=v.find(an=>an.id===dt);return(_n==null?void 0:_n._id)||(_n==null?void 0:_n.id)||dt}).filter(Boolean);try{const dt=[],_n=[];if(ut!==rr)try{await Po.addPersonasBatch(ut,St),dt.push(...tt)}catch(rn){console.error("Error adding personas to folder:",rn),_n.push(...tt)}else dt.push(...tt);await Promise.all([H(),Z()]);const an=ut===rr?"All Personas":((on=x.find(rn=>rn._id===ut||rn.id===ut))==null?void 0:on.name)||"folder";return dt.length>0&&Fe.success(`Added ${dt.length} persona${dt.length!==1?"s":""} to ${an}`),_n.length>0&&Fe.error(`Failed to add ${_n.length} persona${_n.length!==1?"s":""} to ${an}.`),W||A(new Set),{success:dt.length>0,successCount:dt.length,failureCount:_n.length}}catch(dt){return console.error("Error moving personas to folder:",dt),Fe.error("An unexpected error occurred while adding personas to folder."),{success:!1,error:dt}}},Ze=async()=>{var Ve,ut,tt;if(_.size===0||d===rr)return;const W=Array.from(_),Ie=W.map(St=>{const on=v.find(dt=>dt.id===St);return(on==null?void 0:on._id)||(on==null?void 0:on.id)||St}).filter(Boolean);console.log("Removing personas from folder:",{selectedFolder:d,selectedIds:W,mongoIds:Ie,folderName:(Ve=x.find(St=>St._id===d))==null?void 0:Ve.name});try{await Po.removePersonasBatch(d,Ie),await Promise.all([H(),Z()]);const St=((ut=x.find(on=>on._id===d))==null?void 0:ut.name)||"folder";Fe.success(`Removed ${W.length} persona${W.length!==1?"s":""} from ${St}`),A(new Set)}catch(St){console.error("Error removing personas from folder:",St),console.error("Error details:",((tt=St.response)==null?void 0:tt.data)||St.message),Fe.error("Failed to remove personas from folder")}},_t=W=>{A(Ie=>{const Ve=new Set(Ie);return Ve.has(W)?Ve.delete(W):Ve.add(W),Ve})},Kt=()=>{_.size===Xt.length?A(new Set):A(new Set(Xt.map(W=>W.id)))},Qn=async()=>{if(_.size===0)return;const W=Array.from(_);A(new Set),T(!1),C(!0);const Ie=[],Ve=[];for(const ut of W)try{const tt=v.find(on=>on.id===ut);if(!tt){console.error(`Could not find persona with id: ${ut}`),Ve.push(ut);continue}let St=ut;tt._id&&(St=tt._id.toString()),console.log(`Attempting to delete persona: ${St}`),await $r.delete(St),Ie.push(ut)}catch(tt){console.error(`Failed to delete persona ${ut}:`,tt),Ve.push(ut)}b(ut=>ut.filter(tt=>!Ie.includes(tt.id))),await H(),C(!1),setTimeout(()=>{Ie.length>0&&Fe.success(`Successfully deleted ${Ie.length} persona${Ie.length!==1?"s":""}`),Ve.length>0&&Fe.error(`Failed to delete ${Ve.length} persona${Ve.length!==1?"s":""}`),(Ie.length>0||Ve.length>0)&&Z()},50)},Xt=v.filter(W=>{const Ie=W.name.toLowerCase().includes(l.toLowerCase())||W.occupation.toLowerCase().includes(l.toLowerCase())||W.location.toLowerCase().includes(l.toLowerCase()),Ve=(F.age.length===0||F.age.includes(W.age))&&(F.gender.length===0||F.gender.includes(W.gender))&&(F.occupation.length===0||F.occupation.includes(W.occupation))&&(F.location.length===0||F.location.includes(W.location))&&(F.ethnicity.length===0||W.ethnicity&&F.ethnicity.includes(W.ethnicity))&&(F.techSavviness.length===0||W.techSavviness!==void 0&&F.techSavviness.includes(W.techSavviness<30?"Low (0-30)":W.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&(F.folderStatus.length===0||F.folderStatus.includes("hasFolder")&&F.folderStatus.includes("noFolder")||F.folderStatus.includes("hasFolder")&&!F.folderStatus.includes("noFolder")&&W.folderId&&W.folderId!==rr||F.folderStatus.includes("noFolder")&&!F.folderStatus.includes("hasFolder")&&(!W.folderId||W.folderId===rr));return d===rr||W.folder_ids&&Array.isArray(W.folder_ids)&&W.folder_ids.includes(d)||W.folder_id===d||W.folderId===d?Ie&&Ve:!1}),at=(W,Ie)=>{const Ve=new Date().toISOString().split("T")[0],ut=W.length;let tt=`# Persona Summary Report - -`;return tt+=`**Folder:** ${Ie} -`,tt+=`**Date:** ${Ve} -`,tt+=`**Total Personas:** ${ut} - -`,ut===0?(tt+=`No personas found in this folder. -`,tt):(W.forEach((St,on)=>{tt+=`## ${St.name} - -`,tt+=`### Demographics -`,tt+=`- **Age:** ${St.age} -`,tt+=`- **Gender:** ${St.gender} -`,tt+=`- **Occupation:** ${St.occupation} -`,tt+=`- **Location:** ${St.location} - -`,St.aiSynthesizedBio&&(tt+=`### AI-Synthesized Bio -`,tt+=`${St.aiSynthesizedBio} - -`),St.qualitativeAttributes&&St.qualitativeAttributes.length>0&&(tt+=`### Key Attributes -`,St.qualitativeAttributes.forEach(dt=>{tt+=`- 🏷️ ${dt} -`}),tt+=` -`),St.topPersonalityTraits&&St.topPersonalityTraits.length>0&&(tt+=`### Top Personality Traits -`,St.topPersonalityTraits.forEach(dt=>{tt+=`- 🧠 ${dt} -`}),tt+=` -`),on{if(Xt.length===0){Fe.error("No personas to download");return}Ct(!0)},st=async()=>{var Ve,ut,tt,St,on;const W=d===rr?"All Personas":((Ve=x.find(dt=>dt.id===d))==null?void 0:Ve.name)||"Unknown Folder",Ie=Xt.map(dt=>dt._id||dt.id);console.log(`🤖 Frontend: User selected ${Xe} for persona summary download`),Ct(!1),ue(!0),Ae(!1),wt(!1),C(!0);try{Fe.info("Generating persona summaries...",{description:`Processing ${Xt.length} persona${Xt.length!==1?"s":""} with AI`});const dt=await da.batchGenerateSummaries(Ie,.7,Xe),{summaries:_n,summary_stats:an,errors:rn}=dt.data,yr=new Date().toISOString().split("T")[0],Rs=`persona-summary-${W.toLowerCase().replace(/\s+/g,"-")}-${yr}.md`;let Xn=`# Persona Summary Report - -`;Xn+=`**Folder:** ${W} -`,Xn+=`**Date:** ${yr} -`,Xn+=`**Total Personas:** ${an.total_requested} -`,Xn+=`**Successfully Processed:** ${an.total_successful} -`,an.total_failed>0&&(Xn+=`**Failed to Process:** ${an.total_failed} -`),Xn+=` ---- - -`,_n.length===0?Xn+=`No persona summaries could be generated. -`:_n.forEach((Ee,jt)=>{Xn+=`# ${Ee.persona_name} - -`,Xn+=`${Ee.summary} - -`,jt<_n.length-1&&(Xn+=`--- - -`)}),rn&&(((ut=rn.failed_summaries)==null?void 0:ut.length)>0||((tt=rn.missing_personas)==null?void 0:tt.length)>0)&&(Xn+=` ---- - -## Processing Errors - -`,((St=rn.failed_summaries)==null?void 0:St.length)>0&&(Xn+=`### Failed to Generate Summaries -`,rn.failed_summaries.forEach(Ee=>{Xn+=`- **${Ee.persona_name}** (ID: ${Ee.persona_id}): ${Ee.error} -`}),Xn+=` -`),((on=rn.missing_personas)==null?void 0:on.length)>0&&(Xn+=`### Missing Personas -`,rn.missing_personas.forEach(Ee=>{Xn+=`- ID: ${Ee} -`})));const V=document.createElement("a"),ve=new Blob([Xn],{type:"text/markdown"});V.href=URL.createObjectURL(ve),V.download=Rs,document.body.appendChild(V),V.click(),document.body.removeChild(V),Ae(!0);const de=Xe==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro";an.total_successful===an.total_requested?Fe.success("Persona summary downloaded",{description:`Successfully processed all ${an.total_successful} persona${an.total_successful!==1?"s":""} from "${W}" using ${de}`}):Fe.success("Persona summary downloaded with warnings",{description:`Processed ${an.total_successful} of ${an.total_requested} personas from "${W}" using ${de}`})}catch(dt){console.error("Error generating persona summaries:",dt),dt.response?(console.error("Error response data:",dt.response.data),console.error("Error response status:",dt.response.status),console.error("Error response headers:",dt.response.headers)):dt.request?console.error("Error request:",dt.request):console.error("Error message:",dt.message),wt(!0),Fe.error("AI summary generation failed, creating basic summary",{description:"Using simplified format due to processing error"});try{const _n=new Date().toISOString().split("T")[0],an=`persona-summary-basic-${W.toLowerCase().replace(/\s+/g,"-")}-${_n}.md`,rn=at(Xt,W),yr=document.createElement("a"),Rs=new Blob([rn],{type:"text/markdown"});yr.href=URL.createObjectURL(Rs),yr.download=an,document.body.appendChild(yr),yr.click(),document.body.removeChild(yr)}catch{Fe.error("Failed to create persona summary",{description:"Unable to generate summary in any format"})}}finally{C(!1)}};return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(ja,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Synthetic Personas"}),a.jsx("p",{className:"text-slate-600 mt-1",children:"Create and manage AI-generated research participants"})]}),a.jsx("div",{className:"mt-4 sm:mt-0 flex flex-col items-end gap-3",children:a.jsxs("div",{className:"flex items-center gap-3",children:[i==="view"&&Xt.length>0&&a.jsxs(X,{variant:"outline",onClick:Wt,disabled:ke,className:"flex items-center gap-2 hover-transition",children:[a.jsx(Jc,{className:"h-4 w-4"}),ke?"Generating Summary...":"Download Persona Summary"]}),a.jsx(X,{onClick:()=>s(i==="view"?"create":"view"),className:"hover-transition",children:i==="view"?"Create New Personas":"View All Personas"})]})})]}),i==="view"&&Xt.length>0&&ke&&a.jsx("div",{className:"mb-6",children:a.jsx(GT,{isActive:ke,isComplete:we,hasError:ee,label:"Generating comprehensive persona summaries",onComplete:N,className:"max-w-4xl mx-auto"})}),i==="view"?a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex flex-col md:flex-row gap-6 mb-6",children:[a.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),a.jsx(X,{variant:"ghost",size:"sm",onClick:()=>p(!0),className:"h-7 w-7 p-0",children:a.jsx(f5,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("button",{onClick:()=>f(rr),className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${d===rr?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx("span",{children:"All Personas"})]}),x.map(W=>a.jsx("div",{className:"flex items-center justify-between group",children:k&&k._id===W._id?a.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx(Ht,{value:E,onChange:Ie=>O(Ie.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:Ie=>{Ie.key==="Enter"?be():Ie.key==="Escape"&&We()}}),a.jsx(X,{size:"sm",variant:"ghost",onClick:be,className:"h-7 w-7 p-0",children:a.jsx(uo,{className:"h-4 w-4"})}),a.jsx(X,{size:"sm",variant:"ghost",onClick:We,className:"h-7 w-7 p-0",children:a.jsx(Mi,{className:"h-4 w-4"})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>f(W._id),className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${d===W._id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx("span",{children:W.name}),a.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:v.filter(Ie=>Ie.folder_ids&&Ie.folder_ids.includes(W._id)).length})]}),a.jsxs(OA,{children:[a.jsx(IA,{asChild:!0,children:a.jsx(X,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:a.jsx(z_,{className:"h-4 w-4"})})}),a.jsxs(Ix,{align:"end",children:[a.jsx(oc,{onClick:()=>Oe(W),children:"Rename"}),a.jsx(oc,{className:"text-red-600",onClick:()=>ot(W),children:"Delete"})]})]})]})},W._id)),h&&a.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[a.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx(Ht,{value:g,onChange:W=>m(W.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:W=>{W.key==="Enter"?he():W.key==="Escape"&&xe()}})]}),a.jsx(X,{size:"sm",variant:"ghost",onClick:he,className:"h-7 w-7 p-0",children:a.jsx(uo,{className:"h-4 w-4"})}),a.jsx(X,{size:"sm",variant:"ghost",onClick:xe,className:"h-7 w-7 p-0",children:a.jsx(Mi,{className:"h-4 w-4"})})]})]})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(FE,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),a.jsx(Ht,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:l,onChange:W=>u(W.target.value)})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[_.size>0&&a.jsxs(OA,{children:[a.jsx(IA,{asChild:!0,children:a.jsxs(X,{variant:"outline",size:"sm",className:"flex items-center gap-2",onClick:W=>{W.stopPropagation()},children:[a.jsxs("span",{children:["Actions (",_.size,")"]}),a.jsx(z_,{className:"h-4 w-4"})]})}),a.jsxs(Ix,{align:"end",onCloseAutoFocus:W=>{W.preventDefault()},children:[a.jsxs(oc,{className:"flex items-center gap-2 cursor-pointer",onClick:W=>{W.preventDefault(),W.stopPropagation();const Ie=Array.from(_);e("/focus-groups",{state:{mode:"create",preSelectedParticipants:Ie}})},children:[a.jsx(Wo,{className:"h-4 w-4"}),"Create Focus Group with selected Personas"]}),a.jsxs(oc,{className:"flex items-center gap-2 cursor-pointer",onClick:W=>{W.preventDefault(),W.stopPropagation(),T(!0)},children:[a.jsx(ir,{className:"h-4 w-4"}),"Delete"]}),a.jsxs(oc,{className:"flex items-center gap-2 cursor-pointer",onClick:W=>{W.preventDefault(),W.stopPropagation(),L(!0)},children:[a.jsx(hs,{className:"h-4 w-4"}),"Move to folder"]}),d!==rr&&a.jsxs(oc,{className:"flex items-center gap-2 cursor-pointer",onClick:W=>{W.preventDefault(),W.stopPropagation(),Ze()},children:[a.jsx(Mi,{className:"h-4 w-4"}),"Remove from ",((Je=x.find(W=>W._id===d))==null?void 0:Je.name)||"folder"]})]})]}),a.jsxs(X,{variant:"outline",className:"flex items-center gap-2",onClick:()=>me(!0),children:[a.jsx($E,{className:"h-4 w-4"}),a.jsxs("span",{children:["Filter",Object.values(F).some(W=>W.length>0)?` (${Object.values(F).reduce((W,Ie)=>W+Ie.length,0)})`:""]})]})]})]}),a.jsxs("div",{className:"glass-panel rounded-xl p-6 mb-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Fr,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:d===rr?"Your Synthetic Persona Library":((fn=x.find(W=>W._id===d))==null?void 0:fn.name)||"Personas"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",Xt.length,")"]})]}),Xt.length>0&&a.jsxs("div",{className:"flex items-center",children:[a.jsx(Fl,{id:"select-all",checked:Xt.length>0&&_.size===Xt.length,onCheckedChange:Kt,className:"mr-2"}),a.jsx("label",{htmlFor:"select-all",className:"text-sm cursor-pointer",children:"Select All"})]})]}),Xt.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-2 xl:grid-cols-2 gap-4",children:Xt.map(W=>a.jsx("div",{className:"relative group",children:a.jsx(pT,{user:W,selected:_.has(W.id),onClick:()=>e(`/synthetic-users/${W._id||W.id}`),onSelectionToggle:Ie=>{Ie.stopPropagation(),_t(W.id)},showAddToFolderButton:!1,folders:x})},W.id))}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-muted-foreground",children:"No personas found matching your criteria."})})]}),a.jsx(RA,{open:j,onOpenChange:W=>{T(W||!1)},children:a.jsxs(Mx,{onInteractOutside:W=>{W.preventDefault()},children:[a.jsxs(Dx,{children:[a.jsx(Lx,{children:"Delete Personas"}),a.jsxs(Fx,{children:["Are you sure you want to delete ",_.size," selected persona",_.size!==1?"s":"","? This action cannot be undone."]})]}),a.jsxs($x,{children:[a.jsx(Bx,{onClick:()=>{setTimeout(()=>A(new Set),50)},children:"Cancel"}),a.jsx(Ux,{onClick:Qn,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),a.jsx(RA,{open:M,onOpenChange:W=>{U(W||!1)},children:a.jsxs(Mx,{children:[a.jsxs(Dx,{children:[a.jsx(Lx,{children:"Delete Folder"}),a.jsxs(Fx,{children:['Are you sure you want to delete the folder "',D==null?void 0:D.name,'"?',a.jsx("br",{}),a.jsx("br",{}),a.jsx("strong",{children:"Note:"})," Any personas in this folder will not be deleted - they will still be available under 'All Personas' after folder deletion."]})]}),a.jsxs($x,{children:[a.jsx(Bx,{children:"Cancel"}),a.jsx(Ux,{onClick:Rt,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),a.jsx(eu,{open:R,onOpenChange:W=>{L(W||!1)},children:a.jsxs(Lc,{className:"z-50",children:[a.jsxs(Fc,{children:[a.jsx(Bc,{children:"Move to Folder"}),a.jsxs(tu,{children:["Choose a folder to move ",_.size," selected persona",_.size!==1?"s":""," to."]})]}),a.jsx("div",{className:"py-4",children:a.jsxs(MA,{value:Y||"",onValueChange:q,className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Qh,{value:rr,id:"folder-all"}),a.jsxs(ms,{htmlFor:"folder-all",className:"flex items-center gap-2",children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx("span",{children:"All Personas (Remove from folders)"})]})]}),x.map(W=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Qh,{value:W._id,id:`folder-${W._id}`}),a.jsxs(ms,{htmlFor:`folder-${W._id}`,className:"flex items-center gap-2",children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx("span",{children:W.name})]})]},W._id))]})}),a.jsxs(Uc,{children:[a.jsx(X,{variant:"outline",onClick:W=>{W.preventDefault(),W.stopPropagation(),L(!1),q(null)},children:"Cancel"}),a.jsx(X,{onClick:async W=>{if(W.preventDefault(),W.stopPropagation(),!Y)return;const Ie=new Set(_),Ve=Y;if(L(!1),q(null),Ve&&Ie.size>0){C(!0);try{await Ke(Ie,Ve)}finally{C(!1),A(new Set)}}},disabled:!Y,children:"Move"})]})]})}),a.jsx(eu,{open:J,onOpenChange:W=>{W?(me(W),le({...F})):(_.size>0&&A(new Set),me(!1))},children:a.jsxs(Lc,{className:"max-w-4xl max-h-[80vh] flex flex-col",onInteractOutside:W=>{W.preventDefault()},children:[a.jsx("div",{className:"sticky top-0 bg-background border-b shadow-sm pb-4 z-10",children:a.jsxs(Fc,{children:[a.jsx(Bc,{children:"Filter Personas"}),a.jsx(tu,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic. Filter options dynamically update to show only relevant values."})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-1 py-4 space-y-6",children:[Object.values(se).some(W=>W.length>0)&&a.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(se).reduce((W,Ie)=>W+Ie.length,0)," active filters"]})}),a.jsx("div",{className:"space-y-4",children:(()=>{const W=tt=>{const St={...se};St[tt]=[];const on=v.filter(dt=>Object.entries(St).every(([_n,an])=>{if(an.length===0)return!0;const rn=_n;if(rn==="techSavviness"&&dt.techSavviness!==void 0){const yr=dt.techSavviness<30?"Low (0-30)":dt.techSavviness<70?"Medium (31-70)":"High (71-100)";return an.includes(yr)}else{if(rn==="age"&&dt.age)return an.includes(dt.age);if(rn==="gender"&&dt.gender)return an.includes(dt.gender);if(rn==="occupation"&&dt.occupation)return an.includes(dt.occupation);if(rn==="location"&&dt.location)return an.includes(dt.location);if(rn==="ethnicity"&&dt.ethnicity)return an.includes(dt.ethnicity)}return!0}));return $(on)},Ie=Object.values(se).every(tt=>tt.length===0),Ve=$(v),ut=(tt,St,on,dt=1)=>{const _n=se[St],an=[...new Set([...on,..._n])].sort();return an.length===0?null:a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:tt}),a.jsx("div",{className:`grid grid-cols-1 ${dt===2?"sm:grid-cols-2":dt===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:an.map(rn=>{const yr=se[St].includes(rn),Rs=on.includes(rn);return a.jsxs("div",{className:`flex items-center space-x-2 ${!Rs&&!yr?"opacity-50":""}`,children:[a.jsx(Fl,{id:`${St}-${rn}`,checked:yr,onCheckedChange:()=>Q(St,rn),disabled:!Rs&&!yr}),a.jsxs(ms,{htmlFor:`${St}-${rn}`,className:"truncate overflow-hidden",children:[rn,yr&&!Rs&&a.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},rn)})})]})};return a.jsxs(a.Fragment,{children:[ut("Gender","gender",Ie?Ve.gender:W("gender").gender,3),ut("Age","age",Ie?Ve.age:W("age").age,3),ut("Ethnicity","ethnicity",Ie?Ve.ethnicity:W("ethnicity").ethnicity,2),ut("Location","location",Ie?Ve.location:W("location").location,2),ut("Occupation","occupation",Ie?Ve.occupation:W("occupation").occupation,2),ut("Tech Savviness","techSavviness",Ie?Ve.techSavviness:W("techSavviness").techSavviness,3),a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Folder Assignment"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Fl,{id:"folderStatus-hasFolder",checked:se.folderStatus.includes("hasFolder"),onCheckedChange:()=>Q("folderStatus","hasFolder")}),a.jsx(ms,{htmlFor:"folderStatus-hasFolder",className:"truncate overflow-hidden",children:"Has folder assignment"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Fl,{id:"folderStatus-noFolder",checked:se.folderStatus.includes("noFolder"),onCheckedChange:()=>Q("folderStatus","noFolder")}),a.jsx(ms,{htmlFor:"folderStatus-noFolder",className:"truncate overflow-hidden",children:"No folder assignment"})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()})]}),a.jsx("div",{className:"sticky bottom-0 bg-background border-t shadow-[0_-2px_4px_rgba(0,0,0,0.05)] pt-4 z-10",children:a.jsxs(Uc,{children:[a.jsx(X,{variant:"outline",onClick:G,children:"Reset"}),a.jsx(X,{onClick:z,children:"Apply Filters"})]})})]})}),a.jsx(eu,{open:et,onOpenChange:Ct,children:a.jsxs(Lc,{children:[a.jsxs(Fc,{children:[a.jsx(Bc,{children:"Select AI Model for Summary Generation"}),a.jsx(tu,{children:"Choose which AI model to use for generating persona summaries"})]}),a.jsx("div",{className:"py-4",children:a.jsxs(MA,{value:Xe,onValueChange:nn,className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Qh,{value:"gemini-2.5-pro",id:"download-gemini"}),a.jsx(ms,{htmlFor:"download-gemini",className:"text-sm font-medium",children:"Gemini 2.5 Pro"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Qh,{value:"gpt-4.1",id:"download-gpt"}),a.jsx(ms,{htmlFor:"download-gpt",className:"text-sm font-medium",children:"GPT-4.1"})]})]})}),a.jsxs(Uc,{children:[a.jsx(X,{variant:"outline",onClick:()=>Ct(!1),children:"Cancel"}),a.jsx(X,{onClick:st,children:"Generate Summary"})]})]})})]})]})}):a.jsxs(hl,{defaultValue:"ai",onValueChange:W=>c(W),children:[a.jsxs(Ka,{className:"grid w-full grid-cols-2 mb-6",children:[a.jsx(gn,{value:"ai",children:"AI Recruiter"}),a.jsx(gn,{value:"manual",children:"Manual Creation"})]}),a.jsxs(vn,{value:"ai",children:[console.log(`Rendering AIRecruiter with targetFolderId: ${d!==rr?d:"null"}`),console.log("Current folders:",x.map(W=>({id:W.id,name:W.name}))),a.jsx(pce,{targetFolderId:d!==rr?d:null,targetFolderName:d!==rr?(Is=x.find(W=>W.id===d))==null?void 0:Is.name:null})]}),a.jsx(vn,{value:"manual",children:a.jsx(ile,{targetFolderId:d!==rr?d:null,targetFolderName:d!==rr?(ra=x.find(W=>W.id===d))==null?void 0:ra.name:null})})]})]})]})},cV=y.createContext(void 0),nC="synthetic-society-navigation-state",ide=({children:t})=>{const[e,n]=y.useState(()=>{try{const s=localStorage.getItem(nC);return s?JSON.parse(s):{}}catch{return{}}});y.useEffect(()=>{localStorage.setItem(nC,JSON.stringify(e))},[e]);const r=(s,o)=>{n({...e,previousRoute:s,...o})},i=()=>{n({}),localStorage.removeItem(nC)};return a.jsx(cV.Provider,{value:{navigationState:e,setNavigationState:n,clearNavigationState:i,setPreviousRoute:r},children:t})},ow=()=>{const t=y.useContext(cV);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t},sde=ZN("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function _r({className:t,variant:e,...n}){return a.jsx("div",{className:Pe(sde({variant:e}),t),...n})}const KT=P.memo(t=>{const{discussionGuide:e,moderatorStatus:n,onSectionSelect:r,onSetPosition:i,onSave:s,showProgress:o=!0,collapsible:c=!0,defaultExpanded:l=!1,className:u,onDownload:d,isDownloading:f=!1,focusGroupId:h,onEditingChange:p}=t,g=typeof e=="string",m=y.useMemo(()=>g?null:e,[e,g]),[v,b]=y.useState(new Set),[x,w]=y.useState(null),[S,C]=y.useState(null),[_,A]=y.useState(!1),[j,T]=y.useState(null),[k,I]=y.useState("");y.useEffect(()=>{p&&p(!!x)},[x,p]),y.useEffect(()=>{if(x&&m){const N=m.sections.find($=>$.id===x);N&&!S&&C({...N})}},[m,x,S]);const E=N=>{w(N.id),C({...N}),b($=>new Set($).add(N.id))},O=()=>{w(null),C(null)},M=y.useCallback(N=>{C($=>$&&{...$,...N})},[]),U=y.useCallback((N,$,z)=>{C(G=>{if(!G)return G;const Q={...G};if(z==="question"&&Q.questions){if(Q.questions.findIndex(Z=>Z.id===N)!==-1)return Q.questions=Q.questions.map(Z=>Z.id===N?{...Z,...$}:Z),Q}else if(z==="activity"&&Q.activities&&Q.activities.findIndex(Z=>Z.id===N)!==-1)return Q.activities=Q.activities.map(Z=>Z.id===N?{...Z,...$}:Z),Q;return Q.subsections&&(Q.subsections=Q.subsections.map(H=>{const Z={...H};return z==="question"&&Z.questions?Z.questions.findIndex(xe=>xe.id===N)!==-1&&(Z.questions=Z.questions.map(xe=>xe.id===N?{...xe,...$}:xe)):z==="activity"&&Z.activities&&Z.activities.findIndex(xe=>xe.id===N)!==-1&&(Z.activities=Z.activities.map(xe=>xe.id===N?{...xe,...$}:xe)),Z})),Q})},[]),D=N=>{if(!S)return;const $={id:`${N}-${Date.now()}`,content:`New ${N}`,type:N==="question"?"open_ended":"discussion",time_limit:void 0},z={...S};N==="question"?z.questions=[...z.questions||[],$]:z.activities=[...z.activities||[],$],C(z)},B=(N,$)=>{if(!S||!S.subsections)return;const z={id:`${$}-${Date.now()}`,content:`New ${$}`,type:$==="question"?"open_ended":"discussion",time_limit:void 0},G=[...S.subsections],Q={...G[N]};$==="question"?Q.questions=[...Q.questions||[],z]:Q.activities=[...Q.activities||[],z],G[N]=Q,C(H=>H&&{...H,subsections:G})},R=()=>{if(!S)return;const N={id:`subsection-${Date.now()}`,title:"New Subsection",questions:[],activities:[]},$=[...S.subsections||[],N];C(z=>z&&{...z,subsections:$})},L=N=>{if(!S||!S.subsections)return;const $=S.subsections.filter((z,G)=>G!==N);C(z=>z&&{...z,subsections:$})},Y=(N,$)=>{var G,Q;if(!S)return;const z={...S};$==="question"?z.questions=(G=z.questions)==null?void 0:G.filter(H=>H.id!==N):z.activities=(Q=z.activities)==null?void 0:Q.filter(H=>H.id!==N),C(z)},q=async()=>{if(!(!S||!m||!s)){A(!0);try{const N={...m,sections:m.sections.map($=>$.id===x?S:$)};await s(N),O(),ne.success("Section updated successfully")}catch(N){console.error("Error saving section:",N),ne.error("Failed to save section")}finally{A(!1)}}},J=N=>{b($=>{const z=new Set($);return z.has(N)?z.delete(N):z.add(N),z})};y.useEffect(()=>{m&&m.sections.length>0&&b(l?new Set(m.sections.map(N=>N.id)):new Set)},[l,m]);const me=(N,$,z,G)=>{if(!n||n.legacy_format)return null;const Q=n.moderator_position;if(Q.section_index!==N)return Q.section_index>N?"completed":null;if(G!==void 0){if(Q.subsection_index===void 0)return null;if(Q.subsection_index!==G)return Q.subsection_index>G?"completed":null}else if(Q.subsection_index!==void 0)return"completed";return Q.item_type!==z?z==="activity"&&Q.item_type==="question"?"completed":null:Q.item_index===$?"current":Q.item_index>$?"completed":null},F=(N,$)=>N===`New ${$}`,oe=y.useCallback((N,$,z)=>{if($<0||$>=N.length||z<0||z>=N.length)return N;const G=[...N],[Q]=G.splice($,1);return G.splice(z,0,Q),G},[]),se=y.useCallback((N,$)=>$>0,[]),le=y.useCallback((N,$)=>${if(!S||!S.subsections)return;const $=S.subsections;if(se($,N)){const z=oe($,N,N-1);C(G=>G&&{...G,subsections:z})}},[S,se,oe]),ue=y.useCallback(N=>{if(!S||!S.subsections)return;const $=S.subsections;if(le($,N)){const z=oe($,N,N+1);C(G=>G&&{...G,subsections:z})}},[S,le,oe]),we=y.useCallback((N,$)=>{T(N),I($)},[]),Ae=y.useCallback(()=>{T(null),I("")},[]),ee=y.useCallback(()=>{if(!j||!S||!S.subsections)return;const N=S.subsections.map($=>$.id===j?{...$,title:k.trim()}:$);C($=>$&&{...$,subsections:N}),Ae()},[j,S,k,Ae]),wt=y.useCallback((N,$,z,G)=>{if(!S)return;const Q=$==="question"?"questions":"activities";if(G!==void 0){const H=S.subsections||[];if(G>=0&&Gbe&&{...be,subsections:Oe})}}}else{const H=S[Q]||[];if(se(H,z)){const Z=oe(H,z,z-1);C(he=>he&&{...he,[Q]:Z})}}},[S,se,oe]),et=y.useCallback((N,$,z,G)=>{if(!S)return;const Q=$==="question"?"questions":"activities";if(G!==void 0){const H=S.subsections||[];if(G>=0&&Gbe&&{...be,subsections:Oe})}}}else{const H=S[Q]||[];if(le(H,z)){const Z=oe(H,z,z+1);C(he=>he&&{...he,[Q]:Z})}}},[S,le,oe]),Ct=(N,$,z,G,Q)=>{var Rt,Ke,Ze,_t,Kt,Qn,Xt,at,Wt;const H=m==null?void 0:m.sections[$],Z=x===(H==null?void 0:H.id),he=me($,z,G,Q),xe=he==="current",Oe=he==="completed",We=(st=>{var Je,fn;return((fn=(Je=st.metadata)==null?void 0:Je.visual_asset)==null?void 0:fn.filename)||null})(N),ot=F(N.content,G);return Z?a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-white border-blue-200",children:[a.jsxs("div",{className:"flex-shrink-0 flex flex-col gap-1",children:[a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>wt(N.id,G,z,Q),disabled:(()=>{if(Q!==void 0){const Je=((S==null?void 0:S.subsections)||[])[Q],fn=(Je==null?void 0:Je[G==="question"?"questions":"activities"])||[];return!se(fn,z)}else{const st=(S==null?void 0:S[G==="question"?"questions":"activities"])||[];return!se(st,z)}})(),className:"h-6 w-6 p-0",title:"Move item up",children:a.jsx(fu,{className:"h-3 w-3"})}),a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>et(N.id,G,z,Q),disabled:(()=>{if(Q!==void 0){const Je=((S==null?void 0:S.subsections)||[])[Q],fn=(Je==null?void 0:Je[G==="question"?"questions":"activities"])||[];return!le(fn,z)}else{const st=(S==null?void 0:S[G==="question"?"questions":"activities"])||[];return!le(st,z)}})(),className:"h-6 w-6 p-0",title:"Move item down",children:a.jsx(Da,{className:"h-3 w-3"})})]}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(_r,{variant:"outline",className:"text-xs",children:G==="activity"?a.jsxs(a.Fragment,{children:[a.jsx(ma,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]}):a.jsxs(a.Fragment,{children:[a.jsx(To,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]})}),N.time_limit&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500",children:[a.jsx(qp,{className:"h-3 w-3"}),a.jsx(Ht,{type:"number",value:N.time_limit,onChange:st=>U(N.id,{time_limit:parseInt(st.target.value)||void 0},G),className:"w-16 h-6 text-xs",placeholder:"min"}),"min"]})]}),a.jsx(ht,{value:ot?"":N.content,onChange:st=>U(N.id,{content:st.target.value},G),placeholder:ot?N.content:"Enter content...",className:"min-h-[60px]"}),G==="question"&&a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium text-slate-700 mb-1 block",children:"Probe Questions (one per line)"}),a.jsx(ht,{value:((Rt=N.probes)==null?void 0:Rt.join(` -`))||"",onChange:st=>{const Je=st.target.value.trim()?st.target.value.split(` -`).filter(fn=>fn.trim()):[];U(N.id,{probes:Je},G)},placeholder:"Enter probe questions, one per line...",className:"min-h-[40px]"})]}),(((Ke=N.metadata)==null?void 0:Ke.image_url)||((Ze=N.metadata)==null?void 0:Ze.image_id)||We)&&a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(cp,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(_t=N.metadata)!=null&&_t.image_url?a.jsx("img",{src:N.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(Kt=N.metadata)!=null&&Kt.image_id&&h?a.jsx("img",{src:bt.getAssetUrl(h,N.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):We&&h?a.jsx("img",{src:bt.getAssetUrl(h,We),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]}),a.jsx("div",{className:"flex-shrink-0",children:a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>Y(N.id,G),className:"h-8 w-8 p-0 text-red-600 hover:text-red-700",children:a.jsx(ir,{className:"h-3 w-3"})})})]},`edit-item-${N.id}`):a.jsxs("div",{className:Pe("flex items-start gap-3 p-3 rounded-lg border transition-colors",xe&&"bg-blue-50 border-blue-200",Oe&&"bg-green-50 border-green-200",!xe&&!Oe&&"bg-slate-50 border-slate-200",r&&"cursor-pointer hover:bg-slate-100"),onClick:()=>r==null?void 0:r(m.sections[$].id,N.id),children:[a.jsx("div",{className:"flex-shrink-0 mt-1",children:Oe?a.jsx(ME,{className:"h-4 w-4 text-green-600"}):xe?a.jsx(d5,{className:"h-4 w-4 text-blue-600"}):a.jsx(DE,{className:"h-4 w-4 text-slate-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[a.jsx(_r,{variant:"outline",className:"text-xs whitespace-nowrap",children:G==="activity"?a.jsxs(a.Fragment,{children:[a.jsx(ma,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]}):a.jsxs(a.Fragment,{children:[a.jsx(To,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]})}),N.time_limit&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500 whitespace-nowrap",children:[a.jsx(qp,{className:"h-3 w-3"}),N.time_limit," min"]}),i&&a.jsxs(X,{size:"sm",variant:"ghost",onClick:st=>{st.stopPropagation();const Je=m.sections[$],fn=G==="activity"?`Activity ${z+1}`:`Question ${z+1}`;i(Je.id,N.id,N.content,Je.title,fn,G,N.metadata)},className:"h-6 px-2 ml-auto",children:[a.jsx(Xv,{className:"h-3 w-3 mr-1"}),"Set Position"]})]}),a.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:N.content}),N.probes&&N.probes.length>0&&a.jsxs("div",{className:"mt-2 pl-4 border-l-2 border-slate-200",children:[a.jsx("p",{className:"text-xs font-medium text-slate-600 mb-1",children:"Probe Questions:"}),a.jsx("ul",{className:"space-y-1",children:N.probes.map((st,Je)=>a.jsxs("li",{className:"text-xs text-slate-600",children:["• ",st]},Je))})]}),(((Qn=N.metadata)==null?void 0:Qn.image_url)||((Xt=N.metadata)==null?void 0:Xt.image_id)||We)&&a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(cp,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(at=N.metadata)!=null&&at.image_url?a.jsx("img",{src:N.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(Wt=N.metadata)!=null&&Wt.image_id&&h?a.jsx("img",{src:bt.getAssetUrl(h,N.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):We&&h?a.jsx("img",{src:bt.getAssetUrl(h,We),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},N.id)},Xe=(N,$)=>{var Z,he,xe,Oe;const z=v.has(N.id),G=x===N.id,Q=G?S:N,H=(n==null?void 0:n.moderator_position.section_index)===$;return a.jsxs("div",{className:Pe("border rounded-lg overflow-hidden transition-colors",H&&"border-blue-500 shadow-md",!H&&"border-slate-200"),children:[a.jsxs("div",{className:Pe("px-4 py-3 flex items-center justify-between cursor-pointer hover:bg-slate-50 transition-colors",H&&"bg-blue-50"),onClick:()=>!G&&J(N.id),children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"transition-transform",style:{transform:z?"rotate(90deg)":"rotate(0deg)"},children:a.jsx(fs,{className:"h-5 w-5 text-slate-500"})}),a.jsx("h3",{className:"font-semibold text-slate-800",children:G?a.jsx(Ht,{value:Q.title,onChange:be=>M({title:be.target.value}),onClick:be=>be.stopPropagation(),className:"font-semibold"}):Q.title}),H&&a.jsx(_r,{variant:"default",className:"text-xs",children:"Current"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[s&&!G&&a.jsx(X,{size:"sm",variant:"ghost",onClick:be=>{be.stopPropagation(),E(N)},className:"h-8 px-2",children:a.jsx(K_,{className:"h-3 w-3"})}),G&&a.jsxs("div",{className:"flex items-center gap-2",onClick:be=>be.stopPropagation(),children:[a.jsxs(X,{size:"sm",variant:"default",onClick:q,disabled:_,className:"h-8",children:[_?a.jsx(eo,{className:"h-3 w-3 animate-spin"}):a.jsx(LE,{className:"h-3 w-3"}),a.jsx("span",{className:"ml-1",children:"Save"})]}),a.jsxs(X,{size:"sm",variant:"ghost",onClick:O,disabled:_,className:"h-8",children:[a.jsx(Mi,{className:"h-3 w-3"}),a.jsx("span",{className:"ml-1",children:"Cancel"})]})]})]})]}),z&&a.jsxs("div",{className:"px-4 py-3 border-t border-slate-200 space-y-4",children:[Q.content&&a.jsx("div",{className:"prose prose-sm max-w-none",children:G?a.jsx(ht,{value:Q.content,onChange:be=>M({content:be.target.value}),placeholder:"Section introduction or context...",className:"min-h-[80px] w-full"}):a.jsx("p",{className:"text-slate-700",children:Q.content})}),Q.activities&&Q.activities.length>0||G?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[a.jsx(ma,{className:"h-4 w-4"}),"Activities"]}),G&&a.jsxs(X,{size:"sm",variant:"outline",onClick:()=>D("activity"),className:"h-7",children:[a.jsx(ma,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),a.jsx("div",{className:"space-y-2",children:(Z=Q.activities)==null?void 0:Z.map((be,We)=>Ct(be,$,We,"activity"))})]}):null,Q.questions&&Q.questions.length>0||G?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[a.jsx(To,{className:"h-4 w-4"}),"Questions"]}),G&&a.jsxs(X,{size:"sm",variant:"outline",onClick:()=>D("question"),className:"h-7",children:[a.jsx(To,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),a.jsx("div",{className:"space-y-2",children:(he=Q.questions)==null?void 0:he.map((be,We)=>Ct(be,$,We,"question"))})]}):null,G&&a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[a.jsx(Xv,{className:"h-4 w-4"}),"Subsections"]}),a.jsxs(X,{size:"sm",variant:"outline",onClick:R,className:"h-7",children:[a.jsx(Xv,{className:"h-3 w-3 mr-1"}),"Add Subsection"]})]})}),Q.subsections&&Q.subsections.length>0&&a.jsx("div",{className:"space-y-3 ml-4",children:Q.subsections.map((be,We)=>{var ot,Rt;return a.jsxs("div",{className:"border-l-2 border-slate-200 pl-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[G&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>ke(We),disabled:!se(Q.subsections||[],We),className:"h-7 w-7 p-0",title:"Move subsection up",children:a.jsx(fu,{className:"h-4 w-4"})}),a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>ue(We),disabled:!le(Q.subsections||[],We),className:"h-7 w-7 p-0",title:"Move subsection down",children:a.jsx(Da,{className:"h-4 w-4"})})]}),G&&j===be.id?a.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[a.jsx(Ht,{value:k,onChange:Ke=>I(Ke.target.value),className:"flex-1",onKeyDown:Ke=>{Ke.key==="Enter"?ee():Ke.key==="Escape"&&Ae()},autoFocus:!0}),a.jsx(X,{size:"sm",onClick:ee,children:a.jsx(uo,{className:"h-3 w-3"})}),a.jsx(X,{size:"sm",variant:"outline",onClick:Ae,children:a.jsx(Mi,{className:"h-3 w-3"})})]}):a.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[a.jsx("h5",{className:Pe("font-medium text-slate-700",G&&"cursor-pointer hover:text-blue-600"),onClick:()=>G&&we(be.id,be.title),children:be.title}),G&&a.jsxs(a.Fragment,{children:[a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>we(be.id,be.title),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100",children:a.jsx(K_,{className:"h-3 w-3"})}),a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>L(We),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100 text-red-600 hover:text-red-700",title:"Delete subsection",children:a.jsx(ir,{className:"h-3 w-3"})})]})]})]}),be.questions&&be.questions.length>0||G?a.jsxs("div",{className:"space-y-2 mb-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[a.jsx(To,{className:"h-3 w-3"}),"Questions"]}),G&&a.jsxs(X,{size:"sm",variant:"outline",onClick:()=>B(We,"question"),className:"h-6",children:[a.jsx(To,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),a.jsx("div",{className:"space-y-2",children:(ot=be.questions)==null?void 0:ot.map((Ke,Ze)=>Ct(Ke,$,Ze,"question",We))})]}):null,be.activities&&be.activities.length>0||G?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[a.jsx(ma,{className:"h-3 w-3"}),"Activities"]}),G&&a.jsxs(X,{size:"sm",variant:"outline",onClick:()=>B(We,"activity"),className:"h-6",children:[a.jsx(ma,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),a.jsx("div",{className:"space-y-2",children:(Rt=be.activities)==null?void 0:Rt.map((Ke,Ze)=>Ct(Ke,$,Ze,"activity",We))})]}):null]},be.id)})}),(((xe=N.metadata)==null?void 0:xe.image_url)||((Oe=N.metadata)==null?void 0:Oe.image_id))&&a.jsxs("div",{className:"mt-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(cp,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),N.metadata.image_url?a.jsx("img",{src:N.metadata.image_url,alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):N.metadata.image_id&&h?a.jsx("img",{src:bt.getAssetUrl(h,N.metadata.image_id),alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},N.id)};if(g)return a.jsxs("div",{className:Pe("space-y-4",u),children:[o&&n&&a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[a.jsx("span",{children:"Progress"}),a.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),a.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:a.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h2",{className:"text-xl font-semibold text-slate-800",children:"Discussion Guide"}),d&&a.jsxs(X,{size:"sm",variant:"outline",onClick:d,disabled:f,children:[f?a.jsx(eo,{className:"h-4 w-4 animate-spin mr-2"}):a.jsx(Jc,{className:"h-4 w-4 mr-2"}),"Download"]})]}),a.jsx("div",{className:"prose prose-sm max-w-none",children:a.jsx("pre",{className:"whitespace-pre-wrap text-sm text-slate-700 font-sans",children:e})}),n&&a.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[a.jsx("h3",{className:"font-medium text-blue-900 mb-2",children:"Current Position"}),a.jsx("p",{className:"text-sm text-blue-800",children:n.current_section}),n.current_item&&a.jsx("p",{className:"text-sm text-blue-700 mt-1",children:n.current_item})]})]})]});if(!m)return a.jsx("div",{className:Pe("bg-slate-50 rounded-lg p-8 text-center",u),children:a.jsx("p",{className:"text-slate-600",children:"No discussion guide available"})});const nn=a.jsxs("div",{className:"space-y-4",children:[o&&n&&a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[a.jsx("span",{children:"Overall Progress"}),a.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),a.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:a.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})}),a.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 mt-2",children:[a.jsxs("span",{children:["Section ",n.moderator_position.section_index+1," of ",n.total_sections]}),a.jsxs("span",{children:[Math.round(n.section_progress),"% of current section"]})]})]}),a.jsx("div",{className:"space-y-3",children:m.sections.map((N,$)=>Xe(N,$))})]});return c?a.jsxs(jg,{defaultOpen:l,className:u,children:[a.jsx(Eg,{asChild:!0,children:a.jsxs("div",{className:"flex items-center justify-between p-4 bg-white rounded-lg border border-slate-200 cursor-pointer hover:bg-slate-50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(fs,{className:"h-5 w-5 text-slate-500 transition-transform data-[state=open]:rotate-90"}),a.jsx("h2",{className:"text-lg font-semibold text-slate-800",children:m.title||"Discussion Guide"}),a.jsxs(_r,{variant:"outline",className:"text-xs",children:[m.total_duration," min"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[n&&a.jsxs(_r,{variant:n.progress===100?"success":"default",className:"text-xs",children:[Math.round(n.progress),"% Complete"]}),d&&a.jsx(X,{size:"sm",variant:"outline",onClick:N=>{N.stopPropagation(),d()},disabled:f,children:f?a.jsx(eo,{className:"h-4 w-4 animate-spin"}):a.jsx(Jc,{className:"h-4 w-4"})})]})]})}),a.jsx(Ng,{className:"mt-4",children:nn})]}):a.jsx("div",{className:u,children:nn})});KT.displayName="DiscussionGuideViewer";function ode({onAssetsChange:t,onUploadComplete:e,onUploadError:n,focusGroupId:r,disabled:i=!1,maxAssets:s=10,allowedTypes:o=["image/*","application/pdf","video/*"],label:c="Upload Assets",description:l="Upload creative assets for testing"}){const[u,d]=y.useState([]),[f,h]=y.useState([]),[p,g]=y.useState(null),[m,v]=y.useState("");y.useEffect(()=>{r&&b()},[r]);const b=async()=>{if(r)try{const M=(await bt.getAssets(r)).data.assets||[];h(M),t&&t(M)}catch(O){console.error("Error fetching backend assets:",O)}},x=async O=>{if(!O||O.length===0||!r)return;if(u.length+f.length+O.length>s){ne.error(`You can only upload up to ${s} assets`);return}const U=Array.from(O).map(D=>{const B=D.type.startsWith("image/")?URL.createObjectURL(D):void 0;return{id:`local-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:D,previewUrl:B,status:"uploading"}});d(D=>[...D,...U]);for(const D of U)try{const B=new FormData;if(B.append("assets",D.file),(await bt.uploadAssets(r,B,!1)).data.uploaded_assets>0)d(Y=>Y.map(q=>q.id===D.id?{...q,status:"uploaded"}:q)),await b(),ne.success(`${D.file.name} uploaded successfully`);else throw new Error("Upload failed")}catch(B){console.error(`Upload failed for ${D.file.name}:`,B),d(R=>R.map(L=>{var Y,q;return L.id===D.id?{...L,status:"failed",error:((q=(Y=B.response)==null?void 0:Y.data)==null?void 0:q.error)||"Upload failed"}:L})),n&&n(B)}e&&setTimeout(()=>{e(f)},500)},w=async O=>{if(r)try{await bt.deleteAsset(r,O),await b(),ne.info("Asset removed")}catch(M){console.error("Error removing asset:",M),ne.error("Failed to remove asset")}},S=O=>{const M=u.find(U=>U.id===O);M!=null&&M.previewUrl&&URL.revokeObjectURL(M.previewUrl),d(U=>U.filter(D=>D.id!==O))},C=async O=>{if(r){d(M=>M.map(U=>U.id===O.id?{...U,status:"uploading",error:void 0}:U));try{const M=new FormData;if(M.append("assets",O.file),(await bt.uploadAssets(r,M,!1)).data.uploaded_assets>0)d(B=>B.map(R=>R.id===O.id?{...R,status:"uploaded"}:R)),await b(),ne.success(`${O.file.name} uploaded successfully`);else throw new Error("Upload failed")}catch(M){d(U=>U.map(D=>{var B,R;return D.id===O.id?{...D,status:"failed",error:((R=(B=M.response)==null?void 0:B.data)==null?void 0:R.error)||"Upload failed"}:D})),ne.error(`Failed to upload ${O.file.name}`)}}},_=O=>{g(O.filename),v(O.user_assigned_name||"")},A=async O=>{if(!r||!m.trim()){j();return}try{await bt.updateAssetName(r,O,m.trim()),h(M=>M.map(U=>U.filename===O?{...U,user_assigned_name:m.trim()}:U)),t&&t(f),g(null),v(""),ne.success("Asset name updated")}catch(M){console.error("Error updating asset name:",M),ne.error("Failed to update asset name")}},j=()=>{g(null),v("")},T=O=>O.startsWith("image/")?a.jsx(cp,{className:"h-8 w-8 text-slate-400"}):O.startsWith("video/")?a.jsx(XJ,{className:"h-8 w-8 text-slate-400"}):O==="application/pdf"?a.jsx(Yp,{className:"h-8 w-8 text-slate-400"}):a.jsx(Yp,{className:"h-8 w-8 text-slate-400"}),k=(O,M)=>O.user_assigned_name||`Asset ${M+1}`,I=u.length+f.length,E=s-I;return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center transition ${i?"border-slate-100 bg-slate-25 cursor-not-allowed":"border-slate-200 bg-slate-50 hover:bg-slate-100 cursor-pointer"}`,children:i?a.jsxs(a.Fragment,{children:[a.jsx(H_,{className:"h-10 w-10 text-slate-300 mb-2"}),a.jsx("p",{className:"text-sm text-slate-400 mb-1",children:"Asset Upload Disabled"}),a.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Complete focus group details above to enable asset uploads"})]}):a.jsxs(a.Fragment,{children:[a.jsx(H_,{className:"h-10 w-10 text-slate-400 mb-2"}),a.jsx("p",{className:"text-sm text-slate-600 mb-1",children:c}),a.jsx("p",{className:"text-xs text-slate-500 mb-3",children:l}),a.jsx("input",{type:"file",accept:o.join(","),multiple:!0,onChange:O=>x(O.target.files),className:"hidden",id:"asset-uploader-input",disabled:i}),a.jsxs(X,{type:"button",variant:"outline",size:"sm",onClick:()=>{var O;return(O=document.getElementById("asset-uploader-input"))==null?void 0:O.click()},disabled:i||E<=0,children:[a.jsx(h5,{className:"mr-2 h-4 w-4"}),"Select Files"]}),a.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:[E," of ",s," uploads remaining"]})]})}),(f.length>0||u.length>0)&&a.jsxs(lt,{className:"p-4",children:[a.jsxs("h4",{className:"text-sm font-medium mb-3",children:["Uploaded Assets (",f.length+u.filter(O=>O.status==="uploaded").length,")"]}),a.jsxs("div",{className:"space-y-3",children:[f.map((O,M)=>{var U;return a.jsxs("div",{className:"flex items-center gap-4 p-3 border rounded-lg bg-white",children:[a.jsx("div",{className:"w-12 h-12 bg-slate-100 rounded flex items-center justify-center flex-shrink-0",children:(U=O.mime_type)!=null&&U.startsWith("image/")?a.jsx("img",{src:bt.getAssetUrl(r,O.filename),alt:k(O,M),className:"max-h-full max-w-full object-contain rounded"}):T(O.mime_type)}),a.jsx("div",{className:"flex-grow min-w-0",children:p===O.filename?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ht,{value:m,onChange:D=>v(D.target.value),placeholder:`Asset ${M+1}`,className:"flex-1",autoFocus:!0,onKeyDown:D=>{D.key==="Enter"?(D.preventDefault(),A(O.filename)):D.key==="Escape"&&j()}}),a.jsx(X,{size:"sm",variant:"outline",type:"button",onClick:()=>A(O.filename),children:a.jsx(uo,{className:"h-4 w-4"})}),a.jsx(X,{size:"sm",variant:"outline",type:"button",onClick:j,children:a.jsx(Mi,{className:"h-4 w-4"})})]}):a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"font-medium text-sm truncate",children:k(O,M)}),a.jsx(X,{size:"sm",variant:"ghost",type:"button",onClick:()=>_(O),className:"h-6 w-6 p-0",children:a.jsx(K_,{className:"h-3 w-3"})})]}),a.jsxs("p",{className:"text-xs text-slate-500 truncate",children:["Original: ",O.original_name]})]})}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Will appear as:"}),a.jsxs("div",{className:"text-sm font-medium text-primary",children:['"',k(O,M),'"']})]}),a.jsx(X,{size:"sm",variant:"ghost",type:"button",onClick:()=>w(O.filename),className:"h-8 w-8 p-0 text-slate-400 hover:text-red-500",children:a.jsx(Mi,{className:"h-4 w-4"})})]})]},O.filename)}),u.map(O=>a.jsxs("div",{className:"flex items-center gap-4 p-3 border rounded-lg bg-slate-50",children:[a.jsx("div",{className:"w-12 h-12 bg-slate-100 rounded flex items-center justify-center flex-shrink-0",children:O.previewUrl?a.jsx("img",{src:O.previewUrl,alt:O.file.name,className:"max-h-full max-w-full object-contain rounded"}):T(O.file.type)}),a.jsxs("div",{className:"flex-grow min-w-0",children:[a.jsx("p",{className:"font-medium text-sm truncate",children:O.file.name}),a.jsxs("p",{className:"text-xs text-slate-500",children:[(O.file.size/1024).toFixed(1)," KB"]}),O.error&&a.jsx("p",{className:"text-xs text-red-500 truncate",children:O.error})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[O.status==="uploading"&&a.jsxs("div",{className:"flex items-center gap-2 text-blue-600",children:[a.jsx(eo,{className:"h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-xs",children:"Uploading..."})]}),O.status==="failed"&&a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(X,{size:"sm",variant:"outline",type:"button",onClick:()=>C(O),className:"h-7 text-xs",children:[a.jsx(Xl,{className:"h-3 w-3 mr-1"}),"Retry"]})}),a.jsx(X,{size:"sm",variant:"ghost",type:"button",onClick:()=>S(O.id),className:"h-8 w-8 p-0 text-slate-400 hover:text-red-500",children:a.jsx(Mi,{className:"h-4 w-4"})})]})]},O.id))]}),f.length>0&&a.jsx("div",{className:"mt-4 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:a.jsxs("p",{className:"text-sm text-blue-800",children:[a.jsx("strong",{children:"Asset Names:"})," Click the edit icon to customize how assets will be referenced in the discussion guide. Leave blank to use default numbering."]})})]})]})}const bl="all",ade=Re.object({researchBrief:Re.string().min(10,{message:"Research brief must be at least 10 characters."}),focusGroupName:Re.string().min(3,{message:"Focus group name must be at least 3 characters."}),discussionTopics:Re.string().min(10,{message:"Discussion topics are required."}),duration:Re.string().min(1,{message:"Duration is required."}),llm_model:Re.string().optional(),reasoning_effort:Re.string().optional(),verbosity:Re.string().optional()});function cde({draftToEdit:t,onDraftSaved:e,preSelectedParticipants:n=[]}={}){console.log("FocusGroupModerator component rendering, draftToEdit:",t);const r=lr();Bi();const{setPreviousRoute:i,navigationState:s,clearNavigationState:o}=ow(),[c,l]=y.useState("setup"),[u,d]=y.useState(!1),[f,h]=y.useState(!1),[p,g]=y.useState(!1),[m,v]=y.useState(null),[b,x]=y.useState(null),[w,S]=y.useState(!1),C=y.useRef(m);C.current=m;const _=y.useRef(!1),A=V=>V&&typeof V=="object"&&V.title&&V.sections,[j,T]=y.useState([]),[k,I]=y.useState([]),[E,O]=y.useState(!1),[M,U]=y.useState([]),[D,B]=y.useState(!1),[R,L]=y.useState(!1),[Y,q]=y.useState([]),[J,me]=y.useState(bl),[F,oe]=y.useState(!1),[se,le]=y.useState(""),[ke,ue]=y.useState(null),[we,Ae]=y.useState(""),[ee,wt]=y.useState(""),[et,Ct]=y.useState(!1),[Xe,nn]=y.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[N,$]=y.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[z,G]=y.useState("idle"),[Q,H]=y.useState(null),[Z,he]=y.useState(0),xe=y.useRef(null),Oe=y.useRef(!1),be=y.useRef(!1),We=V=>{i("/focus-groups",{focusGroupId:b,focusGroupTab:"participants",isNewFocusGroup:!t,focusGroupData:{name:Je.getValues("name"),description:Je.getValues("description"),selectedParticipants:j,discussionGuide:m}}),r(`/synthetic-users/${V.id}`)},ot=V=>{const ve={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return V.forEach(de=>{if(de.age&&ve.age.add(de.age),de.gender&&ve.gender.add(de.gender),de.occupation&&ve.occupation.add(de.occupation),de.location&&ve.location.add(de.location),de.techSavviness!==void 0){const Ee=de.techSavviness<30?"Low (0-30)":de.techSavviness<70?"Medium (31-70)":"High (71-100)";ve.techSavviness.add(Ee)}de.ethnicity&&ve.ethnicity.add(de.ethnicity)}),{age:Array.from(ve.age).sort(),gender:Array.from(ve.gender).sort(),occupation:Array.from(ve.occupation).sort(),location:Array.from(ve.location).sort(),techSavviness:Array.from(ve.techSavviness).sort((de,Ee)=>{const jt=["Low (0-30)","Medium (31-70)","High (71-100)"];return jt.indexOf(de)-jt.indexOf(Ee)}),ethnicity:Array.from(ve.ethnicity).sort()}},Rt=V=>{const ve={...N};ve[V]=[];const de=M.filter(Ee=>{let jt=!0;return J!==bl&&(jt=!1,Ee.folder_ids&&Array.isArray(Ee.folder_ids)&&(jt=Ee.folder_ids.includes(J)),!jt&&(Ee.folder_id===J||Ee.folderId===J)&&(jt=!0)),jt?Object.entries(ve).every(([Gn,as])=>{if(as.length===0)return!0;const te=Gn;if(te==="techSavviness"&&Ee.techSavviness!==void 0){const ae=Ee.techSavviness<30?"Low (0-30)":Ee.techSavviness<70?"Medium (31-70)":"High (71-100)";return as.includes(ae)}else{if(te==="age"&&Ee.age)return as.includes(Ee.age);if(te==="gender"&&Ee.gender)return as.includes(Ee.gender);if(te==="occupation"&&Ee.occupation)return as.includes(Ee.occupation);if(te==="location"&&Ee.location)return as.includes(Ee.location);if(te==="ethnicity"&&Ee.ethnicity)return as.includes(Ee.ethnicity)}return!0}):!1});return ot(de)},Ke=()=>{Ct(!1),setTimeout(()=>{nn({...N})},0)},Ze=()=>{$({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]})},_t=(V,ve)=>{$(de=>{const Ee={...de};return Ee[V].includes(ve)?Ee[V]=Ee[V].filter(jt=>jt!==ve):Ee[V]=[...Ee[V],ve],Ee})},Kt=async()=>{try{const de=(await Po.getAll()).data.map(Ee=>({...Ee,id:Ee._id}));return q(de),de}catch(V){return console.error("Error fetching folders:",V),ne.error("Failed to load folders"),q([]),[]}},Qn=async()=>{if(!se.trim()){ne.error("Please enter a folder name");return}try{const V=await Po.create({name:se.trim()});await Kt(),le(""),oe(!1),ne.success(`Folder "${se}" created`)}catch(V){console.error("Error creating folder:",V),ne.error("Failed to create folder")}},Xt=()=>{le(""),oe(!1)},at=V=>{ue(V),Ae(V.name)},Wt=async()=>{if(!ke||!we.trim()){ue(null);return}try{await Po.update(ke._id,{name:we.trim()}),await Kt(),ue(null),ne.success(`Folder renamed to "${we}"`)}catch(V){console.error("Error renaming folder:",V),ne.error("Failed to rename folder"),ue(null)}},st=()=>{ue(null),Ae("")};y.useEffect(()=>{const V=async()=>{B(!0);try{const de=await $r.getAll();console.log("Fetched personas for FocusGroupModerator:",de.data),Array.isArray(de.data)&&de.data.length>0?U(de.data):(console.warn("No personas returned from API or invalid format",de.data),ne.warning("No participants available"))}catch(de){console.error("Error fetching personas:",de),ne.error("Failed to load participants")}finally{B(!1)}};(async()=>{await Promise.all([Kt(),V()])})()},[]),console.log("About to initialize form with useForm hook");const Je=V0({resolver:G0(ade),defaultValues:{researchBrief:"",focusGroupName:"",discussionTopics:"",duration:"60",llm_model:"gemini-2.5-pro",reasoning_effort:"medium",verbosity:"medium"}});console.log("Form initialized successfully");const fn=()=>{c!=="setup"||be.current||(xe.current&&clearTimeout(xe.current),xe.current=setTimeout(async()=>{if(Oe.current)return;const V=Je.getValues(),ve={name:V.focusGroupName||"",description:V.researchBrief||"",objective:V.researchBrief||"",topic:V.discussionTopics||"",duration:V.duration?parseInt(V.duration):60,llm_model:V.llm_model||"gemini-2.5-pro",reasoning_effort:V.reasoning_effort||"medium",verbosity:V.verbosity||"medium",participants:j,participants_count:j.length,status:"draft",date:new Date().toISOString(),uploadedAssets:k.map(de=>de.filename||de.original_name||"unknown")};if(!(Q&&JSON.stringify(ve)===JSON.stringify(Q))&&!(!ve.name&&!ve.description&&!ve.topic)){Oe.current=!0,G("saving");try{let de=b||(t==null?void 0:t.id)||(t==null?void 0:t._id);if(console.log("Auto-save: draftFocusGroupId =",b),console.log("Auto-save: draftToEdit ID =",(t==null?void 0:t.id)||(t==null?void 0:t._id)),console.log("Auto-save: using focusGroupId =",de),console.log("Auto-save: llm_model in currentData =",ve.llm_model),console.log("Auto-save: duration in currentData =",ve.duration),de)console.log("Auto-save: Updating existing focus group:",de),await bt.update(de,ve),console.log("Auto-save: Updated existing draft:",de);else{console.log("Auto-save: Creating NEW focus group (no existing ID)");const Ee=await bt.create(ve);de=Ee.data.focus_group_id||Ee.data.id||Ee.data._id,x(de),console.log("Auto-save: Created new draft with ID:",de)}H(ve),G("saved"),he(0),setTimeout(()=>{G("idle")},2e3)}catch(de){if(console.error("Auto-save failed:",de),G("error"),he(Ee=>Ee+1),Z<3){const Ee=Math.pow(2,Z)*2e3;setTimeout(()=>{fn()},Ee)}else ne.error("Auto-save failed",{description:"Your changes may not be saved. Please check your connection."})}finally{Oe.current=!1}}},2e3))},Is=async V=>{try{O(!0);const ve=await bt.getAssets(V);I(ve.data.assets||[])}catch(ve){console.error("Error fetching backend assets:",ve),ne.error("Failed to load asset information")}finally{O(!1)}},ra=Je.watch(),W=y.useRef(""),Ie=y.useRef("");y.useEffect(()=>{const V=JSON.stringify(ra);c==="setup"&&V!==W.current&&(W.current=V,fn())},[ra,c]),y.useEffect(()=>{const V=JSON.stringify(j);c==="setup"&&V!==Ie.current&&(Ie.current=V,fn())},[j,c]),y.useEffect(()=>(c!=="setup"&&xe.current&&clearTimeout(xe.current),()=>{xe.current&&clearTimeout(xe.current)}),[c]),y.useEffect(()=>{if(console.log("Draft loading effect - draftToEdit:",t,"draftLoadedRef.current:",_.current),!t){_.current=!1;return}if(t&&!_.current){console.log("Loading draft focus group:",t),be.current=!0,_.current=!0;const V=t.id||t._id;x(V),console.log("Setting draft ID from draftToEdit:",V),V&&Is(V),t.name&&Je.setValue("focusGroupName",t.name),(t.description||t.objective)&&Je.setValue("researchBrief",t.description||t.objective||""),t.topic&&Je.setValue("discussionTopics",t.topic),t.duration&&Je.setValue("duration",t.duration.toString()),t.llm_model&&Je.setValue("llm_model",t.llm_model),t.reasoning_effort&&Je.setValue("reasoning_effort",t.reasoning_effort),t.verbosity&&Je.setValue("verbosity",t.verbosity),t.discussionGuide&&(v(t.discussionGuide),(!s.focusGroupTab||s.previousRoute!=="/focus-groups")&&l("review")),t.participants&&Array.isArray(t.participants)&&T(t.participants);const ve={name:t.name||"",description:t.description||t.objective||"",objective:t.description||t.objective||"",topic:t.topic||"",duration:t.duration||60,llm_model:t.llm_model||"gemini-2.5-pro",reasoning_effort:t.reasoning_effort||"medium",verbosity:t.verbosity||"medium",participants:t.participants||[],participants_count:(t.participants||[]).length,status:"draft",date:t.date||new Date().toISOString(),uploadedAssets:k.map(de=>de.filename||de.original_name||"unknown")};H(ve),console.log("Set lastSavedData to current draft:",ve),ne.success("Draft focus group loaded",{description:"Continue editing your focus group setup"}),setTimeout(()=>{be.current=!1;const de=JSON.stringify(Je.getValues());W.current=de},1e3)}},[t,Je]),y.useEffect(()=>{n.length>0&&(console.log("Pre-selected participants received:",n),T(n),l("participants"))},[n]),y.useEffect(()=>{s.focusGroupTab&&s.previousRoute==="/focus-groups"&&setTimeout(()=>{l(s.focusGroupTab),o()},0)},[s.focusGroupTab,t,o]),y.useEffect(()=>{t||setTimeout(()=>{be.current=!1;const V=JSON.stringify(Je.getValues());W.current=V},500)},[t,Je]);const Ve=()=>{if(z==="idle")return null;const ve={saving:{text:"Saving...",className:"text-blue-600 bg-blue-50"},saved:{text:"All changes saved",className:"text-green-600 bg-green-50"},error:{text:"Save failed - retrying...",className:"text-red-600 bg-red-50"}}[z];return a.jsx("div",{className:`fixed top-16 left-1/2 transform -translate-x-1/2 z-50 px-3 py-1 rounded-md text-sm font-medium border shadow-sm ${ve.className}`,children:ve.text})},ut=async(V,ve)=>{var de,Ee;d(!0),h(!1),g(!1);try{const jt={name:V.focusGroupName,description:V.researchBrief,objective:V.researchBrief,topic:V.discussionTopics,duration:parseInt(V.duration),llm_model:V.llm_model,reasoning_effort:V.reasoning_effort,verbosity:V.verbosity},Gn=ve?await bt.generateDiscussionGuideForGroup(ve,jt):await bt.generateDiscussionGuide(jt);if(Gn.data&&Gn.data.discussionGuide)return h(!0),Gn.data.discussionGuide;throw new Error("Failed to generate discussion guide")}catch(jt){console.error("Error generating discussion guide:",jt),g(!0);let Gn="Unknown error occurred";throw(Ee=(de=jt==null?void 0:jt.response)==null?void 0:de.data)!=null&&Ee.error?Gn=jt.response.data.error:jt!=null&&jt.message&&(Gn=jt.message),Gn.includes("500")||Gn.includes("internal error")||Gn.includes("Internal Server Error")?ne.error("AI service temporarily unavailable",{description:"The discussion guide generator is experiencing issues. Please try again in a few minutes.",action:{label:"Retry",onClick:()=>ut(V)}}):ne.error("Failed to generate discussion guide",{description:Gn,action:{label:"Retry",onClick:()=>ut(V)}}),jt}},tt=()=>{d(!1),h(!1),g(!1)};async function St(V){try{let ve=b;if(!ve){const de={name:V.focusGroupName,status:"draft",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(V.duration),topic:V.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:V.researchBrief,objective:V.researchBrief,llm_model:V.llm_model,reasoning_effort:V.reasoning_effort,verbosity:V.verbosity},Ee=await bt.create(de);ve=Ee.data.focus_group_id||Ee.data.id||Ee.data._id,x(ve),console.log("Draft focus group created for discussion guide generation:",Ee,"with ID:",ve)}if(ve)try{const de={name:V.focusGroupName,participants:j,participants_count:j.length,duration:parseInt(V.duration),topic:V.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:V.researchBrief,objective:V.researchBrief,llm_model:V.llm_model,reasoning_effort:V.reasoning_effort,verbosity:V.verbosity};await bt.update(ve,de),console.log("Focus group updated with latest form values before guide generation"),console.log(`🔄 Updated focus group ${ve} with model: ${V.llm_model}`)}catch(de){console.error("Failed to update focus group before guide generation:",de)}try{const de=await ut(V,ve);v(de);try{const Ee={name:V.focusGroupName,status:"draft",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(V.duration),topic:V.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:V.researchBrief,objective:V.researchBrief,llm_model:V.llm_model,reasoning_effort:V.reasoning_effort,verbosity:V.verbosity,discussionGuide:de};await bt.update(ve,Ee),console.log("Focus group updated with discussion guide"),ne.success("Progress saved as draft",{description:"Your focus group setup has been automatically saved"})}catch(Ee){console.error("Failed to update focus group with discussion guide:",Ee),ne.error("Failed to save draft",{description:"Discussion guide generated, but draft save failed"})}l("review"),ne.success("Discussion guide generated",{description:"Review and edit before proceeding"})}catch(de){console.error("Discussion guide generation failed:",de),ne.error("Discussion guide generation failed",{description:"Please go back to the setup tab and try generating again. Check your inputs and try a different AI model if the issue persists.",duration:8e3});return}}catch(ve){console.error("Error in focus group creation flow:",ve),ne.error("Focus group creation failed",{description:ve.message||"An unexpected error occurred"})}}const on=(()=>{var ve;const V=M.filter(de=>{const Ee=de.name.toLowerCase().includes(ee.toLowerCase())||de.occupation&&de.occupation.toLowerCase().includes(ee.toLowerCase())||de.location&&de.location.toLowerCase().includes(ee.toLowerCase()),jt=(Xe.age.length===0||Xe.age.includes(de.age))&&(Xe.gender.length===0||Xe.gender.includes(de.gender))&&(Xe.occupation.length===0||Xe.occupation.includes(de.occupation))&&(Xe.location.length===0||Xe.location.includes(de.location))&&(Xe.ethnicity.length===0||de.ethnicity&&Xe.ethnicity.includes(de.ethnicity))&&(Xe.techSavviness.length===0||de.techSavviness!==void 0&&Xe.techSavviness.includes(de.techSavviness<30?"Low (0-30)":de.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&!0;let Gn=!0;return J!==bl&&(Gn=!1,de.folder_ids&&Array.isArray(de.folder_ids)&&(Gn=de.folder_ids.includes(J)),Gn||(de.folder_id===J||de.folderId===J)&&(Gn=!0)),Ee&&jt&&Gn});if(console.log(`Filtered personas: ${V.length}/${M.length}`),console.log(`Selected folder: ${J===bl?"All Personas":((ve=Y.find(de=>de._id===J||de.id===J))==null?void 0:ve.name)||J}`),J!==bl){const de=Y.find(Ee=>Ee._id===J||Ee.id===J);if(de){const Ee=M.filter(jt=>jt.folder_ids&&Array.isArray(jt.folder_ids)?jt.folder_ids.includes(J):jt.folder_id===J||jt.folderId===J);console.log(`Folder details: ${de.name}, ID: ${de._id}, Contains: ${Ee.length} personas`),console.log("Personas in this folder:",Ee.map(jt=>jt.name))}}return V})(),dt=V=>{console.log("Toggling selection for participant ID:",V),T(ve=>{const de=ve.includes(V);console.log("Current selection:",{id:V,isCurrentlySelected:de,currentSelections:[...ve]});const Ee=de?ve.filter(jt=>jt!==V):[...ve,V];return console.log("New selection:",Ee),Ee})},_n=async()=>{try{const V=Je.getValues(),ve={name:V.focusGroupName,status:"in-progress",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(V.duration),topic:V.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),discussionGuide:m},Ee=(await bt.create(ve)).data;return console.log("Focus group created successfully:",Ee),Ee.focus_group_id}catch(V){throw console.error("Error saving focus group:",V),V}},an=y.useCallback(async()=>{if(!C.current){ne.error("No discussion guide available",{description:"Please generate a discussion guide first"});return}L(!0);try{const{downloadDiscussionGuideAsMarkdown:V}=await Vie(async()=>{const{downloadDiscussionGuideAsMarkdown:de}=await import("./discussionGuideMarkdown-eMXneipz.js");return{downloadDiscussionGuideAsMarkdown:de}},[]),ve=Je.getValues();V(C.current,ve.focusGroupName),ne.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(V){console.error("Error downloading discussion guide:",V),ne.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{L(!1)}},[Je]),rn=y.useCallback(async V=>{console.log("📝 handleSaveDiscussionGuide called with:",V),w?(C.current=V,console.log("📝 Skipping discussionGuide state update during editing to preserve focus")):(v(V),ne.success("Discussion guide updated",{description:"Your changes have been saved."}))},[w]),yr=y.useCallback(V=>{console.log("📝 Discussion guide editing state changed:",V),S(V),!V&&C.current&&(console.log("📝 Updating discussionGuide state after editing ended"),v(C.current))},[]),Rs=y.useCallback(()=>{},[]),Xn=async()=>{if(!Je.getValues().focusGroupName){ne.error("Missing focus group name",{description:"Please provide a name for the focus group"});return}if(!m){ne.error("Missing discussion guide",{description:"Please generate a discussion guide first"});return}if(j.length<1){ne.error("Not enough participants",{description:"Please select at least one participant for the focus group"});return}console.log("Starting focus group with participants:",j);try{ne.loading("Creating focus group...");let V;if(b){const ve=Je.getValues(),de={name:ve.focusGroupName,status:"in-progress",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(ve.duration),topic:ve.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:ve.researchBrief,objective:ve.researchBrief,discussionGuide:m},Ee=await bt.update(b,de);V=b,console.log("Draft focus group updated to in-progress:",Ee),e&&e()}else V=await _n();ne.dismiss(),ne.success("Focus group created successfully",{description:"The AI moderator is now running the session"}),r(`/focus-groups/${V}`)}catch(V){ne.dismiss(),V!=null&&V.message,console.error("Failed to start focus group:",V),ne.error("Failed to create focus group",{description:"Please try again or check your connection"})}};return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{}),a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Wo,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Focus Group Moderator"})]}),u&&a.jsx("div",{className:"mb-6",children:a.jsx(GT,{isActive:u,isComplete:f,hasError:p,label:"Generating discussion guide",onComplete:tt})}),a.jsxs(hl,{value:c,onValueChange:l,children:[a.jsxs(Ka,{className:"grid w-full grid-cols-3 mb-6",children:[a.jsx(gn,{value:"setup",children:"Setup"}),a.jsx(gn,{value:"review",children:"Review & Edit"}),a.jsx(gn,{value:"participants",children:"Participants"})]}),a.jsx(vn,{value:"setup",children:a.jsx(W0,{...Je,children:a.jsxs("form",{onSubmit:Je.handleSubmit(St),className:"space-y-6",children:[a.jsx(yt,{control:Je.control,name:"focusGroupName",render:({field:V})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Focus Group Name"}),a.jsx(gt,{children:a.jsx(Ht,{placeholder:"e.g., Mobile App UX Evaluation",...V})}),a.jsx(Mn,{children:"Give your focus group a descriptive name"}),a.jsx(vt,{})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(yt,{control:Je.control,name:"researchBrief",render:({field:V})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Research Brief"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"Describe your research objectives...",className:"h-36",...V})}),a.jsx(Mn,{children:"Provide context about what you want to learn"}),a.jsx(vt,{})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(yt,{control:Je.control,name:"discussionTopics",render:({field:V})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Discussion Topics"}),a.jsx(gt,{children:a.jsx(ht,{placeholder:"List main topics to cover, separated by commas",className:"h-24",...V})}),a.jsx(Mn,{children:"E.g., User experience, feature preferences, pain points"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:Je.control,name:"duration",render:({field:V})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Duration (minutes)"}),a.jsxs(Bn,{onValueChange:V.onChange,value:V.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select duration"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"30",children:"30 minutes"}),a.jsx(ie,{value:"45",children:"45 minutes"}),a.jsx(ie,{value:"60",children:"60 minutes"}),a.jsx(ie,{value:"90",children:"90 minutes"}),a.jsx(ie,{value:"120",children:"120 minutes"})]})]}),a.jsx(Mn,{children:"How long should the focus group session last?"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:Je.control,name:"llm_model",render:({field:V})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"AI Model"}),a.jsxs(Bn,{onValueChange:V.onChange,value:V.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select AI model"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),a.jsx(ie,{value:"gpt-4.1",children:"GPT-4.1"}),a.jsx(ie,{value:"gpt-5",children:"GPT-5"})]})]}),a.jsx(Mn,{children:"Choose which AI model to use for generating responses and discussion guides"}),a.jsx(vt,{})]})}),Je.watch("llm_model")==="gpt-5"&&a.jsxs(a.Fragment,{children:[a.jsx(yt,{control:Je.control,name:"reasoning_effort",render:({field:V})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Reasoning Effort"}),a.jsxs(Bn,{onValueChange:V.onChange,value:V.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select reasoning effort"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"minimal",children:"Minimal - Fast responses"}),a.jsx(ie,{value:"low",children:"Low - Quick thinking"}),a.jsx(ie,{value:"medium",children:"Medium - Balanced (default)"}),a.jsx(ie,{value:"high",children:"High - Deep reasoning"})]})]}),a.jsx(Mn,{children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx("div",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx(vt,{})]})}),a.jsx(yt,{control:Je.control,name:"verbosity",render:({field:V})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Response Verbosity"}),a.jsxs(Bn,{onValueChange:V.onChange,value:V.value,children:[a.jsx(gt,{children:a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select verbosity level"})})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"low",children:"Low - Concise responses"}),a.jsx(ie,{value:"medium",children:"Medium - Balanced length (default)"}),a.jsx(ie,{value:"high",children:"High - Detailed responses"})]})]}),a.jsx(Mn,{children:"Controls how detailed and lengthy GPT-5's responses will be"}),a.jsx("div",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx(vt,{})]})})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-2 block",children:"Creative Assets (Optional)"}),a.jsx(ode,{focusGroupId:b,disabled:!b,onUploadComplete:V=>{I(V)},onUploadError:V=>{console.error("Asset upload error:",V)},onAssetsChange:V=>{I(V)},maxAssets:10,allowedTypes:["image/*","application/pdf","video/*"],label:"Upload Creative Assets",description:"Upload images, mockups, or product designs for testing"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Upload visuals that you want feedback on during the session"})]}),a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex justify-end",children:a.jsxs(X,{type:"submit",disabled:u,className:"min-w-32",children:[a.jsx(Wo,{className:"mr-2 h-4 w-4"}),u?"Generating...":"Generate Discussion Guide"]})})})]})})}),a.jsx(vn,{value:"review",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h3",{className:"font-sf text-lg font-medium",children:"AI-Generated Discussion Guide"}),m&&a.jsx(_r,{variant:"outline",className:"text-xs",children:A(m)?"Structured JSON":"Legacy Text"})]})}),a.jsx("div",{className:"prose max-w-none",children:m?a.jsx(KT,{discussionGuide:m,showProgress:!1,collapsible:!0,defaultExpanded:!0,className:"border-0",onSave:rn,onDownload:an,onSectionSelect:Rs,isDownloading:R,focusGroupId:b,onEditingChange:yr}):a.jsx("div",{className:"bg-slate-50 p-4 rounded border text-center text-slate-600",children:p?a.jsxs("div",{children:[a.jsx("p",{className:"mb-2",children:"Discussion guide generation failed."}),a.jsxs("p",{className:"text-sm",children:["Go back to the ",a.jsx("strong",{children:"Setup"})," tab and try generating again. Check your inputs and try a different AI model if the issue persists."]})]}):a.jsx("p",{children:'No discussion guide generated yet. Complete the setup and click "Generate Discussion Guide" to create one.'})})})]})}),k.length>0&&a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Creative Assets"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-slate-600",children:"Assets that will be referenced in the discussion guide:"}),a.jsx("div",{className:"space-y-2",children:k.map((V,ve)=>{var Ee;const de=V.user_assigned_name||`Asset ${ve+1}`;return a.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-lg bg-slate-50",children:[a.jsx("div",{className:"w-10 h-10 bg-slate-200 rounded flex items-center justify-center flex-shrink-0",children:(Ee=V.mime_type)!=null&&Ee.startsWith("image/")?a.jsx("img",{src:bt.getAssetUrl(b,V.filename),alt:de,className:"max-h-full max-w-full object-contain rounded"}):a.jsx(Yp,{className:"h-6 w-6 text-slate-600"})}),a.jsxs("div",{className:"flex-grow",children:[a.jsxs("p",{className:"font-medium text-sm",children:['"',de,'"']}),a.jsx("p",{className:"text-xs text-slate-500",children:"Will appear in discussion guide"})]})]},V.filename)})}),a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:a.jsxs("p",{className:"text-sm text-blue-700",children:[a.jsx("strong",{children:"Note:"})," To rename assets, go back to the Setup tab and click the edit icon next to each asset."]})})]})]})}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx(X,{variant:"outline",onClick:()=>l("setup"),children:"Back to Setup"}),a.jsxs(X,{onClick:()=>l("participants"),children:["Select Participants",a.jsx(Fr,{className:"ml-2 h-4 w-4"})]})]})]})}),a.jsxs(vn,{value:"participants",children:[a.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[a.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),a.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{console.log("Clicked 'Create new folder' button"),oe(!0)},className:"h-7 w-7 p-0",children:a.jsx(f5,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("button",{onClick:()=>{console.log("Clicked 'All Personas' folder"),console.log("All personas count:",M.length),me(bl),setTimeout(()=>{console.log(`Will show all ${M.length} personas`)},0)},className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${J===bl?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx("span",{children:"All Personas"})]}),Y.map(V=>a.jsx("div",{className:"flex items-center justify-between group",children:ke&&ke._id===V._id?a.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx(Ht,{value:we,onChange:ve=>Ae(ve.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:ve=>{ve.key==="Enter"?Wt():ve.key==="Escape"&&st()}}),a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming folder rename: "${ke==null?void 0:ke.name}" to "${we}"`),Wt()},className:"h-7 w-7 p-0",children:a.jsx(uo,{className:"h-4 w-4"})}),a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Cancelling rename of folder: "${ke==null?void 0:ke.name}"`),st()},className:"h-7 w-7 p-0",children:a.jsx(Mi,{className:"h-4 w-4"})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>{console.log(`Clicked folder: ${V.name} (ID: ${V._id})`);const ve=M.filter(de=>de.folder_ids&&Array.isArray(de.folder_ids)?de.folder_ids.includes(V._id):de.folder_id===V._id||de.folderId===V._id);console.log(`Current persona count in folder: ${ve.length}`),console.log("All personas count:",M.length),me(V._id),setTimeout(()=>{console.log(`Will show ${ve.length} personas after filtering`),console.log("Filtered personas:",ve.map(de=>de.name))},0)},className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${J===V._id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx("span",{children:V.name}),a.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:M.filter(ve=>ve.folder_ids&&Array.isArray(ve.folder_ids)?ve.folder_ids.includes(V._id):ve.folder_id===V._id||ve.folderId===V._id).length})]}),a.jsxs(OA,{children:[a.jsx(IA,{asChild:!0,children:a.jsx(X,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:a.jsx(z_,{className:"h-4 w-4"})})}),a.jsx(Ix,{align:"end",children:a.jsx(oc,{onClick:()=>{console.log(`Initiating rename for folder: ${V.name} (ID: ${V.id})`),at(V)},children:"Rename"})})]})]})},V._id)),F&&a.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[a.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[a.jsx(hs,{className:"h-4 w-4"}),a.jsx(Ht,{value:se,onChange:V=>le(V.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:V=>{V.key==="Enter"?Qn():V.key==="Escape"&&Xt()}})]}),a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming creation of new folder: "${se}"`),Qn()},className:"h-7 w-7 p-0",children:a.jsx(uo,{className:"h-4 w-4"})}),a.jsx(X,{size:"sm",variant:"ghost",onClick:()=>{console.log("Cancelling folder creation"),Xt()},className:"h-7 w-7 p-0",children:a.jsx(Mi,{className:"h-4 w-4"})})]})]})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx(lt,{className:"mb-4",children:a.jsx(Ot,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Select Participants"}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Fr,{className:"h-5 w-5 mr-2 text-muted-foreground"}),a.jsxs("span",{className:"text-sm font-medium",children:[j.length," of ",on.length," selected"]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(FE,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),a.jsx(Ht,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:ee,onChange:V=>wt(V.target.value)})]}),a.jsxs(X,{variant:"outline",className:"flex items-center gap-2",onClick:()=>Ct(!0),children:[a.jsx($E,{className:"h-4 w-4"}),a.jsxs("span",{children:["Filter",Object.values(Xe).some(V=>V.length>0)?` (${Object.values(Xe).reduce((V,ve)=>V+ve.length,0)})`:""]})]})]}),D?a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx(eo,{className:"h-8 w-8 animate-spin text-primary"})}):on.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:on.map(V=>{const ve=V._id||V.id;return a.jsx(pT,{user:{id:ve,_id:V._id,name:V.name,age:V.age,gender:V.gender,occupation:V.occupation,location:V.location||"Unknown",techSavviness:V.techSavviness||50,personality:V.personality||"No description available",oceanTraits:V.oceanTraits,qualitativeAttributes:V.qualitativeAttributes,topPersonalityTraits:V.topPersonalityTraits,aiSynthesizedBio:V.aiSynthesizedBio},selected:j.includes(ve),onSelectionToggle:()=>dt(ve),onViewDetails:We},ve)})}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-muted-foreground",children:"No personas available matching your criteria."})})]})})}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx(X,{variant:"outline",onClick:()=>l("review"),children:"Back to Review"}),a.jsxs(X,{onClick:Xn,disabled:j.length<1||!m,children:[a.jsx(aZ,{className:"mr-2 h-4 w-4"}),"Start Focus Group Session"]})]})]})]}),a.jsx(eu,{open:et,onOpenChange:V=>{V?(Ct(V),$({...Xe})):Ct(!1)},children:a.jsxs(Lc,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Fc,{children:[a.jsx(Bc,{children:"Filter Personas"}),a.jsx(tu,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic."})]}),a.jsxs("div",{className:"py-4 space-y-6",children:[Object.values(N).some(V=>V.length>0)&&a.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(N).reduce((V,ve)=>V+ve.length,0)," active filters"]})}),(()=>{const V=ot(M),ve=Object.values(N).every(Ee=>Ee.length===0),de=(Ee,jt,Gn=1)=>{const as=ve?V[jt]:Rt(jt)[jt],te=N[jt],ae=[...new Set([...as,...te])].sort();return ae.length===0?null:a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:Ee}),a.jsx("div",{className:`grid grid-cols-1 ${Gn===2?"sm:grid-cols-2":Gn===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:ae.map(Te=>{const $e=N[jt].includes(Te),Be=as.includes(Te);return a.jsxs("div",{className:`flex items-center space-x-2 ${!Be&&!$e?"opacity-50":""}`,children:[a.jsx(Fl,{id:`${jt}-${Te}`,checked:$e,onCheckedChange:()=>_t(jt,Te),disabled:!Be&&!$e}),a.jsxs(ms,{htmlFor:`${jt}-${Te}`,className:"truncate overflow-hidden",children:[Te,$e&&!Be&&a.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},Te)})})]})};return a.jsxs(a.Fragment,{children:[de("Gender","gender",3),de("Age","age",3),de("Ethnicity","ethnicity",2),de("Location","location",2),de("Occupation","occupation",2),de("Tech Savviness","techSavviness",3),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()]}),a.jsxs(Uc,{children:[a.jsx(X,{variant:"outline",onClick:Ze,children:"Reset"}),a.jsx(X,{onClick:Ke,children:"Apply Filters"})]})]})})]})]})]})]})}const lde=[{id:"1",name:"Mobile App UX Evaluation",status:"completed",participants:6,date:"2023-06-10T14:00:00Z",duration:60,topic:"user-experience"},{id:"2",name:"Product Feature Feedback",status:"scheduled",participants:8,date:"2023-06-15T10:00:00Z",duration:90,topic:"product-feedback"},{id:"3",name:"Marketing Campaign Testing",status:"in-progress",participants:5,date:"2023-06-12T15:30:00Z",duration:45,topic:"creative-testing"},{id:"4",name:"Website Navigation Study",status:"scheduled",participants:7,date:"2023-06-18T13:00:00Z",duration:60,topic:"user-experience"}],ude={completed:"bg-green-100 text-green-800 border-green-200",scheduled:"bg-blue-100 text-blue-800 border-blue-200","in-progress":"bg-amber-100 text-amber-800 border-amber-200",active:"bg-amber-100 text-amber-800 border-amber-200",paused:"bg-purple-100 text-purple-800 border-purple-200",new:"bg-slate-100 text-slate-800 border-slate-200",ai_mode:"bg-amber-100 text-amber-800 border-amber-200",draft:"bg-gray-100 text-gray-800 border-gray-200"},dde=()=>{console.log("FocusGroups component rendering");const[t,e]=y.useState("view"),[n,r]=y.useState(""),[i,s]=y.useState([]),[o,c]=y.useState(!0),[l,u]=y.useState([]),[d,f]=y.useState(!1),[h,p]=y.useState(!1),[g,m]=y.useState(null),v=lr(),b=Bi(),[x,w]=y.useState([]),S=y.useRef(!0),C=async(E=!0)=>{if(console.log("fetchFocusGroups called with isMountedCheck:",E),console.log("isMounted.current:",S.current),E&&!S.current){console.log("Exiting early: component not mounted");return}console.log("Setting loading to true and making API call"),c(!0);try{console.log("Calling focusGroupsApi.getAll()");const O=await bt.getAll();if(console.log("API response received:",O),!E||S.current){const M=O.data.map(U=>({...U,id:U.id||U._id,participants_count:Array.isArray(U.participants)?U.participants.length:typeof U.participants=="number"?U.participants:0}));s(M)}}catch(O){console.error("Error fetching focus groups:",O),(!E||S.current)&&(Fe.error("Failed to load focus groups"),s(lde))}finally{(!E||S.current)&&c(!1)}},_=async E=>{try{const O=await bt.getById(E);O&&O.data&&(m(O.data),e("create"))}catch(O){console.error("Error fetching focus group for edit:",O),Fe.error("Failed to load focus group for editing")}};y.useEffect(()=>(console.log("useEffect running - about to fetch focus groups"),C(),()=>{console.log("useEffect cleanup - setting isMounted to false"),S.current=!1}),[]),y.useEffect(()=>{console.log("Mode change useEffect running, mode:",t),t==="view"&&(console.log("Mode is view, calling fetchFocusGroups"),C())},[t]),y.useEffect(()=>{const E=b.state;(E==null?void 0:E.mode)==="create"&&(E!=null&&E.preSelectedParticipants)&&(w(E.preSelectedParticipants),e("create"),v(b.pathname,{replace:!0,state:null}))},[b.state,b.pathname,v]),y.useEffect(()=>{const E=new URLSearchParams(b.search),O=E.get("mode"),M=E.get("id"),U=E.get("tab");if(O==="create")e("create"),m(null);else if(O==="edit"&&M){const D=i.find(B=>(B._id||B.id)===M);D?(m(D),e("create")):_(M)}if(O||M||U){const D=b.pathname;v(D,{replace:!0})}},[b.search,i,v,b.pathname]);const A=i.filter(E=>E.name.toLowerCase().includes(n.toLowerCase())||E.topic.toLowerCase().includes(n.toLowerCase())),j=E=>new Date(E).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),T=E=>new Date(E).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),k=E=>{u(O=>O.includes(E)?O.filter(M=>M!==E):[...O,E])},I=async()=>{if(l.length!==0){p(!0);try{const E=l.map(O=>bt.delete(O));await Promise.all(E),s(O=>O.filter(M=>!l.includes(M.id||M._id||""))),u([]),Fe.success(`${l.length} focus group${l.length>1?"s":""} deleted successfully`)}catch(E){console.error("Error deleting focus groups:",E),Fe.error("Failed to delete focus groups")}finally{p(!1),f(!1)}}};return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(ja,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Focus Groups"}),a.jsx("p",{className:"text-slate-600 mt-1",children:"Set up and manage AI-moderated research sessions"})]}),a.jsx("div",{className:"mt-4 sm:mt-0",children:a.jsx(X,{onClick:()=>{console.log("Create New Focus Group button clicked, current mode:",t);try{t==="view"?(console.log("Setting draft to null and switching to create mode"),m(null),e("create")):(console.log("Switching back to view mode"),e("view"))}catch(E){console.error("Error in Create New Focus Group onClick:",E)}},className:"hover-transition",children:t==="view"?"Create New Focus Group":"View All Focus Groups"})})]}),t==="view"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(FE,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),a.jsx(Ht,{placeholder:"Search focus groups by name or topic...",className:"pl-10 bg-white",value:n,onChange:E=>r(E.target.value)})]}),a.jsxs(X,{variant:"outline",className:"flex items-center gap-2",children:[a.jsx($E,{className:"h-4 w-4"}),a.jsx("span",{children:"Filter"})]})]}),a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Wo,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Your Focus Groups"})]}),l.length>0&&a.jsxs(X,{variant:"destructive",size:"sm",onClick:()=>f(!0),disabled:h,className:"flex items-center gap-2",children:[a.jsx(ir,{className:"h-4 w-4"}),"Delete Selected (",l.length,")"]})]}),o?a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx(eo,{className:"h-8 w-8 animate-spin text-primary"})}):A.length>0?a.jsx("div",{className:"space-y-4",children:A.map(E=>a.jsx("div",{className:"glass-card rounded-xl overflow-hidden hover:shadow-md button-transition",children:a.jsxs("div",{className:"flex flex-col md:flex-row",children:[a.jsxs("div",{className:"flex-1 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Fl,{id:`select-${E.id||E._id}`,checked:l.includes(E.id||E._id||""),onCheckedChange:()=>k(E.id||E._id||""),className:"mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:E.name}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(zJ,{className:"h-4 w-4 mr-1"}),j(E.date)]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(qp,{className:"h-4 w-4 mr-1"}),T(E.date)]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Fr,{className:"h-4 w-4 mr-1"}),E.participants_count||(Array.isArray(E.participants)?E.participants.length:0)," participant",E.participants_count>1||Array.isArray(E.participants)&&E.participants.length>1?"s":""]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(qp,{className:"h-4 w-4 mr-1"}),E.duration," min"]})]})]})]}),a.jsxs("div",{className:Pe("px-3 py-1 rounded-full text-xs font-medium border",ude[E.status]||"bg-gray-100 text-gray-800 border-gray-200"),children:[E.status==="completed"&&"Completed",E.status==="scheduled"&&"Scheduled",E.status==="in-progress"&&"In Progress",E.status==="active"&&"In Progress",E.status==="ai_mode"&&"In Progress",E.status==="paused"&&"Paused",E.status==="new"&&"Not Started",E.status==="draft"&&"Draft",!["completed","scheduled","in-progress","active","ai_mode","paused","new","draft"].includes(E.status)&&E.status]})]}),a.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[a.jsxs("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:[E.topic==="user-experience"&&"User Experience",E.topic==="product-feedback"&&"Product Feedback",E.topic==="creative-testing"&&"Creative Testing",E.topic==="messaging-evaluation"&&"Messaging Evaluation",E.topic&&!["user-experience","product-feedback","creative-testing","messaging-evaluation"].includes(E.topic)&&E.topic.charAt(0).toUpperCase()+E.topic.slice(1).replace(/-/g," ")]}),a.jsx("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:"AI Moderated"})]})]}),a.jsx("div",{className:"bg-slate-50 p-6 flex flex-col justify-center items-center md:border-l border-slate-100",children:a.jsx(X,{variant:E.status==="in-progress"||E.status==="active"||E.status==="ai_mode"?"default":E.status==="new"||E.status==="draft"?"outline":"default",className:Pe("w-full hover-transition",E.status==="new"?"bg-slate-200 text-slate-700 hover:bg-slate-300 border-slate-300":"",E.status==="draft"?"bg-gray-200 text-gray-700 hover:bg-gray-300 border-gray-300":""),onClick:()=>{if(E.status==="draft")m(E),e("create");else{const O=E.id||E._id;console.log("Navigating to focus group:",O),v(`/focus-groups/${O}`)}},children:E.status==="completed"?a.jsxs(a.Fragment,{children:["View Session",a.jsx(fs,{className:"ml-2 h-4 w-4"})]}):E.status==="in-progress"||E.status==="active"||E.status==="ai_mode"?a.jsxs(a.Fragment,{children:["Join Session",a.jsx(fs,{className:"ml-2 h-4 w-4"})]}):E.status==="paused"?a.jsxs(a.Fragment,{children:["Session Details",a.jsx(fs,{className:"ml-2 h-4 w-4"})]}):E.status==="scheduled"?a.jsxs(a.Fragment,{children:["View Details",a.jsx(fs,{className:"ml-2 h-4 w-4"})]}):E.status==="new"?a.jsxs(a.Fragment,{children:["View Session",a.jsx(fs,{className:"ml-2 h-4 w-4"})]}):E.status==="draft"?a.jsxs(a.Fragment,{children:["Edit",a.jsx(fs,{className:"ml-2 h-4 w-4"})]}):a.jsxs(a.Fragment,{children:["View Session",a.jsx(fs,{className:"ml-2 h-4 w-4"})]})})})]})},E.id))}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-muted-foreground",children:"No focus groups found matching your search criteria."})})]})]}):a.jsx(cde,{draftToEdit:g,preSelectedParticipants:x,onDraftSaved:()=>{m(null),e("view"),w([]),C()}})]}),a.jsx(RA,{open:d,onOpenChange:f,children:a.jsxs(Mx,{children:[a.jsxs(Dx,{children:[a.jsxs(Lx,{children:["Delete ",l.length," Focus Group",l.length!==1?"s":"","?"]}),a.jsxs(Fx,{children:["This action cannot be undone. This will permanently delete the selected focus group",l.length!==1?"s":""," and remove all data associated with ",l.length!==1?"them":"it","."]})]}),a.jsxs($x,{children:[a.jsx(Bx,{disabled:h,children:"Cancel"}),a.jsx(Ux,{onClick:E=>{E.preventDefault(),I()},disabled:h,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:h?a.jsxs(a.Fragment,{children:[a.jsx(eo,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):a.jsx(a.Fragment,{children:"Delete"})})]})]})})]})},fde=({participants:t,selectedParticipantIds:e,onToggleParticipantFilter:n})=>{const r=lr(),{id:i}=RE(),{setPreviousRoute:s}=ow(),o=l=>{const u=l.id||l._id;u&&i&&(s(`/focus-groups/${i}`,{focusGroupId:i}),r(`/personas/${u}`))},c=l=>{const u=l.id||l._id;u&&n(u)};return a.jsx("div",{className:"w-full lg:w-64 shrink-0",children:a.jsxs("div",{className:"glass-panel rounded-xl p-4",children:[a.jsxs("h2",{className:"font-sf text-lg font-semibold flex items-center mb-3",children:[a.jsx(Fr,{className:"h-5 w-5 text-primary mr-2"})," Participants"]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center p-2 bg-primary/5 rounded-lg",children:[a.jsx(xa,{className:"h-8 w-8 text-primary mr-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-primary",children:"AI Moderator"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Session facilitator"})]})]}),t.map(l=>{const u=l.id||l._id,d=e.includes(u);return a.jsxs("div",{className:`flex items-center p-2 rounded-lg transition-colors ${d?"bg-blue-50 border border-blue-200":"hover:bg-slate-100"}`,children:[a.jsx("div",{className:"cursor-pointer mr-3",onClick:()=>o(l),title:`View ${l.name}'s profile`,children:a.jsx("img",{src:Ag(l),alt:l.name,className:"h-8 w-8 rounded-full object-cover"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("p",{className:"font-medium cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>c(l),title:`Filter to show only ${l.name}'s messages`,children:l.name}),d&&a.jsx(uo,{className:"h-4 w-4 text-blue-600 ml-2"})]}),a.jsx("p",{className:"text-xs text-slate-500",children:l.occupation})]})]},l.id)})]})]})})};function hde(t,e){return y.useReducer((n,r)=>e[n][r]??n,t)}var WT="ScrollArea",[lV,bFe]=Ui(WT),[pde,Ps]=lV(WT),uV=y.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...o}=t,[c,l]=y.useState(null),[u,d]=y.useState(null),[f,h]=y.useState(null),[p,g]=y.useState(null),[m,v]=y.useState(null),[b,x]=y.useState(0),[w,S]=y.useState(0),[C,_]=y.useState(!1),[A,j]=y.useState(!1),T=Pt(e,I=>l(I)),k=Ou(i);return a.jsx(pde,{scope:n,type:r,dir:k,scrollHideDelay:s,scrollArea:c,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:_,scrollbarY:m,onScrollbarYChange:v,scrollbarYEnabled:A,onScrollbarYEnabledChange:j,onCornerWidthChange:x,onCornerHeightChange:S,children:a.jsx(it.div,{dir:k,...o,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});uV.displayName=WT;var dV="ScrollAreaViewport",fV=y.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,asChild:i,nonce:s,...o}=t,c=Ps(dV,n),l=y.useRef(null),u=Pt(e,l,c.onViewportChange);return a.jsxs(a.Fragment,{children:[a.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; -} -:where([data-radix-scroll-area-viewport]) { - display: flex; - flex-direction: column; - align-items: stretch; -} -:where([data-radix-scroll-area-content]) { - flex-grow: 1; -} -`},nonce:s}),a.jsx(it.div,{"data-radix-scroll-area-viewport":"",...o,asChild:i,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:_de({asChild:i,children:r},d=>a.jsx("div",{"data-radix-scroll-area-content":"",ref:c.onContentChange,style:{minWidth:c.scrollbarXEnabled?"fit-content":void 0},children:d}))})]})});fV.displayName=dV;var ea="ScrollAreaScrollbar",qT=y.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ps(ea,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,c=t.orientation==="horizontal";return y.useEffect(()=>(c?s(!0):o(!0),()=>{c?s(!1):o(!1)}),[c,s,o]),i.type==="hover"?a.jsx(mde,{...r,ref:e,forceMount:n}):i.type==="scroll"?a.jsx(gde,{...r,ref:e,forceMount:n}):i.type==="auto"?a.jsx(hV,{...r,ref:e,forceMount:n}):i.type==="always"?a.jsx(YT,{...r,ref:e}):null});qT.displayName=ea;var mde=y.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ps(ea,t.__scopeScrollArea),[s,o]=y.useState(!1);return y.useEffect(()=>{const c=i.scrollArea;let l=0;if(c){const u=()=>{window.clearTimeout(l),o(!0)},d=()=>{l=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),a.jsx(Yr,{present:n||s,children:a.jsx(hV,{"data-state":s?"visible":"hidden",...r,ref:e})})}),gde=y.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ps(ea,t.__scopeScrollArea),s=t.orientation==="horizontal",o=cw(()=>l("SCROLL_END"),100),[c,l]=hde("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 y.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,i.scrollHideDelay,l]),y.useEffect(()=>{const u=i.viewport,d=s?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(l("SCROLL"),o()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[i.viewport,s,l,o]),a.jsx(Yr,{present:n||c!=="hidden",children:a.jsx(YT,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Ne(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ne(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),hV=y.forwardRef((t,e)=>{const n=Ps(ea,t.__scopeScrollArea),{forceMount:r,...i}=t,[s,o]=y.useState(!1),c=t.orientation==="horizontal",l=cw(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,i=Ps(ea,t.__scopeScrollArea),s=y.useRef(null),o=y.useRef(0),[c,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=yV(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,p){return Sde(h,o.current,c,p)}return n==="horizontal"?a.jsx(vde,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollLeft,p=ER(h,c,i.dir);s.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?a.jsx(yde,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollTop,p=ER(h,c);s.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),vde=y.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,s=Ps(ea,t.__scopeScrollArea),[o,c]=y.useState(),l=y.useRef(null),u=Pt(e,l,s.onScrollbarXChange);return y.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),a.jsx(mV,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":aw(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(h),bV(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:zx(o.paddingLeft),paddingEnd:zx(o.paddingRight)}})}})}),yde=y.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,s=Ps(ea,t.__scopeScrollArea),[o,c]=y.useState(),l=y.useRef(null),u=Pt(e,l,s.onScrollbarYChange);return y.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),a.jsx(mV,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":aw(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(h),bV(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:zx(o.paddingTop),paddingEnd:zx(o.paddingBottom)}})}})}),[xde,pV]=lV(ea),mV=y.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=t,p=Ps(ea,n),[g,m]=y.useState(null),v=Pt(e,T=>m(T)),b=y.useRef(null),x=y.useRef(""),w=p.viewport,S=r.content-r.viewport,C=Ar(d),_=Ar(l),A=cw(f,10);function j(T){if(b.current){const k=T.clientX-b.current.left,I=T.clientY-b.current.top;u({x:k,y:I})}}return y.useEffect(()=>{const T=k=>{const I=k.target;(g==null?void 0:g.contains(I))&&C(k,S)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[w,g,S,C]),y.useEffect(_,[r,_]),rf(g,A),rf(p.content,A),a.jsx(xde,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Ar(s),onThumbPointerUp:Ar(o),onThumbPositionChange:_,onThumbPointerDown:Ar(c),children:a.jsx(it.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Ne(t.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),b.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),j(T))}),onPointerMove:Ne(t.onPointerMove,j),onPointerUp:Ne(t.onPointerUp,T=>{const k=T.target;k.hasPointerCapture(T.pointerId)&&k.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),Hx="ScrollAreaThumb",gV=y.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=pV(Hx,t.__scopeScrollArea);return a.jsx(Yr,{present:n||i.hasThumb,children:a.jsx(bde,{ref:e,...r})})}),bde=y.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,s=Ps(Hx,n),o=pV(Hx,n),{onThumbPositionChange:c}=o,l=Pt(e,f=>o.onThumbChange(f)),u=y.useRef(),d=cw(()=>{u.current&&(u.current(),u.current=void 0)},100);return y.useEffect(()=>{const f=s.viewport;if(f){const h=()=>{if(d(),!u.current){const p=Cde(f,c);u.current=p,c()}};return c(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[s.viewport,d,c]),a.jsx(it.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ne(t.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),g=f.clientX-p.left,m=f.clientY-p.top;o.onThumbPointerDown({x:g,y:m})}),onPointerUp:Ne(t.onPointerUp,o.onThumbPointerUp)})});gV.displayName=Hx;var QT="ScrollAreaCorner",vV=y.forwardRef((t,e)=>{const n=Ps(QT,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(wde,{...t,ref:e}):null});vV.displayName=QT;var wde=y.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=Ps(QT,n),[s,o]=y.useState(0),[c,l]=y.useState(0),u=!!(s&&c);return rf(i.scrollbarX,()=>{var f;const d=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(d),l(d)}),rf(i.scrollbarY,()=>{var f;const d=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(d),o(d)}),u?a.jsx(it.div,{...r,ref:e,style:{width:s,height:c,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function zx(t){return t?parseInt(t,10):0}function yV(t,e){const n=t/e;return isNaN(n)?0:n}function aw(t){const e=yV(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Sde(t,e,n,r="ltr"){const i=aw(n),s=i/2,o=e||s,c=i-o,l=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return xV([l,u],f)(t)}function ER(t,e,n="ltr"){const r=aw(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,c=s-r,l=n==="ltr"?[0,o]:[o*-1,0],u=xm(t,l);return xV([0,o],[0,c])(u)}function xV(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function bV(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const s={left:t.scrollLeft,top:t.scrollTop},o=n.left!==s.left,c=n.top!==s.top;(o||c)&&e(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function cw(t,e){const n=Ar(t),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function rf(t,e){const n=Ar(e);qr(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}function _de(t,e){const{asChild:n,children:r}=t;if(!n)return typeof e=="function"?e(r):e;const i=y.Children.only(r);return y.cloneElement(i,{children:typeof e=="function"?e(i.props.children):e})}var wV=uV,Ade=fV,jde=vV;const lw=y.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(wV,{ref:r,className:Pe("relative overflow-hidden",t),...n,children:[a.jsx(Ade,{className:"h-full w-full rounded-[inherit]",children:e}),a.jsx(SV,{}),a.jsx(jde,{})]}));lw.displayName=wV.displayName;const SV=y.forwardRef(({className:t,orientation:e="vertical",...n},r)=>a.jsx(qT,{ref:r,orientation:e,className:Pe("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:a.jsx(gV,{className:"relative flex-1 rounded-full bg-border"})}));SV.displayName=qT.displayName;const Ede=({participants:t,isVisible:e,selectedIndex:n,onSelect:r,onClose:i,position:s})=>{const o=y.useRef(null);return y.useEffect(()=>{const c=l=>{o.current&&!o.current.contains(l.target)&&i()};if(e)return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[e,i]),y.useEffect(()=>{if(e&&n>=0&&o.current){const c=o.current.children[n];c&&c.scrollIntoView({block:"nearest",behavior:"smooth"})}},[n,e]),!e||t.length===0?null:a.jsxs("div",{ref:o,className:"absolute z-50 w-64 max-h-48 overflow-y-auto bg-white border border-slate-200 rounded-lg shadow-lg",style:{top:s.top,left:s.left},children:[t.map((c,l)=>{const u=c.id||c._id,d=l===n;return a.jsxs("div",{className:`flex items-center p-3 cursor-pointer transition-colors ${d?"bg-blue-50 border-l-4 border-blue-500":"hover:bg-slate-50"}`,onClick:()=>r(c),children:[a.jsx("img",{src:Ag(c),alt:c.name,className:"h-8 w-8 rounded-full object-cover mr-3 flex-shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:`font-medium truncate ${d?"text-blue-900":"text-slate-900"}`,children:c.name}),a.jsx("p",{className:`text-sm truncate ${d?"text-blue-600":"text-slate-500"}`,children:c.occupation})]})]},u)}),t.length===0&&a.jsx("div",{className:"p-3 text-center text-slate-500 text-sm",children:"No participants found"})]})};function DA(t,e){const n=[],r=[],i=/@(\w+(?:\s+\w+)*?)(?=\s+and\s|\s+or\s|\s*[^\w\s]|\s*$)/g;let s;for(;(s=i.exec(t))!==null;){const o=s[1],c=s.index,l=s.index+s[0].length,u=e.find(d=>d.name.toLowerCase()===o.toLowerCase());if(u){const d=u.id||u._id;d&&(n.push({id:d,name:u.name,startIndex:c,endIndex:l}),r.includes(d)||r.push(d))}}return{text:t,mentions:n,mentionedParticipantIds:r}}function Nde(t,e){if(e.length===0)return[t];const n=[];let r=0;return[...e].sort((s,o)=>s.startIndex-o.startIndex).forEach((s,o)=>{s.startIndex>r&&n.push(t.slice(r,s.startIndex)),n.push(P.createElement("span",{key:`mention-${o}`,className:"text-blue-600 bg-blue-50 px-1 rounded font-medium"},`@${s.name}`)),r=s.endIndex}),r=0;n--){const r=t[n];if(r==="@"){if(n===0||/\s/.test(t[n-1]))return n}else if(/\s/.test(r))break}return null}function kde(t,e,n){return t.slice(e+1,n).toLowerCase()}function Ode(t,e){return e?t.filter(n=>n.name.toLowerCase().includes(e)):t}const CV=y.forwardRef(({value:t,onChange:e,participants:n,placeholder:r="Ask a question or provide guidance...",className:i="",disabled:s=!1},o)=>{const[c,l]=y.useState(!1),[u,d]=y.useState(0),[f,h]=y.useState({top:0,left:0}),[p,g]=y.useState(null),[m,v]=y.useState([]),b=y.useRef(null),x=y.useRef(null);y.useEffect(()=>{o&&b.current&&(typeof o=="function"?o(b.current):o.current=b.current)},[o]);const w=()=>{if(b.current&&x.current&&p!==null){const j=b.current,T=x.current,k=document.createElement("div");k.style.position="absolute",k.style.visibility="hidden",k.style.whiteSpace="pre",k.style.font=window.getComputedStyle(j).font,k.textContent=t.slice(0,p),document.body.appendChild(k);const I=k.offsetWidth;document.body.removeChild(k);const E=T.getBoundingClientRect(),O=j.getBoundingClientRect();h({top:O.height+4,left:Math.min(I,E.width-280)})}},S=j=>{const T=j.target.value,k=j.target.selectionStart||0,I=Pde(T,k);if(I!==null&&n.length>0){const O=kde(T,I,k),M=Ode(n,O);g(I),v(M),d(0),l(!0)}else l(!1),g(null);const E=DA(T,n);e(T,E)},C=j=>{if(c&&m.length>0)switch(j.key){case"ArrowDown":j.preventDefault(),d(T=>TT>0?T-1:m.length-1);break;case"Enter":case"Tab":j.preventDefault(),m[u]&&_(m[u]);break;case"Escape":j.preventDefault(),l(!1);break}},_=j=>{if(p!==null&&b.current){const T=b.current.selectionStart||0,{newText:k,newCursorPosition:I}=Tde(t,T,j,p),E=DA(k,n);e(k,E),setTimeout(()=>{b.current&&(b.current.focus(),b.current.setSelectionRange(I,I))},0),l(!1),g(null)}},A=()=>{l(!1),g(null)};return y.useEffect(()=>{c&&p!==null&&w()},[c,p,t]),a.jsxs("div",{ref:x,className:`relative ${i}`,children:[a.jsx("input",{ref:b,type:"text",value:t,onChange:S,onKeyDown:C,placeholder:r,disabled:s,className:"flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),a.jsx(Ede,{participants:m,isVisible:c,selectedIndex:u,onSelect:_,onClose:A,position:f})]})});CV.displayName="MentionInput";const Ide=({message:t,persona:e,toggleHighlight:n,participants:r=[],focusGroupId:i})=>{const[s,o]=y.useState(!1),c=t.senderId==="moderator",l=t.senderId==="facilitator",u=DA(t.text,r),d=Nde(t.text,u.mentions),f=(c||l)&&(t.visualAsset||g(t.text))&&i,p=(()=>{if(t.visualAsset)return{filename:t.visualAsset.filename,displayReference:t.visualAsset.displayReference};{const v=g(t.text);return v?{filename:v,displayReference:v}:null}})();function g(v){const b=[/titled\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/asset\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/(fg-[a-f0-9]+-[a-f0-9]{32}\.(jpg|jpeg|png))/i];for(const x of b){const w=v.match(x);if(w)return w[1]}return null}const m=()=>{n()};return a.jsxs("div",{id:`message-${t.id}`,className:Pe("flex items-start p-3 rounded-lg transition-colors",t.highlighted?"bg-amber-50 border border-amber-200":"hover:bg-slate-50",c?"border-l-4 border-l-primary pl-4":"",l?"border-l-4 border-l-green-500 pl-4":""),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-highlighted":t.highlighted?"true":"false",children:[a.jsx("div",{className:"flex-shrink-0 mr-3",children:c?a.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:a.jsx(xa,{className:"h-6 w-6 text-primary"})}):l?a.jsx("div",{className:"bg-green-100 p-2 rounded-full",children:a.jsx(Qp,{className:"h-6 w-6 text-green-600"})}):e?a.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:a.jsx("img",{src:Ag(e),alt:`${e.name} avatar`,className:"h-6 w-6 rounded-full object-cover"})}):a.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:a.jsx(WJ,{className:"h-6 w-6 text-slate-600"})})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center mb-1",children:[a.jsx("span",{className:"font-medium mr-2",children:c?"AI Moderator":l?"Human Facilitator":(e==null?void 0:e.name)||"Unknown"}),!c&&!l&&e&&a.jsx(_r,{variant:"outline",className:"text-xs font-normal",children:e.occupation}),a.jsx("span",{className:"text-xs text-slate-500 ml-auto",children:t.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),a.jsx("p",{className:"text-slate-700",children:!t.text||t.text.trim()===""||t.text==="..."?a.jsx("span",{className:"text-red-500 italic",children:"[No response content - AI generation may have failed]"}):d}),f&&p&&a.jsxs("div",{className:"mt-3 p-3 border rounded-lg bg-slate-50",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(cp,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Creative Asset"}),p.displayReference!==p.filename&&a.jsxs("span",{className:"text-xs text-slate-500",children:["(",p.displayReference,")"]})]}),a.jsx("img",{src:bt.getAssetUrl(i,p.filename),alt:"Creative asset for review",className:"max-w-full h-auto rounded border shadow-sm",style:{maxHeight:"300px"},onError:v=>{var x;console.error("Failed to load creative asset:",bt.getAssetUrl(i,p.filename)),v.currentTarget.style.display="none";const b=document.createElement("div");b.className="text-xs text-slate-500 italic p-2 border rounded bg-slate-100",b.textContent=`Creative asset not found: ${p.displayReference}`,(x=v.currentTarget.parentNode)==null||x.appendChild(b)}})]}),a.jsx("div",{className:Pe("flex mt-2 space-x-2",!s&&!t.highlighted&&"hidden"),children:a.jsxs(X,{variant:"ghost",size:"sm",onClick:m,className:"h-8 px-2 text-xs",children:[a.jsx(hZ,{className:Pe("h-3 w-3 mr-1",t.highlighted?"fill-amber-400 text-amber-400":"text-slate-400")}),t.highlighted?"Highlighted":"Highlight"]})})]})]})},Rde=({action:t})=>{switch(t){case"moderator_speak":return a.jsx(Wo,{className:"h-4 w-4 text-blue-500"});case"participant_respond":return a.jsx(Fr,{className:"h-4 w-4 text-green-500"});case"participant_interaction":return a.jsx(Fr,{className:"h-4 w-4 text-purple-500"});case"probe_trigger":return a.jsx(p5,{className:"h-4 w-4 text-orange-500"});case"end_session":return a.jsx(gZ,{className:"h-4 w-4 text-red-500"});default:return a.jsx(du,{className:"h-4 w-4 text-gray-500"})}},Mde=({status:t})=>{switch(t){case"success":return a.jsx(ME,{className:"h-3 w-3 text-green-500"});case"error":return a.jsx(qJ,{className:"h-3 w-3 text-red-500"});case"pending":return a.jsx(qp,{className:"h-3 w-3 text-yellow-500 animate-pulse"});default:return null}},Dde=({action:t})=>({moderator_speak:"Moderator",participant_respond:"Participant Response",participant_interaction:"Participant Interaction",probe_trigger:"Probe Question",end_session:"End Session"})[t]||t,$de=t=>{try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return t}},Lde=({entry:t,isLatest:e})=>{const[n,r]=y.useState(e);return a.jsx(lt,{className:`mb-2 ${e?"ring-2 ring-blue-200 bg-blue-50/50":""}`,children:a.jsxs(jg,{open:n,onOpenChange:r,children:[a.jsx(Eg,{asChild:!0,children:a.jsx(Ei,{className:"pb-2 cursor-pointer hover:bg-gray-50/50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Rde,{action:t.action}),a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-sm",children:a.jsx(Dde,{action:t.action})}),a.jsx(Mde,{status:t.execution_status})]}),a.jsx("span",{className:"text-xs text-gray-500",children:$de(t.timestamp)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsx(_r,{variant:"secondary",className:"text-xs",children:"Latest"}),n?a.jsx(fu,{className:"h-4 w-4 text-gray-400"}):a.jsx(Da,{className:"h-4 w-4 text-gray-400"})]})]})})}),a.jsx(Ng,{children:a.jsx(Ot,{className:"pt-0",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"AI Reasoning:"}),a.jsxs("p",{className:"text-sm text-gray-600 bg-gray-50 p-2 rounded italic",children:['"',t.reasoning,'"']})]}),t.details&&Object.keys(t.details).length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Details:"}),a.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded font-mono",children:JSON.stringify(t.details,null,2)})]}),t.execution_result&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Execution Result:"}),a.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded",children:t.execution_result.error?a.jsxs("span",{className:"text-red-600",children:["Error: ",t.execution_result.error]}):a.jsx("span",{className:"text-green-600",children:t.execution_result.message||"Success"})})]})]})})})]})})},Fde=({reasoningHistory:t,isVisible:e,onToggle:n,isAiMode:r=!1})=>{const[i,s]=y.useState(!0);return y.useEffect(()=>{if(i&&t.length>0){const o=document.getElementById("reasoning-panel-content");o&&(o.scrollTop=0)}},[t.length,i]),a.jsx("div",{className:"border-t border-gray-200 bg-white",children:a.jsxs(jg,{open:e,onOpenChange:n,children:[a.jsx(Eg,{asChild:!0,children:a.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-gray-50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(du,{className:"h-4 w-4 text-purple-600"}),a.jsx("span",{className:"font-medium text-sm",children:r?"AI Decision Reasoning":"AI Moderator Logic"}),r&&t.length>0&&a.jsx(_r,{variant:"outline",className:"text-xs",children:t.length}),!r&&a.jsx(_r,{variant:"secondary",className:"text-xs",children:"Manual Mode"})]}),e?a.jsx(fu,{className:"h-4 w-4 text-gray-400"}):a.jsx(Da,{className:"h-4 w-4 text-gray-400"})]})}),a.jsx(Ng,{children:a.jsx("div",{className:"border-t border-gray-100",children:r?t.length===0?a.jsxs("div",{className:"p-4 text-center text-gray-500",children:[a.jsx(du,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),a.jsx("p",{className:"text-sm",children:"No AI decisions yet"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Reasoning will appear here when the AI makes decisions"})]}):a.jsx(lw,{id:"reasoning-panel-content",className:"h-[25vh] p-3",children:a.jsx("div",{className:"space-y-2",children:t.map((o,c)=>a.jsx(Lde,{entry:o,isLatest:c===0},`${o.timestamp}-${c}`))})}):a.jsxs("div",{className:"p-4 text-center text-gray-500",children:[a.jsx(UE,{className:"h-8 w-8 mx-auto mb-2 text-gray-400"}),a.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Manual Moderation Mode"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"You are currently moderating the discussion manually."}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Switch to AI Mode to see automated reasoning and decisions."})]})})})]})})},Ude=({modeEvent:t})=>{const e=i=>i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=i=>{switch(i){case"ai_mode_started":return"AI Mode Started";case"manual_mode_started":return"Manual Moderation Enabled";case"ai_session_concluded":return"AI Discussion Concluded";default:return"Mode Changed"}},r=i=>{switch(i){case"ai_mode_started":return"text-blue-600";case"manual_mode_started":return"text-slate-600";case"ai_session_concluded":return"text-green-600";default:return"text-gray-600"}};return a.jsxs("div",{className:"flex items-center my-6 px-4",children:[a.jsx("div",{className:"flex-1 border-t border-gray-200"}),a.jsx("div",{className:`mx-4 px-3 py-1 bg-white border border-gray-200 rounded-full ${r(t.event_type)}`,children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-medium",children:[a.jsx("span",{children:n(t.event_type)}),a.jsx("span",{className:"text-gray-400",children:"at"}),a.jsx("span",{children:e(t.timestamp)})]})}),a.jsx("div",{className:"flex-1 border-t border-gray-200"})]})},Bde=({messages:t,modeEvents:e,personas:n,isSpeaking:r,focusGroupId:i,isAiModeActive:s=!1,selectedParticipantIds:o,onToggleHighlight:c,onAdvanceDiscussion:l,onNewMessage:u,onStatusChange:d,isEditingDiscussionGuide:f=!1})=>{const[h,p]=y.useState(""),[g,m]=y.useState(null),[v,b]=y.useState(!1),[x,w]=y.useState(null),S=y.useRef(null),[C,_]=y.useState(-1),[A,j]=y.useState(!1),T=y.useRef(0),k=y.useRef(null),I=y.useRef(1e4),E=y.useRef(null),[O,M]=y.useState(!1),[U,D]=y.useState(!1),[B,R]=y.useState(!1),[L,Y]=y.useState(null),q=L!==null?L:s,[J,me]=y.useState([]),[F,oe]=y.useState(!1),se=F;y.useEffect(()=>{s&&i&&le()},[s,i]);const le=async()=>{if(i)try{s&&ke()}catch(H){console.error("Error checking autonomous status:",H)}},ke=async()=>{if(i)try{const H=await er.getReasoningHistory(i);me(H.data.reasoning_history||[])}catch(H){console.error("Error fetching reasoning history:",H)}};y.useEffect(()=>{O&&ee()},[t,O]),y.useEffect(()=>{let H;return s&&i&&(H=setInterval(()=>{ke(),le()},5e3)),()=>{H&&clearInterval(H)}},[s,i]),y.useEffect(()=>{T.current=t.length},[]),y.useEffect(()=>{const H=t.length,Z=T.current;if(A&&H>Z){const he=Date.now(),xe=k.current;if(xe&&he-xe>=I.current)b(!1),j(!1),k.current=null;else if(xe){const Oe=I.current-(he-xe);setTimeout(()=>{b(!1),j(!1),k.current=null},Math.max(0,Oe))}else b(!1),j(!1)}T.current=H},[t.length,A]);const ue=H=>n.find(Z=>Z.id===H||Z._id===H),we=o.length===0?t:t.filter(H=>H.senderId==="moderator"||H.senderId==="facilitator"||o.includes(H.senderId)),Ae=()=>{const H=[];return we.forEach(Z=>{H.push({type:"message",data:Z,timestamp:Z.timestamp})}),e.forEach(Z=>{H.push({type:"mode_event",data:Z,timestamp:Z.timestamp})}),H.sort((Z,he)=>Z.timestamp.getTime()-he.timestamp.getTime())},ee=()=>{if(!f&&E.current){const H=E.current.closest("[data-radix-scroll-area-viewport]");if(H){const Z=E.current.offsetTop-H.clientHeight+50,he=H.scrollTop,xe=Z-he,Oe=300;let be=null;const We=ot=>{be||(be=ot);const Rt=ot-be,Ke=Math.min(Rt/Oe,1),Ze=1-Math.pow(1-Ke,3);H.scrollTop=he+xe*Ze,Ke<1&&window.requestAnimationFrame(We)};window.requestAnimationFrame(We)}else E.current.scrollIntoView({behavior:"smooth",block:"end"})}},wt=async H=>{var be,We;if(H.preventDefault(),!h.trim())return;let Z=h,he=null,xe=null;const Oe=g;p(""),m(null),b(!0),j(!0),k.current=Date.now();try{if(x){try{ne.info("Uploading creative asset...",{description:"Please wait while we upload your image."});const Ke=new FormData;Ke.append("assets",x);const Ze=await bt.uploadAssets(i,Ke);console.log("Upload response:",Ze==null?void 0:Ze.data);const _t=Ze==null?void 0:Ze.data;if(_t&&_t.assets&&_t.assets.length>0?(he=_t.assets[0].filename,console.log("Successfully got filename from upload response:",he)):console.error("Invalid upload response structure:",_t),he){try{const Kt=await bt.getAssets(i),Qn=((be=Kt==null?void 0:Kt.data)==null?void 0:be.assets)||[],Xt=Qn.find(Wt=>Wt.filename===he);let at="the uploaded asset";Xt&&(Xt.user_assigned_name?at=Xt.user_assigned_name:at=`Asset ${Qn.findIndex(st=>st.filename===he)+1}`),xe={filename:he,displayReference:at},Z=`Please review ${at}. ${h}`,console.log("Using display reference in message:",at)}catch(Kt){console.error("Error fetching asset metadata:",Kt),Z=`Please review the uploaded asset. ${h}`,xe={filename:he,displayReference:"the uploaded asset"}}ne.success("Creative asset uploaded successfully",{description:"The image has been attached to your message."})}}catch(Ke){console.error("Error uploading file:",Ke),console.error("Upload error details:",(We=Ke.response)==null?void 0:We.data),ne.error("Failed to upload creative asset",{description:"Your message will be sent without the attachment."})}z()}const ot={text:Z,type:"question",senderId:"facilitator"};he&&(ot.attached_assets=[he],ot.activates_visual_context=!0,xe&&(ot.visualAsset=xe));const Rt=await bt.sendMessage(i,ot);console.log("Message sent to API:",Rt),setTimeout(()=>{ee()},100),Oe&&Oe.mentionedParticipantIds.length>0?setTimeout(()=>{G(Oe.mentionedParticipantIds,Z)},500):(b(!1),j(!1),k.current=null)}catch(ot){console.error("Error sending message:",ot),b(!1),j(!1),k.current=null;const Rt={id:`msg-${Date.now()}`,senderId:"facilitator",text:h,timestamp:new Date,type:"question"};u(Rt),setTimeout(()=>{ee()},100),ne.error("Failed to send message to server",{description:"Message will be shown locally but not saved."})}},et=()=>{for(let H=t.length-1;H>=0;H--)if(t[H].senderId==="moderator"&&t[H].type==="question")return t[H].text;for(let H=t.length-1;H>=0;H--)if(t[H].senderId==="moderator")return t[H].text;return"What are your thoughts on this topic?"},Ct=(H,Z)=>{if(!H||!H.sections||!Z)return null;const{section_index:he,subsection_index:xe,item_index:Oe,item_type:be}=Z,We=H.sections,ot=Ke=>{const Ze=[];return Ke.questions&&Ke.questions.forEach((_t,Kt)=>{Ze.push({..._t,type:"question",index:Kt})}),Ke.activities&&Ke.activities.forEach((_t,Kt)=>{Ze.push({..._t,type:"activity",index:Kt})}),Ze.sort((_t,Kt)=>_t.type!==Kt.type?_t.type==="question"?-1:1:_t.index-Kt.index)};if(he>=We.length)return{completed:!0};const Rt=We[he];if(xe!==void 0&&Rt.subsections){if(xe>=Rt.subsections.length)return Ct(H,{section_index:he+1,subsection_index:void 0,item_index:0,item_type:"question"});const Ke=Rt.subsections[xe],Ze=ot(Ke),_t=Ze.findIndex(Kt=>Kt.type===be&&Kt.index===Oe);if(_t0){const Ze=Ke.findIndex(_t=>_t.type===be&&_t.index===Oe);if(Ze0?Ct(H,{section_index:he,subsection_index:0,item_index:0,item_type:"question"}):Ct(H,{section_index:he+1,subsection_index:void 0,item_index:0,item_type:"question"})}},Xe=async()=>{var H,Z,he;if(i)try{b(!0),j(!0),k.current=Date.now(),ne.info("Advancing discussion...",{description:"Moving to the next question in the discussion guide."});const[xe,Oe]=await Promise.all([er.getModeratorStatus(i),bt.getById(i)]);if(!((H=xe==null?void 0:xe.data)!=null&&H.status)||!((Z=Oe==null?void 0:Oe.data)!=null&&Z.discussionGuide))throw new Error("Could not fetch moderator status or discussion guide");const be=xe.data.status,We=Oe.data.discussionGuide;if(!We.sections)throw new Error("Discussion guide does not have a structured format");const ot=Ct(We,be.moderator_position);if(!ot)throw new Error("Could not determine next discussion item");if(ot.completed){ne.success("Discussion guide completed",{description:"All sections of the discussion guide have been covered."});const Ke={id:`msg-${Date.now()}`,senderId:"moderator",text:"We have covered all the questions in our discussion guide. Thank you all for your valuable insights and participation in this focus group session.",timestamp:new Date,type:"system"};u(Ke),b(!1),j(!1),k.current=null;return}await er.setModeratorPosition(i,ot.sectionId,ot.itemId);const Rt={id:`msg-${Date.now()}`,senderId:"moderator",text:ot.content,timestamp:new Date,type:"question"};try{const Ke=await bt.sendMessage(i,{senderId:"moderator",text:Rt.text,type:"question"});(he=Ke==null?void 0:Ke.data)!=null&&he.message_id&&(Rt.id=Ke.data.message_id)}catch(Ke){console.warn("Failed to save message to API, showing locally:",Ke)}u(Rt),b(!1),j(!1),k.current=null,setTimeout(()=>{ee()},100),ne.success("Discussion advanced",{description:`Moved to: ${ot.section.title}${ot.subsection?` > ${ot.subsection.title}`:""}`}),d&&setTimeout(()=>d(),500)}catch(xe){console.error("Error advancing discussion:",xe),ne.error("Failed to advance discussion",{description:xe.message||"There was a problem advancing to the next question."}),b(!1),j(!1),k.current=null}},nn=async()=>{var H,Z,he,xe;if(i){console.log("Starting AI Mode: setting autonomousLoading to true"),R(!0);try{console.log("Starting AI Mode: calling API...");const be=await Promise.race([er.startAutonomousConversation(i),new Promise((We,ot)=>setTimeout(()=>ot(new Error("API call timeout after 30 seconds")),3e4))]);if(console.log("Starting AI Mode: API response received:",be),be.data.error){ne.error("Failed to start autonomous conversation",{description:be.data.error}),R(!1);return}ne.success("Autonomous conversation started",{description:"The AI is now managing the focus group conversation"}),Y(!0);try{console.log("Starting AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Starting AI Mode: onStatusChange completed successfully"))}catch(We){console.error("Starting AI Mode: onStatusChange failed:",We)}console.log("Starting AI Mode: resetting autonomousLoading to false"),R(!1),ke()}catch(Oe){console.error("Error starting autonomous conversation:",Oe),Oe.response&&Oe.response.data&&console.error("Backend error details:",Oe.response.data);const be=((Z=(H=Oe.response)==null?void 0:H.data)==null?void 0:Z.message)||((xe=(he=Oe.response)==null?void 0:he.data)==null?void 0:xe.error)||"Please check your connection and try again";ne.error("Failed to start autonomous conversation",{description:be}),R(!1)}}},N=async()=>{if(i){console.log("Stopping AI Mode: setting autonomousLoading to true"),R(!0);try{const H=await er.stopAutonomousConversation(i,"manual_stop");if(H.data.error){ne.error("Failed to stop autonomous conversation",{description:H.data.error}),R(!1);return}me([]),ne.success("Autonomous conversation stopped",{description:"You can now moderate the discussion manually"}),Y(!1);try{console.log("Stopping AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Stopping AI Mode: onStatusChange completed successfully"))}catch(Z){console.error("Stopping AI Mode: onStatusChange failed:",Z)}console.log("Stopping AI Mode: resetting autonomousLoading to false"),R(!1)}catch(H){console.error("Error stopping autonomous conversation:",H),ne.error("Failed to stop autonomous conversation"),R(!1)}}},$=H=>{var he;const Z=(he=H.target.files)==null?void 0:he[0];if(Z){if(!Z.type.startsWith("image/")){ne.error("Please select an image file",{description:"Only image files (JPG, PNG, etc.) are supported for creative review."});return}if(Z.size>10*1024*1024){ne.error("File too large",{description:"Please select an image smaller than 10MB."});return}w(Z),ne.success(`Image selected: ${Z.name}`,{description:"The image will be attached to your next message."})}},z=()=>{w(null),S.current&&(S.current.value="")},G=async(H,Z)=>{var he;if(!(!i||H.length===0))try{b(!0),j(!0),k.current=Date.now(),ne.info("Generating responses from mentioned participants...",{description:`Generating responses from ${H.length} mentioned participant(s).`});for(const xe of H){const Oe=n.find(be=>(be._id||be.id)===xe);if(!Oe){console.warn(`Mentioned participant ${xe} not found in focus group`);continue}try{const be=await er.generateResponse(i,xe,Z||"Continue the conversation based on the latest moderator message.");if((he=be==null?void 0:be.data)!=null&&he.response){console.log("Generated response from mentioned participant:",be.data);const We={id:be.data.message_id||`msg-${Date.now()}-${xe}`,senderId:xe,text:be.data.response,timestamp:new Date(be.data.timestamp||be.data.created_at||new Date),type:"response"};u(We),ne.success(`Response generated from ${Oe.name}`,{description:be.data.response.substring(0,100)+"..."})}}catch(be){console.error(`Error generating response from ${Oe.name}:`,be),ne.error(`Failed to generate response from ${Oe.name}`)}}b(!1),j(!1),k.current=null}catch(xe){console.error("Error generating mentioned responses:",xe),ne.error("Failed to generate responses from mentioned participants"),b(!1),j(!1),k.current=null}},Q=async()=>{var H,Z,he,xe;if(i){if(n.length===0){ne.error("No participants available",{description:"Add participants to the focus group before generating responses."});return}try{b(!0),j(!0),k.current=Date.now(),ne.info("AI is selecting participant...",{description:"Analyzing the conversation to choose the best respondent."});const Oe=await er.makeConversationDecision(i,.7,"manual");if(!Oe||!Oe.data||!Oe.data.decision)throw new Error("Empty decision response from AI");const be=Oe.data.decision;if(be.action==="participant_respond"){const We=be.details.participant_id,ot=be.details.topic_context,Rt=be.reasoning,Ke=n.find(_t=>(_t._id||_t.id)===We);if(!Ke)throw new Error(`Selected participant ${We} not found in focus group`);ne.info("Generating response...",{description:`AI selected ${Ke.name}: ${Rt.substring(0,100)}${Rt.length>100?"...":""}`});const Ze=await er.generateResponse(i,We,ot);if(!Ze||!Ze.data)throw new Error("Empty response from API");if((H=Ze==null?void 0:Ze.data)!=null&&H.message_id&&((Z=Ze==null?void 0:Ze.data)!=null&&Z.response)){const _t={id:Ze.data.message_id,senderId:We,text:Ze.data.response,timestamp:new Date(Ze.data.timestamp||Ze.data.created_at||new Date),type:"response",highlighted:!1};u(_t),b(!1),j(!1),k.current=null,setTimeout(()=>{ee()},100)}else throw new Error("Failed to generate or save AI response")}else{if(console.log("AI suggested different action:",be.action),be.action==="moderator_speak"){ne.info("AI suggests moderator intervention",{description:`AI reasoning: ${be.reasoning.substring(0,100)}${be.reasoning.length>100?"...":""}`}),b(!1),j(!1),k.current=null;return}ne.warning("Using fallback participant selection",{description:`AI suggested "${be.action}" but generating participant response anyway.`});const We=(C+1)%n.length,ot=n[We],Rt=et(),Ke=ot._id||ot.id,Ze=await er.generateResponse(i,Ke,Rt);if((he=Ze==null?void 0:Ze.data)!=null&&he.message_id&&((xe=Ze==null?void 0:Ze.data)!=null&&xe.response)){const _t={id:Ze.data.message_id,senderId:Ke,text:Ze.data.response,timestamp:new Date(Ze.data.timestamp||Ze.data.created_at||new Date),type:"response",highlighted:!1};u(_t),b(!1),j(!1),k.current=null,setTimeout(()=>{ee()},100),_(We)}}}catch(Oe){console.error("Error generating AI response:",Oe),ne.error("Failed to generate AI response",{description:"There was a problem connecting to the server."}),b(!1),j(!1),k.current=null}}};return a.jsxs("div",{className:"glass-panel rounded-xl p-4 flex flex-col h-full",children:[a.jsx("div",{className:"flex-1 min-h-0 mb-4",children:a.jsxs(lw,{className:"h-full pr-4",children:[a.jsxs("div",{className:"space-y-4",children:[Ae().map(H=>H.type==="message"?a.jsx(Ide,{message:H.data,persona:H.data.senderId!=="moderator"&&H.data.senderId!=="facilitator"?ue(H.data.senderId):null,toggleHighlight:()=>c(H.data.id),participants:n,focusGroupId:i},H.data.id):a.jsx(Ude,{modeEvent:H.data},H.data.id)),(v||s)&&a.jsxs("div",{className:"flex items-center space-x-2 text-sm text-slate-500 animate-pulse",children:[a.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:s?a.jsx(xa,{className:"h-4 w-4 text-primary animate-spin"}):a.jsx(To,{className:"h-4 w-4 text-primary"})}),a.jsx("span",{children:s?"AI is generating next response...":"Generating AI response..."})]}),a.jsx("div",{className:"h-8"}),a.jsx("div",{ref:E,className:"h-1"})]}),!O&&we.length>6&&a.jsx("div",{className:"sticky bottom-5 ml-auto mr-5 z-10 w-fit",children:a.jsx(X,{size:"sm",className:"rounded-full shadow-md h-10 w-10 p-0",onClick:ee,title:"Scroll to bottom",children:a.jsx(QO,{className:"h-4 w-4"})})})]})}),a.jsx(Fde,{reasoningHistory:J,isVisible:se,onToggle:()=>oe(!F),isAiMode:s}),a.jsxs("div",{className:"pt-4 border-t border-slate-200 w-full",children:[x&&a.jsxs("div",{className:"mb-2 p-2 bg-blue-50 border border-blue-200 rounded-md flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(tI,{className:"h-4 w-4 text-blue-600"}),a.jsx("span",{className:"text-sm text-blue-700",children:x.name}),a.jsxs("span",{className:"text-xs text-blue-500",children:["(",(x.size/1024/1024).toFixed(1)," MB)"]})]}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",onClick:z,className:"h-6 w-6 p-0 text-blue-600 hover:text-blue-800",children:"×"})]}),a.jsxs("form",{onSubmit:wt,className:"flex items-center gap-2 w-full",children:[a.jsx("input",{ref:S,type:"file",accept:"image/*",onChange:$,className:"hidden"}),a.jsx(CV,{value:h,onChange:(H,Z)=>{p(H),m(Z||null)},participants:n,placeholder:"Ask a question or provide guidance...",className:"flex-1 min-w-0",disabled:!1}),a.jsx(X,{type:"button",variant:"outline",size:"sm",onClick:()=>{var H;return(H=S.current)==null?void 0:H.click()},className:"hover-transition shrink-0 px-3",disabled:!1,title:"Attach image for creative review",children:a.jsx(tI,{className:"h-4 w-4"})}),a.jsxs(X,{type:"submit",variant:"default",className:"hover-transition shrink-0",disabled:!1,children:[a.jsx(Wo,{className:"mr-2 h-4 w-4"}),"Send"]})]}),a.jsxs("div",{className:"flex justify-between items-center mt-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("p",{className:"text-sm text-slate-500",children:r?"Speaking...":s?"AI mode active":"Manual moderation mode"}),a.jsx(X,{variant:"outline",size:"sm",onClick:q?N:nn,disabled:B,className:`hover-transition ${q?"bg-red-50 text-red-600 hover:bg-red-100":"bg-blue-50 text-blue-600 hover:bg-blue-100"}`,title:q?"Stop AI mode and return to manual":"Start autonomous AI conversation",children:B?a.jsxs(a.Fragment,{children:[a.jsx(xa,{className:"mr-1 h-3 w-3 animate-spin"}),s?"Stopping...":"Starting..."]}):q?a.jsxs(a.Fragment,{children:[a.jsx(xa,{className:"mr-1 h-3 w-3"}),"Stop AI Mode"]}):a.jsxs(a.Fragment,{children:[a.jsx(xa,{className:"mr-1 h-3 w-3"}),"Start AI Mode"]})}),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>{M(!O),O||ee()},className:`hover-transition ${O?"bg-blue-50 text-blue-600 hover:bg-blue-100":""}`,title:O?"Disable auto-scroll":"Enable auto-scroll",children:[a.jsx(QO,{className:"h-3 w-3 mr-1"}),"Auto-scroll"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!s&&a.jsxs(a.Fragment,{children:[a.jsxs(X,{variant:"outline",onClick:Xe,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:v,title:n.length===0?"Add participants to the focus group first":"Advance to the next part of the discussion guide",children:[a.jsx(Wo,{className:"mr-2 h-4 w-4"}),n.length===0?"No Participants":"Advance Discussion"]}),a.jsxs(X,{variant:"ghost",size:"sm",onClick:Q,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:v||n.length===0,title:"Generate a participant response to the current topic",children:[a.jsx(To,{className:"mr-1 h-3 w-3"}),"Get Response"]})]}),s&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1 text-sm text-slate-600",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{children:"AI Active"})]}),a.jsx(X,{variant:"outline",size:"sm",onClick:()=>D(!U),className:"hover-transition",title:"Show autonomous conversation controls",children:a.jsx(UE,{className:"h-3 w-3"})})]})]})]})]})]})},Hde=({themes:t,messages:e,personas:n=[],onThemeDelete:r,onQuoteClick:i})=>{const s=(d,f)=>{d.stopPropagation(),r&&(r(f),ne.success("Theme deleted successfully"))},o=d=>n.find(f=>f.id===d||f._id===d),c=d=>{let f=d;const h=d.match(/^\[MSG_ID:[^\]]+\]\s*(.*)$/);h&&(f=h[1]);const p=f.match(/^\[([^\]]+)\]:\s*(.*)$/);if(p)return{persona:p[1],text:p[2]};const g=f.match(/^([^:]+):\s*(.*)$/);return g&&g[1].trim()!==f.trim()?{persona:g[1].trim(),text:g[2]}:{persona:null,text:f}},l=t.filter(d=>"source"in d?d.source==="highlight":!0),u=t.filter(d=>"source"in d&&d.source==="generated");return a.jsxs("div",{className:"glass-panel rounded-xl p-6 h-[70vh] flex flex-col overflow-hidden",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(hu,{className:"h-5 w-5 text-primary mr-2"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Key Themes"})]}),a.jsxs("div",{className:"overflow-auto",children:[u.length>0&&a.jsxs("div",{className:"mb-8",children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(du,{className:"h-4 w-4 text-primary mr-2"}),a.jsx("h3",{className:"font-medium",children:"AI-Generated Themes"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:u.map(d=>a.jsxs(lt,{className:"hover:shadow-md transition-shadow relative group",children:[r&&a.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity",onClick:f=>s(f,d.id),children:a.jsx(Mi,{className:"h-3 w-3 text-slate-700"})}),a.jsx(Ei,{className:"pb-2",children:a.jsx(Yi,{className:"text-base",children:d.title})}),a.jsxs(Ot,{children:[a.jsx("p",{className:"text-sm text-slate-600 mb-2",children:d.description}),d.quotes&&d.quotes.length>0&&a.jsxs("div",{className:"mt-3",children:[a.jsx("h4",{className:"text-xs font-medium text-slate-700 mb-2",children:"Supporting Quotes:"}),a.jsx("div",{className:"space-y-2",children:d.quotes.map((f,h)=>{const p=typeof f=="object"&&f!==null,g=p?f.text:f,m=p?f.speaker:c(f).persona,v=p?f.message_id:void 0,b=p?f.original:f;return a.jsxs("div",{className:"bg-slate-50 p-2 rounded text-xs text-slate-600 border-l-2 border-slate-200 cursor-pointer hover:bg-slate-100 transition-colors",onClick:x=>{x.stopPropagation(),i&&i(p?f:b,v)},title:v?`Message ID: ${v}`:"Click to find original message",children:[m&&a.jsxs("span",{className:"font-semibold text-slate-700 mr-1",children:[m,":"]}),'"',g,'"',v&&a.jsx("span",{className:"ml-2 text-xs text-green-600 opacity-70",children:"✓"})]},h)})})]})]})]},d.id))})]}),l.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(oZ,{className:"h-4 w-4 text-primary mr-2"}),a.jsx("h3",{className:"font-medium",children:"Highlighted Comments"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:l.map(d=>{const f=d.messages.length>0?e.find(v=>v.id===d.messages[0]):null,h=(f==null?void 0:f.text)||d.text,p=h.length>200?h.substring(0,200)+"...":h,g=f==null?void 0:f.senderId;let m="";if(g==="moderator")m="AI Moderator";else if(g==="facilitator")m="Human Facilitator";else if(g){const v=o(g);m=(v==null?void 0:v.name)||"Unknown Participant"}return a.jsxs(lt,{className:"hover:shadow-md hover:bg-slate-50 transition-all cursor-pointer relative group",onClick:v=>{v.stopPropagation(),i&&f&&i(f.text,f.id)},title:"Click to view in discussion",children:[r&&a.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity z-10",onClick:v=>s(v,d.id),children:a.jsx(Mi,{className:"h-3 w-3 text-slate-700"})}),a.jsx(Ei,{className:"pb-2",children:a.jsx(Yi,{className:"text-sm font-medium text-slate-800 line-clamp-2",children:m&&a.jsx("span",{className:"text-primary font-semibold",children:m})})}),a.jsxs(Ot,{className:"pt-0",children:[a.jsxs("p",{className:"text-sm text-slate-600 leading-relaxed",children:['"',p,'"']}),a.jsxs("div",{className:"mt-2 flex items-center text-xs text-slate-400",children:[a.jsx(To,{className:"h-3 w-3 mr-1"}),"Click to view in discussion"]})]})]},d.id)})})]}),t.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[a.jsx(hu,{className:"h-8 w-8 text-slate-400 mb-3"}),a.jsx("p",{className:"text-slate-600",children:"No themes have been identified yet."}),a.jsx("p",{className:"text-sm text-slate-500 mt-2",children:"Highlight important messages in the discussion or generate themes automatically."})]})]})]})},zde=({themes:t,messages:e,personas:n,focusGroupId:r,onThemesGenerated:i,onThemeDelete:s,onQuoteClick:o,onGenerateKeyThemes:c})=>{const l=()=>{if(!t||t.length===0){ne.warning("No themes to export",{description:"Generate some themes first before exporting."});return}let u=`# Key Themes Analysis - -`;const d=t.filter(g=>"source"in g&&g.source==="generated");if(d.length===0){ne.warning("No AI-generated themes to export",{description:"Only AI-generated themes are included in the export."});return}d.forEach((g,m)=>{u+=`## ${m+1}. ${g.title} - -`,u+=`${g.description} - -`,g.quotes&&g.quotes.length>0&&(u+=`**Supporting Quotes:** - -`,g.quotes.forEach(v=>{if(typeof v=="string")u+=`> ${v} - -`;else{let b="";v.speaker&&(b+=`**${v.speaker}:** `),b+=v.text,u+=`> ${b} - -`}})),u+=`--- - -`});const f=new Blob([u],{type:"text/markdown"}),h=URL.createObjectURL(f),p=document.createElement("a");p.href=h,p.download=`key-themes-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(h),ne.success("Themes exported successfully",{description:`Downloaded ${d.length} themes as markdown file.`})};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsxs(X,{onClick:c,className:"w-full",children:[a.jsx(vZ,{className:"mr-2 h-4 w-4"}),"Analyze Discussion for Key Themes"]}),a.jsxs(X,{onClick:l,disabled:!t||t.length===0,variant:"outline",className:"w-full",children:[a.jsx(Jc,{className:"mr-2 h-4 w-4"}),"Export Themes"]})]}),a.jsx("div",{className:"flex-grow overflow-hidden",children:a.jsx(Hde,{themes:t,messages:e,personas:n,onThemeDelete:s,focusGroupId:r,onQuoteClick:o})})]})};var Vde=Array.isArray,Hi=Vde,Gde=typeof Hg=="object"&&Hg&&Hg.Object===Object&&Hg,_V=Gde,Kde=_V,Wde=typeof self=="object"&&self&&self.Object===Object&&self,qde=Kde||Wde||Function("return this")(),ta=qde,Yde=ta,Qde=Yde.Symbol,kg=Qde,NR=kg,AV=Object.prototype,Xde=AV.hasOwnProperty,Jde=AV.toString,Nh=NR?NR.toStringTag:void 0;function Zde(t){var e=Xde.call(t,Nh),n=t[Nh];try{t[Nh]=void 0;var r=!0}catch{}var i=Jde.call(t);return r&&(e?t[Nh]=n:delete t[Nh]),i}var efe=Zde,tfe=Object.prototype,nfe=tfe.toString;function rfe(t){return nfe.call(t)}var ife=rfe,TR=kg,sfe=efe,ofe=ife,afe="[object Null]",cfe="[object Undefined]",PR=TR?TR.toStringTag:void 0;function lfe(t){return t==null?t===void 0?cfe:afe:PR&&PR in Object(t)?sfe(t):ofe(t)}var qa=lfe;function ufe(t){return t!=null&&typeof t=="object"}var Ya=ufe,dfe=qa,ffe=Ya,hfe="[object Symbol]";function pfe(t){return typeof t=="symbol"||ffe(t)&&dfe(t)==hfe}var Qf=pfe,mfe=Hi,gfe=Qf,vfe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yfe=/^\w*$/;function xfe(t,e){if(mfe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||gfe(t)?!0:yfe.test(t)||!vfe.test(t)||e!=null&&t in Object(e)}var XT=xfe;function bfe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pl=bfe;const Xf=dn(pl);var wfe=qa,Sfe=pl,Cfe="[object AsyncFunction]",_fe="[object Function]",Afe="[object GeneratorFunction]",jfe="[object Proxy]";function Efe(t){if(!Sfe(t))return!1;var e=wfe(t);return e==_fe||e==Afe||e==Cfe||e==jfe}var JT=Efe;const At=dn(JT);var Nfe=ta,Tfe=Nfe["__core-js_shared__"],Pfe=Tfe,rC=Pfe,kR=function(){var t=/[^.]+$/.exec(rC&&rC.keys&&rC.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function kfe(t){return!!kR&&kR in t}var Ofe=kfe,Ife=Function.prototype,Rfe=Ife.toString;function Mfe(t){if(t!=null){try{return Rfe.call(t)}catch{}try{return t+""}catch{}}return""}var jV=Mfe,Dfe=JT,$fe=Ofe,Lfe=pl,Ffe=jV,Ufe=/[\\^$.*+?()[\]{}|]/g,Bfe=/^\[object .+?Constructor\]$/,Hfe=Function.prototype,zfe=Object.prototype,Vfe=Hfe.toString,Gfe=zfe.hasOwnProperty,Kfe=RegExp("^"+Vfe.call(Gfe).replace(Ufe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wfe(t){if(!Lfe(t)||$fe(t))return!1;var e=Dfe(t)?Kfe:Bfe;return e.test(Ffe(t))}var qfe=Wfe;function Yfe(t,e){return t==null?void 0:t[e]}var Qfe=Yfe,Xfe=qfe,Jfe=Qfe;function Zfe(t,e){var n=Jfe(t,e);return Xfe(n)?n:void 0}var Mu=Zfe,ehe=Mu,the=ehe(Object,"create"),uw=the,OR=uw;function nhe(){this.__data__=OR?OR(null):{},this.size=0}var rhe=nhe;function ihe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var she=ihe,ohe=uw,ahe="__lodash_hash_undefined__",che=Object.prototype,lhe=che.hasOwnProperty;function uhe(t){var e=this.__data__;if(ohe){var n=e[t];return n===ahe?void 0:n}return lhe.call(e,t)?e[t]:void 0}var dhe=uhe,fhe=uw,hhe=Object.prototype,phe=hhe.hasOwnProperty;function mhe(t){var e=this.__data__;return fhe?e[t]!==void 0:phe.call(e,t)}var ghe=mhe,vhe=uw,yhe="__lodash_hash_undefined__";function xhe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=vhe&&e===void 0?yhe:e,this}var bhe=xhe,whe=rhe,She=she,Che=dhe,_he=ghe,Ahe=bhe;function Jf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Hhe=Bhe,zhe=dw;function Vhe(t,e){var n=this.__data__,r=zhe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ghe=Vhe,Khe=Nhe,Whe=Dhe,qhe=Fhe,Yhe=Hhe,Qhe=Ghe;function Zf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},Ul=function(e){return Og(e)&&e.indexOf("%")===e.length-1},je=function(e){return vme(e)&&!th(e)},Tr=function(e){return je(e)||Og(e)},wme=0,nh=function(e){var n=++wme;return"".concat(e||"").concat(n)},yi=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!je(e)&&!Og(e))return r;var s;if(Ul(e)){var o=e.indexOf("%");s=n*parseFloat(e.slice(0,o))/100}else s=+e;return th(s)&&(s=r),i&&s>n&&(s=n),s},hc=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},Sme=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Nme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function LA(t){"@babel/helpers - typeof";return LA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LA(t)}var FR={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Ea=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},UR=null,sC=null,cP=function t(e){if(e===UR&&Array.isArray(sC))return sC;var n=[];return y.Children.forEach(e,function(r){Dt(r)||(MV.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),sC=n,UR=e,n};function js(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Ea(i)}):r=[Ea(e)],cP(t).forEach(function(i){var s=rs(i,"type.displayName")||rs(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function qi(t,e){var n=js(t,e);return n&&n[0]}var BR=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!je(r)||r<=0||!je(i)||i<=0)},Tme=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Pme=function(e){return e&&e.type&&Og(e.type)&&Tme.indexOf(e.type)>=0},kme=function(e){return e&&LA(e)==="object"&&"clipDot"in e},Ome=function(e,n,r,i){var s,o=(s=iC==null?void 0:iC[i])!==null&&s!==void 0?s:[];return!At(e)&&(i&&o.includes(n)||_me.includes(n))||r&&aP.includes(n)},rt=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(y.isValidElement(e)&&(i=e.props),!Xf(i))return null;var s={};return Object.keys(i).forEach(function(o){var c;Ome((c=i)===null||c===void 0?void 0:c[o],o,n,r)&&(s[o]=i[o])}),s},FA=function t(e,n){if(e===n)return!0;var r=y.Children.count(e);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return HR(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function $me(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function BA(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,s=t.className,o=t.style,c=t.title,l=t.desc,u=Dme(t,Mme),d=i||{width:n,height:r,x:0,y:0},f=It("recharts-surface",s);return P.createElement("svg",UA({},rt(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),P.createElement("title",null,c),P.createElement("desc",null,l),e)}var Lme=["children","className"];function HA(){return HA=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ume(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var qt=P.forwardRef(function(t,e){var n=t.children,r=t.className,i=Fme(t,Lme),s=It("recharts-layer",r);return P.createElement("g",HA({className:s},rt(i,!0),{ref:e}),n)}),ro=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;si?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r=r?t:zme(t,e,n)}var Gme=Vme,Kme="\\ud800-\\udfff",Wme="\\u0300-\\u036f",qme="\\ufe20-\\ufe2f",Yme="\\u20d0-\\u20ff",Qme=Wme+qme+Yme,Xme="\\ufe0e\\ufe0f",Jme="\\u200d",Zme=RegExp("["+Jme+Kme+Qme+Xme+"]");function ege(t){return Zme.test(t)}var $V=ege;function tge(t){return t.split("")}var nge=tge,LV="\\ud800-\\udfff",rge="\\u0300-\\u036f",ige="\\ufe20-\\ufe2f",sge="\\u20d0-\\u20ff",oge=rge+ige+sge,age="\\ufe0e\\ufe0f",cge="["+LV+"]",zA="["+oge+"]",VA="\\ud83c[\\udffb-\\udfff]",lge="(?:"+zA+"|"+VA+")",FV="[^"+LV+"]",UV="(?:\\ud83c[\\udde6-\\uddff]){2}",BV="[\\ud800-\\udbff][\\udc00-\\udfff]",uge="\\u200d",HV=lge+"?",zV="["+age+"]?",dge="(?:"+uge+"(?:"+[FV,UV,BV].join("|")+")"+zV+HV+")*",fge=zV+HV+dge,hge="(?:"+[FV+zA+"?",zA,UV,BV,cge].join("|")+")",pge=RegExp(VA+"(?="+VA+")|"+hge+fge,"g");function mge(t){return t.match(pge)||[]}var gge=mge,vge=nge,yge=$V,xge=gge;function bge(t){return yge(t)?xge(t):vge(t)}var wge=bge,Sge=Gme,Cge=$V,_ge=wge,Age=PV;function jge(t){return function(e){e=Age(e);var n=Cge(e)?_ge(e):void 0,r=n?n[0]:e.charAt(0),i=n?Sge(n,1).join(""):e.slice(1);return r[t]()+i}}var Ege=jge,Nge=Ege,Tge=Nge("toUpperCase"),Pge=Tge;const Aw=dn(Pge);function Tn(t){return function(){return t}}const VV=Math.cos,Kx=Math.sin,xo=Math.sqrt,Wx=Math.PI,jw=2*Wx,GA=Math.PI,KA=2*GA,El=1e-6,kge=KA-El;function GV(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return GV;const n=10**e;return function(r){this._+=r[0];for(let i=1,s=r.length;iEl)if(!(Math.abs(f*l-u*d)>El)||!s)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-o,g=i-c,m=l*l+u*u,v=p*p+g*g,b=Math.sqrt(m),x=Math.sqrt(h),w=s*Math.tan((GA-Math.acos((m+h-v)/(2*b*x)))/2),S=w/x,C=w/b;Math.abs(S-1)>El&&this._append`L${e+S*d},${n+S*f}`,this._append`A${s},${s},0,0,${+(f*p>d*g)},${this._x1=e+C*l},${this._y1=n+C*u}`}}arc(e,n,r,i,s,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),l=r*Math.sin(i),u=e+c,d=n+l,f=1^o,h=o?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>El||Math.abs(this._y1-d)>El)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%KA+KA),h>kge?this._append`A${r},${r},0,1,${f},${e-c},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>El&&this._append`A${r},${r},0,${+(h>=GA)},${f},${this._x1=e+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function lP(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Ige(e)}function uP(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function KV(t){this._context=t}KV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Ew(t){return new KV(t)}function WV(t){return t[0]}function qV(t){return t[1]}function YV(t,e){var n=Tn(!0),r=null,i=Ew,s=null,o=lP(c);t=typeof t=="function"?t:t===void 0?WV:Tn(t),e=typeof e=="function"?e:e===void 0?qV:Tn(e);function c(l){var u,d=(l=uP(l)).length,f,h=!1,p;for(r==null&&(s=i(p=o())),u=0;u<=d;++u)!(u=p;--g)c.point(w[g],S[g]);c.lineEnd(),c.areaEnd()}b&&(w[h]=+t(v,h,f),S[h]=+e(v,h,f),c.point(r?+r(v,h,f):w[h],n?+n(v,h,f):S[h]))}if(x)return c=null,x+""||null}function d(){return YV().defined(i).curve(o).context(s)}return u.x=function(f){return arguments.length?(t=typeof f=="function"?f:Tn(+f),r=null,u):t},u.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Tn(+f),u):t},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Tn(+f),u):r},u.y=function(f){return arguments.length?(e=typeof f=="function"?f:Tn(+f),n=null,u):e},u.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Tn(+f),u):e},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Tn(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(n)},u.lineX1=function(){return d().x(r).y(e)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Tn(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,s!=null&&(c=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=c=null:c=o(s=f),u):s},u}class QV{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Rge(t){return new QV(t,!0)}function Mge(t){return new QV(t,!1)}const dP={draw(t,e){const n=xo(e/Wx);t.moveTo(n,0),t.arc(0,0,n,0,jw)}},Dge={draw(t,e){const n=xo(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},XV=xo(1/3),$ge=XV*2,Lge={draw(t,e){const n=xo(e/$ge),r=n*XV;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Fge={draw(t,e){const n=xo(e),r=-n/2;t.rect(r,r,n,n)}},Uge=.8908130915292852,JV=Kx(Wx/10)/Kx(7*Wx/10),Bge=Kx(jw/10)*JV,Hge=-VV(jw/10)*JV,zge={draw(t,e){const n=xo(e*Uge),r=Bge*n,i=Hge*n;t.moveTo(0,-n),t.lineTo(r,i);for(let s=1;s<5;++s){const o=jw*s/5,c=VV(o),l=Kx(o);t.lineTo(l*n,-c*n),t.lineTo(c*r-l*i,l*r+c*i)}t.closePath()}},oC=xo(3),Vge={draw(t,e){const n=-xo(e/(oC*3));t.moveTo(0,n*2),t.lineTo(-oC*n,-n),t.lineTo(oC*n,-n),t.closePath()}},cs=-.5,ls=xo(3)/2,WA=1/xo(12),Gge=(WA/2+1)*3,Kge={draw(t,e){const n=xo(e/Gge),r=n/2,i=n*WA,s=r,o=n*WA+n,c=-s,l=o;t.moveTo(r,i),t.lineTo(s,o),t.lineTo(c,l),t.lineTo(cs*r-ls*i,ls*r+cs*i),t.lineTo(cs*s-ls*o,ls*s+cs*o),t.lineTo(cs*c-ls*l,ls*c+cs*l),t.lineTo(cs*r+ls*i,cs*i-ls*r),t.lineTo(cs*s+ls*o,cs*o-ls*s),t.lineTo(cs*c+ls*l,cs*l-ls*c),t.closePath()}};function Wge(t,e){let n=null,r=lP(i);t=typeof t=="function"?t:Tn(t||dP),e=typeof e=="function"?e:Tn(e===void 0?64:+e);function i(){let s;if(n||(n=s=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Tn(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Tn(+s),i):e},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function qx(){}function Yx(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ZV(t){this._context=t}ZV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Yx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function qge(t){return new ZV(t)}function eG(t){this._context=t}eG.prototype={areaStart:qx,areaEnd:qx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Yge(t){return new eG(t)}function tG(t){this._context=t}tG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Qge(t){return new tG(t)}function nG(t){this._context=t}nG.prototype={areaStart:qx,areaEnd:qx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Xge(t){return new nG(t)}function VR(t){return t<0?-1:1}function GR(t,e,n){var r=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),c=(s*i+o*r)/(r+i);return(VR(s)+VR(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(c))||0}function KR(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function aC(t,e,n){var r=t._x0,i=t._y0,s=t._x1,o=t._y1,c=(s-r)/3;t._context.bezierCurveTo(r+c,i+c*e,s-c,o-c*n,s,o)}function Qx(t){this._context=t}Qx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:aC(this,this._t0,KR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,aC(this,KR(this,n=GR(this,t,e)),n);break;default:aC(this,this._t0,n=GR(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function rG(t){this._context=new iG(t)}(rG.prototype=Object.create(Qx.prototype)).point=function(t,e){Qx.prototype.point.call(this,e,t)};function iG(t){this._context=t}iG.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,s){this._context.bezierCurveTo(e,t,r,n,s,i)}};function Jge(t){return new Qx(t)}function Zge(t){return new rG(t)}function sG(t){this._context=t}sG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=WR(t),i=WR(e),s=0,o=1;o=0;--e)i[e]=(o[e]-i[e+1])/s[e];for(s[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function tve(t){return new Nw(t,.5)}function nve(t){return new Nw(t,0)}function rve(t){return new Nw(t,1)}function sf(t,e){if((o=t.length)>1)for(var n=1,r,i,s=t[e[0]],o,c=s.length;n=0;)n[e]=e;return n}function ive(t,e){return t[e]}function sve(t){const e=[];return e.key=t,e}function ove(){var t=Tn([]),e=qA,n=sf,r=ive;function i(s){var o=Array.from(t.apply(this,arguments),sve),c,l=o.length,u=-1,d;for(const f of s)for(c=0,++u;c0){for(var n,r,i=0,s=t[0].length,o;i0){for(var n=0,r=t[e[0]],i,s=r.length;n0)||!((s=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,s,o;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mve(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var oG={symbolCircle:dP,symbolCross:Dge,symbolDiamond:Lge,symbolSquare:Fge,symbolStar:zge,symbolTriangle:Vge,symbolWye:Kge},gve=Math.PI/180,vve=function(e){var n="symbol".concat(Aw(e));return oG[n]||dP},yve=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*gve;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},xve=function(e,n){oG["symbol".concat(Aw(e))]=n},fP=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,s=i===void 0?64:i,o=e.sizeType,c=o===void 0?"area":o,l=pve(e,uve),u=YR(YR({},l),{},{type:r,size:s,sizeType:c}),d=function(){var v=vve(r),b=Wge().type(v).size(yve(s,c,r));return b()},f=u.className,h=u.cx,p=u.cy,g=rt(u,!0);return h===+h&&p===+p&&s===+s?P.createElement("path",YA({},g,{className:It("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};fP.registerSymbol=xve;function of(t){"@babel/helpers - typeof";return of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},of(t)}function QA(){return QA=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var x=p.inactive?u:p.color;return P.createElement("li",QA({className:v,style:f,key:"legend-item-".concat(g)},Cu(r.props,p,g)),P.createElement(BA,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),P.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},m?m(b,p,g):b))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,o=r.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return P.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])}(y.PureComponent);_m(hP,"displayName","Legend");_m(hP,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Tve=fw;function Pve(){this.__data__=new Tve,this.size=0}var kve=Pve;function Ove(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Ive=Ove;function Rve(t){return this.__data__.get(t)}var Mve=Rve;function Dve(t){return this.__data__.has(t)}var $ve=Dve,Lve=fw,Fve=eP,Uve=tP,Bve=200;function Hve(t,e){var n=this.__data__;if(n instanceof Lve){var r=n.__data__;if(!Fve||r.lengthc))return!1;var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,p=n&uye?new oye:void 0;for(s.set(t,e),s.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=pxe}var vP=mxe,gxe=qa,vxe=vP,yxe=Ya,xxe="[object Arguments]",bxe="[object Array]",wxe="[object Boolean]",Sxe="[object Date]",Cxe="[object Error]",_xe="[object Function]",Axe="[object Map]",jxe="[object Number]",Exe="[object Object]",Nxe="[object RegExp]",Txe="[object Set]",Pxe="[object String]",kxe="[object WeakMap]",Oxe="[object ArrayBuffer]",Ixe="[object DataView]",Rxe="[object Float32Array]",Mxe="[object Float64Array]",Dxe="[object Int8Array]",$xe="[object Int16Array]",Lxe="[object Int32Array]",Fxe="[object Uint8Array]",Uxe="[object Uint8ClampedArray]",Bxe="[object Uint16Array]",Hxe="[object Uint32Array]",In={};In[Rxe]=In[Mxe]=In[Dxe]=In[$xe]=In[Lxe]=In[Fxe]=In[Uxe]=In[Bxe]=In[Hxe]=!0;In[xxe]=In[bxe]=In[Oxe]=In[wxe]=In[Ixe]=In[Sxe]=In[Cxe]=In[_xe]=In[Axe]=In[jxe]=In[Exe]=In[Nxe]=In[Txe]=In[Pxe]=In[kxe]=!1;function zxe(t){return yxe(t)&&vxe(t.length)&&!!In[gxe(t)]}var Vxe=zxe;function Gxe(t){return function(e){return t(e)}}var vG=Gxe,eb={exports:{}};eb.exports;(function(t,e){var n=_V,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s&&n.process,c=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=c})(eb,eb.exports);var Kxe=eb.exports,Wxe=Vxe,qxe=vG,n2=Kxe,r2=n2&&n2.isTypedArray,Yxe=r2?qxe(r2):Wxe,yG=Yxe,Qxe=Zye,Xxe=mP,Jxe=Hi,Zxe=gG,ebe=gP,tbe=yG,nbe=Object.prototype,rbe=nbe.hasOwnProperty;function ibe(t,e){var n=Jxe(t),r=!n&&Xxe(t),i=!n&&!r&&Zxe(t),s=!n&&!r&&!i&&tbe(t),o=n||r||i||s,c=o?Qxe(t.length,String):[],l=c.length;for(var u in t)(e||rbe.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ebe(u,l)))&&c.push(u);return c}var sbe=ibe,obe=Object.prototype;function abe(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||obe;return t===n}var cbe=abe;function lbe(t,e){return function(n){return t(e(n))}}var xG=lbe,ube=xG,dbe=ube(Object.keys,Object),fbe=dbe,hbe=cbe,pbe=fbe,mbe=Object.prototype,gbe=mbe.hasOwnProperty;function vbe(t){if(!hbe(t))return pbe(t);var e=[];for(var n in Object(t))gbe.call(t,n)&&n!="constructor"&&e.push(n);return e}var ybe=vbe,xbe=JT,bbe=vP;function wbe(t){return t!=null&&bbe(t.length)&&!xbe(t)}var Ig=wbe,Sbe=sbe,Cbe=ybe,_be=Ig;function Abe(t){return _be(t)?Sbe(t):Cbe(t)}var Tw=Abe,jbe=Bye,Ebe=Xye,Nbe=Tw;function Tbe(t){return jbe(t,Nbe,Ebe)}var Pbe=Tbe,i2=Pbe,kbe=1,Obe=Object.prototype,Ibe=Obe.hasOwnProperty;function Rbe(t,e,n,r,i,s){var o=n&kbe,c=i2(t),l=c.length,u=i2(e),d=u.length;if(l!=d&&!o)return!1;for(var f=l;f--;){var h=c[f];if(!(o?h in e:Ibe.call(e,h)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var v=o;++f-1}var Owe=kwe;function Iwe(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=qwe){var u=e?null:Kwe(t);if(u)return Wwe(u);o=!1,i=Gwe,l=new Hwe}else l=e?[]:c;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function dSe(t){return t.value}function fSe(t,e){if(P.isValidElement(t))return P.cloneElement(t,e);if(typeof t=="function")return P.createElement(t,e);e.ref;var n=lSe(e,tSe);return P.createElement(hP,n)}var b2=1,Na=function(t){function e(){var n;nSe(this,e);for(var r=arguments.length,i=new Array(r),s=0;sb2||Math.abs(i.height-this.lastBoundingBox.height)>b2)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?aa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,o=i.align,c=i.verticalAlign,l=i.margin,u=i.chartWidth,d=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&s==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=c==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return aa(aa({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,o=i.width,c=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=aa(aa({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(l)),l);return P.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},fSe(s,aa(aa({},this.props),{},{payload:jG(d,u,dSe)})))}}],[{key:"getWithHeight",value:function(r,i){var s=aa(aa({},this.defaultProps),r.props),o=s.layout;return o==="vertical"&&je(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(y.PureComponent);Pw(Na,"displayName","Legend");Pw(Na,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var w2=kg,hSe=mP,pSe=Hi,S2=w2?w2.isConcatSpreadable:void 0;function mSe(t){return pSe(t)||hSe(t)||!!(S2&&t&&t[S2])}var gSe=mSe,vSe=pG,ySe=gSe;function TG(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=ySe),i||(i=[]);++s0&&n(c)?e>1?TG(c,e-1,n,r,i):vSe(i,c):r||(i[i.length]=c)}return i}var PG=TG;function xSe(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),c=o.length;c--;){var l=o[t?c:++i];if(n(s[l],l,s)===!1)break}return e}}var bSe=xSe,wSe=bSe,SSe=wSe(),CSe=SSe,_Se=CSe,ASe=Tw;function jSe(t,e){return t&&_Se(t,e,ASe)}var kG=jSe,ESe=Ig;function NSe(t,e){return function(n,r){if(n==null)return n;if(!ESe(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=Object(n);(e?s--:++se||s&&o&&l&&!c&&!u||r&&o&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&t=c)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}var HSe=BSe,dC=rP,zSe=iP,VSe=na,GSe=OG,KSe=$Se,WSe=vG,qSe=HSe,YSe=sh,QSe=Hi;function XSe(t,e,n){e.length?e=dC(e,function(s){return QSe(s)?function(o){return zSe(o,s.length===1?s[0]:s)}:s}):e=[YSe];var r=-1;e=dC(e,WSe(VSe));var i=GSe(t,function(s,o,c){var l=dC(e,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return KSe(i,function(s,o){return qSe(s,o,n)})}var JSe=XSe;function ZSe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var eCe=ZSe,tCe=eCe,_2=Math.max;function nCe(t,e,n){return e=_2(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=_2(r.length-e,0),o=Array(s);++i0){if(++e>=fCe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var gCe=mCe,vCe=dCe,yCe=gCe,xCe=yCe(vCe),bCe=xCe,wCe=sh,SCe=rCe,CCe=bCe;function _Ce(t,e){return CCe(SCe(t,e,wCe),t+"")}var ACe=_Ce,jCe=ZT,ECe=Ig,NCe=gP,TCe=pl;function PCe(t,e,n){if(!TCe(n))return!1;var r=typeof e;return(r=="number"?ECe(n)&&NCe(e,n.length):r=="string"&&e in n)?jCe(n[e],t):!1}var kw=PCe,kCe=PG,OCe=JSe,ICe=ACe,j2=kw,RCe=ICe(function(t,e){if(t==null)return[];var n=e.length;return n>1&&j2(t,e[0],e[1])?e=[]:n>2&&j2(e[0],e[1],e[2])&&(e=[e[0]]),OCe(t,kCe(e,1),[])}),MCe=RCe;const bP=dn(MCe);function Am(t){"@babel/helpers - typeof";return Am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Am(t)}function i1(){return i1=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(Th,"-left"),je(n)&&e&&je(e.x)&&n=e.y),"".concat(Th,"-top"),je(r)&&e&&je(e.y)&&rm?Math.max(d,l[r]):Math.max(f,l[r])}function QCe(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function XCe(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,s=t.reverseDirection,o=t.tooltipBox,c=t.useTranslate3d,l=t.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=T2({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=T2({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=QCe({translateX:d,translateY:f,useTranslate3d:c})):u=qCe,{cssProperties:u,cssClasses:YCe({translateX:d,translateY:f,coordinate:n})}}function cf(t){"@babel/helpers - typeof";return cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cf(t)}function P2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function k2(t){for(var e=1;eO2||Math.abs(r.height-this.state.lastBoundingBox.height)>O2)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,c=i.animationDuration,l=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,p=i.offset,g=i.position,m=i.reverseDirection,v=i.useTranslate3d,b=i.viewBox,x=i.wrapperStyle,w=XCe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:b}),S=w.cssClasses,C=w.cssProperties,_=k2(k2({transition:h&&s?"transform ".concat(c,"ms ").concat(l):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return P.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(j){r.wrapperNode=j}},u)}}])}(y.PureComponent),a_e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},io={isSsr:a_e(),get:function(e){return io[e]},set:function(e,n){if(typeof e=="string")io[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){io[i]=e[i]})}}};function lf(t){"@babel/helpers - typeof";return lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lf(t)}function I2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function R2(t){for(var e=1;e0;return P.createElement(o_e,{allowEscapeViewBox:o,animationDuration:c,animationEasing:l,isAnimationActive:h,active:s,coordinate:d,hasPayload:_,offset:p,position:v,reverseDirection:b,useTranslate3d:x,viewBox:w,wrapperStyle:S},v_e(u,R2(R2({},this.props),{},{payload:C})))}}])}(y.PureComponent);wP(ni,"displayName","Tooltip");wP(ni,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!io.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var y_e=ta,x_e=function(){return y_e.Date.now()},b_e=x_e,w_e=/\s/;function S_e(t){for(var e=t.length;e--&&w_e.test(t.charAt(e)););return e}var C_e=S_e,__e=C_e,A_e=/^\s+/;function j_e(t){return t&&t.slice(0,__e(t)+1).replace(A_e,"")}var E_e=j_e,N_e=E_e,M2=pl,T_e=Qf,D2=NaN,P_e=/^[-+]0x[0-9a-f]+$/i,k_e=/^0b[01]+$/i,O_e=/^0o[0-7]+$/i,I_e=parseInt;function R_e(t){if(typeof t=="number")return t;if(T_e(t))return D2;if(M2(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=M2(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=N_e(t);var n=k_e.test(t);return n||O_e.test(t)?I_e(t.slice(2),n?2:8):P_e.test(t)?D2:+t}var LG=R_e,M_e=pl,hC=b_e,$2=LG,D_e="Expected a function",$_e=Math.max,L_e=Math.min;function F_e(t,e,n){var r,i,s,o,c,l,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(D_e);e=$2(e)||0,M_e(n)&&(d=!!n.leading,f="maxWait"in n,s=f?$_e($2(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function p(_){var A=r,j=i;return r=i=void 0,u=_,o=t.apply(j,A),o}function g(_){return u=_,c=setTimeout(b,e),d?p(_):o}function m(_){var A=_-l,j=_-u,T=e-A;return f?L_e(T,s-j):T}function v(_){var A=_-l,j=_-u;return l===void 0||A>=e||A<0||f&&j>=s}function b(){var _=hC();if(v(_))return x(_);c=setTimeout(b,m(_))}function x(_){return c=void 0,h&&r?p(_):(r=i=void 0,o)}function w(){c!==void 0&&clearTimeout(c),u=0,r=l=i=c=void 0}function S(){return c===void 0?o:x(hC())}function C(){var _=hC(),A=v(_);if(r=arguments,i=this,l=_,A){if(c===void 0)return g(l);if(f)return clearTimeout(c),c=setTimeout(b,e),p(l)}return c===void 0&&(c=setTimeout(b,e)),o}return C.cancel=w,C.flush=S,C}var U_e=F_e,B_e=U_e,H_e=pl,z_e="Expected a function";function V_e(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(z_e);return H_e(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),B_e(t,e,{leading:r,maxWait:e,trailing:i})}var G_e=V_e;const FG=dn(G_e);function Em(t){"@babel/helpers - typeof";return Em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Em(t)}function L2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Av(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(O=FG(O,m,{trailing:!0,leading:!1}));var M=new ResizeObserver(O),U=C.current.getBoundingClientRect(),D=U.width,B=U.height;return I(D,B),M.observe(C.current),function(){M.disconnect()}},[I,m]);var E=y.useMemo(function(){var O=T.containerWidth,M=T.containerHeight;if(O<0||M<0)return null;ro(Ul(o)||Ul(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),ro(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=Ul(o)?O:o,D=Ul(l)?M:l;n&&n>0&&(U?D=U/n:D&&(U=D*n),h&&D>h&&(D=h)),ro(U>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,U,D,o,l,d,f,n);var B=!Array.isArray(p)&&Ea(p.type).endsWith("Chart");return P.Children.map(p,function(R){return MV.isElement(R)?y.cloneElement(R,Av({width:U,height:D},B?{style:Av({height:"100%",width:"100%",maxHeight:D,maxWidth:U},R.props.style)}:{})):R})},[n,p,l,h,f,d,T,o]);return P.createElement("div",{id:v?"".concat(v):void 0,className:It("recharts-responsive-container",b),style:Av(Av({},S),{},{width:o,height:l,minWidth:d,minHeight:f,maxHeight:h}),ref:C},E)}),Rg=function(e){return null};Rg.displayName="Cell";function Nm(t){"@babel/helpers - typeof";return Nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nm(t)}function U2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function c1(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||io.isSsr)return{width:0,height:0};var r=sAe(n),i=JSON.stringify({text:e,copyStyle:r});if(Gu.widthCache[i])return Gu.widthCache[i];try{var s=document.getElementById(B2);s||(s=document.createElement("span"),s.setAttribute("id",B2),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=c1(c1({},iAe),r);Object.assign(s.style,o),s.textContent="".concat(e);var c=s.getBoundingClientRect(),l={width:c.width,height:c.height};return Gu.widthCache[i]=l,++Gu.cacheCount>rAe&&(Gu.cacheCount=0,Gu.widthCache={}),l}catch{return{width:0,height:0}}},oAe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Tm(t){"@babel/helpers - typeof";return Tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tm(t)}function ib(t,e){return uAe(t)||lAe(t,e)||cAe(t,e)||aAe()}function aAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cAe(t,e){if(t){if(typeof t=="string")return H2(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H2(t,e)}}function H2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _Ae(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function q2(t,e){return NAe(t)||EAe(t,e)||jAe(t,e)||AAe()}function AAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jAe(t,e){if(t){if(typeof t=="string")return Y2(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y2(t,e)}}function Y2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(D,B){var R=B.word,L=B.width,Y=D[D.length-1];if(Y&&(i==null||s||Y.width+L+rB.width?D:B})};if(!d)return p;for(var m="…",v=function(U){var D=f.slice(0,U),B=zG({breakAll:u,style:l,children:D+m}).wordsWithComputedWidth,R=h(B),L=R.length>o||g(R).width>Number(i);return[L,R]},b=0,x=f.length-1,w=0,S;b<=x&&w<=f.length-1;){var C=Math.floor((b+x)/2),_=C-1,A=v(_),j=q2(A,2),T=j[0],k=j[1],I=v(C),E=q2(I,1),O=E[0];if(!T&&!O&&(b=C+1),T&&O&&(x=C-1),!T&&O){S=k;break}w++}return S||p},Q2=function(e){var n=Dt(e)?[]:e.toString().split(HG);return[{words:n}]},PAe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,s=e.style,o=e.breakAll,c=e.maxLines;if((n||r)&&!io.isSsr){var l,u,d=zG({breakAll:o,children:i,style:s});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;l=f,u=h}else return Q2(i);return TAe({breakAll:o,children:i,maxLines:c,style:s},l,u,n,r)}return Q2(i)},X2="#808080",_u=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,s=i===void 0?0:i,o=e.lineHeight,c=o===void 0?"1em":o,l=e.capHeight,u=l===void 0?"0.71em":l,d=e.scaleToFit,f=d===void 0?!1:d,h=e.textAnchor,p=h===void 0?"start":h,g=e.verticalAnchor,m=g===void 0?"end":g,v=e.fill,b=v===void 0?X2:v,x=W2(e,SAe),w=y.useMemo(function(){return PAe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),S=x.dx,C=x.dy,_=x.angle,A=x.className,j=x.breakAll,T=W2(x,CAe);if(!Tr(r)||!Tr(s))return null;var k=r+(je(S)?S:0),I=s+(je(C)?C:0),E;switch(m){case"start":E=pC("calc(".concat(u,")"));break;case"middle":E=pC("calc(".concat((w.length-1)/2," * -").concat(c," + (").concat(u," / 2))"));break;default:E=pC("calc(".concat(w.length-1," * -").concat(c,")"));break}var O=[];if(f){var M=w[0].width,U=x.width;O.push("scale(".concat((je(U)?U/M:1)/M,")"))}return _&&O.push("rotate(".concat(_,", ").concat(k,", ").concat(I,")")),O.length&&(T.transform=O.join(" ")),P.createElement("text",l1({},rt(T,!0),{x:k,y:I,className:It("recharts-text",A),textAnchor:p,fill:b.includes("url")?X2:b}),w.map(function(D,B){var R=D.words.join(j?"":" ");return P.createElement("tspan",{x:k,dy:B===0?E:c,key:"".concat(R,"-").concat(B)},R)}))};function Vc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function kAe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function SP(t){let e,n,r;t.length!==2?(e=Vc,n=(c,l)=>Vc(t(c),l),r=(c,l)=>t(c)-l):(e=t===Vc||t===kAe?t:OAe,n=t,r=t);function i(c,l,u=0,d=c.length){if(u>>1;n(c[f],l)<0?u=f+1:d=f}while(u>>1;n(c[f],l)<=0?u=f+1:d=f}while(uu&&r(c[f-1],l)>-r(c[f],l)?f-1:f}return{left:i,center:o,right:s}}function OAe(){return 0}function VG(t){return t===null?NaN:+t}function*IAe(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const RAe=SP(Vc),Mg=RAe.right;SP(VG).center;class J2 extends Map{constructor(e,n=$Ae){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Z2(this,e))}has(e){return super.has(Z2(this,e))}set(e,n){return super.set(MAe(this,e),n)}delete(e){return super.delete(DAe(this,e))}}function Z2({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function MAe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function DAe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function $Ae(t){return t!==null&&typeof t=="object"?t.valueOf():t}function LAe(t=Vc){if(t===Vc)return GG;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function GG(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const FAe=Math.sqrt(50),UAe=Math.sqrt(10),BAe=Math.sqrt(2);function sb(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),o=s>=FAe?10:s>=UAe?5:s>=BAe?2:1;let c,l,u;return i<0?(u=Math.pow(10,-i)/o,c=Math.round(t*u),l=Math.round(e*u),c/ue&&--l,u=-u):(u=Math.pow(10,i)*o,c=Math.round(t/u),l=Math.round(e/u),c*ue&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const c=s-i+1,l=new Array(c);if(r)if(o<0)for(let u=0;u=r)&&(n=r);return n}function tM(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function KG(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?GG:LAe(i);r>n;){if(r-n>600){const l=r-n+1,u=e-n+1,d=Math.log(l),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(l-f)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(e-u*f/l+h)),g=Math.min(r,Math.floor(e+(l-u)*f/l+h));KG(t,e,p,g,i)}const s=t[e];let o=n,c=r;for(Ph(t,n,e),i(t[r],s)>0&&Ph(t,n,r);o0;)--c}i(t[n],s)===0?Ph(t,n,c):(++c,Ph(t,c,r)),c<=e&&(n=c+1),e<=c&&(r=c-1)}return t}function Ph(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function HAe(t,e,n){if(t=Float64Array.from(IAe(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return tM(t);if(e>=1)return eM(t);var r,i=(r-1)*e,s=Math.floor(i),o=eM(KG(t,s).subarray(0,s+1)),c=tM(t.subarray(s+1));return o+(c-o)*(i-s)}}function zAe(t,e,n=VG){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,s=Math.floor(i),o=+n(t[s],s,t),c=+n(t[s+1],s+1,t);return o+(c-o)*(i-s)}}function VAe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,s=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Ev(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Ev(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=KAe.exec(t))?new ki(e[1],e[2],e[3],1):(e=WAe.exec(t))?new ki(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=qAe.exec(t))?Ev(e[1],e[2],e[3],e[4]):(e=YAe.exec(t))?Ev(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=QAe.exec(t))?cM(e[1],e[2]/100,e[3]/100,1):(e=XAe.exec(t))?cM(e[1],e[2]/100,e[3]/100,e[4]):nM.hasOwnProperty(t)?sM(nM[t]):t==="transparent"?new ki(NaN,NaN,NaN,0):null}function sM(t){return new ki(t>>16&255,t>>8&255,t&255,1)}function Ev(t,e,n,r){return r<=0&&(t=e=n=NaN),new ki(t,e,n,r)}function e1e(t){return t instanceof Dg||(t=Im(t)),t?(t=t.rgb(),new ki(t.r,t.g,t.b,t.opacity)):new ki}function p1(t,e,n,r){return arguments.length===1?e1e(t):new ki(t,e,n,r??1)}function ki(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}_P(ki,p1,qG(Dg,{brighter(t){return t=t==null?ob:Math.pow(ob,t),new ki(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?km:Math.pow(km,t),new ki(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ki(nu(this.r),nu(this.g),nu(this.b),ab(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oM,formatHex:oM,formatHex8:t1e,formatRgb:aM,toString:aM}));function oM(){return`#${Bl(this.r)}${Bl(this.g)}${Bl(this.b)}`}function t1e(){return`#${Bl(this.r)}${Bl(this.g)}${Bl(this.b)}${Bl((isNaN(this.opacity)?1:this.opacity)*255)}`}function aM(){const t=ab(this.opacity);return`${t===1?"rgb(":"rgba("}${nu(this.r)}, ${nu(this.g)}, ${nu(this.b)}${t===1?")":`, ${t})`}`}function ab(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function nu(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Bl(t){return t=nu(t),(t<16?"0":"")+t.toString(16)}function cM(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new qs(t,e,n,r)}function YG(t){if(t instanceof qs)return new qs(t.h,t.s,t.l,t.opacity);if(t instanceof Dg||(t=Im(t)),!t)return new qs;if(t instanceof qs)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=NaN,c=s-i,l=(s+i)/2;return c?(e===s?o=(n-r)/c+(n0&&l<1?0:o,new qs(o,c,l,t.opacity)}function n1e(t,e,n,r){return arguments.length===1?YG(t):new qs(t,e,n,r??1)}function qs(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}_P(qs,n1e,qG(Dg,{brighter(t){return t=t==null?ob:Math.pow(ob,t),new qs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?km:Math.pow(km,t),new qs(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ki(mC(t>=240?t-240:t+120,i,r),mC(t,i,r),mC(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new qs(lM(this.h),Nv(this.s),Nv(this.l),ab(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ab(this.opacity);return`${t===1?"hsl(":"hsla("}${lM(this.h)}, ${Nv(this.s)*100}%, ${Nv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function lM(t){return t=(t||0)%360,t<0?t+360:t}function Nv(t){return Math.max(0,Math.min(1,t||0))}function mC(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const AP=t=>()=>t;function r1e(t,e){return function(n){return t+n*e}}function i1e(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function s1e(t){return(t=+t)==1?QG:function(e,n){return n-e?i1e(e,n,t):AP(isNaN(e)?n:e)}}function QG(t,e){var n=e-t;return n?r1e(t,n):AP(isNaN(t)?e:t)}const uM=function t(e){var n=s1e(e);function r(i,s){var o=n((i=p1(i)).r,(s=p1(s)).r),c=n(i.g,s.g),l=n(i.b,s.b),u=QG(i.opacity,s.opacity);return function(d){return i.r=o(d),i.g=c(d),i.b=l(d),i.opacity=u(d),i+""}}return r.gamma=t,r}(1);function o1e(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(s){for(i=0;in&&(s=e.slice(n,s),c[o]?c[o]+=s:c[++o]=s),(r=r[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,l.push({i:o,x:cb(r,i)})),n=gC.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function v1e(t,e,n){var r=t[0],i=t[1],s=e[0],o=e[1];return i2?y1e:v1e,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?s:(l||(l=c(t.map(r),e,n)))(r(o(h)))}return f.invert=function(h){return o(i((u||(u=c(e,t.map(r),cb)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,lb),d()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),d()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=jP,d()},f.clamp=function(h){return arguments.length?(o=h?!0:xi,d()):o!==xi},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,p){return r=h,i=p,d()}}function EP(){return Ow()(xi,xi)}function x1e(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ub(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function uf(t){return t=ub(Math.abs(t)),t?t[1]:NaN}function b1e(t,e){return function(n,r){for(var i=n.length,s=[],o=0,c=t[0],l=0;i>0&&c>0&&(l+c+1>r&&(c=Math.max(1,r-l)),s.push(n.substring(i-=c,i+c)),!((l+=c+1)>r));)c=t[o=(o+1)%t.length];return s.reverse().join(e)}}function w1e(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var S1e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rm(t){if(!(e=S1e.exec(t)))throw new Error("invalid format: "+t);var e;return new NP({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Rm.prototype=NP.prototype;function NP(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}NP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function C1e(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var XG;function _1e(t,e){var n=ub(t,e);if(!n)return t+"";var r=n[0],i=n[1],s=i-(XG=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ub(t,Math.max(0,e+s-1))[0]}function fM(t,e){var n=ub(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const hM={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:x1e,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>fM(t*100,e),r:fM,s:_1e,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function pM(t){return t}var mM=Array.prototype.map,gM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function A1e(t){var e=t.grouping===void 0||t.thousands===void 0?pM:b1e(mM.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?pM:w1e(mM.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(f){f=Rm(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,v=f.zero,b=f.width,x=f.comma,w=f.precision,S=f.trim,C=f.type;C==="n"?(x=!0,C="g"):hM[C]||(w===void 0&&(w=12),S=!0,C="g"),(v||h==="0"&&p==="=")&&(v=!0,h="0",p="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",A=m==="$"?r:/[%p]/.test(C)?o:"",j=hM[C],T=/[defgprs%]/.test(C);w=w===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function k(I){var E=_,O=A,M,U,D;if(C==="c")O=j(I)+O,I="";else{I=+I;var B=I<0||1/I<0;if(I=isNaN(I)?l:j(Math.abs(I),w),S&&(I=C1e(I)),B&&+I==0&&g!=="+"&&(B=!1),E=(B?g==="("?g:c:g==="-"||g==="("?"":g)+E,O=(C==="s"?gM[8+XG/3]:"")+O+(B&&g==="("?")":""),T){for(M=-1,U=I.length;++MD||D>57){O=(D===46?i+I.slice(M+1):I.slice(M))+O,I=I.slice(0,M);break}}}x&&!v&&(I=e(I,1/0));var R=E.length+I.length+O.length,L=R>1)+E+I+O+L.slice(R);break;default:I=L+E+I+O;break}return s(I)}return k.toString=function(){return f+""},k}function d(f,h){var p=u((f=Rm(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(uf(h)/3)))*3,m=Math.pow(10,-g),v=gM[8+g/3];return function(b){return p(m*b)+v}}return{format:u,formatPrefix:d}}var Tv,TP,JG;j1e({thousands:",",grouping:[3],currency:["$",""]});function j1e(t){return Tv=A1e(t),TP=Tv.format,JG=Tv.formatPrefix,Tv}function E1e(t){return Math.max(0,-uf(Math.abs(t)))}function N1e(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(uf(e)/3)))*3-uf(Math.abs(t)))}function T1e(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,uf(e)-uf(t))+1}function ZG(t,e,n,r){var i=f1(t,e,n),s;switch(r=Rm(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(s=N1e(i,o))&&(r.precision=s),JG(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=T1e(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=E1e(i))&&(r.precision=s-(r.type==="%")*2);break}}return TP(r)}function ml(t){var e=t.domain;return t.ticks=function(n){var r=e();return u1(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return ZG(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,s=r.length-1,o=r[i],c=r[s],l,u,d=10;for(c0;){if(u=d1(o,c,n),u===l)return r[i]=o,r[s]=c,e(r);if(u>0)o=Math.floor(o/u)*u,c=Math.ceil(c/u)*u;else if(u<0)o=Math.ceil(o*u)/u,c=Math.floor(c*u)/u;else break;l=u}return t},t}function db(){var t=EP();return t.copy=function(){return $g(t,db())},Os.apply(t,arguments),ml(t)}function e8(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,lb),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return e8(t).unknown(e)},t=arguments.length?Array.from(t,lb):[0,1],ml(n)}function t8(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],o;return sMath.pow(t,e)}function R1e(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function xM(t){return(e,n)=>-t(-e,n)}function PP(t){const e=t(vM,yM),n=e.domain;let r=10,i,s;function o(){return i=R1e(r),s=I1e(r),n()[0]<0?(i=xM(i),s=xM(s),t(P1e,k1e)):t(vM,yM),e}return e.base=function(c){return arguments.length?(r=+c,o()):r},e.domain=function(c){return arguments.length?(n(c),o()):n()},e.ticks=c=>{const l=n();let u=l[0],d=l[l.length-1];const f=d0){for(;h<=p;++h)for(g=1;gd)break;b.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/s(-h):g*s(h),!(md)break;b.push(m)}b.length*2{if(c==null&&(c=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Rm(l)).precision==null&&(l.trim=!0),l=TP(l)),c===1/0)return l;const u=Math.max(1,r*c/e.ticks().length);return d=>{let f=d/s(Math.round(i(d)));return f*rn(t8(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),e}function n8(){const t=PP(Ow()).domain([1,10]);return t.copy=()=>$g(t,n8()).base(t.base()),Os.apply(t,arguments),t}function bM(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function wM(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function kP(t){var e=1,n=t(bM(e),wM(e));return n.constant=function(r){return arguments.length?t(bM(e=+r),wM(e)):e},ml(n)}function r8(){var t=kP(Ow());return t.copy=function(){return $g(t,r8()).constant(t.constant())},Os.apply(t,arguments)}function SM(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function M1e(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function D1e(t){return t<0?-t*t:t*t}function OP(t){var e=t(xi,xi),n=1;function r(){return n===1?t(xi,xi):n===.5?t(M1e,D1e):t(SM(n),SM(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},ml(e)}function IP(){var t=OP(Ow());return t.copy=function(){return $g(t,IP()).exponent(t.exponent())},Os.apply(t,arguments),t}function $1e(){return IP.apply(null,arguments).exponent(.5)}function CM(t){return Math.sign(t)*t*t}function L1e(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function i8(){var t=EP(),e=[0,1],n=!1,r;function i(s){var o=L1e(t(s));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(s){return t.invert(CM(s))},i.domain=function(s){return arguments.length?(t.domain(s),i):t.domain()},i.range=function(s){return arguments.length?(t.range((e=Array.from(s,lb)).map(CM)),i):e.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(t.clamp(s),i):t.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return i8(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Os.apply(i,arguments),ml(i)}function s8(){var t=[],e=[],n=[],r;function i(){var o=0,c=Math.max(1,e.length);for(n=new Array(c-1);++o0?n[c-1]:t[0],c=n?[r[n-1],e]:[r[u-1],r[u]]},o.unknown=function(l){return arguments.length&&(s=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return o8().domain([t,e]).range(i).unknown(s)},Os.apply(ml(o),arguments)}function a8(){var t=[.5],e=[0,1],n,r=1;function i(s){return s!=null&&s<=s?e[Mg(t,s,0,r)]:n}return i.domain=function(s){return arguments.length?(t=Array.from(s),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(s){return arguments.length?(e=Array.from(s),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(s){var o=e.indexOf(s);return[t[o-1],t[o]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return a8().domain(t).range(e).unknown(n)},Os.apply(i,arguments)}const vC=new Date,yC=new Date;function Pr(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const o=i(s),c=i.ceil(s);return s-o(e(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,c)=>{const l=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s0))return l;let u;do l.push(u=new Date(+s)),e(s,c),t(s);while(uPr(o=>{if(o>=o)for(;t(o),!s(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;e(o,-1),!s(o););else for(;--c>=0;)for(;e(o,1),!s(o););}),n&&(i.count=(s,o)=>(vC.setTime(+s),yC.setTime(+o),t(vC),t(yC),Math.floor(n(vC,yC))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?o=>r(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const fb=Pr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);fb.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Pr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):fb);fb.range;const Sa=1e3,Cs=Sa*60,Ca=Cs*60,Ua=Ca*24,RP=Ua*7,_M=Ua*30,xC=Ua*365,Hl=Pr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Sa)},(t,e)=>(e-t)/Sa,t=>t.getUTCSeconds());Hl.range;const MP=Pr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Sa)},(t,e)=>{t.setTime(+t+e*Cs)},(t,e)=>(e-t)/Cs,t=>t.getMinutes());MP.range;const DP=Pr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Cs)},(t,e)=>(e-t)/Cs,t=>t.getUTCMinutes());DP.range;const $P=Pr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Sa-t.getMinutes()*Cs)},(t,e)=>{t.setTime(+t+e*Ca)},(t,e)=>(e-t)/Ca,t=>t.getHours());$P.range;const LP=Pr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ca)},(t,e)=>(e-t)/Ca,t=>t.getUTCHours());LP.range;const Lg=Pr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Cs)/Ua,t=>t.getDate()-1);Lg.range;const Iw=Pr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Ua,t=>t.getUTCDate()-1);Iw.range;const c8=Pr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Ua,t=>Math.floor(t/Ua));c8.range;function Du(t){return Pr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Cs)/RP)}const Rw=Du(0),hb=Du(1),F1e=Du(2),U1e=Du(3),df=Du(4),B1e=Du(5),H1e=Du(6);Rw.range;hb.range;F1e.range;U1e.range;df.range;B1e.range;H1e.range;function $u(t){return Pr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/RP)}const Mw=$u(0),pb=$u(1),z1e=$u(2),V1e=$u(3),ff=$u(4),G1e=$u(5),K1e=$u(6);Mw.range;pb.range;z1e.range;V1e.range;ff.range;G1e.range;K1e.range;const FP=Pr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());FP.range;const UP=Pr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());UP.range;const Ba=Pr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Ba.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Pr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Ba.range;const Ha=Pr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Ha.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Pr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Ha.range;function l8(t,e,n,r,i,s){const o=[[Hl,1,Sa],[Hl,5,5*Sa],[Hl,15,15*Sa],[Hl,30,30*Sa],[s,1,Cs],[s,5,5*Cs],[s,15,15*Cs],[s,30,30*Cs],[i,1,Ca],[i,3,3*Ca],[i,6,6*Ca],[i,12,12*Ca],[r,1,Ua],[r,2,2*Ua],[n,1,RP],[e,1,_M],[e,3,3*_M],[t,1,xC]];function c(u,d,f){const h=dv).right(o,h);if(p===o.length)return t.every(f1(u/xC,d/xC,f));if(p===0)return fb.every(Math.max(f1(u,d,f),1));const[g,m]=o[h/o[p-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(et=wC(kh(ee.y,0,1)),Ct=et.getUTCDay(),et=Ct>4||Ct===0?pb.ceil(et):pb(et),et=Iw.offset(et,(ee.V-1)*7),ee.y=et.getUTCFullYear(),ee.m=et.getUTCMonth(),ee.d=et.getUTCDate()+(ee.w+6)%7):(et=bC(kh(ee.y,0,1)),Ct=et.getDay(),et=Ct>4||Ct===0?hb.ceil(et):hb(et),et=Lg.offset(et,(ee.V-1)*7),ee.y=et.getFullYear(),ee.m=et.getMonth(),ee.d=et.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),Ct="Z"in ee?wC(kh(ee.y,0,1)).getUTCDay():bC(kh(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-(Ct+5)%7:ee.w+ee.U*7-(Ct+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,wC(ee)):bC(ee)}}function j(ue,we,Ae,ee){for(var wt=0,et=we.length,Ct=Ae.length,Xe,nn;wt=Ct)return-1;if(Xe=we.charCodeAt(wt++),Xe===37){if(Xe=we.charAt(wt++),nn=C[Xe in AM?we.charAt(wt++):Xe],!nn||(ee=nn(ue,Ae,ee))<0)return-1}else if(Xe!=Ae.charCodeAt(ee++))return-1}return ee}function T(ue,we,Ae){var ee=u.exec(we.slice(Ae));return ee?(ue.p=d.get(ee[0].toLowerCase()),Ae+ee[0].length):-1}function k(ue,we,Ae){var ee=p.exec(we.slice(Ae));return ee?(ue.w=g.get(ee[0].toLowerCase()),Ae+ee[0].length):-1}function I(ue,we,Ae){var ee=f.exec(we.slice(Ae));return ee?(ue.w=h.get(ee[0].toLowerCase()),Ae+ee[0].length):-1}function E(ue,we,Ae){var ee=b.exec(we.slice(Ae));return ee?(ue.m=x.get(ee[0].toLowerCase()),Ae+ee[0].length):-1}function O(ue,we,Ae){var ee=m.exec(we.slice(Ae));return ee?(ue.m=v.get(ee[0].toLowerCase()),Ae+ee[0].length):-1}function M(ue,we,Ae){return j(ue,e,we,Ae)}function U(ue,we,Ae){return j(ue,n,we,Ae)}function D(ue,we,Ae){return j(ue,r,we,Ae)}function B(ue){return o[ue.getDay()]}function R(ue){return s[ue.getDay()]}function L(ue){return l[ue.getMonth()]}function Y(ue){return c[ue.getMonth()]}function q(ue){return i[+(ue.getHours()>=12)]}function J(ue){return 1+~~(ue.getMonth()/3)}function me(ue){return o[ue.getUTCDay()]}function F(ue){return s[ue.getUTCDay()]}function oe(ue){return l[ue.getUTCMonth()]}function se(ue){return c[ue.getUTCMonth()]}function le(ue){return i[+(ue.getUTCHours()>=12)]}function ke(ue){return 1+~~(ue.getUTCMonth()/3)}return{format:function(ue){var we=_(ue+="",w);return we.toString=function(){return ue},we},parse:function(ue){var we=A(ue+="",!1);return we.toString=function(){return ue},we},utcFormat:function(ue){var we=_(ue+="",S);return we.toString=function(){return ue},we},utcParse:function(ue){var we=A(ue+="",!0);return we.toString=function(){return ue},we}}}var AM={"-":"",_:" ",0:"0"},Ur=/^\s*\d+/,J1e=/^%/,Z1e=/[\\^$*+?|[\]().{}]/g;function cn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function tje(t,e,n){var r=Ur.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function nje(t,e,n){var r=Ur.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function rje(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function ije(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function sje(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function jM(t,e,n){var r=Ur.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function EM(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function oje(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function aje(t,e,n){var r=Ur.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function cje(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function NM(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function lje(t,e,n){var r=Ur.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function TM(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function uje(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function dje(t,e,n){var r=Ur.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function fje(t,e,n){var r=Ur.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function hje(t,e,n){var r=Ur.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function pje(t,e,n){var r=J1e.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function mje(t,e,n){var r=Ur.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function gje(t,e,n){var r=Ur.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function PM(t,e){return cn(t.getDate(),e,2)}function vje(t,e){return cn(t.getHours(),e,2)}function yje(t,e){return cn(t.getHours()%12||12,e,2)}function xje(t,e){return cn(1+Lg.count(Ba(t),t),e,3)}function u8(t,e){return cn(t.getMilliseconds(),e,3)}function bje(t,e){return u8(t,e)+"000"}function wje(t,e){return cn(t.getMonth()+1,e,2)}function Sje(t,e){return cn(t.getMinutes(),e,2)}function Cje(t,e){return cn(t.getSeconds(),e,2)}function _je(t){var e=t.getDay();return e===0?7:e}function Aje(t,e){return cn(Rw.count(Ba(t)-1,t),e,2)}function d8(t){var e=t.getDay();return e>=4||e===0?df(t):df.ceil(t)}function jje(t,e){return t=d8(t),cn(df.count(Ba(t),t)+(Ba(t).getDay()===4),e,2)}function Eje(t){return t.getDay()}function Nje(t,e){return cn(hb.count(Ba(t)-1,t),e,2)}function Tje(t,e){return cn(t.getFullYear()%100,e,2)}function Pje(t,e){return t=d8(t),cn(t.getFullYear()%100,e,2)}function kje(t,e){return cn(t.getFullYear()%1e4,e,4)}function Oje(t,e){var n=t.getDay();return t=n>=4||n===0?df(t):df.ceil(t),cn(t.getFullYear()%1e4,e,4)}function Ije(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+cn(e/60|0,"0",2)+cn(e%60,"0",2)}function kM(t,e){return cn(t.getUTCDate(),e,2)}function Rje(t,e){return cn(t.getUTCHours(),e,2)}function Mje(t,e){return cn(t.getUTCHours()%12||12,e,2)}function Dje(t,e){return cn(1+Iw.count(Ha(t),t),e,3)}function f8(t,e){return cn(t.getUTCMilliseconds(),e,3)}function $je(t,e){return f8(t,e)+"000"}function Lje(t,e){return cn(t.getUTCMonth()+1,e,2)}function Fje(t,e){return cn(t.getUTCMinutes(),e,2)}function Uje(t,e){return cn(t.getUTCSeconds(),e,2)}function Bje(t){var e=t.getUTCDay();return e===0?7:e}function Hje(t,e){return cn(Mw.count(Ha(t)-1,t),e,2)}function h8(t){var e=t.getUTCDay();return e>=4||e===0?ff(t):ff.ceil(t)}function zje(t,e){return t=h8(t),cn(ff.count(Ha(t),t)+(Ha(t).getUTCDay()===4),e,2)}function Vje(t){return t.getUTCDay()}function Gje(t,e){return cn(pb.count(Ha(t)-1,t),e,2)}function Kje(t,e){return cn(t.getUTCFullYear()%100,e,2)}function Wje(t,e){return t=h8(t),cn(t.getUTCFullYear()%100,e,2)}function qje(t,e){return cn(t.getUTCFullYear()%1e4,e,4)}function Yje(t,e){var n=t.getUTCDay();return t=n>=4||n===0?ff(t):ff.ceil(t),cn(t.getUTCFullYear()%1e4,e,4)}function Qje(){return"+0000"}function OM(){return"%"}function IM(t){return+t}function RM(t){return Math.floor(+t/1e3)}var Ku,p8,m8;Xje({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Xje(t){return Ku=X1e(t),p8=Ku.format,Ku.parse,m8=Ku.utcFormat,Ku.utcParse,Ku}function Jje(t){return new Date(t)}function Zje(t){return t instanceof Date?+t:+new Date(+t)}function BP(t,e,n,r,i,s,o,c,l,u){var d=EP(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),b=u("%a %d"),x=u("%b %d"),w=u("%B"),S=u("%Y");function C(_){return(l(_)<_?p:c(_)<_?g:o(_)<_?m:s(_)<_?v:r(_)<_?i(_)<_?b:x:n(_)<_?w:S)(_)}return d.invert=function(_){return new Date(f(_))},d.domain=function(_){return arguments.length?h(Array.from(_,Zje)):h().map(Jje)},d.ticks=function(_){var A=h();return t(A[0],A[A.length-1],_??10)},d.tickFormat=function(_,A){return A==null?C:u(A)},d.nice=function(_){var A=h();return(!_||typeof _.range!="function")&&(_=e(A[0],A[A.length-1],_??10)),_?h(t8(A,_)):d},d.copy=function(){return $g(d,BP(t,e,n,r,i,s,o,c,l,u))},d}function eEe(){return Os.apply(BP(Y1e,Q1e,Ba,FP,Rw,Lg,$P,MP,Hl,p8).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function tEe(){return Os.apply(BP(W1e,q1e,Ha,UP,Mw,Iw,LP,DP,Hl,m8).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Dw(){var t=0,e=1,n,r,i,s,o=xi,c=!1,l;function u(f){return f==null||isNaN(f=+f)?l:o(i===0?.5:(f=(s(f)-n)*i,c?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([t,e]=f,n=s(t=+t),r=s(e=+e),i=n===r?0:1/(r-n),u):[t,e]},u.clamp=function(f){return arguments.length?(c=!!f,u):c},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,o=f(p,g),u):[o(0),o(1)]}}return u.range=d(oh),u.rangeRound=d(jP),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return s=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),u}}function gl(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function g8(){var t=ml(Dw()(xi));return t.copy=function(){return gl(t,g8())},Qa.apply(t,arguments)}function v8(){var t=PP(Dw()).domain([1,10]);return t.copy=function(){return gl(t,v8()).base(t.base())},Qa.apply(t,arguments)}function y8(){var t=kP(Dw());return t.copy=function(){return gl(t,y8()).constant(t.constant())},Qa.apply(t,arguments)}function HP(){var t=OP(Dw());return t.copy=function(){return gl(t,HP()).exponent(t.exponent())},Qa.apply(t,arguments)}function nEe(){return HP.apply(null,arguments).exponent(.5)}function x8(){var t=[],e=xi;function n(r){if(r!=null&&!isNaN(r=+r))return e((Mg(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(Vc),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>HAe(t,s/r))},n.copy=function(){return x8(e).domain(t)},Qa.apply(n,arguments)}function $w(){var t=0,e=.5,n=1,r=1,i,s,o,c,l,u=xi,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-s)*(r*me}var C8=oEe,aEe=Lw,cEe=C8,lEe=sh;function uEe(t){return t&&t.length?aEe(t,lEe,cEe):void 0}var dEe=uEe;const Cc=dn(dEe);function fEe(t,e){return tt.e^s.s<0?1:-1;for(r=s.d.length,i=t.d.length,e=0,n=rt.d[e]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};Qe.decimalPlaces=Qe.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Dn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Qe.dividedBy=Qe.div=function(t){return Ta(this,new this.constructor(t))};Qe.dividedToIntegerBy=Qe.idiv=function(t){var e=this,n=e.constructor;return jn(Ta(e,new n(t),0,1),n.precision)};Qe.equals=Qe.eq=function(t){return!this.cmp(t)};Qe.exponent=function(){return gr(this)};Qe.greaterThan=Qe.gt=function(t){return this.cmp(t)>0};Qe.greaterThanOrEqualTo=Qe.gte=function(t){return this.cmp(t)>=0};Qe.isInteger=Qe.isint=function(){return this.e>this.d.length-2};Qe.isNegative=Qe.isneg=function(){return this.s<0};Qe.isPositive=Qe.ispos=function(){return this.s>0};Qe.isZero=function(){return this.s===0};Qe.lessThan=Qe.lt=function(t){return this.cmp(t)<0};Qe.lessThanOrEqualTo=Qe.lte=function(t){return this.cmp(t)<1};Qe.logarithm=Qe.log=function(t){var e,n=this,r=n.constructor,i=r.precision,s=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Xi))throw Error(Ts+"NaN");if(n.s<1)throw Error(Ts+(n.s?"NaN":"-Infinity"));return n.eq(Xi)?new r(0):(Vn=!1,e=Ta(Mm(n,s),Mm(t,s),s),Vn=!0,jn(e,i))};Qe.minus=Qe.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?N8(e,t):j8(e,(t.s=-t.s,t))};Qe.modulo=Qe.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Ts+"NaN");return n.s?(Vn=!1,e=Ta(n,t,0,1).times(t),Vn=!0,n.minus(e)):jn(new r(n),i)};Qe.naturalExponential=Qe.exp=function(){return E8(this)};Qe.naturalLogarithm=Qe.ln=function(){return Mm(this)};Qe.negated=Qe.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Qe.plus=Qe.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?j8(e,t):N8(e,(t.s=-t.s,t))};Qe.precision=Qe.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(ru+t);if(e=gr(i)+1,r=i.d.length-1,n=r*Dn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Qe.squareRoot=Qe.sqrt=function(){var t,e,n,r,i,s,o,c=this,l=c.constructor;if(c.s<1){if(!c.s)return new l(0);throw Error(Ts+"NaN")}for(t=gr(c),Vn=!1,i=Math.sqrt(+c),i==0||i==1/0?(e=Do(c.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=ch((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=o=n+3;;)if(s=r,r=s.plus(Ta(c,s,o+2)).times(.5),Do(s.d).slice(0,o)===(e=Do(r.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(jn(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(e!="9999")break;o+=4}return Vn=!0,jn(r,n)};Qe.times=Qe.mul=function(t){var e,n,r,i,s,o,c,l,u,d=this,f=d.constructor,h=d.d,p=(t=new f(t)).d;if(!d.s||!t.s)return new f(0);for(t.s*=d.s,n=d.e+t.e,l=h.length,u=p.length,l=0;){for(e=0,i=l+r;i>r;)c=s[i]+p[r]*h[i-r-1]+e,s[i--]=c%Ir|0,e=c/Ir|0;s[i]=(s[i]+e)%Ir|0}for(;!s[--o];)s.pop();return e?++n:s.shift(),t.d=s,t.e=n,Vn?jn(t,f.precision):t};Qe.toDecimalPlaces=Qe.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Qo(t,0,ah),e===void 0?e=r.rounding:Qo(e,0,8),jn(n,t+gr(n)+1,e))};Qe.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=ju(r,!0):(Qo(t,0,ah),e===void 0?e=i.rounding:Qo(e,0,8),r=jn(new i(r),t+1,e),n=ju(r,!0,t+1)),n};Qe.toFixed=function(t,e){var n,r,i=this,s=i.constructor;return t===void 0?ju(i):(Qo(t,0,ah),e===void 0?e=s.rounding:Qo(e,0,8),r=jn(new s(i),t+gr(i)+1,e),n=ju(r.abs(),!1,t+gr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Qe.toInteger=Qe.toint=function(){var t=this,e=t.constructor;return jn(new e(t),gr(t)+1,e.rounding)};Qe.toNumber=function(){return+this};Qe.toPower=Qe.pow=function(t){var e,n,r,i,s,o,c=this,l=c.constructor,u=12,d=+(t=new l(t));if(!t.s)return new l(Xi);if(c=new l(c),!c.s){if(t.s<1)throw Error(Ts+"Infinity");return c}if(c.eq(Xi))return c;if(r=l.precision,t.eq(Xi))return jn(c,r);if(e=t.e,n=t.d.length-1,o=e>=n,s=c.s,o){if((n=d<0?-d:d)<=A8){for(i=new l(Xi),e=Math.ceil(r/Dn+4),Vn=!1;n%2&&(i=i.times(c),$M(i.d,e)),n=ch(n/2),n!==0;)c=c.times(c),$M(c.d,e);return Vn=!0,t.s<0?new l(Xi).div(i):jn(i,r)}}else if(s<0)throw Error(Ts+"NaN");return s=s<0&&t.d[Math.max(e,n)]&1?-1:1,c.s=1,Vn=!1,i=t.times(Mm(c,r+u)),Vn=!0,i=E8(i),i.s=s,i};Qe.toPrecision=function(t,e){var n,r,i=this,s=i.constructor;return t===void 0?(n=gr(i),r=ju(i,n<=s.toExpNeg||n>=s.toExpPos)):(Qo(t,1,ah),e===void 0?e=s.rounding:Qo(e,0,8),i=jn(new s(i),t,e),n=gr(i),r=ju(i,t<=n||n<=s.toExpNeg,t)),r};Qe.toSignificantDigits=Qe.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Qo(t,1,ah),e===void 0?e=r.rounding:Qo(e,0,8)),jn(new r(n),t,e)};Qe.toString=Qe.valueOf=Qe.val=Qe.toJSON=Qe[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=gr(t),n=t.constructor;return ju(t,e<=n.toExpNeg||e>=n.toExpPos)};function j8(t,e){var n,r,i,s,o,c,l,u,d=t.constructor,f=d.precision;if(!t.s||!e.s)return e.s||(e=new d(t)),Vn?jn(e,f):e;if(l=t.d,u=e.d,o=t.e,i=e.e,l=l.slice(),s=o-i,s){for(s<0?(r=l,s=-s,c=u.length):(r=u,i=o,c=l.length),o=Math.ceil(f/Dn),c=o>c?o+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=l.length,s=u.length,c-s<0&&(s=c,r=u,u=l,l=r),n=0;s;)n=(l[--s]=l[s]+u[s]+n)/Ir|0,l[s]%=Ir;for(n&&(l.unshift(n),++i),c=l.length;l[--c]==0;)l.pop();return e.d=l,e.e=i,Vn?jn(e,f):e}function Qo(t,e,n){if(t!==~~t||tn)throw Error(ru+t)}function Do(t){var e,n,r,i=t.length-1,s="",o=t[0];if(i>0){for(s+=o,e=1;eo?1:-1;else for(c=l=0;ci[c]?1:-1;break}return l}function n(r,i,s){for(var o=0;s--;)r[s]-=o,o=r[s]1;)r.shift()}return function(r,i,s,o){var c,l,u,d,f,h,p,g,m,v,b,x,w,S,C,_,A,j,T=r.constructor,k=r.s==i.s?1:-1,I=r.d,E=i.d;if(!r.s)return new T(r);if(!i.s)throw Error(Ts+"Division by zero");for(l=r.e-i.e,A=E.length,C=I.length,p=new T(k),g=p.d=[],u=0;E[u]==(I[u]||0);)++u;if(E[u]>(I[u]||0)&&--l,s==null?x=s=T.precision:o?x=s+(gr(r)-gr(i))+1:x=s,x<0)return new T(0);if(x=x/Dn+2|0,u=0,A==1)for(d=0,E=E[0],x++;(u1&&(E=t(E,d),I=t(I,d),A=E.length,C=I.length),S=A,m=I.slice(0,A),v=m.length;v=Ir/2&&++_;do d=0,c=e(E,m,A,v),c<0?(b=m[0],A!=v&&(b=b*Ir+(m[1]||0)),d=b/_|0,d>1?(d>=Ir&&(d=Ir-1),f=t(E,d),h=f.length,v=m.length,c=e(f,m,h,v),c==1&&(d--,n(f,A16)throw Error(VP+gr(t));if(!t.s)return new d(Xi);for(e==null?(Vn=!1,c=f):c=e,o=new d(.03125);t.abs().gte(.1);)t=t.times(o),u+=5;for(r=Math.log(Tl(2,u))/Math.LN10*2+5|0,c+=r,n=i=s=new d(Xi),d.precision=c;;){if(i=jn(i.times(t),c),n=n.times(++l),o=s.plus(Ta(i,n,c)),Do(o.d).slice(0,c)===Do(s.d).slice(0,c)){for(;u--;)s=jn(s.times(s),c);return d.precision=f,e==null?(Vn=!0,jn(s,f)):s}s=o}}function gr(t){for(var e=t.e*Dn,n=t.d[0];n>=10;n/=10)e++;return e}function SC(t,e,n){if(e>t.LN10.sd())throw Vn=!0,n&&(t.precision=n),Error(Ts+"LN10 precision limit exceeded");return jn(new t(t.LN10),e)}function ac(t){for(var e="";t--;)e+="0";return e}function Mm(t,e){var n,r,i,s,o,c,l,u,d,f=1,h=10,p=t,g=p.d,m=p.constructor,v=m.precision;if(p.s<1)throw Error(Ts+(p.s?"NaN":"-Infinity"));if(p.eq(Xi))return new m(0);if(e==null?(Vn=!1,u=v):u=e,p.eq(10))return e==null&&(Vn=!0),SC(m,u);if(u+=h,m.precision=u,n=Do(g),r=n.charAt(0),s=gr(p),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=Do(p.d),r=n.charAt(0),f++;s=gr(p),r>1?(p=new m("0."+n),s++):p=new m(r+"."+n.slice(1))}else return l=SC(m,u+2,v).times(s+""),p=Mm(new m(r+"."+n.slice(1)),u-h).plus(l),m.precision=v,e==null?(Vn=!0,jn(p,v)):p;for(c=o=p=Ta(p.minus(Xi),p.plus(Xi),u),d=jn(p.times(p),u),i=3;;){if(o=jn(o.times(d),u),l=c.plus(Ta(o,new m(i),u)),Do(l.d).slice(0,u)===Do(c.d).slice(0,u))return c=c.times(2),s!==0&&(c=c.plus(SC(m,u+2,v).times(s+""))),c=Ta(c,new m(f),u),m.precision=v,e==null?(Vn=!0,jn(c,v)):c;c=l,i+=2}}function DM(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=ch(n/Dn),t.d=[],r=(n+1)%Dn,n<0&&(r+=Dn),rmb||t.e<-mb))throw Error(VP+n)}else t.s=0,t.e=0,t.d=[0];return t}function jn(t,e,n){var r,i,s,o,c,l,u,d,f=t.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(r=e-o,r<0)r+=Dn,i=e,u=f[d=0];else{if(d=Math.ceil((r+1)/Dn),s=f.length,d>=s)return t;for(u=s=f[d],o=1;s>=10;s/=10)o++;r%=Dn,i=r-Dn+o}if(n!==void 0&&(s=Tl(10,o-i-1),c=u/s%10|0,l=e<0||f[d+1]!==void 0||u%s,l=n<4?(c||l)&&(n==0||n==(t.s<0?3:2)):c>5||c==5&&(n==4||l||n==6&&(r>0?i>0?u/Tl(10,o-i):0:f[d-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(s=gr(t),f.length=1,e=e-s-1,f[0]=Tl(10,(Dn-e%Dn)%Dn),t.e=ch(-e/Dn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=d,s=1,d--):(f.length=d+1,s=Tl(10,Dn-r),f[d]=i>0?(u/Tl(10,o-i)%Tl(10,i)|0)*s:0),l)for(;;)if(d==0){(f[0]+=s)==Ir&&(f[0]=1,++t.e);break}else{if(f[d]+=s,f[d]!=Ir)break;f[d--]=0,s=1}for(r=f.length;f[--r]===0;)f.pop();if(Vn&&(t.e>mb||t.e<-mb))throw Error(VP+gr(t));return t}function N8(t,e){var n,r,i,s,o,c,l,u,d,f,h=t.constructor,p=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),Vn?jn(e,p):e;if(l=t.d,f=e.d,r=e.e,u=t.e,l=l.slice(),o=u-r,o){for(d=o<0,d?(n=l,o=-o,c=f.length):(n=f,r=u,c=l.length),i=Math.max(Math.ceil(p/Dn),c)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=l.length,c=f.length,d=i0;--i)l[c++]=0;for(i=f.length;i>o;){if(l[--i]0?s=s.charAt(0)+"."+s.slice(1)+ac(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+ac(-i-1)+s,n&&(r=n-o)>0&&(s+=ac(r))):i>=o?(s+=ac(i+1-o),n&&(r=n-i-1)>0&&(s=s+"."+ac(r))):((r=i+1)0&&(i+1===o&&(s+="."),s+=ac(r))),t.s<0?"-"+s:s}function $M(t,e){if(t.length>e)return t.length=e,!0}function T8(t){var e,n,r;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(ru+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return DM(o,s.toString())}else if(typeof s!="string")throw Error(ru+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,IEe.test(s))DM(o,s);else throw Error(ru+s)}if(i.prototype=Qe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=T8,i.config=i.set=REe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(ru+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ru+n+": "+r);return this}var GP=T8(OEe);Xi=new GP(1);const wn=GP;function MEe(t){return FEe(t)||LEe(t)||$Ee(t)||DEe()}function DEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Ee(t,e){if(t){if(typeof t=="string")return v1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v1(t,e)}}function LEe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function FEe(t){if(Array.isArray(t))return v1(t)}function v1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-o,LM(function(){for(var c=arguments.length,l=new Array(c),u=0;ut.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,s=void 0;try{for(var o=t[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,s=l}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw s}}return n}}function eNe(t){if(Array.isArray(t))return t}function R8(t){var e=Dm(t,2),n=e[0],r=e[1],i=n,s=r;return n>r&&(i=r,s=n),[i,s]}function M8(t,e,n){if(t.lte(0))return new wn(0);var r=Bw.getDigitCount(t.toNumber()),i=new wn(10).pow(r),s=t.div(i),o=r!==1?.05:.1,c=new wn(Math.ceil(s.div(o).toNumber())).add(n).mul(o),l=c.mul(i);return e?l:new wn(Math.ceil(l))}function tNe(t,e,n){var r=1,i=new wn(t);if(!i.isint()&&n){var s=Math.abs(t);s<1?(r=new wn(10).pow(Bw.getDigitCount(t)-1),i=new wn(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new wn(Math.floor(t)))}else t===0?i=new wn(Math.floor((e-1)/2)):n||(i=new wn(Math.floor(t)));var o=Math.floor((e-1)/2),c=zEe(HEe(function(l){return i.add(new wn(l-o).mul(r)).toNumber()}),y1);return c(0,e)}function D8(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new wn(0),tickMin:new wn(0),tickMax:new wn(0)};var s=M8(new wn(e).sub(t).div(n-1),r,i),o;t<=0&&e>=0?o=new wn(0):(o=new wn(t).add(e).div(2),o=o.sub(new wn(o).mod(s)));var c=Math.ceil(o.sub(t).div(s).toNumber()),l=Math.ceil(new wn(e).sub(o).div(s).toNumber()),u=c+l+1;return u>n?D8(t,e,n,r,i+1):(u0?l+(n-u):l,c=e>0?c:c+(n-u)),{step:s,tickMin:o.sub(new wn(c).mul(s)),tickMax:o.add(new wn(l).mul(s))})}function nNe(t){var e=Dm(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),c=R8([n,r]),l=Dm(c,2),u=l[0],d=l[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(b1(y1(0,i-1).map(function(){return 1/0}))):[].concat(b1(y1(0,i-1).map(function(){return-1/0})),[d]);return n>r?x1(f):f}if(u===d)return tNe(u,i,s);var h=D8(u,d,o,s),p=h.step,g=h.tickMin,m=h.tickMax,v=Bw.rangeStep(g,m.add(new wn(.1).mul(p)),p);return n>r?x1(v):v}function rNe(t,e){var n=Dm(t,2),r=n[0],i=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=R8([r,i]),c=Dm(o,2),l=c[0],u=c[1];if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var d=Math.max(e,2),f=M8(new wn(u).sub(l).div(d-1),s,0),h=[].concat(b1(Bw.rangeStep(new wn(l),new wn(u).sub(new wn(.99).mul(f)),f)),[u]);return r>i?x1(h):h}var iNe=O8(nNe),sNe=O8(rNe),oNe="Invariant failed";function Eu(t,e){throw new Error(oNe)}var aNe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function hf(t){"@babel/helpers - typeof";return hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hf(t)}function gb(){return gb=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pNe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function mNe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gNe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var l=s.range,u=0;u0?i[u-1].coordinate:i[c-1].coordinate,f=i[u].coordinate,h=u>=c-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(vi(f-d)!==vi(h-f)){var g=[];if(vi(h-f)===vi(l[1]-l[0])){p=h;var m=f+l[1]-l[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var v=h+l[1]-l[0];g[0]=Math.min(f,(v+f)/2),g[1]=Math.max(f,(v+f)/2)}var b=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(e>b[0]&&e<=b[1]||e>=g[0]&&e<=g[1]){o=i[u].index;break}}else{var x=Math.min(d,h),w=Math.max(d,h);if(e>(x+f)/2&&e<=(w+f)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===c-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){o=r[S].index;break}return o},KP=function(e){var n,r=e,i=r.type.displayName,s=(n=e.type)!==null&&n!==void 0&&n.defaultProps?nr(nr({},e.type.defaultProps),e.props):e.props,o=s.stroke,c=s.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:c;break;default:l=c;break}return l},INe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var o={},c=Object.keys(s),l=0,u=c.length;l=0});if(b&&b.length){var x=b[0].type.defaultProps,w=x!==void 0?nr(nr({},x),b[0].props):b[0].props,S=w.barSize,C=w[v];o[C]||(o[C]=[]);var _=Dt(S)?n:S;o[C].push({item:b[0],stackList:b.slice(1),barSize:Dt(_)?void 0:yi(_,r,0)})}}return o},RNe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,s=e.sizeList,o=s===void 0?[]:s,c=e.maxBarSize,l=o.length;if(l<1)return null;var u=yi(n,i,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/l,g=o.reduce(function(S,C){return S+C.barSize||0},0);g+=(l-1)*u,g>=i&&(g-=(l-1)*u,u=0),g>=i&&p>0&&(h=!0,p*=.9,g=l*p);var m=(i-g)/2>>0,v={offset:m-u,size:0};d=o.reduce(function(S,C){var _={item:C.item,position:{offset:v.offset+v.size+u,size:h?p:C.barSize}},A=[].concat(BM(S),[_]);return v=A[A.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(j){A.push({item:j,position:v})}),A},f)}else{var b=yi(r,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var x=(i-2*b-(l-1)*u)/l;x>1&&(x>>=0);var w=c===+c?Math.min(x,c):x;d=o.reduce(function(S,C,_){var A=[].concat(BM(S),[{item:C.item,position:{offset:b+(x+u)*_+(x-w)/2,size:w}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(j){A.push({item:j,position:A[A.length-1].position})}),A},f)}return d},MNe=function(e,n,r,i){var s=r.children,o=r.width,c=r.margin,l=o-(c.left||0)-(c.right||0),u=U8({children:s,legendWidth:l});if(u){var d=i||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&je(e[p]))return nr(nr({},e),{},kd({},p,e[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&je(e[g]))return nr(nr({},e),{},kd({},g,e[g]+(h||0)))}return e},DNe=function(e,n,r){return Dt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},B8=function(e,n,r,i,s){var o=n.props.children,c=js(o,Hw).filter(function(u){return DNe(i,s,u.props.direction)});if(c&&c.length){var l=c.map(function(u){return u.props.dataKey});return e.reduce(function(u,d){var f=or(d,r);if(Dt(f))return u;var h=Array.isArray(f)?[Fw(f),Cc(f)]:[f,f],p=l.reduce(function(g,m){var v=or(d,m,0),b=h[0]-Math.abs(Array.isArray(v)?v[0]:v),x=h[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(b,g[0]),Math.max(x,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},$Ne=function(e,n,r,i,s){var o=n.map(function(c){return B8(e,c,r,s,i)}).filter(function(c){return!Dt(c)});return o&&o.length?o.reduce(function(c,l){return[Math.min(c[0],l[0]),Math.max(c[1],l[1])]},[1/0,-1/0]):null},H8=function(e,n,r,i,s){var o=n.map(function(l){var u=l.props.dataKey;return r==="number"&&u&&B8(e,l,u,i)||xp(e,u,r,s)});if(r==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var c={};return o.reduce(function(l,u){for(var d=0,f=u.length;d=2?vi(c[0]-c[1])*2*u:u,n&&(e.ticks||e.niceTicks)){var d=(e.ticks||e.niceTicks).map(function(f){var h=s?s.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!th(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:s?s[f]:f,index:h,offset:u}})},CC=new WeakMap,Pv=function(e,n){if(typeof n!="function")return e;CC.has(e)||CC.set(e,new WeakMap);var r=CC.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},G8=function(e,n,r){var i=e.scale,s=e.type,o=e.layout,c=e.axisType;if(i==="auto")return o==="radial"&&c==="radiusAxis"?{scale:Pm(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:db(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:yp(),realScaleType:"point"}:s==="category"?{scale:Pm(),realScaleType:"band"}:{scale:db(),realScaleType:"linear"};if(Og(i)){var l="scale".concat(Aw(i));return{scale:(MM[l]||yp)(),realScaleType:MM[l]?l:"point"}}return At(i)?{scale:i}:{scale:yp(),realScaleType:"point"}},zM=1e-4,K8=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),s=Math.min(i[0],i[1])-zM,o=Math.max(i[0],i[1])+zM,c=e(n[0]),l=e(n[r-1]);(co||lo)&&e.domain([n[0],n[r-1]])}},LNe=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]=0?(e[c][r][0]=s,e[c][r][1]=s+l,s=e[c][r][1]):(e[c][r][0]=o,e[c][r][1]=o+l,o=e[c][r][1])}},BNe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[o][r][0]=s,e[o][r][1]=s+c,s=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}},HNe={sign:UNe,expand:ave,none:sf,silhouette:cve,wiggle:lve,positive:BNe},zNe=function(e,n,r){var i=n.map(function(c){return c.props.dataKey}),s=HNe[r],o=ove().keys(i).value(function(c,l){return+or(c,l,0)}).order(qA).offset(s);return o(e)},VNe=function(e,n,r,i,s,o){if(!e)return null;var c=o?n.reverse():n,l={},u=c.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?nr(nr({},h.type.defaultProps),h.props):h.props,m=g.stackId,v=g.hide;if(v)return f;var b=g[r],x=f[b]||{hasStack:!1,stackGroups:{}};if(Tr(m)){var w=x.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[m]=w}else x.stackGroups[nh("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return nr(nr({},f),{},kd({},b,x))},l),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,v){var b=p.stackGroups[v];return nr(nr({},m),{},kd({},v,{numericAxisId:r,cateAxisId:i,items:b.items,stackedData:zNe(e,b.items,s)}))},g)}return nr(nr({},f),{},kd({},h,p))},d)},W8=function(e,n){var r=n.realScaleType,i=n.type,s=n.tickCount,o=n.originalDomain,c=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(s&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=e.domain();if(!u.length)return null;var d=iNe(u,s,c);return e.domain([Fw(d),Cc(d)]),{niceTicks:d}}if(s&&i==="number"){var f=e.domain(),h=sNe(f,s,c);return{niceTicks:h}}return null};function VM(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,s=t.index,o=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Dt(i[e.dataKey])){var c=Vx(n,"value",i[e.dataKey]);if(c)return c.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var l=or(i,Dt(o)?e.dataKey:o);return Dt(l)?null:e.scale(l)}var GM=function(e){var n=e.axis,r=e.ticks,i=e.offset,s=e.bandSize,o=e.entry,c=e.index;if(n.type==="category")return r[c]?r[c].coordinate+i:null;var l=or(o,n.dataKey,n.domain[c]);return Dt(l)?null:n.scale(l)-s/2+i},GNe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return i<=0&&s>=0?0:s<0?s:i}return r[0]},KNe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?nr(nr({},e.type.defaultProps),e.props):e.props,s=i.stackId;if(Tr(s)){var o=n[s];if(o){var c=o.items.indexOf(e);return c>=0?o.stackedData[c]:null}}return null},WNe=function(e){return e.reduce(function(n,r){return[Fw(r.concat([n[0]]).filter(je)),Cc(r.concat([n[1]]).filter(je))]},[1/0,-1/0])},q8=function(e,n,r){return Object.keys(e).reduce(function(i,s){var o=e[s],c=o.stackedData,l=c.reduce(function(u,d){var f=WNe(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},KM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,WM=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_1=function(e,n,r){if(At(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(je(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(KM.test(e[0])){var s=+KM.exec(e[0])[1];i[0]=n[0]-s}else At(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(je(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(WM.test(e[1])){var o=+WM.exec(e[1])[1];i[1]=n[1]+o}else At(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},yb=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var s=bP(n,function(f){return f.coordinate}),o=1/0,c=1,l=s.length;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},J8=function(e,n,r,i,s){var o=e.width,c=e.height,l=e.startAngle,u=e.endAngle,d=yi(e.cx,o,o/2),f=yi(e.cy,c,c/2),h=X8(o,c,r),p=yi(e.innerRadius,h,0),g=yi(e.outerRadius,h,h*.8),m=Object.keys(n);return m.reduce(function(v,b){var x=n[b],w=x.domain,S=x.reversed,C;if(Dt(x.range))i==="angleAxis"?C=[l,u]:i==="radiusAxis"&&(C=[p,g]),S&&(C=[C[1],C[0]]);else{C=x.range;var _=C,A=QNe(_,2);l=A[0],u=A[1]}var j=G8(x,s),T=j.realScaleType,k=j.scale;k.domain(w).range(C),K8(k);var I=W8(k,ha(ha({},x),{},{realScaleType:T})),E=ha(ha(ha({},x),I),{},{range:C,radius:g,realScaleType:T,scale:k,cx:d,cy:f,innerRadius:p,outerRadius:g,startAngle:l,endAngle:u});return ha(ha({},v),{},Q8({},b,E))},{})},nTe=function(e,n){var r=e.x,i=e.y,s=n.x,o=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(i-o,2))},rTe=function(e,n){var r=e.x,i=e.y,s=n.cx,o=n.cy,c=nTe({x:r,y:i},{x:s,y:o});if(c<=0)return{radius:c};var l=(r-s)/c,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:c,angle:tTe(u),angleInRadian:u}},iTe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(i,s);return{startAngle:n-o*360,endAngle:r-o*360}},sTe=function(e,n){var r=n.startAngle,i=n.endAngle,s=Math.floor(r/360),o=Math.floor(i/360),c=Math.min(s,o);return e+c*360},XM=function(e,n){var r=e.x,i=e.y,s=rTe({x:r,y:i},n),o=s.radius,c=s.angle,l=n.innerRadius,u=n.outerRadius;if(ou)return!1;if(o===0)return!0;var d=iTe(n),f=d.startAngle,h=d.endAngle,p=c,g;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return g?ha(ha({},n),{},{radius:o,angle:sTe(p,n)}):null},Z8=function(e){return!y.isValidElement(e)&&!At(e)&&typeof e!="boolean"?e.className:""};function Um(t){"@babel/helpers - typeof";return Um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Um(t)}var oTe=["offset"];function aTe(t){return dTe(t)||uTe(t)||lTe(t)||cTe()}function cTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lTe(t,e){if(t){if(typeof t=="string")return A1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A1(t,e)}}function uTe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function dTe(t){if(Array.isArray(t))return A1(t)}function A1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function hTe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function JM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function xr(t){for(var e=1;e=0?1:-1,w,S;i==="insideStart"?(w=p+x*o,S=m):i==="insideEnd"?(w=g-x*o,S=!m):i==="end"&&(w=g+x*o,S=m),S=b<=0?S:!S;var C=un(u,d,v,w),_=un(u,d,v,w+(S?1:-1)*359),A="M".concat(C.x,",").concat(C.y,` - A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`, - `).concat(_.x,",").concat(_.y),j=Dt(e.id)?nh("recharts-radial-line-"):e.id;return P.createElement("text",Bm({},r,{dominantBaseline:"central",className:It("recharts-radial-bar-label",c)}),P.createElement("defs",null,P.createElement("path",{id:j,d:A})),P.createElement("textPath",{xlinkHref:"#".concat(j)},n))},bTe=function(e){var n=e.viewBox,r=e.offset,i=e.position,s=n,o=s.cx,c=s.cy,l=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,h=(d+f)/2;if(i==="outside"){var p=un(o,c,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var v=(l+u)/2,b=un(o,c,v,h),x=b.x,w=b.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},wTe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,s=e.position,o=n,c=o.x,l=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*i,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,v=m*i,b=m>0?"end":"start",x=m>0?"start":"end";if(s==="top"){var w={x:c+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:p};return xr(xr({},w),r?{height:Math.max(l-r.y,0),width:u}:{})}if(s==="bottom"){var S={x:c+u/2,y:l+d+h,textAnchor:"middle",verticalAnchor:g};return xr(xr({},S),r?{height:Math.max(r.y+r.height-(l+d),0),width:u}:{})}if(s==="left"){var C={x:c-v,y:l+d/2,textAnchor:b,verticalAnchor:"middle"};return xr(xr({},C),r?{width:Math.max(C.x-r.x,0),height:d}:{})}if(s==="right"){var _={x:c+u+v,y:l+d/2,textAnchor:x,verticalAnchor:"middle"};return xr(xr({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:d}:{})}var A=r?{width:u,height:d}:{};return s==="insideLeft"?xr({x:c+v,y:l+d/2,textAnchor:x,verticalAnchor:"middle"},A):s==="insideRight"?xr({x:c+u-v,y:l+d/2,textAnchor:b,verticalAnchor:"middle"},A):s==="insideTop"?xr({x:c+u/2,y:l+h,textAnchor:"middle",verticalAnchor:g},A):s==="insideBottom"?xr({x:c+u/2,y:l+d-h,textAnchor:"middle",verticalAnchor:p},A):s==="insideTopLeft"?xr({x:c+v,y:l+h,textAnchor:x,verticalAnchor:g},A):s==="insideTopRight"?xr({x:c+u-v,y:l+h,textAnchor:b,verticalAnchor:g},A):s==="insideBottomLeft"?xr({x:c+v,y:l+d-h,textAnchor:x,verticalAnchor:p},A):s==="insideBottomRight"?xr({x:c+u-v,y:l+d-h,textAnchor:b,verticalAnchor:p},A):Xf(s)&&(je(s.x)||Ul(s.x))&&(je(s.y)||Ul(s.y))?xr({x:c+yi(s.x,u),y:l+yi(s.y,d),textAnchor:"end",verticalAnchor:"end"},A):xr({x:c+u/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},A)},STe=function(e){return"cx"in e&&je(e.cx)};function Dr(t){var e=t.offset,n=e===void 0?5:e,r=fTe(t,oTe),i=xr({offset:n},r),s=i.viewBox,o=i.position,c=i.value,l=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!s||Dt(c)&&Dt(l)&&!y.isValidElement(u)&&!At(u))return null;if(y.isValidElement(u))return y.cloneElement(u,i);var p;if(At(u)){if(p=y.createElement(u,i),y.isValidElement(p))return p}else p=vTe(i);var g=STe(s),m=rt(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return xTe(i,p,m);var v=g?bTe(i):wTe(i);return P.createElement(_u,Bm({className:It("recharts-label",f)},m,v,{breakAll:h}),p)}Dr.displayName="Label";var eK=function(e){var n=e.cx,r=e.cy,i=e.angle,s=e.startAngle,o=e.endAngle,c=e.r,l=e.radius,u=e.innerRadius,d=e.outerRadius,f=e.x,h=e.y,p=e.top,g=e.left,m=e.width,v=e.height,b=e.clockWise,x=e.labelViewBox;if(x)return x;if(je(m)&&je(v)){if(je(f)&&je(h))return{x:f,y:h,width:m,height:v};if(je(p)&&je(g))return{x:p,y:g,width:m,height:v}}return je(f)&&je(h)?{x:f,y:h,width:0,height:0}:je(n)&&je(r)?{cx:n,cy:r,startAngle:s||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:d||l||c||0,clockWise:b}:e.viewBox?e.viewBox:{}},CTe=function(e,n){return e?e===!0?P.createElement(Dr,{key:"label-implicit",viewBox:n}):Tr(e)?P.createElement(Dr,{key:"label-implicit",viewBox:n,value:e}):y.isValidElement(e)?e.type===Dr?y.cloneElement(e,{key:"label-implicit",viewBox:n}):P.createElement(Dr,{key:"label-implicit",content:e,viewBox:n}):At(e)?P.createElement(Dr,{key:"label-implicit",content:e,viewBox:n}):Xf(e)?P.createElement(Dr,Bm({viewBox:n},e,{key:"label-implicit"})):null:null},_Te=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,s=eK(e),o=js(i,Dr).map(function(l,u){return y.cloneElement(l,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return o;var c=CTe(e.label,n||s);return[c].concat(aTe(o))};Dr.parseViewBox=eK;Dr.renderCallByParent=_Te;function ATe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var jTe=ATe;const tK=dn(jTe);function Hm(t){"@babel/helpers - typeof";return Hm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hm(t)}var ETe=["valueAccessor"],NTe=["data","dataKey","clockWise","id","textBreakAll"];function TTe(t){return ITe(t)||OTe(t)||kTe(t)||PTe()}function PTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kTe(t,e){if(t){if(typeof t=="string")return j1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j1(t,e)}}function OTe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ITe(t){if(Array.isArray(t))return j1(t)}function j1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function $Te(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var LTe=function(e){return Array.isArray(e.value)?tK(e.value):e.value};function zo(t){var e=t.valueAccessor,n=e===void 0?LTe:e,r=tD(t,ETe),i=r.data,s=r.dataKey,o=r.clockWise,c=r.id,l=r.textBreakAll,u=tD(r,NTe);return!i||!i.length?null:P.createElement(qt,{className:"recharts-label-list"},i.map(function(d,f){var h=Dt(s)?n(d,f):or(d&&d.payload,s),p=Dt(c)?{}:{id:"".concat(c,"-").concat(f)};return P.createElement(Dr,bb({},rt(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:l,viewBox:Dr.parseViewBox(Dt(o)?d:eD(eD({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}zo.displayName="LabelList";function FTe(t,e){return t?t===!0?P.createElement(zo,{key:"labelList-implicit",data:e}):P.isValidElement(t)||At(t)?P.createElement(zo,{key:"labelList-implicit",data:e,content:t}):Xf(t)?P.createElement(zo,bb({data:e},t,{key:"labelList-implicit"})):null:null}function UTe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=js(r,zo).map(function(o,c){return y.cloneElement(o,{data:e,key:"labelList-".concat(c)})});if(!n)return i;var s=FTe(t.label,e);return[s].concat(TTe(i))}zo.renderCallByParent=UTe;function zm(t){"@babel/helpers - typeof";return zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zm(t)}function E1(){return E1=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(o>u),`, - `).concat(f.x,",").concat(f.y,` - `);if(i>0){var p=un(n,r,i,o),g=un(n,r,i,u);h+="L ".concat(g.x,",").concat(g.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},GTe=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,s=e.outerRadius,o=e.cornerRadius,c=e.forceCornerRadius,l=e.cornerIsExternal,u=e.startAngle,d=e.endAngle,f=vi(d-u),h=kv({cx:n,cy:r,radius:s,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),p=h.circleTangency,g=h.lineTangency,m=h.theta,v=kv({cx:n,cy:r,radius:s,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:l}),b=v.circleTangency,x=v.lineTangency,w=v.theta,S=l?Math.abs(u-d):Math.abs(u-d)-m-w;if(S<0)return c?"M ".concat(g.x,",").concat(g.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):nK({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d});var C="M ".concat(g.x,",").concat(g.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,` - A`).concat(s,",").concat(s,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,` - `);if(i>0){var _=kv({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=_.circleTangency,j=_.lineTangency,T=_.theta,k=kv({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),I=k.circleTangency,E=k.lineTangency,O=k.theta,M=l?Math.abs(u-d):Math.abs(u-d)-T-O;if(M<0&&o===0)return"".concat(C,"L").concat(n,",").concat(r,"Z");C+="L".concat(E.x,",").concat(E.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,` - A`).concat(i,",").concat(i,",0,").concat(+(M>180),",").concat(+(f>0),",").concat(A.x,",").concat(A.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(j.x,",").concat(j.y,"Z")}else C+="L".concat(n,",").concat(r,"Z");return C},KTe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},rK=function(e){var n=rD(rD({},KTe),e),r=n.cx,i=n.cy,s=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,l=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o0&&Math.abs(d-f)<360?v=GTe({cx:r,cy:i,innerRadius:s,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:f}):v=nK({cx:r,cy:i,innerRadius:s,outerRadius:o,startAngle:d,endAngle:f}),P.createElement("path",E1({},rt(n,!0),{className:p,d:v,role:"img"}))};function Vm(t){"@babel/helpers - typeof";return Vm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vm(t)}function N1(){return N1=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function aPe(t,e){return lh(t.getTime(),e.getTime())}function dD(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,c;(o=i.next())&&!o.done;){for(var l=e.entries(),u=!1,d=0;(c=l.next())&&!c.done;){var f=o.value,h=f[0],p=f[1],g=c.value,m=g[0],v=g[1];!u&&!r[d]&&(u=n.equals(h,m,s,d,t,e,n)&&n.equals(p,v,h,m,t,e,n))&&(r[d]=!0),d++}if(!u)return!1;s++}return!0}function cPe(t,e,n){var r=uD(t),i=r.length;if(uD(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===cK&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!aK(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Dh(t,e,n){var r=cD(t),i=r.length;if(cD(e).length!==i)return!1;for(var s,o,c;i-- >0;)if(s=r[i],s===cK&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!aK(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=lD(t,s),c=lD(e,s),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function lPe(t,e){return lh(t.valueOf(),e.valueOf())}function uPe(t,e){return t.source===e.source&&t.flags===e.flags}function fD(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var c=e.values(),l=!1,u=0;(o=c.next())&&!o.done;)!l&&!r[u]&&(l=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!l)return!1}return!0}function dPe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var fPe="[object Arguments]",hPe="[object Boolean]",pPe="[object Date]",mPe="[object Map]",gPe="[object Number]",vPe="[object Object]",yPe="[object RegExp]",xPe="[object Set]",bPe="[object String]",wPe=Array.isArray,hD=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,pD=Object.assign,SPe=Object.prototype.toString.call.bind(Object.prototype.toString);function CPe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,c=t.areSetsEqual,l=t.areTypedArraysEqual;return function(d,f,h){if(d===f)return!0;if(d==null||f==null||typeof d!="object"||typeof f!="object")return d!==d&&f!==f;var p=d.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(d,f,h);if(wPe(d))return e(d,f,h);if(hD!=null&&hD(d))return l(d,f,h);if(p===Date)return n(d,f,h);if(p===RegExp)return o(d,f,h);if(p===Map)return r(d,f,h);if(p===Set)return c(d,f,h);var g=SPe(d);return g===pPe?n(d,f,h):g===yPe?o(d,f,h):g===mPe?r(d,f,h):g===xPe?c(d,f,h):g===vPe?typeof d.then!="function"&&typeof f.then!="function"&&i(d,f,h):g===fPe?i(d,f,h):g===hPe||g===gPe||g===bPe?s(d,f,h):!1}}function _Pe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Dh:oPe,areDatesEqual:aPe,areMapsEqual:r?aD(dD,Dh):dD,areObjectsEqual:r?Dh:cPe,arePrimitiveWrappersEqual:lPe,areRegExpsEqual:uPe,areSetsEqual:r?aD(fD,Dh):fD,areTypedArraysEqual:r?Dh:dPe};if(n&&(i=pD({},i,n(i))),e){var s=Iv(i.areArraysEqual),o=Iv(i.areMapsEqual),c=Iv(i.areObjectsEqual),l=Iv(i.areSetsEqual);i=pD({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:c,areSetsEqual:l})}return i}function APe(t){return function(e,n,r,i,s,o,c){return t(e,n,c)}}function jPe(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(l,u){var d=r(),f=d.cache,h=f===void 0?e?new WeakMap:void 0:f,p=d.meta;return n(l,u,{cache:h,equals:i,meta:p,strict:s})};if(e)return function(l,u){return n(l,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(l,u){return n(l,u,o)}}var EPe=vl();vl({strict:!0});vl({circular:!0});vl({circular:!0,strict:!0});vl({createInternalComparator:function(){return lh}});vl({strict:!0,createInternalComparator:function(){return lh}});vl({circular:!0,createInternalComparator:function(){return lh}});vl({circular:!0,createInternalComparator:function(){return lh},strict:!0});function vl(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,c=_Pe(t),l=CPe(c),u=r?r(l):APe(l);return jPe({circular:n,comparator:l,createState:i,equals:u,strict:o})}function NPe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function mD(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(s){n<0&&(n=s),s-n>e?(t(s),n=-1):NPe(i)};requestAnimationFrame(r)}function T1(t){"@babel/helpers - typeof";return T1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T1(t)}function TPe(t){return IPe(t)||OPe(t)||kPe(t)||PPe()}function PPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kPe(t,e){if(t){if(typeof t=="string")return gD(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gD(t,e)}}function gD(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:b<0?0:b},m=function(b){for(var x=b>1?1:b,w=x,S=0;S<8;++S){var C=f(w)-x,_=p(w);if(Math.abs(C-x)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,s=i===void 0?8:i,o=e.dt,c=o===void 0?17:o,l=function(d,f,h){var p=-(d-f)*r,g=h*s,m=h+(p-g)*c/1e3,v=h*c/1e3+d;return Math.abs(v-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uke(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s=0)&&(n[i]=t[i]);return n}function _C(t){return pke(t)||hke(t)||fke(t)||dke()}function dke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fke(t,e){if(t){if(typeof t=="string")return R1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R1(t,e)}}function hke(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function pke(t){if(Array.isArray(t))return R1(t)}function R1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cb(t){return Cb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cb(t)}var go=function(t){xke(n,t);var e=bke(n);function n(r,i){var s;mke(this,n),s=e.call(this,r,i);var o=s.props,c=o.isActive,l=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind($1(s)),s.changeStyle=s.changeStyle.bind($1(s)),!c||p<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),D1(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof h=="function")return s.state={style:u},D1(s);s.state={style:l?Xh({},l,u):u}}else s.state={style:{}};return s}return vke(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,o=i.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isActive,c=s.canBegin,l=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,h=this.state.style;if(c){if(!o){var p={style:l?Xh({},l,d):d};this.state&&h&&(l&&h[l]!==d||!l&&h!==d)&&this.setState(p);return}if(!(EPe(i.to,d)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:i.to;if(this.state&&h){var v={style:l?Xh({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(v)}this.runAnimation(Ds(Ds({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,o=i.from,c=i.to,l=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,p=ake(o,c,QPe(u),l,this.changeStyle),g=function(){s.stopJSAnimation=p()};this.manager.start([h,d,g,l,f])}},{key:"runStepAnimation",value:function(i){var s=this,o=i.steps,c=i.begin,l=i.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,v,b){if(b===0)return m;var x=v.duration,w=v.easing,S=w===void 0?"ease":w,C=v.style,_=v.properties,A=v.onAnimationEnd,j=b>0?o[b-1]:v,T=_||Object.keys(C);if(typeof S=="function"||S==="spring")return[].concat(_C(m),[s.runJSAnimation.bind(s,{from:j.style,to:C,duration:x,easing:S}),x]);var k=xD(T,x,S),I=Ds(Ds(Ds({},j.style),C),{},{transition:k});return[].concat(_C(m),[I,x,A]).filter(LPe)};return this.manager.start([l].concat(_C(o.reduce(p,[d,Math.max(h,c)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=RPe());var s=i.begin,o=i.duration,c=i.attributeName,l=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,p=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=c?Xh({},c,l):l,v=xD(Object.keys(m),o,u);g.start([d,s,Ds(Ds({},m),{},{transition:v}),o,f])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var c=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=lke(i,cke),u=y.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!c||u===0||o<=0)return s;var f=function(p){var g=p.props,m=g.style,v=m===void 0?{}:m,b=g.className,x=y.cloneElement(p,Ds(Ds({},l),{},{style:Ds(Ds({},v),d),className:b}));return x};return u===1?f(y.Children.only(s)):P.createElement("div",null,y.Children.map(s,function(h){return f(h)}))}}]),n}(y.PureComponent);go.displayName="Animate";go.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};go.propTypes={from:Bt.oneOfType([Bt.object,Bt.string]),to:Bt.oneOfType([Bt.object,Bt.string]),attributeName:Bt.string,duration:Bt.number,begin:Bt.number,easing:Bt.oneOfType([Bt.string,Bt.func]),steps:Bt.arrayOf(Bt.shape({duration:Bt.number.isRequired,style:Bt.object.isRequired,easing:Bt.oneOfType([Bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Bt.func]),properties:Bt.arrayOf("string"),onAnimationEnd:Bt.func})),children:Bt.oneOfType([Bt.node,Bt.func]),isActive:Bt.bool,canBegin:Bt.bool,onAnimationEnd:Bt.func,shouldReAnimate:Bt.bool,onAnimationStart:Bt.func,onAnimationReStart:Bt.func};Bt.object,Bt.object,Bt.object,Bt.element;Bt.object,Bt.object,Bt.object,Bt.oneOfType([Bt.array,Bt.element]),Bt.any;function Wm(t){"@babel/helpers - typeof";return Wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wm(t)}function _b(){return _b=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(o>0&&s instanceof Array){for(var f=[0,0,0,0],h=0,p=4;ho?o:s[h];d="M".concat(e,",").concat(n+c*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(e+l*f[0],",").concat(n)),d+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, - `).concat(e+r,",").concat(n+c*f[1])),d+="L ".concat(e+r,",").concat(n+i-c*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, - `).concat(e+r-l*f[2],",").concat(n+i)),d+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, - `).concat(e,",").concat(n+i-c*f[3])),d+="Z"}else if(o>0&&s===+s&&s>0){var g=Math.min(o,s);d="M ".concat(e,",").concat(n+c*g,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+l*g,",").concat(n,` - L `).concat(e+r-l*g,",").concat(n,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+r,",").concat(n+c*g,` - L `).concat(e+r,",").concat(n+i-c*g,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+r-l*g,",").concat(n+i,` - L `).concat(e+l*g,",").concat(n+i,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e,",").concat(n+i-c*g," Z")}else d="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},Pke=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,s=n.x,o=n.y,c=n.width,l=n.height;if(Math.abs(c)>0&&Math.abs(l)>0){var u=Math.min(s,s+c),d=Math.max(s,s+c),f=Math.min(o,o+l),h=Math.max(o,o+l);return r>=u&&r<=d&&i>=f&&i<=h}return!1},kke={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},WP=function(e){var n=ED(ED({},kke),e),r=y.useRef(),i=y.useState(-1),s=Ske(i,2),o=s[0],c=s[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&c(S)}catch{}},[]);var l=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=It("recharts-rectangle",p);return x?P.createElement(go,{canBegin:o>0,from:{width:d,height:f,x:l,y:u},to:{width:d,height:f,x:l,y:u},duration:m,animationEasing:g,isActive:x},function(S){var C=S.width,_=S.height,A=S.x,j=S.y;return P.createElement(go,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,isActive:b,easing:g},P.createElement("path",_b({},rt(n,!0),{className:w,d:ND(A,j,C,_,h),ref:r})))}):P.createElement("path",_b({},rt(n,!0),{className:w,d:ND(l,u,d,f,h)}))},Oke=["points","className","baseLinePoints","connectNulls"];function fd(){return fd=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function TD(t){return Lke(t)||$ke(t)||Dke(t)||Mke()}function Mke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dke(t,e){if(t){if(typeof t=="string")return L1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L1(t,e)}}function $ke(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Lke(t){if(Array.isArray(t))return L1(t)}function L1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){PD(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),PD(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},wp=function(e,n){var r=Fke(e);n&&(r=[r.reduce(function(s,o){return[].concat(TD(s),TD(o))},[])]);var i=r.map(function(s){return s.reduce(function(o,c,l){return"".concat(o).concat(l===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Uke=function(e,n,r){var i=wp(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(wp(n.reverse(),r).slice(1))},mK=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,s=e.connectNulls,o=Ike(e,Oke);if(!n||!n.length)return null;var c=It("recharts-polygon",r);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=Uke(n,i,s);return P.createElement("g",{className:c},P.createElement("path",fd({},rt(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?P.createElement("path",fd({},rt(o,!0),{fill:"none",d:wp(n,s)})):null,l?P.createElement("path",fd({},rt(o,!0),{fill:"none",d:wp(i,s)})):null)}var d=wp(n,s);return P.createElement("path",fd({},rt(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:c,d}))};function F1(){return F1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Wke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var qke=function(e,n,r,i,s,o){return"M".concat(e,",").concat(s,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},Yke=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,s=i===void 0?0:i,o=e.top,c=o===void 0?0:o,l=e.left,u=l===void 0?0:l,d=e.width,f=d===void 0?0:d,h=e.height,p=h===void 0?0:h,g=e.className,m=Kke(e,Bke),v=Hke({x:r,y:s,top:c,left:u,width:f,height:p},m);return!je(r)||!je(s)||!je(f)||!je(p)||!je(c)||!je(u)?null:P.createElement("path",U1({},rt(v,!0),{className:It("recharts-cross",g),d:qke(r,s,f,p,c,u)}))},Qke=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function Ym(t){"@babel/helpers - typeof";return Ym=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ym(t)}function Xke(t,e){if(t==null)return{};var n=Jke(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Jke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function za(){return za=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function wOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function SOe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function MD(t,e){for(var n=0;nLD?o=i==="outer"?"start":"end":s<-LD?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,s=r.cy,o=r.radius,c=r.axisLine,l=r.axisLineType,u=Cl(Cl({},rt(this.props,!1)),{},{fill:"none"},rt(c,!1));if(l==="circle")return P.createElement(Fg,Pl({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:s,r:o}));var d=this.props.ticks,f=d.map(function(h){return un(i,s,o,h.coordinate)});return P.createElement(mK,Pl({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,s=i.ticks,o=i.tick,c=i.tickLine,l=i.tickFormatter,u=i.stroke,d=rt(this.props,!1),f=rt(o,!1),h=Cl(Cl({},d),{},{fill:"none"},rt(c,!1)),p=s.map(function(g,m){var v=r.getTickLineCoord(g),b=r.getTickTextAnchor(g),x=Cl(Cl(Cl({textAnchor:b},d),{},{stroke:"none",fill:u},f),{},{index:m,payload:g,x:v.x2,y:v.y2});return P.createElement(qt,Pl({className:It("recharts-polar-angle-axis-tick",Z8(o)),key:"tick-".concat(g.coordinate)},Cu(r.props,g,m)),c&&P.createElement("line",Pl({className:"recharts-polar-angle-axis-tick-line"},h,v)),o&&e.renderTickItem(o,x,l?l(g.value,m):g.value))});return P.createElement(qt,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,i=r.ticks,s=r.radius,o=r.axisLine;return s<=0||!i||!i.length?null:P.createElement(qt,{className:It("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,s){var o;return P.isValidElement(r)?o=P.cloneElement(r,i):At(r)?o=r(i):o=P.createElement(_u,Pl({},i,{className:"recharts-polar-angle-axis-tick-value"}),s),o}}])}(y.PureComponent);Vw(dh,"displayName","PolarAngleAxis");Vw(dh,"axisType","angleAxis");Vw(dh,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var $Oe=xG,LOe=$Oe(Object.getPrototypeOf,Object),FOe=LOe,UOe=qa,BOe=FOe,HOe=Ya,zOe="[object Object]",VOe=Function.prototype,GOe=Object.prototype,wK=VOe.toString,KOe=GOe.hasOwnProperty,WOe=wK.call(Object);function qOe(t){if(!HOe(t)||UOe(t)!=zOe)return!1;var e=BOe(t);if(e===null)return!0;var n=KOe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&wK.call(n)==WOe}var YOe=qOe;const QOe=dn(YOe);var XOe=qa,JOe=Ya,ZOe="[object Boolean]";function eIe(t){return t===!0||t===!1||JOe(t)&&XOe(t)==ZOe}var tIe=eIe;const nIe=dn(tIe);function Xm(t){"@babel/helpers - typeof";return Xm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xm(t)}function Eb(){return Eb=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:l,y:u},duration:m,animationEasing:g,isActive:b},function(w){var S=w.upperWidth,C=w.lowerWidth,_=w.height,A=w.x,j=w.y;return P.createElement(go,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},P.createElement("path",Eb({},rt(n,!0),{className:x,d:HD(A,j,S,C,_),ref:r})))}):P.createElement("g",null,P.createElement("path",Eb({},rt(n,!0),{className:x,d:HD(l,u,d,f,h)})))},hIe=["option","shapeType","propTransformer","activeClassName","isActive"];function Jm(t){"@babel/helpers - typeof";return Jm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jm(t)}function pIe(t,e){if(t==null)return{};var n=mIe(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function zD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Nb(t){for(var e=1;e0?rs(w,"paddingAngle",0):0;if(C){var A=Mr(C.endAngle-C.startAngle,w.endAngle-w.startAngle),j=Nn(Nn({},w),{},{startAngle:x+_,endAngle:x+A(m)+_});v.push(j),x=j.endAngle}else{var T=w.endAngle,k=w.startAngle,I=Mr(0,T-k),E=I(m),O=Nn(Nn({},w),{},{startAngle:x+_,endAngle:x+E+_});v.push(O),x=O.endAngle}}),P.createElement(qt,null,r.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(s){if(!s.altKey)switch(s.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[c].focus(),i.setState({sectorToFocus:c});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,s=r.isAnimationActive,o=this.state.prevSectors;return s&&i&&i.length&&(!o||!Au(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,s=i.hide,o=i.sectors,c=i.className,l=i.label,u=i.cx,d=i.cy,f=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,g=this.state.isAnimationFinished;if(s||!o||!o.length||!je(u)||!je(d)||!je(f)||!je(h))return null;var m=It("recharts-pie",c);return P.createElement(qt,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){r.pieRef=b}},this.renderSectors(),l&&this.renderLabels(o),Dr.renderCallByParent(this.props,null,!1),(!p||g)&&zo.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r=360?x:x-1)*l,S=v-x*p-w,C=i.reduce(function(j,T){var k=or(T,b,0);return j+(je(k)?k:0)},0),_;if(C>0){var A;_=i.map(function(j,T){var k=or(j,b,0),I=or(j,d,T),E=(je(k)?k:0)/C,O;T?O=A.endAngle+vi(m)*l*(k!==0?1:0):O=o;var M=O+vi(m)*((k!==0?p:0)+E*S),U=(O+M)/2,D=(g.innerRadius+g.outerRadius)/2,B=[{name:I,value:k,payload:j,dataKey:b,type:h}],R=un(g.cx,g.cy,D,U);return A=Nn(Nn(Nn({percent:E,cornerRadius:s,name:I,tooltipPayload:B,midAngle:U,middleRadius:D,tooltipPosition:R},j),g),{},{value:or(j,b),startAngle:O,endAngle:M,payload:j,paddingAngle:vi(m)*l}),A})}return Nn(Nn({},g),{},{sectors:_,data:i})});function DIe(t){return t&&t.length?t[0]:void 0}var $Ie=DIe,LIe=$Ie;const FIe=dn(LIe);var UIe=["key"];function yf(t){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yf(t)}function BIe(t,e){if(t==null)return{};var n=HIe(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function HIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Pb(){return Pb=Object.assign?Object.assign.bind():function(t){for(var e=1;e=2&&(l=!0),u.push(di(di({},un(o,c,x,v)),{},{name:g,value:m,cx:o,cy:c,radius:x,angle:v,payload:h}))});var f=[];return l&&u.forEach(function(h){if(Array.isArray(h.value)){var p=FIe(h.value),g=Dt(p)?void 0:e.scale(p);f.push(di(di({},h),{},{radius:g},un(o,c,g,h.angle)))}else f.push(h)}),{points:u,isRange:l,baseLinePoints:f}});var QIe=Math.ceil,XIe=Math.max;function JIe(t,e,n,r){for(var i=-1,s=XIe(QIe((e-t)/(n||1)),0),o=Array(s);s--;)o[r?s:++i]=t,t+=n;return o}var ZIe=JIe,eRe=LG,YD=1/0,tRe=17976931348623157e292;function nRe(t){if(!t)return t===0?t:0;if(t=eRe(t),t===YD||t===-YD){var e=t<0?-1:1;return e*tRe}return t===t?t:0}var EK=nRe,rRe=ZIe,iRe=kw,AC=EK;function sRe(t){return function(e,n,r){return r&&typeof r!="number"&&iRe(e,n,r)&&(n=r=void 0),e=AC(e),n===void 0?(n=e,e=0):n=AC(n),r=r===void 0?e0&&r.handleDrag(i.changedTouches[0])}),Vi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,s=i.endIndex,o=i.onDragEnd,c=i.startIndex;o==null||o({endIndex:s,startIndex:c})}),r.detachDragEndListener()}),Vi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Vi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Vi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Vi(r,"handleSlideDragStart",function(i){var s=e$(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return xRe(e,t),mRe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,s=r.endX,o=this.state.scaleValues,c=this.props,l=c.gap,u=c.data,d=u.length-1,f=Math.min(i,s),h=Math.max(i,s),p=e.getIndexInRange(o,f),g=e.getIndexInRange(o,h);return{startIndex:p-p%l,endIndex:g===d?d:g-g%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,s=i.data,o=i.tickFormatter,c=i.dataKey,l=or(s[r],c,r);return At(o)?o(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,s=i.slideMoveStartX,o=i.startX,c=i.endX,l=this.props,u=l.x,d=l.width,f=l.travellerWidth,h=l.startIndex,p=l.endIndex,g=l.onChange,m=r.pageX-s;m>0?m=Math.min(m,u+d-f-c,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-c));var v=this.getIndex({startX:o+m,endX:c+m});(v.startIndex!==h||v.endIndex!==p)&&g&&g(v),this.setState({startX:o+m,endX:c+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var s=e$(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,s=i.brushMoveStartX,o=i.movingTravellerId,c=i.endX,l=i.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,v=d.data,b={startX:this.state.startX,endX:this.state.endX},x=r.pageX-s;x>0?x=Math.min(x,f+h-p-u):x<0&&(x=Math.max(x,f-u)),b[o]=u+x;var w=this.getIndex(b),S=w.startIndex,C=w.endIndex,_=function(){var j=v.length-1;return o==="startX"&&(c>l?S%m===0:C%m===0)||cl?C%m===0:S%m===0)||c>l&&C===j};this.setState(Vi(Vi({},o,u+x),"brushMoveStartX",r.pageX),function(){g&&_()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var s=this,o=this.state,c=o.scaleValues,l=o.startX,u=o.endX,d=this.state[i],f=c.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=c.length)){var p=c[h];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(Vi({},i,p),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,s=r.y,o=r.width,c=r.height,l=r.fill,u=r.stroke;return P.createElement("rect",{stroke:u,fill:l,x:i,y:s,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,s=r.y,o=r.width,c=r.height,l=r.data,u=r.children,d=r.padding,f=y.Children.only(u);return f?P.cloneElement(f,{x:i,y:s,width:o,height:c,margin:d,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var s,o,c=this,l=this.props,u=l.y,d=l.travellerWidth,f=l.height,h=l.traveller,p=l.ariaLabel,g=l.data,m=l.startIndex,v=l.endIndex,b=Math.max(r,this.props.x),x=jC(jC({},rt(this.props,!1)),{},{x:b,y:u,width:d,height:f}),w=p||"Min value: ".concat((s=g[m])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return P.createElement(qt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),c.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(h,x))}},{key:"renderSlide",value:function(r,i){var s=this.props,o=s.y,c=s.height,l=s.stroke,u=s.travellerWidth,d=Math.min(r,i)+u,f=Math.max(Math.abs(i-r)-u,0);return P.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:d,y:o,width:f,height:c})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,s=r.endIndex,o=r.y,c=r.height,l=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:u};return P.createElement(qt,{className:"recharts-brush-texts"},P.createElement(_u,Ib({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+c/2},g),this.getTextOfTick(i)),P.createElement(_u,Ib({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+p,y:o+c/2},g),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,i=r.data,s=r.className,o=r.children,c=r.x,l=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,v=h.isSlideMoving,b=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!je(c)||!je(l)||!je(u)||!je(d)||u<=0||d<=0)return null;var w=It("recharts-brush",s),S=P.Children.count(o)===1,C=hRe("userSelect","none");return P.createElement(qt,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||v||b||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,s=r.y,o=r.width,c=r.height,l=r.stroke,u=Math.floor(s+c/2)-1;return P.createElement(P.Fragment,null,P.createElement("rect",{x:i,y:s,width:o,height:c,fill:l,stroke:"none"}),P.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),P.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var s;return P.isValidElement(r)?s=P.cloneElement(r,i):At(r)?s=r(i):s=e.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(r,i){var s=r.data,o=r.width,c=r.x,l=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return jC({prevData:s,prevTravellerWidth:l,prevUpdateId:u,prevX:c,prevWidth:o},s&&s.length?wRe({data:s,width:o,x:c,travellerWidth:l,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||c!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([c,c+o-l]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:s,prevTravellerWidth:l,prevUpdateId:u,prevX:c,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var s=r.length,o=0,c=s-1;c-o>1;){var l=Math.floor((o+c)/2);r[l]>i?c=l:o=l}return i>=r[c]?c:o}}])}(y.PureComponent);Vi(bf,"displayName","Brush");Vi(bf,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var SRe=xP;function CRe(t,e){var n;return SRe(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}var _Re=CRe,ARe=dG,jRe=na,ERe=_Re,NRe=Hi,TRe=kw;function PRe(t,e,n){var r=NRe(t)?ARe:ERe;return n&&TRe(t,e,n)&&(e=void 0),r(t,jRe(e))}var kRe=PRe;const ORe=dn(kRe);var Vo=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},t$=IG;function IRe(t,e,n){e=="__proto__"&&t$?t$(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var RRe=IRe,MRe=RRe,DRe=kG,$Re=na;function LRe(t,e){var n={};return e=$Re(e),DRe(t,function(r,i,s){MRe(n,i,e(r,i,s))}),n}var FRe=LRe;const URe=dn(FRe);function BRe(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function i2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function s2e(t,e){var n=t.x,r=t.y,i=r2e(t,ZRe),s="".concat(n),o=parseInt(s,10),c="".concat(r),l=parseInt(c,10),u="".concat(e.height||i.height),d=parseInt(u,10),f="".concat(e.width||i.width),h=parseInt(f,10);return $h($h($h($h($h({},e),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:d,width:h,name:e.name,radius:e.radius})}function r$(t){return P.createElement(SK,K1({shapeType:"rectangle",propTransformer:s2e,activeClassName:"recharts-active-bar"},t))}var o2e=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var s=typeof r=="number";return s?e(r,i):(s||Eu(),n)}},a2e=["value","background"],OK;function wf(t){"@babel/helpers - typeof";return wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wf(t)}function c2e(t,e){if(t==null)return{};var n=l2e(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function l2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Mb(){return Mb=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(U)0&&Math.abs(M)0&&(O=Math.min((F||0)-(M[oe-1]||0),O))}),Number.isFinite(O)){var U=O/E,D=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(A=U*D/2),m.padding==="no-gap"){var B=yi(e.barCategoryGap,U*D),R=U*D/2;A=R-B-(R-B)/D*B}}}i==="xAxis"?j=[r.left+(w.left||0)+(A||0),r.left+r.width-(w.right||0)-(A||0)]:i==="yAxis"?j=l==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(A||0),r.top+r.height-(w.bottom||0)-(A||0)]:j=m.range,C&&(j=[j[1],j[0]]);var L=G8(m,s,h),Y=L.scale,q=L.realScaleType;Y.domain(b).range(j),K8(Y);var J=W8(Y,Vs(Vs({},m),{},{realScaleType:q}));i==="xAxis"?(I=v==="top"&&!S||v==="bottom"&&S,T=r.left,k=f[_]-I*m.height):i==="yAxis"&&(I=v==="left"&&!S||v==="right"&&S,T=f[_]-I*m.width,k=r.top);var me=Vs(Vs(Vs({},m),J),{},{realScaleType:q,x:T,y:k,scale:Y,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return me.bandSize=yb(me,J),!m.hide&&i==="xAxis"?f[_]+=(I?-1:1)*me.height:m.hide||(f[_]+=(I?-1:1)*me.width),Vs(Vs({},p),{},Ww({},g,me))},{})},$K=function(e,n){var r=e.x,i=e.y,s=n.x,o=n.y;return{x:Math.min(r,s),y:Math.min(i,o),width:Math.abs(s-r),height:Math.abs(o-i)}},b2e=function(e){var n=e.x1,r=e.y1,i=e.x2,s=e.y2;return $K({x:n,y:r},{x:i,y:s})},LK=function(){function t(e){v2e(this,t),this.scale=e}return y2e(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],s=r[r.length-1];return i<=s?n>=i&&n<=s:n>=s&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();Ww(LK,"EPS",1e-4);var qP=function(e){var n=Object.keys(e).reduce(function(r,i){return Vs(Vs({},r),{},Ww({},i,LK.create(e[i])))},{});return Vs(Vs({},n),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,c=s.position;return URe(i,function(l,u){return n[u].apply(l,{bandAware:o,position:c})})},isInRange:function(i){return kK(i,function(s,o){return n[o].isInRange(s)})}})};function w2e(t){return(t%180+180)%180}var S2e=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=w2e(i),o=s*Math.PI/180,c=Math.atan(r/n),l=o>c&&o-1?i[s?e[o]:o]:void 0}}var E2e=j2e,N2e=EK;function T2e(t){var e=N2e(t),n=e%1;return e===e?n?e-n:e:0}var P2e=T2e,k2e=AG,O2e=na,I2e=P2e,R2e=Math.max;function M2e(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:I2e(n);return i<0&&(i=R2e(r+i,0)),k2e(t,O2e(e),i)}var D2e=M2e,$2e=E2e,L2e=D2e,F2e=$2e(L2e),U2e=F2e;const B2e=dn(U2e);var H2e=jpe(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),YP=y.createContext(void 0),QP=y.createContext(void 0),FK=y.createContext(void 0),UK=y.createContext({}),BK=y.createContext(void 0),HK=y.createContext(0),zK=y.createContext(0),c$=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,s=n.offset,o=e.clipPathId,c=e.children,l=e.width,u=e.height,d=H2e(s);return P.createElement(YP.Provider,{value:r},P.createElement(QP.Provider,{value:i},P.createElement(UK.Provider,{value:s},P.createElement(FK.Provider,{value:d},P.createElement(BK.Provider,{value:o},P.createElement(HK.Provider,{value:u},P.createElement(zK.Provider,{value:l},c)))))))},z2e=function(){return y.useContext(BK)},VK=function(e){var n=y.useContext(YP);n==null&&Eu();var r=n[e];return r==null&&Eu(),r},V2e=function(){var e=y.useContext(YP);return hc(e)},G2e=function(){var e=y.useContext(QP),n=B2e(e,function(r){return kK(r.domain,Number.isFinite)});return n||hc(e)},GK=function(e){var n=y.useContext(QP);n==null&&Eu();var r=n[e];return r==null&&Eu(),r},K2e=function(){var e=y.useContext(FK);return e},W2e=function(){return y.useContext(UK)},XP=function(){return y.useContext(zK)},JP=function(){return y.useContext(HK)};function Sf(t){"@babel/helpers - typeof";return Sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sf(t)}function q2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y2e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var s=n();return t*(e-t*s/2-r)>=0&&t*(e+t*s/2-i)<=0}function PMe(t,e){return JK(t,e+1)}function kMe(t,e,n,r,i){for(var s=(r||[]).slice(),o=e.start,c=e.end,l=0,u=1,d=o,f=function(){var g=r==null?void 0:r[l];if(g===void 0)return{v:JK(r,u)};var m=l,v,b=function(){return v===void 0&&(v=n(g,m)),v},x=g.coordinate,w=l===0||Ub(t,x,b,d,c);w||(l=0,d=o,u+=1),w&&(d=x+t*(b()/2+i),l+=u)},h;u<=s.length;)if(h=f(),h)return h.v;return[]}function rg(t){"@babel/helpers - typeof";return rg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rg(t)}function g$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ei(t){for(var e=1;e0?p.coordinate-v*t:p.coordinate})}else s[h]=p=ei(ei({},p),{},{tickCoord:p.coordinate});var b=Ub(t,p.tickCoord,m,c,l);b&&(l=p.tickCoord-t*(m()/2+i),s[h]=ei(ei({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return s}function DMe(t,e,n,r,i,s){var o=(r||[]).slice(),c=o.length,l=e.start,u=e.end;if(s){var d=r[c-1],f=n(d,c-1),h=t*(d.coordinate+t*f/2-u);o[c-1]=d=ei(ei({},d),{},{tickCoord:h>0?d.coordinate-h*t:d.coordinate});var p=Ub(t,d.tickCoord,function(){return f},l,u);p&&(u=d.tickCoord-t*(f/2+i),o[c-1]=ei(ei({},d),{},{isShow:!0}))}for(var g=s?c-1:c,m=function(x){var w=o[x],S,C=function(){return S===void 0&&(S=n(w,x)),S};if(x===0){var _=t*(w.coordinate-t*C()/2-l);o[x]=w=ei(ei({},w),{},{tickCoord:_<0?w.coordinate-_*t:w.coordinate})}else o[x]=w=ei(ei({},w),{},{tickCoord:w.coordinate});var A=Ub(t,w.tickCoord,C,l,u);A&&(l=w.tickCoord+t*(C()/2+i),o[x]=ei(ei({},w),{},{isShow:!0}))},v=0;v=2?vi(i[1].coordinate-i[0].coordinate):1,b=TMe(s,v,p);return l==="equidistantPreserveStart"?kMe(v,b,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=DMe(v,b,m,i,o,l==="preserveStartEnd"):h=MMe(v,b,m,i,o),h.filter(function(x){return x.isShow}))}var $Me=["viewBox"],LMe=["viewBox"],FMe=["ticks"];function Af(t){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Af(t)}function pd(){return pd=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function UMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function BMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y$(t,e){for(var n=0;n0?l(this.props):l(p)),o<=0||c<=0||!g||!g.length?null:P.createElement(qt,{className:It("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},s&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Dr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,s){var o;return P.isValidElement(r)?o=P.cloneElement(r,i):At(r)?o=r(i):o=P.createElement(_u,pd({},i,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(y.Component);nk(fh,"displayName","CartesianAxis");nk(fh,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var qMe=["x1","y1","x2","y2","key"],YMe=["offset"];function Nu(t){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nu(t)}function x$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ii(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ZMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var eDe=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,s=e.y,o=e.width,c=e.height,l=e.ry;return P.createElement("rect",{x:i,y:s,ry:l,width:o,height:c,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function tW(t,e){var n;if(P.isValidElement(t))n=P.cloneElement(t,e);else if(At(t))n=t(e);else{var r=e.x1,i=e.y1,s=e.x2,o=e.y2,c=e.key,l=b$(e,qMe),u=rt(l,!1);u.offset;var d=b$(u,YMe);n=P.createElement("line",zl({},d,{x1:r,y1:i,x2:s,y2:o,fill:"none",key:c}))}return n}function tDe(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,s=t.horizontalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(c,l){var u=ii(ii({},t),{},{x1:e,y1:c,x2:e+n,y2:c,key:"line-".concat(l),index:l});return tW(i,u)});return P.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function nDe(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,s=t.verticalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(c,l){var u=ii(ii({},t),{},{x1:c,y1:e,x2:c,y2:e+n,key:"line-".concat(l),index:l});return tW(i,u)});return P.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function rDe(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,s=t.width,o=t.height,c=t.horizontalPoints,l=t.horizontal,u=l===void 0?!0:l;if(!u||!e||!e.length)return null;var d=c.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?i+o-h:d[p+1]-h;if(m<=0)return null;var v=p%e.length;return P.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:s,stroke:"none",fill:e[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function iDe(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,s=t.x,o=t.y,c=t.width,l=t.height,u=t.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,p){return h-p});s!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?s+c-h:d[p+1]-h;if(m<=0)return null;var v=p%r.length;return P.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:l,stroke:"none",fill:r[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var sDe=function(e,n){var r=e.xAxis,i=e.width,s=e.height,o=e.offset;return V8(tk(ii(ii(ii({},fh.defaultProps),r),{},{ticks:_a(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.left,o.left+o.width,n)},oDe=function(e,n){var r=e.yAxis,i=e.width,s=e.height,o=e.offset;return V8(tk(ii(ii(ii({},fh.defaultProps),r),{},{ticks:_a(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.top,o.top+o.height,n)},Wu={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function ig(t){var e,n,r,i,s,o,c=XP(),l=JP(),u=W2e(),d=ii(ii({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Wu.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:Wu.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:Wu.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:Wu.horizontalFill,vertical:(s=t.vertical)!==null&&s!==void 0?s:Wu.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:Wu.verticalFill,x:je(t.x)?t.x:u.left,y:je(t.y)?t.y:u.top,width:je(t.width)?t.width:u.width,height:je(t.height)?t.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,v=d.horizontalValues,b=d.verticalValues,x=V2e(),w=G2e();if(!je(p)||p<=0||!je(g)||g<=0||!je(f)||f!==+f||!je(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||sDe,C=d.horizontalCoordinatesGenerator||oDe,_=d.horizontalPoints,A=d.verticalPoints;if((!_||!_.length)&&At(C)){var j=v&&v.length,T=C({yAxis:w?ii(ii({},w),{},{ticks:j?v:w.ticks}):void 0,width:c,height:l,offset:u},j?!0:m);ro(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Nu(T),"]")),Array.isArray(T)&&(_=T)}if((!A||!A.length)&&At(S)){var k=b&&b.length,I=S({xAxis:x?ii(ii({},x),{},{ticks:k?b:x.ticks}):void 0,width:c,height:l,offset:u},k?!0:m);ro(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Nu(I),"]")),Array.isArray(I)&&(A=I)}return P.createElement("g",{className:"recharts-cartesian-grid"},P.createElement(eDe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),P.createElement(tDe,zl({},d,{offset:u,horizontalPoints:_,xAxis:x,yAxis:w})),P.createElement(nDe,zl({},d,{offset:u,verticalPoints:A,xAxis:x,yAxis:w})),P.createElement(rDe,zl({},d,{horizontalPoints:_})),P.createElement(iDe,zl({},d,{verticalPoints:A})))}ig.displayName="CartesianGrid";var aDe=["layout","type","stroke","connectNulls","isRange","ref"],cDe=["key"],nW;function jf(t){"@babel/helpers - typeof";return jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jf(t)}function rW(t,e){if(t==null)return{};var n=lDe(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lDe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Vl(){return Vl=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!Au(d,o)||!Au(f,c))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(o,c,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,o=i.dot,c=i.points,l=i.className,u=i.top,d=i.left,f=i.xAxis,h=i.yAxis,p=i.width,g=i.height,m=i.isAnimationActive,v=i.id;if(s||!c||!c.length)return null;var b=this.state.isAnimationFinished,x=c.length===1,w=It("recharts-area",l),S=f&&f.allowDataOverflow,C=h&&h.allowDataOverflow,_=S||C,A=Dt(v)?this.id:v,j=(r=rt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},T=j.r,k=T===void 0?3:T,I=j.strokeWidth,E=I===void 0?2:I,O=kme(o)?o:{},M=O.clipDot,U=M===void 0?!0:M,D=k*2+E;return P.createElement(qt,{className:w},S||C?P.createElement("defs",null,P.createElement("clipPath",{id:"clipPath-".concat(A)},P.createElement("rect",{x:S?d:d-p/2,y:C?u:u-g/2,width:S?p:p*2,height:C?g:g*2})),!U&&P.createElement("clipPath",{id:"clipPath-dots-".concat(A)},P.createElement("rect",{x:d-D/2,y:u-D/2,width:p+D,height:g+D}))):null,x?null:this.renderArea(_,A),(o||x)&&this.renderDots(_,U,A),(!m||b)&&zo.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(y.PureComponent);nW=so;$o(so,"displayName","Area");$o(so,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!io.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});$o(so,"getBaseValue",function(t,e,n,r){var i=t.layout,s=t.baseValue,o=e.props.baseValue,c=o??s;if(je(c)&&typeof c=="number")return c;var l=i==="horizontal"?r:n,u=l.scale.domain();if(l.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return c==="dataMin"?f:c==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return c==="dataMin"?u[0]:c==="dataMax"?u[1]:u[0]});$o(so,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,s=t.xAxisTicks,o=t.yAxisTicks,c=t.bandSize,l=t.dataKey,u=t.stackedData,d=t.dataStartIndex,f=t.displayedData,h=t.offset,p=e.layout,g=u&&u.length,m=nW.getBaseValue(e,n,r,i),v=p==="horizontal",b=!1,x=f.map(function(S,C){var _;g?_=u[d+C]:(_=or(S,l),Array.isArray(_)?b=!0:_=[m,_]);var A=_[1]==null||g&&or(S,l)==null;return v?{x:VM({axis:r,ticks:s,bandSize:c,entry:S,index:C}),y:A?null:i.scale(_[1]),value:_,payload:S}:{x:A?null:r.scale(_[1]),y:VM({axis:i,ticks:o,bandSize:c,entry:S,index:C}),value:_,payload:S}}),w;return g||b?w=x.map(function(S){var C=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:C!=null&&S.y!=null?i.scale(C):null}:{x:C!=null?r.scale(C):null,y:S.y}}):w=v?i.scale(m):r.scale(m),rc({points:x,baseLine:w,layout:p,isRange:b},h)});$o(so,"renderDotItem",function(t,e){var n;if(P.isValidElement(t))n=P.cloneElement(t,e);else if(At(t))n=t(e);else{var r=It("recharts-area-dot",typeof t!="boolean"?t.className:""),i=e.key,s=rW(e,cDe);n=P.createElement(Fg,Vl({},s,{key:i,className:r}))}return n});function Ef(t){"@babel/helpers - typeof";return Ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ef(t)}function vDe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yDe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function i$e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function s$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o$e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?o:e&&e.length&&je(i)&&je(s)?e.slice(i,s+1):[]};function xW(t){return t==="number"?[0,"auto"]:void 0}var uj=function(e,n,r,i){var s=e.graphicalItems,o=e.tooltipAxis,c=Jw(n,e);return r<0||!s||!s.length||r>=c.length?null:s.reduce(function(l,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?c:f;h=Vx(p,o.dataKey,i)}else h=f&&f[r]||c[r];return h?[].concat(Pf(l),[Y8(u,h)]):l},[])},N$=function(e,n,r,i){var s=i||{x:e.chartX,y:e.chartY},o=y$e(s,r),c=e.orderedTooltipTicks,l=e.tooltipAxis,u=e.tooltipTicks,d=ONe(o,c,u,l);if(d>=0&&u){var f=u[d]&&u[d].value,h=uj(e,n,d,f),p=x$e(r,c,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},b$e=function(e,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,o=n.axisIdKey,c=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=e.layout,f=e.children,h=e.stackOffset,p=z8(d,s);return r.reduce(function(g,m){var v,b=m.type.defaultProps!==void 0?ce(ce({},m.type.defaultProps),m.props):m.props,x=b.type,w=b.dataKey,S=b.allowDataOverflow,C=b.allowDuplicatedCategory,_=b.scale,A=b.ticks,j=b.includeHidden,T=b[o];if(g[T])return g;var k=Jw(e.data,{graphicalItems:i.filter(function(J){var me,F=o in J.props?J.props[o]:(me=J.type.defaultProps)===null||me===void 0?void 0:me[o];return F===T}),dataStartIndex:l,dataEndIndex:u}),I=k.length,E,O,M;KDe(b.domain,S,x)&&(E=_1(b.domain,null,S),p&&(x==="number"||_!=="auto")&&(M=xp(k,w,"category")));var U=xW(x);if(!E||E.length===0){var D,B=(D=b.domain)!==null&&D!==void 0?D:U;if(w){if(E=xp(k,w,x),x==="category"&&p){var R=Sme(E);C&&R?(O=E,E=Ob(0,I)):C||(E=qM(B,E,m).reduce(function(J,me){return J.indexOf(me)>=0?J:[].concat(Pf(J),[me])},[]))}else if(x==="category")C?E=E.filter(function(J){return J!==""&&!Dt(J)}):E=qM(B,E,m).reduce(function(J,me){return J.indexOf(me)>=0||me===""||Dt(me)?J:[].concat(Pf(J),[me])},[]);else if(x==="number"){var L=$Ne(k,i.filter(function(J){var me,F,oe=o in J.props?J.props[o]:(me=J.type.defaultProps)===null||me===void 0?void 0:me[o],se="hide"in J.props?J.props.hide:(F=J.type.defaultProps)===null||F===void 0?void 0:F.hide;return oe===T&&(j||!se)}),w,s,d);L&&(E=L)}p&&(x==="number"||_!=="auto")&&(M=xp(k,w,"category"))}else p?E=Ob(0,I):c&&c[T]&&c[T].hasStack&&x==="number"?E=h==="expand"?[0,1]:q8(c[T].stackGroups,l,u):E=H8(k,i.filter(function(J){var me=o in J.props?J.props[o]:J.type.defaultProps[o],F="hide"in J.props?J.props.hide:J.type.defaultProps.hide;return me===T&&(j||!F)}),x,d,!0);if(x==="number")E=aj(f,E,T,s,A),B&&(E=_1(B,E,S));else if(x==="category"&&B){var Y=B,q=E.every(function(J){return Y.indexOf(J)>=0});q&&(E=Y)}}return ce(ce({},g),{},Nt({},T,ce(ce({},b),{},{axisType:s,domain:E,categoricalDomain:M,duplicateDomain:O,originalDomain:(v=b.domain)!==null&&v!==void 0?v:U,isCategorical:p,layout:d})))},{})},w$e=function(e,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,o=n.axisIdKey,c=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=e.layout,f=e.children,h=Jw(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:u}),p=h.length,g=z8(d,s),m=-1;return r.reduce(function(v,b){var x=b.type.defaultProps!==void 0?ce(ce({},b.type.defaultProps),b.props):b.props,w=x[o],S=xW("number");if(!v[w]){m++;var C;return g?C=Ob(0,p):c&&c[w]&&c[w].hasStack?(C=q8(c[w].stackGroups,l,u),C=aj(f,C,w,s)):(C=_1(S,H8(h,r.filter(function(_){var A,j,T=o in _.props?_.props[o]:(A=_.type.defaultProps)===null||A===void 0?void 0:A[o],k="hide"in _.props?_.props.hide:(j=_.type.defaultProps)===null||j===void 0?void 0:j.hide;return T===w&&!k}),"number",d),i.defaultProps.allowDataOverflow),C=aj(f,C,w,s)),ce(ce({},v),{},Nt({},w,ce(ce({axisType:s},i.defaultProps),{},{hide:!0,orientation:rs(g$e,"".concat(s,".").concat(m%2),null),domain:C,originalDomain:S,isCategorical:g,layout:d})))}return v},{})},S$e=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=e.children,f="".concat(i,"Id"),h=js(d,s),p={};return h&&h.length?p=b$e(e,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(p=w$e(e,{Axis:s,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:l,dataEndIndex:u})),p},C$e=function(e){var n=hc(e),r=_a(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:bP(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:yb(n,r)}},T$=function(e){var n=e.children,r=e.defaultShowTooltip,i=qi(n,bf),s=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},_$e=function(e){return!e||!e.length?!1:e.some(function(n){var r=Ea(n&&n.type);return r&&r.indexOf("Bar")>=0})},P$=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},A$e=function(e,n){var r=e.props,i=e.graphicalItems,s=e.xAxisMap,o=s===void 0?{}:s,c=e.yAxisMap,l=c===void 0?{}:c,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=qi(f,bf),g=qi(f,Na),m=Object.keys(l).reduce(function(C,_){var A=l[_],j=A.orientation;return!A.mirror&&!A.hide?ce(ce({},C),{},Nt({},j,C[j]+A.width)):C},{left:h.left||0,right:h.right||0}),v=Object.keys(o).reduce(function(C,_){var A=o[_],j=A.orientation;return!A.mirror&&!A.hide?ce(ce({},C),{},Nt({},j,rs(C,"".concat(j))+A.height)):C},{top:h.top||0,bottom:h.bottom||0}),b=ce(ce({},v),m),x=b.bottom;p&&(b.bottom+=p.props.height||bf.defaultProps.height),g&&n&&(b=MNe(b,i,r,n));var w=u-b.left-b.right,S=d-b.top-b.bottom;return ce(ce({brushBottom:x},b),{},{width:Math.max(w,0),height:Math.max(S,0)})},j$e=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},Zw=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,s=i===void 0?"axis":i,o=e.validateTooltipEventTypes,c=o===void 0?["axis"]:o,l=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,f=e.defaultProps,h=function(v,b){var x=b.graphicalItems,w=b.stackGroups,S=b.offset,C=b.updateId,_=b.dataStartIndex,A=b.dataEndIndex,j=v.barSize,T=v.layout,k=v.barGap,I=v.barCategoryGap,E=v.maxBarSize,O=P$(T),M=O.numericAxisName,U=O.cateAxisName,D=_$e(x),B=[];return x.forEach(function(R,L){var Y=Jw(v.data,{graphicalItems:[R],dataStartIndex:_,dataEndIndex:A}),q=R.type.defaultProps!==void 0?ce(ce({},R.type.defaultProps),R.props):R.props,J=q.dataKey,me=q.maxBarSize,F=q["".concat(M,"Id")],oe=q["".concat(U,"Id")],se={},le=l.reduce(function(z,G){var Q=b["".concat(G.axisType,"Map")],H=q["".concat(G.axisType,"Id")];Q&&Q[H]||G.axisType==="zAxis"||Eu();var Z=Q[H];return ce(ce({},z),{},Nt(Nt({},G.axisType,Z),"".concat(G.axisType,"Ticks"),_a(Z)))},se),ke=le[U],ue=le["".concat(U,"Ticks")],we=w&&w[F]&&w[F].hasStack&&KNe(R,w[F].stackGroups),Ae=Ea(R.type).indexOf("Bar")>=0,ee=yb(ke,ue),wt=[],et=D&&INe({barSize:j,stackGroups:w,totalSize:j$e(le,U)});if(Ae){var Ct,Xe,nn=Dt(me)?E:me,N=(Ct=(Xe=yb(ke,ue,!0))!==null&&Xe!==void 0?Xe:nn)!==null&&Ct!==void 0?Ct:0;wt=RNe({barGap:k,barCategoryGap:I,bandSize:N!==ee?N:ee,sizeList:et[oe],maxBarSize:nn}),N!==ee&&(wt=wt.map(function(z){return ce(ce({},z),{},{position:ce(ce({},z.position),{},{offset:z.position.offset-N/2})})}))}var $=R&&R.type&&R.type.getComposedData;$&&B.push({props:ce(ce({},$(ce(ce({},le),{},{displayedData:Y,props:v,dataKey:J,item:R,bandSize:ee,barPosition:wt,offset:S,stackedData:we,layout:T,dataStartIndex:_,dataEndIndex:A}))),{},Nt(Nt(Nt({key:R.key||"item-".concat(L)},M,le[M]),U,le[U]),"animationId",C)),childIndex:Rme(R,v.children),item:R})}),B},p=function(v,b){var x=v.props,w=v.dataStartIndex,S=v.dataEndIndex,C=v.updateId;if(!BR({props:x}))return null;var _=x.children,A=x.layout,j=x.stackOffset,T=x.data,k=x.reverseStackOrder,I=P$(A),E=I.numericAxisName,O=I.cateAxisName,M=js(_,r),U=VNe(T,M,"".concat(E,"Id"),"".concat(O,"Id"),j,k),D=l.reduce(function(q,J){var me="".concat(J.axisType,"Map");return ce(ce({},q),{},Nt({},me,S$e(x,ce(ce({},J),{},{graphicalItems:M,stackGroups:J.axisType===E&&U,dataStartIndex:w,dataEndIndex:S}))))},{}),B=A$e(ce(ce({},D),{},{props:x,graphicalItems:M}),b==null?void 0:b.legendBBox);Object.keys(D).forEach(function(q){D[q]=d(x,D[q],B,q.replace("Map",""),n)});var R=D["".concat(O,"Map")],L=C$e(R),Y=h(x,ce(ce({},D),{},{dataStartIndex:w,dataEndIndex:S,updateId:C,graphicalItems:M,stackGroups:U,offset:B}));return ce(ce({formattedGraphicalItems:Y,graphicalItems:M,offset:B,stackGroups:U},L),D)},g=function(m){function v(b){var x,w,S;return s$e(this,v),S=c$e(this,v,[b]),Nt(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Nt(S,"accessibilityManager",new GDe),Nt(S,"handleLegendBBoxUpdate",function(C){if(C){var _=S.state,A=_.dataStartIndex,j=_.dataEndIndex,T=_.updateId;S.setState(ce({legendBBox:C},p({props:S.props,dataStartIndex:A,dataEndIndex:j,updateId:T},ce(ce({},S.state),{},{legendBBox:C}))))}}),Nt(S,"handleReceiveSyncEvent",function(C,_,A){if(S.props.syncId===C){if(A===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(_)}}),Nt(S,"handleBrushChange",function(C){var _=C.startIndex,A=C.endIndex;if(_!==S.state.dataStartIndex||A!==S.state.dataEndIndex){var j=S.state.updateId;S.setState(function(){return ce({dataStartIndex:_,dataEndIndex:A},p({props:S.props,dataStartIndex:_,dataEndIndex:A,updateId:j},S.state))}),S.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),Nt(S,"handleMouseEnter",function(C){var _=S.getMouseInfo(C);if(_){var A=ce(ce({},_),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var j=S.props.onMouseEnter;At(j)&&j(A,C)}}),Nt(S,"triggeredAfterMouseMove",function(C){var _=S.getMouseInfo(C),A=_?ce(ce({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(A),S.triggerSyncEvent(A);var j=S.props.onMouseMove;At(j)&&j(A,C)}),Nt(S,"handleItemMouseEnter",function(C){S.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Nt(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Nt(S,"handleMouseMove",function(C){C.persist(),S.throttleTriggeredAfterMouseMove(C)}),Nt(S,"handleMouseLeave",function(C){S.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};S.setState(_),S.triggerSyncEvent(_);var A=S.props.onMouseLeave;At(A)&&A(_,C)}),Nt(S,"handleOuterEvent",function(C){var _=Ime(C),A=rs(S.props,"".concat(_));if(_&&At(A)){var j,T;/.*touch.*/i.test(_)?T=S.getMouseInfo(C.changedTouches[0]):T=S.getMouseInfo(C),A((j=T)!==null&&j!==void 0?j:{},C)}}),Nt(S,"handleClick",function(C){var _=S.getMouseInfo(C);if(_){var A=ce(ce({},_),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var j=S.props.onClick;At(j)&&j(A,C)}}),Nt(S,"handleMouseDown",function(C){var _=S.props.onMouseDown;if(At(_)){var A=S.getMouseInfo(C);_(A,C)}}),Nt(S,"handleMouseUp",function(C){var _=S.props.onMouseUp;if(At(_)){var A=S.getMouseInfo(C);_(A,C)}}),Nt(S,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Nt(S,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.handleMouseDown(C.changedTouches[0])}),Nt(S,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.handleMouseUp(C.changedTouches[0])}),Nt(S,"triggerSyncEvent",function(C){S.props.syncId!==void 0&&NC.emit(TC,S.props.syncId,C,S.eventEmitterSymbol)}),Nt(S,"applySyncEvent",function(C){var _=S.props,A=_.layout,j=_.syncMethod,T=S.state.updateId,k=C.dataStartIndex,I=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)S.setState(ce({dataStartIndex:k,dataEndIndex:I},p({props:S.props,dataStartIndex:k,dataEndIndex:I,updateId:T},S.state)));else if(C.activeTooltipIndex!==void 0){var E=C.chartX,O=C.chartY,M=C.activeTooltipIndex,U=S.state,D=U.offset,B=U.tooltipTicks;if(!D)return;if(typeof j=="function")M=j(B,C);else if(j==="value"){M=-1;for(var R=0;R=0){var we,Ae;if(E.dataKey&&!E.allowDuplicatedCategory){var ee=typeof E.dataKey=="function"?ue:"payload.".concat(E.dataKey.toString());we=Vx(R,ee,M),Ae=L&&Y&&Vx(Y,ee,M)}else we=R==null?void 0:R[O],Ae=L&&Y&&Y[O];if(oe||F){var wt=C.props.activeIndex!==void 0?C.props.activeIndex:O;return[y.cloneElement(C,ce(ce(ce({},j.props),le),{},{activeIndex:wt})),null,null]}if(!Dt(we))return[ke].concat(Pf(S.renderActivePoints({item:j,activePoint:we,basePoint:Ae,childIndex:O,isRange:L})))}else{var et,Ct=(et=S.getItemByXY(S.state.activeCoordinate))!==null&&et!==void 0?et:{graphicalItem:ke},Xe=Ct.graphicalItem,nn=Xe.item,N=nn===void 0?C:nn,$=Xe.childIndex,z=ce(ce(ce({},j.props),le),{},{activeIndex:$});return[y.cloneElement(N,z),null,null]}return L?[ke,null,null]:[ke,null]}),Nt(S,"renderCustomized",function(C,_,A){return y.cloneElement(C,ce(ce({key:"recharts-customized-".concat(A)},S.props),S.state))}),Nt(S,"renderMap",{CartesianGrid:{handler:Mv,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:Mv},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:Mv},YAxis:{handler:Mv},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:nh("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=FG(S.triggeredAfterMouseMove,(w=b.throttleDelay)!==null&&w!==void 0?w:1e3/60),S.state={},S}return d$e(v,m),a$e(v,[{key:"componentDidMount",value:function(){var x,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,w=x.children,S=x.data,C=x.height,_=x.layout,A=qi(w,ni);if(A){var j=A.props.defaultIndex;if(!(typeof j!="number"||j<0||j>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[j]&&this.state.tooltipTicks[j].value,k=uj(this.state,S,j,T),I=this.state.tooltipTicks[j].coordinate,E=(this.state.offset.top+C)/2,O=_==="horizontal",M=O?{x:I,y:E}:{y:I,x:E},U=this.state.formattedGraphicalItems.find(function(B){var R=B.item;return R.type.name==="Scatter"});U&&(M=ce(ce({},M),U.props.points[j].tooltipPosition),k=U.props.points[j].tooltipPayload);var D={activeTooltipIndex:j,isTooltipActive:!0,activeLabel:T,activePayload:k,activeCoordinate:M};this.setState(D),this.renderCursor(A),this.accessibilityManager.setIndex(j)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var S,C;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(x){FA([qi(x.children,ni)],[qi(this.props.children,ni)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=qi(this.props.children,ni);if(x&&typeof x.props.shared=="boolean"){var w=x.props.shared?"axis":"item";return c.indexOf(w)>=0?w:s}return s}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var w=this.container,S=w.getBoundingClientRect(),C=oAe(S),_={chartX:Math.round(x.pageX-C.left),chartY:Math.round(x.pageY-C.top)},A=S.width/w.offsetWidth||1,j=this.inRange(_.chartX,_.chartY,A);if(!j)return null;var T=this.state,k=T.xAxisMap,I=T.yAxisMap,E=this.getTooltipEventType();if(E!=="axis"&&k&&I){var O=hc(k).scale,M=hc(I).scale,U=O&&O.invert?O.invert(_.chartX):null,D=M&&M.invert?M.invert(_.chartY):null;return ce(ce({},_),{},{xValue:U,yValue:D})}var B=N$(this.state,this.props.data,this.props.layout,j);return B?ce(ce({},_),B):null}},{key:"inRange",value:function(x,w){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,_=x/S,A=w/S;if(C==="horizontal"||C==="vertical"){var j=this.state.offset,T=_>=j.left&&_<=j.left+j.width&&A>=j.top&&A<=j.top+j.height;return T?{x:_,y:A}:null}var k=this.state,I=k.angleAxisMap,E=k.radiusAxisMap;if(I&&E){var O=hc(I);return XM({x:_,y:A},O)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,w=this.getTooltipEventType(),S=qi(x,ni),C={};S&&w==="axis"&&(S.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var _=Gx(this.props,this.handleOuterEvent);return ce(ce({},_),C)}},{key:"addListener",value:function(){NC.on(TC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){NC.removeListener(TC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,w,S){for(var C=this.state.formattedGraphicalItems,_=0,A=C.length;_{var g;const[r,i]=y.useState([{name:"Very Positive",value:0,color:"#4ade80"},{name:"Positive",value:0,color:"#a3e635"},{name:"Neutral",value:0,color:"#93c5fd"},{name:"Negative",value:0,color:"#fb923c"},{name:"Very Negative",value:0,color:"#f87171"}]),[s,o]=y.useState([]),[c,l]=y.useState({}),[u,d]=y.useState({isBalanced:!1,score:0,reason:""}),f=m=>{const v=n.find(b=>b.id===m);return v?v.name:`Participant ${m}`};y.useEffect(()=>{if(t.length===0)return;const m={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0},v={},b={};t.forEach(S=>{if(S.senderId!=="moderator"&&S.senderId!=="facilitator"){const C=S.text.toLowerCase();let _="Neutral";C.includes("love")||C.includes("excellent")||C.includes("amazing")?_="Very Positive":C.includes("good")||C.includes("like")||C.includes("great")?_="Positive":C.includes("bad")||C.includes("issue")||C.includes("problem")?_="Negative":(C.includes("terrible")||C.includes("hate")||C.includes("awful"))&&(_="Very Negative"),m[_]++,b[S.senderId]||(b[S.senderId]={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0}),b[S.senderId][_]++,v[S.senderId]=(v[S.senderId]||0)+1}}),i(S=>S.map(C=>({...C,value:m[C.name]||0})));const x=Object.entries(v).map(([S,C])=>({name:f(S),messages:C}));o(x);const w={};Object.entries(b).forEach(([S,C])=>{w[S]={name:f(S),sentiments:C}}),l(w),h(v,b)},[t,n,f]);const h=(m,v)=>{if(Object.keys(m).length===0){d({isBalanced:!1,score:0,reason:"No participant data available"});return}const x=Object.values(m).reduce((B,R)=>B+R,0)/Object.keys(m).length,w=Object.values(m).map(B=>Math.abs(B-x)/x),S=w.reduce((B,R)=>B+R,0)/w.length,C=Object.values(v).map(B=>Object.values(B).filter(R=>R>0).length),_=C.reduce((B,R)=>B+R,0)/C.length,A=["Very Positive","Positive","Neutral","Negative","Very Negative"],j=Object.values(v).map(B=>{const R=Math.max(...Object.values(B));return A.find(L=>B[L]===R)||"Neutral"}),T=new Set(j).size,k=T/A.length,I=Math.max(0,100-S*100),E=_/5*100,O=k*100,M=Math.round(I*.6+E*.2+O*.2);let U="";const D=M>=70;S>.3&&(U+="Participation is uneven among participants. "),_<2&&(U+="Limited range of sentiments expressed. "),T<=1?U+="Participants show similar sentiment patterns, suggesting potential group-think. ":T>=4&&(U+="Wide divergence in participant sentiments, showing healthy diversity of opinions. "),U===""&&(U=D?"Good mix of participation and diverse opinions.":"Multiple factors affecting balance."),d({isBalanced:D,score:M,reason:U})},p=m=>{const v=c[m];if(!v)return"N/A";const b=v.sentiments;let x=0,w="Neutral";return Object.entries(b).forEach(([S,C])=>{C>x&&(x=C,w=S)}),w};return a.jsx("div",{className:"glass-panel rounded-xl p-4",children:a.jsxs(hl,{defaultValue:"sentiment",children:[a.jsxs(Ka,{className:"grid grid-cols-2 mb-4",children:[a.jsxs(gn,{value:"sentiment",className:"flex items-center",children:[a.jsx(GJ,{className:"h-4 w-4 mr-2"}),"Sentiment"]}),a.jsxs(gn,{value:"participation",className:"flex items-center",children:[a.jsx(B_,{className:"h-4 w-4 mr-2"}),"Participation"]})]}),a.jsx(vn,{value:"sentiment",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Sentiment Analysis"}),a.jsxs("div",{className:`px-3 py-1 rounded-full text-sm ${u.isBalanced?"bg-green-100 text-green-800":"bg-amber-100 text-amber-800"}`,children:["Balance score: ",u.score,"/100"]})]}),a.jsx("div",{className:"h-60",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(rk,{children:[a.jsx(ni,{}),a.jsx(bo,{data:r,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:m,percent:v})=>v>0?`${m} ${(v*100).toFixed(0)}%`:"",children:r.map((m,v)=>a.jsx(Rg,{fill:m.color},`cell-${v}`))}),a.jsx(Na,{})]})})}),a.jsxs("div",{className:"mt-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Sentiment by Participant"}),a.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto pr-2",children:Object.entries(c).map(([m,v])=>{var w;const b=p(m),x=((w=r.find(S=>S.name===b))==null?void 0:w.color)||"#93c5fd";return a.jsxs("div",{className:"flex items-center justify-between p-2 bg-slate-50 rounded",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Qp,{className:"h-4 w-4 text-slate-400 mr-2"}),a.jsx("span",{className:"text-sm",children:v.name})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("span",{className:"text-xs mr-2",children:"Predominant:"}),a.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded",style:{backgroundColor:`${x}30`,color:x},children:b})]})]},m)})})]}),a.jsxs("div",{className:"mt-4 pt-4 border-t",children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Focus Group Balance Assessment"}),a.jsxs("div",{className:`p-3 rounded text-sm ${u.isBalanced?"bg-green-50 text-green-700":"bg-amber-50 text-amber-700"}`,children:[a.jsx("span",{className:"font-medium",children:u.isBalanced?"Balanced Focus Group":"Potential Balance Issues"}),a.jsx("p",{className:"mt-1 text-xs",children:u.reason})]})]})]})})}),a.jsx(vn,{value:"participation",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"pt-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Participation Distribution"}),a.jsx("div",{className:"h-60",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(bW,{data:s,layout:"vertical",margin:{top:5,right:30,left:20,bottom:5},children:[a.jsx(ig,{strokeDasharray:"3 3"}),a.jsx(sl,{type:"number"}),a.jsx(ol,{dataKey:"name",type:"category",width:100}),a.jsx(ni,{}),a.jsx(yl,{dataKey:"messages",fill:"#8884d8",name:"Messages"})]})})}),a.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:s.length>0?`Most active: ${(g=s.sort((m,v)=>v.messages-m.messages)[0])==null?void 0:g.name}`:"No participation data available"})]})})})]})})};function T$e(t){if(console.log("🔍 [GPT-5 CONVERTER] Input wsMessage:",JSON.stringify(t,null,2)),!t)return console.error("🔍 [GPT-5 CONVERTER] ERROR: wsMessage is null/undefined"),null;const e={id:t.id,senderId:t.senderId,text:t.text,timestamp:new Date(t.timestamp),type:t.type,highlighted:t.highlighted,attached_assets:t.attached_assets||[],activates_visual_context:t.activates_visual_context||!1,visualAsset:t.visualAsset};return console.log("🔍 [GPT-5 CONVERTER] Output converted:",JSON.stringify(e,null,2)),e}function P$e(t){return{id:t.id,title:t.title,description:t.description,quotes:t.quotes,source:t.source,created_at:t.created_at}}function SW(){return!0}const k$e=({focusGroupId:t,personas:e,isVisible:n,onToggle:r})=>{const[i,s]=y.useState(null),[o,c]=y.useState(null),[l,u]=y.useState(null),[d,f]=y.useState(null),[h,p]=y.useState(!1),[g,m]=y.useState(null),[v,b]=y.useState(null);Zo();const x=SW();y.useEffect(()=>{if(!(!n||!t))return S(),console.log("📊 Setting up STABLE WebSocket event listeners for dashboard"),console.log("📊 Dashboard WebSocket listeners temporarily disabled for GPT-5 fix"),()=>{console.log("📊 Cleaning up STABLE dashboard WebSocket listeners")}},[n,t,x,!0]);const S=async()=>{p(!0),m(null);try{const[T,k,I,E]=await Promise.allSettled([er.getConversationAnalytics(t),er.getConversationState(t),er.getAutonomousConversationStatus(t),er.getConversationInsights(t)]);T.status==="fulfilled"&&s(T.value.data.analytics),k.status==="fulfilled"&&c(k.value.data.state),I.status==="fulfilled"&&u(I.value.data.status),E.status==="fulfilled"&&f(E.value.data.insights),b(new Date)}catch(T){console.error("Error fetching dashboard data:",T),m("Failed to load dashboard data")}finally{p(!1)}},C=()=>{S()},_=T=>{switch(T){case"running":return"bg-green-500";case"paused":return"bg-amber-500";case"completed":return"bg-blue-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},A=T=>{switch(T){case"positive":return"text-green-600";case"negative":return"text-red-600";default:return"text-gray-600"}},j=T=>{switch(T){case"excellent":return"text-green-600";case"good":return"text-blue-600";case"fair":return"text-amber-600";case"poor":return"text-red-600";default:return"text-gray-600"}};return n?a.jsxs("div",{className:"fixed right-4 top-4 bottom-4 w-80 bg-white rounded-lg shadow-lg border border-gray-200 flex flex-col overflow-hidden z-50",children:[a.jsxs("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xa,{className:"h-5 w-5 text-blue-600"}),a.jsx("h3",{className:"font-semibold text-gray-900",children:"AI Dashboard"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(X,{variant:"ghost",size:"sm",onClick:C,disabled:h,className:"p-1",children:a.jsx(Xl,{className:`h-4 w-4 ${h?"animate-spin":""}`})}),a.jsx(X,{variant:"ghost",size:"sm",onClick:r,className:"p-1",children:a.jsx(QJ,{className:"h-4 w-4"})})]})]}),v&&a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Last updated: ",v.toLocaleTimeString()]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[g&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(KJ,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-sm text-red-800",children:g})]})}),l&&a.jsxs(lt,{children:[a.jsx(Ei,{className:"pb-3",children:a.jsxs(Yi,{className:"text-sm flex items-center gap-2",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${_(l.conversation_state)}`}),"Autonomous Status"]})}),a.jsx(Ot,{className:"pt-0",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"State:"}),a.jsx(_r,{variant:l.conversation_state==="running"?"default":"secondary",children:l.conversation_state})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Actions:"}),a.jsx("span",{className:"font-medium",children:l.action_count||0})]})]})})]}),o&&a.jsxs(lt,{children:[a.jsx(Ei,{className:"pb-3",children:a.jsxs(Yi,{className:"text-sm flex items-center gap-2",children:[a.jsx(ma,{className:"h-4 w-4"}),"Conversation Health"]})}),a.jsx(Ot,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm",children:"Overall Health:"}),a.jsx(_r,{className:j(o.conversation_health.status),children:o.conversation_health.status})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Score:"}),a.jsxs("span",{className:"font-medium",children:[o.conversation_health.score,"/100"]})]}),a.jsx($l,{value:o.conversation_health.score,className:"h-2"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("span",{className:"text-xs text-gray-600",children:"Indicators:"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:o.conversation_health.indicators.map((T,k)=>a.jsx(_r,{variant:"outline",className:"text-xs",children:T.replace("_"," ")},k))})]})]})})]}),i&&a.jsxs(lt,{children:[a.jsx(Ei,{className:"pb-3",children:a.jsxs(Yi,{className:"text-sm flex items-center gap-2",children:[a.jsx(Fr,{className:"h-4 w-4"}),"Participation"]})}),a.jsx(Ot,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-lg font-semibold text-blue-600",children:i.overview.active_participants}),a.jsx("div",{className:"text-xs text-gray-600",children:"Active"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-lg font-semibold text-green-600",children:i.overview.participant_messages}),a.jsx("div",{className:"text-xs text-gray-600",children:"Messages"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Balance:"}),a.jsx(_r,{variant:i.participation.participation_balance==="balanced"?"default":"secondary",children:i.participation.participation_balance.replace("_"," ")})]}),i.participation.dominant_participants.length>0&&a.jsxs("div",{className:"text-xs text-amber-600",children:["Dominant: ",i.participation.dominant_participants.length," participant(s)"]}),i.participation.quiet_participants.length>0&&a.jsxs("div",{className:"text-xs text-blue-600",children:["Quiet: ",i.participation.quiet_participants.length," participant(s)"]})]})]})})]}),i&&a.jsxs(lt,{children:[a.jsx(Ei,{className:"pb-3",children:a.jsxs(Yi,{className:"text-sm flex items-center gap-2",children:[a.jsx(mZ,{className:"h-4 w-4"}),"Sentiment"]})}),a.jsx(Ot,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm",children:"Overall:"}),a.jsx(_r,{className:A(i.sentiment_analysis.overall_sentiment),children:i.sentiment_analysis.overall_sentiment})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsxs("span",{children:["Positive: ",i.sentiment_analysis.sentiment_distribution.positive]}),a.jsxs("span",{children:["Neutral: ",i.sentiment_analysis.sentiment_distribution.neutral]}),a.jsxs("span",{children:["Negative: ",i.sentiment_analysis.sentiment_distribution.negative]})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Trend:"}),a.jsx("span",{className:"font-medium",children:i.sentiment_analysis.sentiment_trend})]})]})]})})]}),i&&a.jsxs(lt,{children:[a.jsx(Ei,{className:"pb-3",children:a.jsxs(Yi,{className:"text-sm flex items-center gap-2",children:[a.jsx(VJ,{className:"h-4 w-4"}),"Quality Metrics"]})}),a.jsx(Ot,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Engagement:"}),a.jsxs("span",{className:"font-medium",children:[Math.round(i.quality_metrics.engagement_score),"/100"]})]}),a.jsx($l,{value:i.quality_metrics.engagement_score,className:"h-2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Depth:"}),a.jsxs("span",{className:"font-medium",children:[Math.round(i.quality_metrics.depth_score),"/100"]})]}),a.jsx($l,{value:i.quality_metrics.depth_score,className:"h-2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Overall:"}),a.jsxs("span",{className:"font-medium",children:[Math.round(i.quality_metrics.quality_score),"/100"]})]}),a.jsx($l,{value:i.quality_metrics.quality_score,className:"h-2"})]})]})})]}),d&&a.jsxs(lt,{children:[a.jsx(Ei,{className:"pb-3",children:a.jsxs(Yi,{className:"text-sm flex items-center gap-2",children:[a.jsx(hu,{className:"h-4 w-4"}),"AI Insights"]})}),a.jsx(Ot,{className:"pt-0",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Energy:"}),a.jsx(_r,{variant:d.conversation_energy==="high"?"default":"secondary",children:d.conversation_energy})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Engagement:"}),a.jsx(_r,{variant:d.topic_engagement==="high"?"default":"secondary",children:d.topic_engagement})]}),d.next_suggested_action&&a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-2 mt-2",children:a.jsxs("div",{className:"text-xs text-blue-800",children:[a.jsx("strong",{children:"Suggestion:"})," ",d.next_suggested_action]})})]})})]}),i&&i.recommendations.length>0&&a.jsxs(lt,{children:[a.jsx(Ei,{className:"pb-3",children:a.jsxs(Yi,{className:"text-sm flex items-center gap-2",children:[a.jsx(ME,{className:"h-4 w-4"}),"Recommendations"]})}),a.jsx(Ot,{className:"pt-0",children:a.jsx("div",{className:"space-y-2",children:i.recommendations.map((T,k)=>a.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-2",children:a.jsx("div",{className:"text-xs text-amber-800",children:T})},k))})})]})]})]}):null},O$e=({discussionGuide:t,moderatorStatus:e,onSectionSelect:n,onSetPosition:r,onSave:i,focusGroupId:s,isOpen:o,onToggle:c,className:l,onEditingChange:u})=>{const d=y.useRef(!1),f=y.useCallback(v=>{d.current=v,u==null||u(v)},[u]),[h,p]=y.useState(!1),g=async()=>{if(!t){ne.error("No discussion guide available",{description:"The discussion guide is not available for download"});return}p(!0);try{await bt.downloadDiscussionGuide(s),ne.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(v){console.error("Error downloading discussion guide:",v),ne.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{p(!1)}},m=t&&typeof t=="object"&&t.sections;return a.jsx("div",{className:Pe("w-full border-b bg-white shadow-sm",l),children:a.jsxs(jg,{open:o,onOpenChange:c,children:[a.jsx(Eg,{asChild:!0,children:a.jsxs("div",{className:"w-full px-4 py-3 flex items-center justify-between hover:bg-slate-50 transition-colors cursor-pointer",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(YJ,{className:"h-5 w-5 text-slate-600"}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold text-slate-900",children:"Discussion Guide"}),m&&a.jsxs("p",{className:"text-xs text-slate-500",children:[t.title," • ",t.total_duration," minutes"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(X,{variant:"ghost",size:"sm",onClick:v=>{v.stopPropagation(),g()},disabled:!t||h,className:"h-8",children:h?a.jsx(eo,{className:"h-4 w-4 animate-spin"}):a.jsx(Jc,{className:"h-4 w-4"})}),o?a.jsx(fu,{className:"h-4 w-4 text-slate-500"}):a.jsx(Da,{className:"h-4 w-4 text-slate-500"})]})]})}),a.jsx(Ng,{children:a.jsx("div",{className:"border-t bg-slate-50",children:a.jsx(lt,{className:"mx-4 mb-4 mt-2",children:a.jsx(Ot,{className:"p-4",children:a.jsx("div",{className:"max-h-[70vh] overflow-y-auto",children:a.jsx(KT,{discussionGuide:t,moderatorStatus:e,onSectionSelect:n,onSetPosition:r,onSave:i,showProgress:!0,collapsible:!0,defaultExpanded:!0,focusGroupId:s,onEditingChange:f})})})})})})]})})},I$e=({focusGroupId:t,focusGroupName:e="Focus Group",onNoteClick:n})=>{const[r,i]=y.useState([]),[s,o]=y.useState(!0),[c,l]=y.useState(null);y.useEffect(()=>{u()},[t]);const u=async()=>{try{o(!0);const x=await bt.getNotes(t);if(x.data&&Array.isArray(x.data)){const w=x.data.map(S=>({...S,timestamp:new Date(S.timestamp),createdAt:new Date(S.createdAt)}));i(v(w))}}catch(x){console.error("Error fetching notes:",x),ne.error("Failed to load notes",{description:"Please refresh the page to try again."})}finally{o(!1)}},d=async x=>{l(x);try{await bt.deleteNote(t,x),i(r.filter(w=>w.id!==x)),ne.success("Note deleted successfully")}catch(w){console.error("Error deleting note:",w),ne.error("Failed to delete note",{description:"Please try again."})}finally{l(null)}},f=x=>{x.associatedMessageId&&n?n(x.associatedMessageId):ne.info("No associated message",{description:"This note is not linked to a specific discussion point."})},h=()=>{if(r.length===0){ne.warning("No notes to export",{description:"Create some notes first before exporting."});return}const x=p(),w=document.createElement("a"),S=new Blob([x],{type:"text/markdown"});w.href=URL.createObjectURL(S),w.download=`${e.replace(/[^a-z0-9]/gi,"_").toLowerCase()}_notes.md`,document.body.appendChild(w),w.click(),document.body.removeChild(w),ne.success("Notes exported successfully",{description:`Downloaded ${r.length} notes as Markdown file.`})},p=()=>{const x=[`# Notes: ${e}`,"",`Exported on: ${new Date().toLocaleString()}`,`Total notes: ${r.length}`,"","---",""];return r.forEach((w,S)=>{var C;x.push(`## Note ${S+1}`),x.push(""),x.push(`**Created:** ${w.createdAt.toLocaleString()}`),(C=w.sectionInfo)!=null&&C.sectionTitle&&x.push(`**Section:** ${w.sectionInfo.sectionTitle}`),x.push(`**Elapsed Time:** ${g(w.elapsedTime)}`),x.push(""),x.push("**Content:**"),x.push(w.content),x.push(""),x.push("---"),x.push("")}),x.join(` -`)},g=x=>{const w=Math.floor(x/1e3),S=Math.floor(w/60),C=w%60;return`${S}:${C.toString().padStart(2,"0")}`},m=x=>x.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),v=x=>[...x].sort((w,S)=>S.createdAt.getTime()-w.createdAt.getTime()),b=x=>{i(w=>v([...w,x]))};return y.useEffect(()=>(window.notesPanelAddNote=b,()=>{delete window.notesPanelAddNote}),[]),s?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Wy,{className:"h-5 w-5 text-primary mr-2"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Notes"}),r.length>0&&a.jsxs("span",{className:"ml-2 text-sm text-slate-500",children:["(",r.length,")"]})]}),a.jsxs(X,{variant:"outline",size:"sm",onClick:h,disabled:r.length===0,children:[a.jsx(Jc,{className:"mr-2 h-4 w-4"}),"Export Notes"]})]}),a.jsx(lw,{className:"flex-1",children:r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[a.jsx(Wy,{className:"h-8 w-8 text-slate-400 mb-3"}),a.jsx("p",{className:"text-slate-600",children:"No notes yet."}),a.jsx("p",{className:"text-sm text-slate-500 mt-2",children:'Click the "Note" button during the session to add contextual notes.'})]}):a.jsx("div",{className:"space-y-4",children:r.map(x=>{var w;return a.jsxs(lt,{className:"hover:shadow-md transition-shadow cursor-pointer group",onClick:()=>f(x),children:[a.jsx(Ei,{className:"pb-2",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Yi,{className:"text-sm font-medium text-slate-600",children:m(x.createdAt)}),((w=x.sectionInfo)==null?void 0:w.sectionTitle)&&a.jsx("div",{className:"text-xs text-slate-500 mt-1",children:a.jsx("span",{children:x.sectionInfo.sectionTitle})})]}),a.jsxs("div",{className:"flex items-center space-x-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[x.associatedMessageId&&a.jsx(X,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:S=>{S.stopPropagation(),f(x)},title:"Go to discussion point",children:a.jsx(cZ,{className:"h-3 w-3"})}),a.jsx(X,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-red-600 hover:text-red-700",onClick:S=>{S.stopPropagation(),d(x.id)},disabled:c===x.id,title:"Delete note",children:a.jsx(ir,{className:"h-3 w-3"})})]})]})}),a.jsx(Ot,{className:"pt-0",children:a.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:x.content})})]},x.id)})})})]})},R$e=({isOpen:t,onClose:e,focusGroupId:n,associatedMessageId:r,sectionInfo:i,messageTimestamp:s,onNoteSaved:o})=>{const[c,l]=y.useState(""),[u,d]=y.useState(!1),f=async()=>{if(!c.trim()){ne.error("Note content cannot be empty");return}d(!0);try{const p={content:c.trim(),associatedMessageId:r,sectionInfo:i,elapsedTime:0,timestamp:s.toISOString(),createdAt:new Date().toISOString()},g=await bt.createNote(n,p);if(g.data){const m={...g.data,timestamp:new Date(g.data.timestamp),createdAt:new Date(g.data.createdAt)},v=i!=null&&i.sectionTitle?`'${i.sectionTitle}'`:"current section",b=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});ne.success("Quick note saved",{description:`Note linked to ${v} at ${b}`}),o&&o(m),l(""),e()}}catch(p){console.error("Error saving note:",p),ne.error("Failed to save note",{description:"Please try again or check your connection."})}finally{d(!1)}},h=()=>{l(""),e()};return a.jsx(eu,{open:t,onOpenChange:h,children:a.jsxs(Lc,{className:"sm:max-w-md",children:[a.jsx(Fc,{children:a.jsx(Bc,{children:"Quick Note"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"text-sm text-slate-600",children:[a.jsxs("div",{children:[a.jsx("strong",{children:"Section:"})," ",(i==null?void 0:i.sectionTitle)||"Unknown section"]}),a.jsxs("div",{children:[a.jsx("strong",{children:"Time:"})," ",s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),a.jsx(ht,{placeholder:"Enter your note here...",value:c,onChange:p=>l(p.target.value),className:"min-h-[100px] resize-none",autoFocus:!0})]}),a.jsxs(Uc,{children:[a.jsx(X,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),a.jsx(X,{onClick:f,disabled:u,children:u?"Saving...":"Save Note"})]})]})})},Xo=Object.create(null);Xo.open="0";Xo.close="1";Xo.ping="2";Xo.pong="3";Xo.message="4";Xo.upgrade="5";Xo.noop="6";const ly=Object.create(null);Object.keys(Xo).forEach(t=>{ly[Xo[t]]=t});const dj={type:"error",data:"parser error"},CW=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",_W=typeof ArrayBuffer=="function",AW=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,ik=({type:t,data:e},n,r)=>CW&&e instanceof Blob?n?r(e):k$(e,r):_W&&(e instanceof ArrayBuffer||AW(e))?n?r(e):k$(new Blob([e]),r):r(Xo[t]+(e||"")),k$=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function O$(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let kC;function M$e(t,e){if(CW&&t.data instanceof Blob)return t.data.arrayBuffer().then(O$).then(e);if(_W&&(t.data instanceof ArrayBuffer||AW(t.data)))return e(O$(t.data));ik(t,!1,n=>{kC||(kC=new TextEncoder),e(kC.encode(n))})}const I$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t{let e=t.length*.75,n=t.length,r,i=0,s,o,c,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const u=new ArrayBuffer(e),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(o&15)<<4|c>>2,d[i++]=(c&3)<<6|l&63;return u},$$e=typeof ArrayBuffer=="function",sk=(t,e)=>{if(typeof t!="string")return{type:"message",data:jW(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:L$e(t.substring(1),e)}:ly[n]?t.length>1?{type:ly[n],data:t.substring(1)}:{type:ly[n]}:dj},L$e=(t,e)=>{if($$e){const n=D$e(t);return jW(n,e)}else return{base64:!0,data:t}},jW=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},EW="",F$e=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{ik(s,!1,c=>{r[o]=c,++i===n&&e(r.join(EW))})})},U$e=(t,e)=>{const n=t.split(EW),r=[];for(let i=0;i{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let OC;function Dv(t){return t.reduce((e,n)=>e+n.length,0)}function $v(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;iMath.pow(2,21)-1){c.enqueue(dj);break}i=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Dv(n)t){c.enqueue(dj);break}}}})}const NW=4;function mr(t){if(t)return z$e(t)}function z$e(t){for(var e in mr.prototype)t[e]=mr.prototype[e];return t}mr.prototype.on=mr.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};mr.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};mr.prototype.off=mr.prototype.removeListener=mr.prototype.removeAllListeners=mr.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;iPromise.resolve().then(e):(e,n)=>n(e,0),xs=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),V$e="arraybuffer";function TW(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const G$e=xs.setTimeout,K$e=xs.clearTimeout;function tS(t,e){e.useNativeTimers?(t.setTimeoutFn=G$e.bind(xs),t.clearTimeoutFn=K$e.bind(xs)):(t.setTimeoutFn=xs.setTimeout.bind(xs),t.clearTimeoutFn=xs.clearTimeout.bind(xs))}const W$e=1.33;function q$e(t){return typeof t=="string"?Y$e(t):Math.ceil((t.byteLength||t.size)*W$e)}function Y$e(t){let e=0,n=0;for(let r=0,i=t.length;r=57344?n+=3:(r++,n+=4);return n}function PW(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Q$e(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function X$e(t){let e={},n=t.split("&");for(let r=0,i=n.length;r{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};U$e(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,F$e(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=PW()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let kW=!1;try{kW=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const eLe=kW;function tLe(){}class nLe extends Z$e{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Id=class uy extends mr{constructor(e,n,r){super(),this.createRequest=e,tS(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=TW(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=uy.requestsCount++,uy.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=tLe,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete uy.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Id.requestsCount=0;Id.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",R$);else if(typeof addEventListener=="function"){const t="onpagehide"in xs?"pagehide":"unload";addEventListener(t,R$,!1)}}function R$(){for(let t in Id.requests)Id.requests.hasOwnProperty(t)&&Id.requests[t].abort()}const rLe=function(){const t=OW({xdomain:!1});return t&&t.responseType!==null}();class iLe extends nLe{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=rLe&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Id(OW,this.uri(),e)}}function OW(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||eLe))return new XMLHttpRequest}catch{}if(!e)try{return new xs[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const IW=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class sLe extends ok{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=IW?{}:TW(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n{try{this.doWrite(r,s)}catch{}i&&eS(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=PW()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const IC=xs.WebSocket||xs.MozWebSocket;class oLe extends sLe{createSocket(e,n,r){return IW?new IC(e,n,r):n?new IC(e,n):new IC(e)}doWrite(e,n){this.ws.send(n)}}class aLe extends ok{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=H$e(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=B$e();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:c,value:l})=>{c||(this.onPacket(l),s())}).catch(c=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n{i&&eS(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const cLe={websocket:oLe,webtransport:aLe,polling:iLe},lLe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,uLe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function fj(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=lLe.exec(t||""),s={},o=14;for(;o--;)s[uLe[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=dLe(s,s.path),s.queryKey=fLe(s,s.query),s}function dLe(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function fLe(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const hj=typeof addEventListener=="function"&&typeof removeEventListener=="function",dy=[];hj&&addEventListener("offline",()=>{dy.forEach(t=>t())},!1);class Gc extends mr{constructor(e,n){if(super(),this.binaryType=V$e,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=fj(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=fj(n.host).host);tS(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=X$e(this.opts.query)),hj&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},dy.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=NW,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Gc.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Gc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,eS(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(Gc.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),hj&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=dy.indexOf(this._offlineEventListener);r!==-1&&dy.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Gc.protocol=NW;class hLe extends Gc{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Gc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=f=>{const h=new Error("probe error: "+f);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function c(){o("transport closed")}function l(){o("socket closed")}function u(f){n&&f.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",c),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",c),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;rcLe[i]).filter(i=>!!i)),super(e,r)}};function mLe(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=fj(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const gLe=typeof ArrayBuffer=="function",vLe=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,RW=Object.prototype.toString,yLe=typeof Blob=="function"||typeof Blob<"u"&&RW.call(Blob)==="[object BlobConstructor]",xLe=typeof File=="function"||typeof File<"u"&&RW.call(File)==="[object FileConstructor]";function ak(t){return gLe&&(t instanceof ArrayBuffer||vLe(t))||yLe&&t instanceof Blob||xLe&&t instanceof File}function fy(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n=0&&t.num{delete this.acks[e];for(let c=0;c{this.io.clearTimeoutFn(s),n.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(o,c)=>o?i(o):r(c);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Qt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Qt.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Qt.EVENT:case Qt.BINARY_EVENT:this.onevent(e);break;case Qt.ACK:case Qt.BINARY_ACK:this.onack(e);break;case Qt.DISCONNECT:this.ondisconnect();break;case Qt.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Qt.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Qt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r0&&t.jitter<=1?t.jitter:0,this.attempts=0}hh.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0};hh.prototype.reset=function(){this.attempts=0};hh.prototype.setMin=function(t){this.ms=t};hh.prototype.setMax=function(t){this.max=t};hh.prototype.setJitter=function(t){this.jitter=t};class gj extends mr{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,tS(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new hh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||jLe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new pLe(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Gs(n,"open",function(){r.onopen(),e&&e()}),s=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=Gs(n,"error",s);if(this._timeout!==!1){const c=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},c);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Gs(e,"ping",this.onping.bind(this)),Gs(e,"data",this.ondata.bind(this)),Gs(e,"error",this.onerror.bind(this)),Gs(e,"close",this.onclose.bind(this)),Gs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){eS(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new MW(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;re()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Lh={};function hy(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=mLe(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Lh[i]&&s in Lh[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return c?l=new gj(r,e):(Lh[i]||(Lh[i]=new gj(r,e)),l=Lh[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(hy,{Manager:gj,Socket:MW,io:hy,connect:hy});const D$=window.location.origin,$$=new URLSearchParams(window.location.search).get("direct")==="1"?"/socket.io/":"/semblance_back/socket.io/";let kt=null,iu=null,L$=!1;function DW(t){if(kt)return kt.io.opts.auth={token:t()},kt;console.log("🔧 [GPT-5] Creating singleton socket:",D$,$$),kt=hy(D$,{path:$$,transports:["websocket"],reconnection:!0,autoConnect:!1,timeout:6e4,pingInterval:45e3,pingTimeout:12e4,auth:n=>n({token:t()})}),kt.io.on("reconnect_attempt",()=>{console.log("🔧 [GPT-5] Reconnect attempt - refreshing token"),kt.io.opts.auth={token:t()}});const e=()=>{console.log("🔧 [GPT-5] Socket connected, rebinding listeners and rejoining room"),kLe(),iu&&PLe()};return kt.on("connect",e),kt.onAny((n,...r)=>{console.log(`🔧 [GPT-5 onAny] ${n}:`,r);const i=r[0];switch(n){case"joined_focus_group":console.log("🔧 [GPT-5] *** ROUTING joined_focus_group from onAny ***"),window.dispatchEvent(new CustomEvent("ws:joined_focus_group",{detail:i}));break;case"left_focus_group":console.log("🔧 [GPT-5] *** ROUTING left_focus_group from onAny ***"),window.dispatchEvent(new CustomEvent("ws:left_focus_group",{detail:i}));break;case"message_update":console.log("🔧 [GPT-5] *** ROUTING message_update from onAny ***");try{window.dispatchEvent(new CustomEvent("ws:message_update",{detail:i})),console.log("🔧 [GPT-5] DISPATCHED window event ws:message_update SUCCESS (via onAny)")}catch(s){console.error("🔧 [GPT-5] ERROR dispatching window event (via onAny):",s)}break;case"ai_status_update":console.log("🔧 [GPT-5] *** ROUTING ai_status_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:ai_status_update",{detail:i}));break;case"moderator_status_update":console.log("🔧 [GPT-5] *** ROUTING moderator_status_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:moderator_status_update",{detail:i}));break;case"theme_update":console.log("🔧 [GPT-5] *** ROUTING theme_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:theme_update",{detail:i}));break;case"focus_group_update":console.log("🔧 [GPT-5] *** ROUTING focus_group_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:focus_group_update",{detail:i}));break;case"connected":console.log("🔧 [GPT-5] *** ROUTING connected from onAny ***");break;case"error":console.error("🔧 [GPT-5] *** ROUTING error from onAny ***",i);break}}),kt.on("connect_error",n=>{console.error("🔧 [GPT-5] Connect error:",n)}),kt.on("disconnect",n=>{console.log("🔧 [GPT-5] Disconnected:",n)}),kt}function $W(){kt&&!kt.connected&&(console.log("🔧 [GPT-5] Connecting socket"),kt.connect())}function NLe(t,e){if(console.log("🔧 [GPT-5] Joining focus group:",t),iu=t,!(kt!=null&&kt.connected)){console.log("🔧 [GPT-5] Socket not connected, will auto-rejoin on connect"),$W(),setTimeout(()=>{kt!=null&&kt.connected?(console.log("🔧 [GPT-5] Retrying join after connection established"),kt.emit("join_focus_group",{focus_group_id:t},n=>{console.log("🔧 [GPT-5] join_focus_group RETRY ACK:",n)})):console.log("🔧 [GPT-5] Still not connected, will rejoin on next connect event")},1e3);return}kt.emit("join_focus_group",{focus_group_id:t},n=>{console.log("🔧 [GPT-5] join_focus_group ACK:",n)})}function TLe(t){console.log("🔧 [GPT-5] Leaving focus group:",t),iu===t&&(iu=null),kt!=null&&kt.connected&&kt.emit("leave_focus_group",{focus_group_id:t})}function PLe(){!(kt!=null&&kt.connected)||!iu||(console.log("🔧 [GPT-5] Auto-rejoining room after reconnect:",iu),kt.emit("join_focus_group",{focus_group_id:iu}))}function kLe(){if(!kt){console.log("🔧 [GPT-5] bindCoreListeners called but socket is null!");return}L$&&console.log("🔧 [GPT-5] Listeners already bound, but rebinding anyway for safety"),console.log("🔧 [GPT-5] bindCoreListeners called - socket exists, binding listeners");const t=c=>{console.log("🔧 [GPT-5] joined_focus_group:",c),window.dispatchEvent(new CustomEvent("ws:joined_focus_group",{detail:c}))},e=c=>{console.log("🔧 [GPT-5] left_focus_group:",c),window.dispatchEvent(new CustomEvent("ws:left_focus_group",{detail:c}))},n=c=>{console.log("🔧 [GPT-5] *** MESSAGE_UPDATE LISTENER FIRED! ***"),console.log("🔧 [GPT-5] message_update payload:",c),console.log("🔧 [GPT-5] DISPATCHING window event ws:message_update");try{window.dispatchEvent(new CustomEvent("ws:message_update",{detail:c})),console.log("🔧 [GPT-5] DISPATCHED window event ws:message_update SUCCESS")}catch(l){console.error("🔧 [GPT-5] ERROR dispatching window event:",l)}},r=c=>{console.log("🔧 [GPT-5] ai_status_update:",c),console.log("🔧 [GPT-5] DISPATCHING window event ws:ai_status_update"),window.dispatchEvent(new CustomEvent("ws:ai_status_update",{detail:c})),console.log("🔧 [GPT-5] DISPATCHED window event ws:ai_status_update")},i=c=>{console.log("🔧 [GPT-5] moderator_status_update:",c),window.dispatchEvent(new CustomEvent("ws:moderator_status_update",{detail:c}))},s=c=>{console.log("🔧 [GPT-5] theme_update:",c),window.dispatchEvent(new CustomEvent("ws:theme_update",{detail:c}))},o=c=>{console.log("🔧 [GPT-5] focus_group_update:",c),window.dispatchEvent(new CustomEvent("ws:focus_group_update",{detail:c}))};console.log("🔧 [GPT-5] BINDING specific listeners to socket"),kt.on("joined_focus_group",t),kt.on("left_focus_group",e),kt.on("message_update",n),kt.on("ai_status_update",r),kt.on("moderator_status_update",i),kt.on("theme_update",s),kt.on("focus_group_update",o),console.log("🔧 [GPT-5] BOUND specific listeners to socket"),console.log("🔧 [GPT-5] Socket listeners after binding:",kt.listeners("message_update").length),console.log("🔧 [GPT-5] Socket hasListeners message_update:",kt.hasListeners("message_update")),setTimeout(()=>{kt!=null&&kt.connected&&(console.log("🔧 [GPT-5] SELF-TEST: Emitting test event"),kt.emit("message_update",{test:"self-emit-test"}))},1e3),kt.on("connected",c=>{console.log("🔧 [GPT-5] connected:",c)}),kt.on("error",c=>{console.error("🔧 [GPT-5] socket error:",c)}),L$=!0}const OLe=()=>{const{id:t}=RE(),e=lr(),{token:n}=Zo(),[r,i]=y.useState([]),[s,o]=y.useState([]),[c,l]=y.useState([]),[u,d]=y.useState(null),[f,h]=y.useState([]),[p,g]=y.useState("chat"),[m,v]=y.useState(null),[b,x]=y.useState(!1),[w,S]=y.useState(!1),[C,_]=y.useState(!0),[A,j]=y.useState(!1),[T,k]=y.useState(!1),I=y.useRef(!1),[E,O]=y.useState(!1),M=y.useRef(u);M.current=u;const[U,D]=y.useState([]),[B,R]=y.useState(!1),[L,Y]=y.useState(""),[q,J]=y.useState("medium"),[me,F]=y.useState("medium"),[oe,se]=y.useState(!1),[le,ke]=y.useState(!1),[ue,we]=y.useState(null),[Ae,ee]=y.useState([]),[wt,et]=y.useState(!1),[Ct,Xe]=y.useState(!1),[nn,N]=y.useState(!1),[$,z]=y.useState(!0),[G,Q]=y.useState({isOpen:!1}),H=y.useRef(!1),[Z,he]=y.useState(""),xe=y.useRef(""),Oe=y.useRef(!1),be=y.useRef({wasConnected:!1,wasConnecting:!1,initialConnection:!0,hasShownFallbackNotification:!1}),We=SW(),[ot,Rt]=y.useState(!1),[Ke,Ze]=y.useState(!1),[_t,Kt]=y.useState(null),Qn=y.useCallback(()=>n||"",[n]);y.useEffect(()=>{console.log("🔧 [GPT-5 Session] Initializing WebSocket"),DW(Qn)},[We,Qn]),y.useEffect(()=>{if(!t)return;(()=>{console.log("🔧 [GPT-5 Session] Joining focus group:",t),NLe(t)})()},[t,We]),y.useEffect(()=>{Ze(!0),Rt(!1),Kt(null);const te=setTimeout(()=>{Rt(!0),Ze(!1)},1e3);return()=>{clearTimeout(te)}},[We]),y.useEffect(()=>{console.log("🔧 [GPT-5 Session] Setting up window event listeners");const te=Ue=>{const nt=Ue.detail;console.log("🔧 [GPT-5 Session] message_update:",nt),nt.focus_group_id&&(console.log("🔧 [GPT-5] Message focus_group_id:",nt.focus_group_id),console.log("🔧 [GPT-5] Current focus group from URL:",t));const ye=T$e(nt.message);if(!ye){console.error("🔧 [GPT-5] convertWebSocketMessage returned null");return}i(Jt=>Jt.find(Zt=>Zt.id===ye.id)?(console.log("🔧 [GPT-5] Message already exists, skipping"),Jt):(console.log("🔧 [GPT-5] Adding new message, count:",Jt.length+1),[...Jt,ye]))},ae=Ue=>{const nt=Ue.detail;console.log("🔧 [GPT-5 Session] ai_status_update:",nt),S(ye=>nt.status.status==="ai_mode"),he(ye=>nt.status.status)},Te=Ue=>{const nt=Ue.detail;console.log("🔧 [GPT-5 Session] moderator_status_update:",nt),v(nt.moderator_status)},$e=Ue=>{const nt=Ue.detail;console.log("🔧 [GPT-5 Session] theme_update:",nt);const ye=P$e(nt.theme);l(Jt=>{const ft=[...Jt],Zt=ft.findIndex(ln=>ln.id===ye.id);return Zt>=0?ft[Zt]=ye:ft.push(ye),ft})},Be=Ue=>{const nt=Ue.detail;console.log("🔧 [GPT-5 Session] focus_group_update:",nt),d(ye=>ye?{...ye,...nt}:null)},Mt=Ue=>{const nt=Ue.detail;console.log("🔧 [GPT-5 Session] joined_focus_group:",nt)};return console.log("🔧 [GPT-5 Session] ADDING window event listeners"),window.addEventListener("ws:message_update",te),window.addEventListener("ws:ai_status_update",ae),window.addEventListener("ws:moderator_status_update",Te),window.addEventListener("ws:theme_update",$e),window.addEventListener("ws:focus_group_update",Be),window.addEventListener("ws:joined_focus_group",Mt),console.log("🔧 [GPT-5 Session] ADDED all window event listeners"),()=>{console.log("🔧 [GPT-5 Session] Cleaning up window event listeners"),window.removeEventListener("ws:message_update",te),window.removeEventListener("ws:ai_status_update",ae),window.removeEventListener("ws:moderator_status_update",Te),window.removeEventListener("ws:theme_update",$e),window.removeEventListener("ws:focus_group_update",Be),window.removeEventListener("ws:joined_focus_group",Mt),t&&TLe(t)}},[We,t]),y.useEffect(()=>{if(!t)return;const te=be.current;ot&&!te.wasConnected&&(te.initialConnection?Fe.success("Live updates enabled",{description:"Connected to real-time updates. Changes will appear instantly.",duration:3e3}):Fe.success("Real-time updates restored",{description:"WebSocket connection re-established. You'll now receive instant updates.",duration:4e3}),te.wasConnected=!0,te.initialConnection=!1),!ot&&!Ke&&te.wasConnected&&!te.initialConnection&&(Fe.warning("Connection lost",{description:"Real-time updates unavailable. Attempting to reconnect...",duration:5e3}),te.wasConnected=!1,z(!0)),_t&&!Ke&&!ot&&!te.initialConnection&&(Fe.error("Connection failed",{description:"Unable to establish real-time connection. Using periodic updates instead.",duration:6e3}),z(!0)),te.wasConnecting=Ke},[ot,Ke,_t,We,t]),y.useEffect(()=>{},[We,t,u]);const Xt=async()=>{var te;if(t)try{const ae=await er.getModeratorStatus(t);if((te=ae==null?void 0:ae.data)!=null&&te.status){const Te=ae.data.status;if(m){const $e=m.current_section_id!==Te.current_section_id||m.current_item_id!==Te.current_item_id||m.progress!==Te.progress}I.current||v(Te)}}catch(ae){console.error("Error fetching moderator status:",ae)}},at=async()=>{if(!t)return{aiActive:!1,sessionStatus:""};try{if(typeof(bt==null?void 0:bt.getById)!="function")return console.error("focusGroupsApi.getById is not a function:",typeof(bt==null?void 0:bt.getById)),{aiActive:w,sessionStatus:Z};const te=await bt.getById(t);if(!te||typeof te!="object")return console.error("Invalid response object received:",te),{aiActive:w,sessionStatus:Z};if(!te.data||typeof te.data!="object")return console.warn("Focus group response missing data property:",te),{aiActive:w,sessionStatus:Z};const ae=te.data.status;if(typeof ae>"u")return console.warn("Focus group response missing status field:",te.data),{aiActive:w,sessionStatus:Z};const Te=ae==="ai_mode";return ae==="autonomous_active"?console.warn('Detected legacy "autonomous_active" status - backend may need updating to "ai_mode"'):["ai_mode","active","completed","paused","draft","in-progress"].includes(ae)||console.warn("Unexpected focus group status value:",ae),{aiActive:Te,sessionStatus:ae}}catch(te){console.error("Error checking AI mode status:",te);const ae={focusGroupId:t,currentAiModeStatus:w,errorType:"unknown",timestamp:new Date().toISOString()};return te.response?(ae.errorType="api_error",ae.status=te.response.status,ae.data=te.response.data,console.error("API error response:",te.response.status,te.response.data),te.response.status===404?console.warn("Focus group not found - may have been deleted"):te.response.status===500&&console.error("Server error during status check - backend issue")):te.request?(ae.errorType="network_error",console.error("Network error - no response received, check connectivity")):(ae.errorType="request_setup",ae.message=te.message,console.error("Request setup error:",te.message)),console.debug("Status check error details:",ae),{aiActive:w,sessionStatus:Z,isGenerating:!1}}},Wt=async(te,ae)=>{if(!t||Oe.current)return;const Te=["completed","paused"],Be=["ai_mode","autonomous_active","active","in-progress"].includes(ae),Mt=Te.includes(te);if(Be&&Mt){Oe.current=!0;try{let Ue="session_ended";te==="completed"?Ue="auto_complete":te==="paused"&&(Ue="manual_stop");const nt=await er.endSession(t,Ue);nt!=null&&nt.data&&(Fe.success("Session concluded",{description:"The focus group session has ended with a concluding statement from the moderator."}),setTimeout(()=>{st()},1e3))}catch(Ue){console.error("❌ Error ending session with concluding statement:",Ue),Fe.error("Error ending session",{description:"Failed to add concluding statement, but the session has ended."})}}},st=async()=>{var te;if(t)try{const ae=await bt.getMessages(t);console.log("🔍 [FetchMessages] Raw API response:",ae==null?void 0:ae.data);let Te=[],$e=[];ae&&ae.data&&(Array.isArray(ae.data)?(Te=ae.data,$e=[]):ae.data.messages||ae.data.mode_events?(Te=ae.data.messages||[],$e=ae.data.mode_events||[]):(Te=Array.isArray(ae.data)?ae.data:[],$e=[]));const Be=Te.map(ye=>({id:ye._id||ye.id||`msg-${Date.now()}`,senderId:ye.senderId,text:ye.text,timestamp:new Date(ye.timestamp||ye.created_at||new Date),type:ye.type||"response",highlighted:ye.highlighted||!1,visualAsset:ye.visualAsset}));console.log("🔍 [FetchMessages] Formatted messages with visual assets:",Be.filter(ye=>ye.visualAsset).map(ye=>({id:ye.id,senderId:ye.senderId,hasVisualAsset:!!ye.visualAsset,visualAsset:ye.visualAsset})));const Mt=$e.map(ye=>({id:ye._id||ye.id||`event-${Date.now()}`,focus_group_id:ye.focus_group_id,event_type:ye.event_type,timestamp:new Date(ye.timestamp||ye.created_at||new Date),user_id:ye.user_id,created_at:new Date(ye.created_at||new Date)}));o(Mt),Be.length>0?i(ye=>{if(ye.length===0)return Be;{const Jt=new Map;ye.forEach(Un=>Jt.set(Un.id,Un));const ft=Be.map(Un=>{if(Jt.has(Un.id)){const kr=Jt.get(Un.id);return{...Un,highlighted:kr.highlighted}}return Un}),Zt=new Set(ft.map(Un=>Un.id)),ln=ye.filter(Un=>!Zt.has(Un.id));return[...ft,...ln].sort((Un,kr)=>Un.timestamp.getTime()-kr.timestamp.getTime())}}):Be.length===0&&i(ye=>ye.length===0?[]:ye);const Ue=Be.filter(ye=>ye.highlighted),nt=Ue.length>0?Ue.map(ye=>({id:`theme-${ye.id}`,text:ye.text.substring(0,40)+(ye.text.length>40?"...":""),count:1,messages:[ye.id],source:"highlight"})):[];try{const ye=await er.getKeyThemes(t);if((te=ye==null?void 0:ye.data)!=null&&te.themes&&Array.isArray(ye.data.themes)){const Jt=ye.data.themes;l([...nt,...Jt])}else l(nt)}catch(ye){console.error("Error fetching AI-generated themes:",ye),l(nt)}}catch(ae){console.error("Error fetching messages:",ae),r.length===0&&Fe.error("Failed to fetch messages",{description:"Please try again later or restart the session."})}},Je=async()=>{if(!t)return!1;try{const ae=(await $r.getAll()).data||[],Te=await bt.getById(t);if(Te&&Te.data){const $e=Te.data;console.log("Focus group data from API:",$e);const Be={id:$e._id||$e.id,name:$e.name,status:$e.status||"in-progress",participants:$e.participants||[],date:$e.date||new Date().toISOString(),duration:$e.duration||60,topic:$e.topic||"general",discussionGuide:$e.discussionGuide||"",llm_model:$e.llm_model||"gemini-2.5-pro"};if(d(Be),Y(Be.llm_model||"gemini-2.5-pro"),J(Be.reasoning_effort||"medium"),F(Be.verbosity||"medium"),$e.participants_data&&Array.isArray($e.participants_data))h($e.participants_data.map(Ue=>({...Ue,id:Ue._id||Ue.id})));else if(Be.participants&&Array.isArray(Be.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:Be.participants,allPersonas:ae.map(nt=>({id:nt._id||nt.id,name:nt.name}))});const Ue=ae.filter(nt=>{const ye=nt._id||nt.id;return Be.participants.includes(ye)});console.log("Matched participants:",Ue.map(nt=>nt.name)),h(Ue)}await st(),await Xt();const Mt=await at();return S(Mt.aiActive),he(Mt.sessionStatus),H.current=Mt.aiActive,xe.current=Mt.sessionStatus,!0}return!1}catch(te){return console.error("Error fetching focus group:",te),!1}},fn=async(te,ae,Te)=>{if(console.log("🔧 updateFocusGroupModel called with:",{id:t,focusGroup:!!u,newModel:te,reasoningEffort:ae,verbosity:Te}),!t||!u){console.log("❌ updateFocusGroupModel: Missing id or focusGroup",{id:t,focusGroup:!!u});return}se(!0);try{const $e={llm_model:te};te==="gpt-5"&&($e.reasoning_effort=ae||q,$e.verbosity=Te||me),console.log("🔧 Making API call to update focus group model:",{id:t,updateData:$e});const Be=await bt.update(t,$e);console.log("🔧 API response:",Be),Be&&Be.data?(d(Mt=>Mt?{...Mt,llm_model:te,reasoning_effort:te==="gpt-5"?ae||q:Mt==null?void 0:Mt.reasoning_effort,verbosity:te==="gpt-5"?Te||me:Mt==null?void 0:Mt.verbosity}:null),Fe.success("AI Model Updated",{description:`Focus group will now use ${te==="gemini-2.5-pro"?"Gemini 2.5 Pro":te==="gpt-4.1"?"GPT-4.1":te==="gpt-5"?"GPT-5":te} for AI responses`}),R(!1),console.log("✅ Model update successful")):console.log("❌ API response missing data:",Be)}catch($e){console.error("❌ Error updating focus group model:",$e),Fe.error("Failed to update AI model",{description:"There was an error updating the AI model. Please try again."})}finally{se(!1)}};y.useEffect(()=>{console.log("Looking for focus group with ID:",t);const te=async()=>{try{return(await $r.getAll()).data||[]}catch(Be){return console.error("Error fetching personas:",Be),[]}},ae=async Be=>{try{const Mt=await bt.getById(t);if(Mt&&Mt.data){const Ue=Mt.data;console.log("Focus group data from API:",Ue);const nt={id:Ue._id||Ue.id,name:Ue.name,status:Ue.status||"in-progress",participants:Ue.participants||[],date:Ue.date||new Date().toISOString(),duration:Ue.duration||60,topic:Ue.topic||"general",discussionGuide:Ue.discussionGuide||"",llm_model:Ue.llm_model||"gemini-2.5-pro"};if(d(nt),Y(nt.llm_model||"gemini-2.5-pro"),J(nt.reasoning_effort||"medium"),F(nt.verbosity||"medium"),Ue.participants_data&&Array.isArray(Ue.participants_data))h(Ue.participants_data.map(ye=>({...ye,id:ye._id||ye.id})));else if(nt.participants&&Array.isArray(nt.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:nt.participants,allPersonas:Be.map(Jt=>({id:Jt._id||Jt.id,name:Jt.name}))});const ye=Be.filter(Jt=>{const ft=Jt._id||Jt.id;return nt.participants.includes(ft)});console.log("Matched participants:",ye.map(Jt=>Jt.name)),h(ye)}return st(),Xt(),_(!1),!0}return!1}catch(Mt){return console.error("Error fetching focus group:",Mt),!1}};let Te,$e;return te().then(Be=>{ae(Be).then(Mt=>{Mt?_t&&(_t.includes("unavailable")||_t.includes("websocket error"))?(console.log("📡 WebSocket connection failed, falling back to polling"),(()=>{st(),Xt(),Te&&window.clearInterval(Te);const ft=w?3e3:1e4;console.log("📡 Setting up message polling:",{aiModeActive:w,pollInterval:ft,timestamp:new Date().toISOString()}),Te=window.setInterval(()=>{I.current?console.log("📡 Skipping poll - editing discussion guide"):(console.log("📡 Polling for messages...",new Date().toISOString()),st(),Xt())},ft)})(),$e=window.setInterval(async()=>{const ft=H.current,Zt=xe.current,ln=await at();if(H.current=ln.aiActive,xe.current=ln.sessionStatus,S(ln.aiActive),he(ln.sessionStatus),Zt&&Zt!==ln.sessionStatus&&await Wt(ln.sessionStatus,Zt),ft!==ln.aiActive&&Te){window.clearInterval(Te);const hn=ln.aiActive?3e3:1e4;Te=window.setInterval(()=>{I.current||(st(),Xt())},hn)}},15e3)):console.log("📡 WebSocket enabled, skipping polling setup"):(console.error("Focus group not found with ID:",t),_(!1),Fe.error("Focus group not found",{description:`Could not find focus group with ID: ${t}`}))})}),()=>{Te&&window.clearInterval(Te),$e&&window.clearInterval($e)}},[t,e,We,_t]);const Is=te=>{if(!te||!te.sections||!Array.isArray(te.sections))return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const ae=te.sections[0];if(!ae)return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const Te=Be=>Be.questions&&Array.isArray(Be.questions)&&Be.questions.length>0?{content:Be.questions[0].content,itemId:Be.questions[0].id,type:"question"}:Be.activities&&Array.isArray(Be.activities)&&Be.activities.length>0?{content:Be.activities[0].content,itemId:Be.activities[0].id,type:"activity"}:null;let $e=Te(ae);if(!$e&&ae.subsections&&Array.isArray(ae.subsections)){for(const Be of ae.subsections)if($e=Te(Be),$e)break}return $e?{content:$e.content,sectionId:ae.id,itemId:$e.itemId}:{content:`Welcome to our focus group session on "${ae.title||"our topic"}". Let's begin our discussion.`,sectionId:ae.id,itemId:"section-intro"}},ra=async()=>{var te,ae,Te,$e,Be,Mt;if(t)try{Fe.info("Starting focus group session...",{description:"The session is now ready for AI moderation."});try{const Ue=await er.getModeratorStatus(t),nt=(ae=(te=Ue==null?void 0:Ue.data)==null?void 0:te.status)==null?void 0:ae.moderator_position;nt?console.log("📍 Preserving existing moderator position:",nt):(await er.setModeratorPosition(t,((Be=($e=(Te=u==null?void 0:u.discussionGuide)==null?void 0:Te.sections)==null?void 0:$e[0])==null?void 0:Be.id)||"welcome"),console.log("🚀 Moderator position initialized to start of discussion guide (first time)"))}catch(Ue){console.warn("Failed to check/initialize moderator position:",Ue)}await bt.update(t,{status:"active"});try{const Ue=Is(u==null?void 0:u.discussionGuide),nt={id:`msg-${Date.now()}`,senderId:"moderator",text:Ue.content,timestamp:new Date,type:"question"},ye=await bt.sendMessage(t,{senderId:"moderator",text:nt.text,type:"question"});(Mt=ye==null?void 0:ye.data)!=null&&Mt.message_id&&(nt.id=ye.data.message_id),W(nt),console.log("🚀 Initial moderator message created:",{content:Ue.content,sectionId:Ue.sectionId,itemId:Ue.itemId})}catch(Ue){console.warn("Failed to create initial moderator message:",Ue)}Fe.success("Focus group session started",{description:"The discussion has begun. Use the control panel below to moderate."})}catch(Ue){console.error("Error starting session:",Ue),Fe.error("Error starting session",{description:"There was a problem connecting to the server."})}},W=te=>{i(ae=>ae.find($e=>$e.id===te.id)?(console.log("🔧 [handleNewMessage] Message already exists, skipping:",te.id),ae):(console.log("🔧 [handleNewMessage] Adding new message:",te.id),[...ae,te]))},Ie=async te=>{const ae=[...r],Te=ae.findIndex($e=>$e.id===te);if(Te!==-1){const $e=ae[Te],Be=!$e.highlighted;if(ae[Te]={...$e,highlighted:Be},i(ae),t)try{!te.startsWith("local-")&&!te.startsWith("msg-")?await bt.updateMessageHighlight(t,te,Be):console.log("Skipping database update for local message:",te)}catch(Mt){console.error("Error updating message highlight state:",Mt),Fe.error("Failed to save highlight state",{description:"The highlight may not persist if the page is refreshed."})}}},Ve=te=>f.find(ae=>ae.id===te||ae._id===te),ut=()=>{const te=r.map($e=>{var Ue;let Be;return $e.senderId==="moderator"?Be="AI Moderator":$e.senderId==="facilitator"?Be="Human Facilitator":Be=((Ue=Ve($e.senderId))==null?void 0:Ue.name)||"Unknown",`[${$e.timestamp.toLocaleTimeString()}] ${Be}: ${$e.text}`}).join(` - -`),ae=document.createElement("a"),Te=new Blob([te],{type:"text/plain"});ae.href=URL.createObjectURL(Te),ae.download=`focus-group-${t}-transcript.txt`,document.body.appendChild(ae),ae.click(),document.body.removeChild(ae),Fe.success("Transcript downloaded",{description:"The focus group transcript has been saved to your device."})},tt=(te,ae)=>{const Te=ft=>{const Zt=ft.match(/^\[([^\]]+)\]:\s*(.*)$/);return Zt?Zt[2].trim():ft.trim()},$e=ft=>ft.toLowerCase().replace(/[^\w\s]/g," ").replace(/\s+/g," ").trim(),Be=(ft,Zt)=>{const ln=$e(ft),hn=$e(Zt);if(ln===hn)return 1;if(ln.includes(hn)||hn.includes(ln))return Math.min(ln.length,hn.length)/Math.max(ln.length,hn.length);const Un=ln.split(" "),kr=hn.split(" "),xl=Un.filter(En=>kr.includes(En)&&En.length>2);return Un.length===0||kr.length===0?0:xl.length/Math.max(Un.length,kr.length)},Mt=typeof te=="object"&&te!==null,Ue=Mt?te.text:Te(te),nt=Mt?te.original:te;let ye=null,Jt="";if(ae&&(ye=r.find(ft=>ft.id===ae),ye?Jt="direct_message_id_match":console.warn(`Message ID ${ae} not found in current messages array`)),ye||(ye=r.find(ft=>ft.text.includes(nt)),ye&&(Jt="exact_full_match")),ye||(ye=r.find(ft=>ft.text.includes(Ue)),ye&&(Jt="exact_text_match")),ye||(ye=r.find(ft=>Ue.includes(ft.text.trim())),ye&&(Jt="reverse_exact_match")),!ye){const ft=Ue.toLowerCase();ye=r.find(Zt=>Zt.text.toLowerCase().includes(ft)||ft.includes(Zt.text.toLowerCase())),ye&&(Jt="case_insensitive_match")}if(!ye){const ft=r.map(Zt=>({message:Zt,similarity:Be(Ue,Zt.text)})).filter(Zt=>Zt.similarity>.7).sort((Zt,ln)=>ln.similarity-Zt.similarity);ft.length>0&&(ye=ft[0].message,Jt=`fuzzy_match_${Math.round(ft[0].similarity*100)}%`)}if(!ye){const Zt=$e(Ue).split(" ").filter(ln=>ln.length>3);Zt.length>0&&(ye=r.find(ln=>{const hn=$e(ln.text);return Zt.every(Un=>hn.includes(Un))}),ye&&(Jt="partial_word_match"))}ye?(console.log(`Quote match found using strategy: ${Jt}`,{quoteType:Mt?"QuoteData":"string",providedMessageId:ae,extractedText:Ue,matchedMessage:ye.text.substring(0,100),matchedMessageId:ye.id,originalQuote:nt.substring(0,100)}),g("chat"),setTimeout(()=>{const ft=document.getElementById(`message-${ye.id}`);ft&&(T||ft.scrollIntoView({behavior:"smooth",block:"center"}),ft.style.backgroundColor="#fbbf24",ft.style.transition="background-color 0.3s ease",setTimeout(()=>{ft.style.backgroundColor=""},2e3))},100)):(console.warn("Quote match failed",{quoteType:Mt?"QuoteData":"string",providedMessageId:ae,originalQuote:nt.substring(0,100),extractedText:Ue.substring(0,100),totalMessages:r.length,messageSample:r.slice(0,3).map(ft=>({id:ft.id,text:ft.text.substring(0,50)}))}),Fe.warning("Message not found",{description:"Could not locate the original message for this quote. The quote may have been paraphrased by the AI."}))},St=te=>{l(ae=>{const Te=new Set(ae.map(Be=>Be.id)),$e=te.filter(Be=>!Te.has(Be.id));return[...ae,...$e]})},on=async te=>{if(!t)return;const ae=c.find(Te=>Te.id===te);if(ae)try{"source"in ae&&ae.source==="generated"&&await er.deleteKeyTheme(t,te),l(c.filter(Te=>Te.id!==te))}catch(Te){console.error("Error deleting theme:",Te),Fe.error("Failed to delete theme",{description:"There was an error removing the theme. Please try again."})}},dt=y.useCallback(async(te,ae)=>{if(t)try{await er.setModeratorPosition(t,te,ae),Fe.success("Moderator position updated",{description:"The moderator has been moved to the selected section."})}catch(Te){console.error("Error setting moderator position:",Te),Fe.error("Failed to update moderator position",{description:"There was an error updating the moderator position."})}},[t]),_n=y.useCallback(async te=>{if(console.log("💾 handleDiscussionGuideSave called:",{hasId:!!t,isEditingGuideContent:E,timestamp:new Date().toISOString()}),!!t)try{await bt.update(t,{discussionGuide:te}),E?(M.current&&(M.current={...M.current,discussionGuide:te}),console.log("⚠️ Skipping focus group state update during editing to preserve focus")):(console.log("🔄 Updating focus group state (not editing)"),d(ae=>ae?{...ae,discussionGuide:te}:null))}catch(ae){throw console.error("Error saving discussion guide:",ae),ae}},[t,E]),an=y.useCallback(te=>{console.log("🔄 handleGuideEditingStateChange called:",{editing:te,timestamp:new Date().toISOString(),currentIsEditingGuideContent:E}),k(te),O(te),!te&&M.current&&(console.log("📝 Updating focus group state after editing ended"),d(M.current))},[E]),rn=y.useCallback(()=>{j(te=>!te)},[]),yr=y.useCallback((te,ae,Te,$e,Be,Mt,Ue)=>{Q({isOpen:!0,sectionId:te,itemId:ae,content:Te,sectionTitle:$e,itemTitle:Be,itemType:Mt,metadata:Ue})},[]),Rs=()=>{if(m)return{sectionId:m.current_section_id,sectionTitle:m.current_section,itemId:m.current_item_id,itemTitle:m.current_item}},Xn=()=>{if(r.length!==0)return r[r.length-1].id},V=()=>{const te=Xn();if(!te||r.length===0)return new Date;const ae=r.find(Te=>Te.id===te);return ae?ae.timestamp:new Date},ve=async()=>{if(t){et(!0),Xe(!1),N(!1),Fe.info("Analyzing discussion for key themes...",{description:"This may take a moment as we process the entire conversation."});try{const te=await er.generateKeyThemes(t);te.data&&te.data.themes?(Xe(!0),Fe.success(`Generated ${te.data.themes.length} key themes`,{description:"New themes have been added to the analysis."}),l(ae=>[...ae,...te.data.themes])):(Xe(!0),Fe.warning("No new themes were generated",{description:"Try again when the discussion has more content."}))}catch(te){console.error("Error generating key themes:",te),N(!0),Fe.error("Failed to generate key themes",{description:"There was an error analyzing the discussion. Please try again."})}}},de=()=>{et(!1),Xe(!1),N(!1)},Ee=()=>{ue||we(new Date),ke(!0)},jt=te=>{D(ae=>[...ae,te].sort((Te,$e)=>$e.createdAt.getTime()-Te.createdAt.getTime())),window.notesPanelAddNote&&window.notesPanelAddNote(te)},Gn=te=>{const ae=r.find(Te=>Te.id===te);ae?(g("chat"),setTimeout(()=>{const Te=document.getElementById(`message-${ae.id}`);Te&&(T||Te.scrollIntoView({behavior:"smooth",block:"center"}),Te.style.backgroundColor="#fbbf24",Te.style.transition="background-color 0.3s ease",setTimeout(()=>{Te.style.backgroundColor=""},2e3))},100)):Fe.info("Message not found",{description:"Could not locate the original message for this note."})};y.useEffect(()=>{r.length>0&&!ue&&we(new Date)},[r.length,ue]),y.useEffect(()=>{I.current=T,T||Xt()},[T]);const as=te=>{ee(ae=>ae.includes(te)?ae.filter(Te=>Te!==te):[...ae,te])};return C?a.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[a.jsx(ja,{}),a.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[a.jsx("div",{className:"flex justify-center items-center",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),a.jsx("p",{className:"mt-4 text-slate-600",children:"Loading focus group..."})]})]}):u?a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(ja,{}),$&&a.jsx("div",{className:`w-full transition-all duration-300 ${ot?"bg-green-500":Ke?"bg-yellow-500":"bg-red-500"}`,children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between py-2 text-white text-sm font-medium",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${ot?"bg-white animate-pulse":Ke?"bg-white animate-spin":"bg-white"}`}),a.jsx("span",{children:ot?"Real-time updates active - Changes appear instantly":Ke?"Connecting to real-time updates...":"Real-time updates unavailable - Using periodic refresh"}),_t&&a.jsx("span",{className:"text-xs opacity-75 ml-2",title:_t,children:"(Connection error)"})]}),a.jsx("button",{onClick:()=>z(!1),className:"ml-4 text-white hover:text-gray-200 transition-colors",title:"Hide status bar","aria-label":"Hide connection status",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}),!$&&a.jsx("div",{className:"fixed top-20 right-4 z-40",children:a.jsx("button",{onClick:()=>z(!0),className:`px-3 py-1 rounded-full text-white text-xs font-medium shadow-lg transition-all duration-200 hover:shadow-xl ${ot?"bg-green-500 hover:bg-green-600":Ke?"bg-yellow-500 hover:bg-yellow-600":"bg-red-500 hover:bg-red-600"}`,title:ot?"WebSocket connected - Show status bar":Ke?"WebSocket connecting - Show status bar":"WebSocket disconnected - Show status bar",children:a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:`w-2 h-2 rounded-full bg-white ${ot?"animate-pulse":""}`}),a.jsx("span",{children:ot?"Live":Ke?"Connecting":"Offline"})]})})}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(X,{variant:"ghost",onClick:()=>e("/focus-groups"),className:"mr-2",children:a.jsx(Wp,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-2xl font-bold text-slate-900",children:u.name}),a.jsx("p",{className:"text-slate-600",children:new Date(u.date).toLocaleString()}),a.jsxs("div",{className:"flex items-center mt-1",children:[a.jsx(xa,{className:"h-3 w-3 text-slate-500 mr-1"}),a.jsx(_r,{variant:"secondary",className:"text-xs",children:u.llm_model==="gpt-4.1"?"GPT-4.1":u.llm_model==="gpt-5"?"GPT-5":"Gemini 2.5 Pro"})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4 mt-4 sm:mt-0",children:[a.jsxs(X,{variant:"outline",onClick:()=>x(!b),className:b?"bg-blue-50 text-blue-600":"",children:[a.jsx(B_,{className:"mr-2 h-4 w-4"}),"AI Dashboard"]}),a.jsxs(X,{variant:"outline",onClick:()=>R(!0),children:[a.jsx(UE,{className:"mr-2 h-4 w-4"}),"AI Model"]}),a.jsxs(X,{variant:"outline",onClick:ut,children:[a.jsx(Jc,{className:"mr-2 h-4 w-4"}),"Download Transcript"]})]})]}),wt&&a.jsx("div",{className:"mb-6",children:a.jsx(GT,{isActive:wt,isComplete:Ct,hasError:nn,label:"Analyzing discussion for key themes",onComplete:de,className:"max-w-4xl mx-auto"})}),a.jsx(O$e,{discussionGuide:u.discussionGuide,moderatorStatus:m,onSectionSelect:dt,onSetPosition:yr,onSave:_n,focusGroupId:t||"",isOpen:A,onToggle:rn,onEditingChange:an}),a.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 h-[calc(100vh-12rem)]",children:[a.jsx(fde,{participants:f,selectedParticipantIds:Ae,onToggleParticipantFilter:as}),a.jsx("div",{className:"flex-1 flex flex-col",children:a.jsxs(hl,{defaultValue:"chat",value:p,onValueChange:g,className:"w-full h-full flex flex-col",children:[a.jsxs(Ka,{className:"grid grid-cols-4 mb-4",children:[a.jsxs(gn,{value:"chat",className:"flex items-center",children:[a.jsx(To,{className:"h-4 w-4 mr-2"}),"Discussion"]}),a.jsxs(gn,{value:"themes",className:"flex items-center",children:[a.jsx(hu,{className:"h-4 w-4 mr-2"}),"Key Themes"]}),a.jsxs(gn,{value:"notes",className:"flex items-center",children:[a.jsx(Wy,{className:"h-4 w-4 mr-2"}),"Notes"]}),a.jsxs(gn,{value:"analytics",className:"flex items-center",children:[a.jsx(B_,{className:"h-4 w-4 mr-2"}),"Analytics"]})]}),a.jsx(vn,{value:"chat",className:"m-0 flex-1 flex flex-col h-0",children:r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[a.jsx("p",{className:"text-lg text-slate-600",children:"No messages yet. Start the session to begin the discussion."}),a.jsxs(X,{onClick:ra,size:"lg",className:"flex items-center gap-2",children:[a.jsx(d5,{className:"h-5 w-5"}),"Start Session"]})]}):a.jsx(Bde,{messages:r,modeEvents:s,personas:f,isSpeaking:!1,focusGroupId:t||"",isAiModeActive:w,selectedParticipantIds:Ae,onToggleHighlight:Ie,onAdvanceDiscussion:()=>null,onNewMessage:W,onStatusChange:Je,isEditingDiscussionGuide:T})}),a.jsx(vn,{value:"themes",className:"m-0",children:a.jsx(zde,{themes:c,messages:r,personas:f,focusGroupId:t||"",onThemesGenerated:St,onThemeDelete:on,onQuoteClick:tt,onGenerateKeyThemes:ve})}),a.jsx(vn,{value:"notes",className:"m-0",style:{height:"calc(100% - 3.5rem)"},children:a.jsx("div",{className:"h-full",children:a.jsx(I$e,{focusGroupId:t||"",focusGroupName:u==null?void 0:u.name,onNoteClick:Gn})})}),a.jsx(vn,{value:"analytics",className:"m-0",children:a.jsx(N$e,{messages:r,themes:c,personas:f})})]})})]})]}),r.length>0&&a.jsx("div",{className:"fixed bottom-6 right-6 z-40",children:a.jsx(X,{onClick:Ee,className:"rounded-full h-12 w-12 p-0 shadow-lg",title:"Take a quick note",children:a.jsx(Wy,{className:"h-5 w-5"})})}),a.jsx(R$e,{isOpen:le,onClose:()=>ke(!1),focusGroupId:t||"",associatedMessageId:Xn(),sectionInfo:Rs(),messageTimestamp:V(),onNoteSaved:jt}),a.jsx(eu,{open:G.isOpen,onOpenChange:te=>Q(ae=>({...ae,isOpen:te})),children:a.jsxs(Lc,{children:[a.jsxs(Fc,{children:[a.jsx(Bc,{children:"Set Moderator Position"}),a.jsxs(tu,{children:['Are you sure you want to set the moderator position to "',G.itemTitle,'" in section "',G.sectionTitle,'"? This will make the moderator ask this question in the chat.']})]}),a.jsxs(Uc,{children:[a.jsx(X,{variant:"outline",disabled:G.isLoading,onClick:()=>Q({isOpen:!1}),children:"Cancel"}),a.jsxs(X,{disabled:G.isLoading,onClick:async()=>{var te,ae,Te,$e,Be,Mt,Ue,nt,ye,Jt;if(!(!t||!G.sectionId||!G.itemId||!G.content)){Q(ft=>({...ft,isLoading:!0}));try{await er.setModeratorPosition(t,G.sectionId,G.itemId);let ft=[],Zt=!1,ln=G.content;const hn=(te=G.metadata)==null?void 0:te.visual_asset,Un=!!(hn!=null&&hn.filename),kr=hn==null?void 0:hn.filename;if(console.log("🔍 MANUAL POSITION DEBUG:",{itemType:G.itemType,hasImageAttached:Un,visualAsset:hn,assetFilename:kr,content:G.content,sectionTitle:G.sectionTitle,itemTitle:G.itemTitle,contentLength:(ae=G.content)==null?void 0:ae.length}),Un&&G.content&&kr)if(console.log("🔍 VISUAL ASSET DEBUG:",{originalContent:G.content,visualAsset:hn,displayReference:hn==null?void 0:hn.display_reference,filename:kr,contentLength:G.content.length}),kr){ft=[kr],Zt=!0,console.log("🎨 MANUAL POSITION: Creative review detected, will activate visual context for:",kr);try{console.log("🎨 MANUAL MODE: Requesting AI description for",kr);const En=await bt.describeAsset(t,kr);if(En.data.description){const lk=(hn==null?void 0:hn.display_reference)||"the asset";ln=G.content.replace(lk,`${lk} - ${En.data.description}`),console.log("✅ MANUAL MODE: Enhanced question with AI description"),console.log("🔍 Original:",G.content),console.log("🔍 Enhanced:",ln)}}catch(En){console.error("⚠️ MANUAL MODE: Failed to generate AI description:",En),console.error("⚠️ Error response data:",(Te=En.response)==null?void 0:Te.data),console.error("⚠️ Error status:",($e=En.response)==null?void 0:$e.status),console.error("⚠️ Error headers:",(Be=En.response)==null?void 0:Be.headers),console.error("⚠️ Full axios error:",{message:En.message,code:En.code,status:(Mt=En.response)==null?void 0:Mt.status,statusText:(Ue=En.response)==null?void 0:Ue.statusText,url:(nt=En.config)==null?void 0:nt.url,method:(ye=En.config)==null?void 0:ye.method}),Fe.warning("AI description failed",{description:"Using original question text. Image will still be available to participants."})}}else console.warn("⚠️ MANUAL POSITION: Creative review detected but no asset filename extracted from content");const xl={id:`msg-${Date.now()}`,senderId:"moderator",text:ln,timestamp:new Date,type:"question",visualAsset:Un&&hn?{filename:kr,displayReference:hn.display_reference}:void 0};console.log("📤 Sending moderator message to API:",{text:ln,attachedAssets:ft,activatesVisualContext:Zt});try{const En=await bt.sendMessage(t,{senderId:"moderator",text:ln,type:"question",attached_assets:ft,activates_visual_context:Zt,visualAsset:Un&&hn?{filename:kr,displayReference:hn.display_reference}:void 0});(Jt=En==null?void 0:En.data)!=null&&Jt.message_id?(xl.id=En.data.message_id,console.log("✅ Message API call successful, assigned ID:",xl.id)):console.warn("⚠️ Message API call succeeded but no message_id returned:",En==null?void 0:En.data)}catch(En){console.error("❌ Failed to save message to API:",En),Fe.warning("Message display only",{description:"The moderator message is shown locally but may not be saved to the server."})}console.log("📨 Adding moderator message to UI:",{messageId:xl.id,text:xl.text,hasAssets:ft.length>0}),W(xl),Q({isOpen:!1}),console.log("✅ Set position complete, moderator message added to UI"),Fe.success("Moderator position set",{description:`Position set to "${G.itemTitle}" in "${G.sectionTitle}"`})}catch(ft){console.error("Error setting moderator position:",ft),Q(Zt=>({...Zt,isLoading:!1})),Fe.error("Failed to set moderator position",{description:"There was an error setting the moderator position."})}}},className:"flex items-center gap-2",children:[G.isLoading&&a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),G.isLoading?"Generating detailed image description...":"Confirm"]})]})]})}),a.jsx(eu,{open:B,onOpenChange:R,children:a.jsxs(Lc,{children:[a.jsxs(Fc,{children:[a.jsx(Bc,{children:"AI Model Settings"}),a.jsx(tu,{children:"Choose which AI model to use for generating responses and discussion guides in this focus group."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(xa,{className:"h-4 w-4 text-slate-500"}),a.jsx("span",{className:"text-sm font-medium",children:"Current Model:"}),a.jsx(_r,{variant:"secondary",children:(u==null?void 0:u.llm_model)==="gpt-4.1"?"GPT-4.1":(u==null?void 0:u.llm_model)==="gpt-5"?"GPT-5":"Gemini 2.5 Pro"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Select AI Model:"}),a.jsxs(Bn,{value:L,onValueChange:te=>{console.log("🔧 Model selection changed:",{from:L,to:te}),Y(te)},children:[a.jsx($n,{className:"mt-1",children:a.jsx(Hn,{placeholder:"Select AI model"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),a.jsx(ie,{value:"gpt-4.1",children:"GPT-4.1"}),a.jsx(ie,{value:"gpt-5",children:"GPT-5"})]})]})]}),L==="gpt-5"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Reasoning Effort:"}),a.jsxs(Bn,{value:q,onValueChange:J,children:[a.jsx($n,{className:"mt-1",children:a.jsx(Hn,{placeholder:"Select reasoning effort"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"minimal",children:"Minimal - Fast responses"}),a.jsx(ie,{value:"low",children:"Low - Quick thinking"}),a.jsx(ie,{value:"medium",children:"Medium - Balanced (default)"}),a.jsx(ie,{value:"high",children:"High - Deep reasoning"})]})]}),a.jsx("p",{className:"text-xs text-slate-600 mt-1",children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx("p",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how thoroughly GPT-5 thinks and how detailed responses are"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Response Verbosity:"}),a.jsxs(Bn,{value:me,onValueChange:F,children:[a.jsx($n,{className:"mt-1",children:a.jsx(Hn,{placeholder:"Select verbosity level"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"low",children:"Low - Concise responses"}),a.jsx(ie,{value:"medium",children:"Medium - Balanced length (default)"}),a.jsx(ie,{value:"high",children:"High - Detailed responses"})]})]}),a.jsx("p",{className:"text-xs text-slate-600 mt-1",children:"Controls how detailed and lengthy GPT-5's responses will be"}),a.jsx("p",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how thoroughly GPT-5 thinks and how detailed responses are"})]})]}),a.jsxs("div",{className:"text-xs text-slate-600",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Gemini 2.5 Pro:"})," Google's advanced model, great for creative and analytical tasks."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"GPT-4.1:"})," OpenAI's latest model, excellent for conversational and reasoning tasks."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"GPT-5:"})," OpenAI's newest model with advanced reasoning and customizable response styles."]})]})]}),a.jsxs(Uc,{children:[a.jsx(X,{variant:"outline",onClick:()=>R(!1),disabled:oe,children:"Cancel"}),a.jsxs(X,{onClick:()=>{console.log("🔧 Update button clicked:",{selectedModel:L,selectedReasoningEffort:q,selectedVerbosity:me,currentModel:u==null?void 0:u.llm_model,isDisabled:oe||L===(u==null?void 0:u.llm_model)&&(L!=="gpt-5"||q===(u==null?void 0:u.reasoning_effort)&&me===(u==null?void 0:u.verbosity))}),fn(L,q,me)},disabled:oe||L===(u==null?void 0:u.llm_model)&&(L!=="gpt-5"||q===((u==null?void 0:u.reasoning_effort)||"medium")&&me===((u==null?void 0:u.verbosity)||"medium")),children:[oe&&a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),oe?"Updating...":"Update Model"]})]})]})}),a.jsx(k$e,{focusGroupId:t,personas:f,isVisible:b,onToggle:()=>x(!b)})]}):a.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[a.jsx(ja,{}),a.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Focus group not found"}),a.jsx("p",{className:"mt-2 text-slate-600",children:"We couldn't find the focus group you're looking for."}),a.jsxs(X,{onClick:()=>e("/focus-groups"),className:"mt-4",children:[a.jsx(Wp,{className:"mr-2 h-4 w-4"})," Back to Focus Groups"]})]})]})},ILe=({title:t,description:e})=>a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:t}),a.jsx("p",{className:"text-slate-600 mt-1",children:e})]}),a.jsxs("div",{className:"mt-4 sm:mt-0 flex gap-2",children:[a.jsx(X,{variant:"outline",children:"Export Data"}),a.jsx(X,{children:"Generate Report"})]})]}),RC=({title:t,value:e,changePercentage:n,icon:r})=>a.jsx(lt,{className:"p-6 hover:shadow-md transition-shadow",children:a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:t}),a.jsx("h3",{className:"text-2xl font-bold mt-1",children:e}),a.jsxs("p",{className:`${n>=0?"text-green-500":"text-red-500"} text-xs mt-1`,children:[n>=0?"↑":"↓"," ",Math.abs(n),"% from last month"]})]}),a.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:a.jsx(r,{className:"h-6 w-6 text-primary"})})]})}),RLe=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],MLe=[{id:"1",title:"User Interface Feedback",description:"Users consistently mentioned difficulty with the navigation menu on mobile devices.",source:"Mobile App Focus Group",date:"2023-06-12",sentiment:"negative"},{id:"2",title:"Feature Adoption",description:'The new search functionality is well-received, with 85% of users rating it as "very useful".',source:"Product Testing Group",date:"2023-06-10",sentiment:"positive"},{id:"3",title:"Pricing Strategy",description:"Price-conscious users expressed willingness to pay up to 20% more for premium features.",source:"Pricing Model Analysis",date:"2023-06-08",sentiment:"positive"},{id:"4",title:"Competitive Analysis",description:"Users who switched from competitor products cited our streamlined onboarding as a key factor.",source:"Customer Journey Mapping",date:"2023-06-05",sentiment:"positive"}],DLe=()=>a.jsxs("div",{className:"space-y-6",children:[a.jsxs(lt,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Research Activity"}),a.jsx("div",{className:"h-64",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(wW,{data:RLe,margin:{top:10,right:30,left:0,bottom:0},children:[a.jsx(ig,{strokeDasharray:"3 3"}),a.jsx(sl,{dataKey:"name"}),a.jsx(ol,{}),a.jsx(ni,{}),a.jsx(so,{type:"monotone",dataKey:"users",stackId:"1",stroke:"#8884d8",fill:"#8884d8",name:"Synthetic Users"}),a.jsx(so,{type:"monotone",dataKey:"groups",stackId:"2",stroke:"#82ca9d",fill:"#82ca9d",name:"Focus Groups"}),a.jsx(so,{type:"monotone",dataKey:"interactions",stackId:"3",stroke:"#ffc658",fill:"#ffc658",name:"Interactions"})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs(lt,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Recent AI Insights"}),a.jsxs("div",{className:"space-y-4",children:[MLe.slice(0,3).map(t=>a.jsx("div",{className:"border-b pb-4 last:border-b-0 last:pb-0",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:`p-2 rounded-full mr-3 ${t.sentiment==="positive"?"bg-green-100":t.sentiment==="negative"?"bg-red-100":"bg-slate-100"}`,children:a.jsx(du,{className:`h-4 w-4 ${t.sentiment==="positive"?"text-green-600":t.sentiment==="negative"?"text-red-600":"text-slate-600"}`})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:t.title}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.description}),a.jsxs("div",{className:"flex items-center text-xs text-muted-foreground mt-2",children:[a.jsx("span",{children:t.source}),a.jsx("span",{className:"mx-2",children:"•"}),a.jsx("span",{children:t.date})]})]})]})},t.id)),a.jsx(X,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"View All Insights"})]})]}),a.jsxs(lt,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Upcoming Research Tasks"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-blue-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Website Redesign Feedback"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus group scheduled for Jun 20"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-purple-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Mobile App User Testing"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"8 participants needed by Jun 25"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-amber-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-amber-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Pricing Strategy Evaluation"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Create discussion guide by Jun 22"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-green-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-green-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Product Onboarding Flow"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Results analysis due Jun 30"})]})]}),a.jsx(X,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"Manage Research Calendar"})]})]})]})]}),$Le=[{name:"18-24",value:15},{name:"25-34",value:35},{name:"35-44",value:25},{name:"45-54",value:15},{name:"55+",value:10}],LLe=()=>a.jsxs(lt,{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Synthetic Persona Analytics"}),a.jsx(X,{variant:"outline",size:"sm",children:"View Demographics"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Demographics"}),a.jsx("div",{className:"h-60",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(rk,{children:[a.jsx(ni,{}),a.jsx(bo,{data:$Le,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,fill:"#FFDEE2",label:!0})]})})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Distribution"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Age: 25-34"}),a.jsx("span",{children:"35%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-400 rounded-full",style:{width:"35%"}})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Tech Savvy"}),a.jsx("span",{children:"72%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-300 rounded-full",style:{width:"72%"}})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Brand Loyal"}),a.jsx("span",{children:"58%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-500 rounded-full",style:{width:"58%"}})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Price Sensitive"}),a.jsx("span",{children:"67%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-200 rounded-full",style:{width:"67%"}})})]})]})]})]}),a.jsx("div",{className:"flex justify-center mt-6",children:a.jsx(X,{onClick:()=>window.location.href="/synthetic-users",children:"Manage Synthetic Personas"})})]}),FLe=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],F$=[{name:"Very Positive",value:25,color:"#4ade80"},{name:"Positive",value:40,color:"#a3e635"},{name:"Neutral",value:20,color:"#93c5fd"},{name:"Negative",value:10,color:"#fb923c"},{name:"Very Negative",value:5,color:"#f87171"}],ULe=[{name:"Navigation",count:42},{name:"Performance",count:28},{name:"UX Design",count:36},{name:"Features",count:22},{name:"Onboarding",count:18}],BLe=()=>{const t=lr();return a.jsxs(lt,{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Focus Group Insights"}),a.jsx(X,{variant:"outline",size:"sm",onClick:()=>t("/focus-groups"),children:"View All Sessions"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Session Analytics"}),a.jsx("div",{className:"h-60",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(wW,{data:FLe,margin:{top:10,right:30,left:0,bottom:0},children:[a.jsx(ig,{strokeDasharray:"3 3"}),a.jsx(sl,{dataKey:"name"}),a.jsx(ol,{}),a.jsx(ni,{}),a.jsx(so,{type:"monotone",dataKey:"interactions",stroke:"#8884d8",fill:"#8884d8",name:"User Interactions"})]})})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Feedback Sentiment"}),a.jsx("div",{className:"h-60",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(rk,{children:[a.jsx(ni,{}),a.jsx(bo,{data:F$,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:e,percent:n})=>`${e} ${(n*100).toFixed(0)}%`,children:F$.map((e,n)=>a.jsx(Rg,{fill:e.color},`cell-${n}`))}),a.jsx(Na,{})]})})})]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Topic Frequency Analysis"}),a.jsx("div",{className:"h-60",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(bW,{data:ULe,margin:{top:5,right:30,left:20,bottom:5},children:[a.jsx(ig,{strokeDasharray:"3 3"}),a.jsx(sl,{dataKey:"name"}),a.jsx(ol,{}),a.jsx(ni,{}),a.jsx(Na,{}),a.jsx(yl,{dataKey:"count",name:"Mentions",fill:"#8884d8"})]})})})]}),a.jsx("div",{className:"flex justify-center",children:a.jsx(X,{onClick:()=>t("/focus-groups"),children:"Manage Focus Groups"})})]})},HLe=()=>{const[t,e]=y.useState("overview");return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(ja,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsx(ILe,{title:"Dashboard",description:"Monitor and analyze your research insights"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[a.jsx(RC,{title:"Total Synthetic Users",value:48,changePercentage:12,icon:Fr}),a.jsx(RC,{title:"Active Focus Groups",value:7,changePercentage:5,icon:Wo}),a.jsx(RC,{title:"Research Insights",value:124,changePercentage:18,icon:hu})]}),a.jsxs(hl,{value:t,onValueChange:e,className:"glass-panel rounded-xl p-6",children:[a.jsxs(Ka,{className:"grid w-full grid-cols-3 mb-6",children:[a.jsx(gn,{value:"overview",children:"Overview"}),a.jsx(gn,{value:"users",children:"Synthetic Users"}),a.jsx(gn,{value:"focus-groups",children:"Focus Groups"})]}),a.jsx(vn,{value:"overview",children:a.jsx(DLe,{})}),a.jsx(vn,{value:"users",children:a.jsx(LLe,{})}),a.jsx(vn,{value:"focus-groups",children:a.jsx(BLe,{})})]})]})]})},LW=y.forwardRef(({...t},e)=>a.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));LW.displayName="Breadcrumb";const FW=y.forwardRef(({className:t,...e},n)=>a.jsx("ol",{ref:n,className:Pe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));FW.displayName="BreadcrumbList";const py=y.forwardRef(({className:t,...e},n)=>a.jsx("li",{ref:n,className:Pe("inline-flex items-center gap-1.5",t),...e}));py.displayName="BreadcrumbItem";const vj=y.forwardRef(({asChild:t,className:e,...n},r)=>{const i=t?Go:"a";return a.jsx(i,{ref:r,className:Pe("transition-colors hover:text-foreground",e),...n})});vj.displayName="BreadcrumbLink";const UW=y.forwardRef(({className:t,...e},n)=>a.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Pe("font-normal text-foreground",t),...e}));UW.displayName="BreadcrumbPage";const yj=({children:t,className:e,...n})=>a.jsx("li",{role:"presentation","aria-hidden":"true",className:Pe("[&>svg]:size-3.5",e),...n,children:t??a.jsx(fs,{})});yj.displayName="BreadcrumbSeparator";function zLe({persona:t}){const e=t.id==="0",n=t.id==="1";return a.jsxs(lt,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"h-16 w-16 rounded-full bg-muted flex items-center justify-center",children:a.jsx("img",{src:Ag(t),alt:t.name,className:"h-16 w-16 rounded-full object-cover"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-sf text-xl font-semibold",children:t.name}),a.jsx("p",{className:"text-muted-foreground",children:t.occupation})]})]}),a.jsxs("div",{className:"mt-6 space-y-4",children:[a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Fr,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Demographics"}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[t.age," ",t.gender?a.jsxs(a.Fragment,{children:["• ",t.gender]}):null,t.ethnicity?a.jsxs(a.Fragment,{children:[" • ",t.ethnicity]}):null]}),t.education&&a.jsx("p",{className:"sidebar-sub-item",children:t.education}),t.socialGrade&&a.jsxs("p",{className:"sidebar-sub-item",children:["Social Grade: ",t.socialGrade]}),t.householdIncome&&a.jsxs("p",{className:"sidebar-sub-item",children:["Household Income: ",t.householdIncome]}),t.householdComposition&&a.jsxs("p",{className:"sidebar-sub-item",children:["Household: ",t.householdComposition]})]})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(rZ,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Location"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.location}),t.livingSituation&&a.jsx("p",{className:"sidebar-sub-item",children:t.livingSituation})]})]}),t.interests&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(V_,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Interests"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.interests})]})]}),t.mediaConsumption&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(RS,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Media"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.mediaConsumption})]})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-sm mb-3",children:"Digital Behavior"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Tech Savviness"}),a.jsxs("span",{children:[t.techSavviness,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${t.techSavviness}%`}})})]}),t.brandLoyalty!==void 0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Brand Loyalty"}),a.jsxs("span",{children:[t.brandLoyalty,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${t.brandLoyalty}%`}})})]}),t.priceConsciousness!==void 0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Price Sensitivity"}),a.jsxs("span",{children:[t.priceConsciousness,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${t.priceConsciousness}%`}})})]}),t.environmentalConcern!==void 0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Environmental Concern"}),a.jsxs("span",{children:[t.environmentalConcern,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${t.environmentalConcern}%`}})})]}),t.deviceUsage&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-medium mt-3",children:"Device Usage"}),a.jsx("p",{className:"sidebar-sub-item text-xs",children:t.deviceUsage})]}),t.shoppingHabits&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-medium mt-3",children:"Shopping Habits"}),a.jsx("p",{className:"sidebar-sub-item text-xs",children:t.shoppingHabits})]})]})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-sm mb-3",children:"Additional Information"}),a.jsxs("div",{className:"space-y-2",children:[t.brandPreferences&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(V_,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:t.brandPreferences})]}),t.communicationPreferences&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Qp,{className:"sidebar-icon"}),a.jsxs("span",{className:"text-muted-foreground text-sm",children:["Prefers: ",t.communicationPreferences]})]}),t.deviceUsage&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(sZ,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:t.deviceUsage})]}),t.shoppingHabits&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(lZ,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:t.shoppingHabits})]}),t.additionalInformation&&typeof t.additionalInformation=="string"&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(ZJ,{className:"sidebar-icon"}),a.jsx("div",{className:"sidebar-sub-item",children:t.additionalInformation.split(` -`).map((r,i)=>a.jsx("div",{className:"mb-1",children:r.trim().startsWith("•")||r.trim().startsWith("-")?r.trim().substring(1).trim():r.trim()},i))})]}),e&&a.jsxs("div",{className:"pt-2 space-y-2",children:[a.jsxs("div",{className:"sidebar-section",children:[a.jsx(XO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Maintains an extensive network of financial and luxury industry contacts"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Ky,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Owns vacation properties in the Cotswolds and South of France"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(RS,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Collector of rare first-edition books and limited-edition art prints"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(JO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Significant investment portfolio with focus on sustainable luxury ventures"})]})]}),n&&a.jsxs("div",{className:"pt-2 space-y-2",children:[a.jsxs("div",{className:"sidebar-section",children:[a.jsx(RS,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Active in industry panels, luxury brand collaborations, follows influencers in luxury & design"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Ky,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Modern flat in exclusive Chelsea, accessible to boutique services"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(JO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Uses premium digital payment & secure banking for HNWIs"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(XO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Respected network in London's luxury sector; attends exclusive events"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Qp,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Seeks autonomy, bespoke service, and acknowledgment for taste"})]})]})]})]})]})]})}function VLe({persona:t}){var e,n,r,i,s,o,c,l,u;return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(Xv,{className:"h-5 w-5 text-primary mr-2"}),a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Goals"})]}),a.jsx("ul",{className:"space-y-2",children:(e=t.goals)==null?void 0:e.map((d,f)=>a.jsxs("li",{className:"flex items-start",children:[a.jsx("div",{className:"h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center mt-0.5 mr-3",children:a.jsx("span",{className:"text-xs text-primary font-medium",children:f+1})}),a.jsx("p",{className:"text-sm",children:d})]},f))})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(p5,{className:"h-5 w-5 text-amber-500 mr-2"}),a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Frustrations"})]}),a.jsx("ul",{className:"space-y-2",children:(n=t.frustrations)==null?void 0:n.map((d,f)=>a.jsxs("li",{className:"text-sm flex items-start",children:[a.jsx("span",{className:"text-amber-500 mr-2",children:"•"}),a.jsx("span",{children:d})]},f))})]})}),a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(ma,{className:"h-5 w-5 text-green-500 mr-2"}),a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Motivations"})]}),a.jsx("ul",{className:"space-y-2",children:(r=t.motivations)==null?void 0:r.map((d,f)=>a.jsxs("li",{className:"text-sm flex items-start",children:[a.jsx("span",{className:"text-green-500 mr-2",children:"•"}),a.jsx("span",{children:d})]},f))})]})})]}),a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Think, Feel, Do"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(du,{className:"h-5 w-5 text-blue-500 mr-2"}),a.jsx("h4",{className:"font-medium text-sm",children:"Thinks"})]}),a.jsx("ul",{className:"space-y-2",children:(s=(i=t.thinkFeelDo)==null?void 0:i.thinks)==null?void 0:s.map((d,f)=>a.jsxs("li",{className:"text-sm bg-blue-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(V_,{className:"h-5 w-5 text-red-500 mr-2"}),a.jsx("h4",{className:"font-medium text-sm",children:"Feels"})]}),a.jsx("ul",{className:"space-y-2",children:(c=(o=t.thinkFeelDo)==null?void 0:o.feels)==null?void 0:c.map((d,f)=>a.jsxs("li",{className:"text-sm bg-red-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(ma,{className:"h-5 w-5 text-green-500 mr-2"}),a.jsx("h4",{className:"font-medium text-sm",children:"Does"})]}),a.jsx("ul",{className:"space-y-2",children:(u=(l=t.thinkFeelDo)==null?void 0:l.does)==null?void 0:u.map((d,f)=>a.jsxs("li",{className:"text-sm bg-green-50 p-2 rounded-md",children:['"',d,'"']},f))})]})]})]})})]})}function GLe({persona:t}){var n,r,i,s,o;const e=[{trait:"Openness",value:((n=t.oceanTraits)==null?void 0:n.openness)||50},{trait:"Conscientiousness",value:((r=t.oceanTraits)==null?void 0:r.conscientiousness)||50},{trait:"Extraversion",value:((i=t.oceanTraits)==null?void 0:i.extraversion)||50},{trait:"Agreeableness",value:((s=t.oceanTraits)==null?void 0:s.agreeableness)||50},{trait:"Neuroticism",value:((o=t.oceanTraits)==null?void 0:o.neuroticism)||50}];return a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"OCEAN Personality Traits"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{className:"h-80",children:a.jsx(zc,{width:"100%",height:"100%",children:a.jsxs(E$e,{outerRadius:90,data:e,children:[a.jsx(gK,{}),a.jsx(dh,{dataKey:"trait"}),a.jsx(uh,{domain:[0,100]}),a.jsx(Ug,{name:"Personality",dataKey:"value",stroke:"#8884d8",fill:"#8884d8",fillOpacity:.5})]})})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Openness to Experience"}),a.jsxs("span",{className:"font-medium",children:[e[0].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${e[0].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[0].value>75?"Highly creative and curious":e[0].value>50?"Somewhat imaginative and open to new ideas":"Practical and prefers routine"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Conscientiousness"}),a.jsxs("span",{className:"font-medium",children:[e[1].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${e[1].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[1].value>75?"Highly organized and responsible":e[1].value>50?"Generally reliable and hardworking":"Spontaneous and flexible"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Extraversion"}),a.jsxs("span",{className:"font-medium",children:[e[2].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${e[2].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[2].value>75?"Highly sociable and outgoing":e[2].value>50?"Moderately social and talkative":"Reserved and reflective"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Agreeableness"}),a.jsxs("span",{className:"font-medium",children:[e[3].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${e[3].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[3].value>75?"Highly cooperative and compassionate":e[3].value>50?"Generally kind and helpful":"Competitive and challenging"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Neuroticism"}),a.jsxs("span",{className:"font-medium",children:[e[4].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-red-500 rounded-full",style:{width:`${e[4].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[4].value>75?"Highly sensitive and prone to stress":e[4].value>50?"Moderately reactive to challenges":"Emotionally stable and resilient"})]})]})]})]})})}function KLe({persona:t}){var r;const e=(i,s)=>{const o=[a.jsx(tZ,{className:"sidebar-icon"},"grid"),a.jsx(uZ,{className:"sidebar-icon"},"smartphone"),a.jsx(eZ,{className:"sidebar-icon"},"laptop"),a.jsx(JJ,{className:"sidebar-icon"},"grid2x2")];return o[s%o.length]},n=()=>t.scenarioType?t.scenarioType:"Life Scenarios";return a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:n()}),a.jsx("div",{className:"space-y-4",children:(r=t.scenarios)==null?void 0:r.map((i,s)=>a.jsx("div",{className:"bg-slate-50 p-4 rounded-lg border",children:a.jsxs("div",{className:"sidebar-section",children:[e(i,s),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-sm mb-2",children:["Scenario ",s+1]}),a.jsx("p",{className:"text-sm",children:i})]})]})},s))})]})})}function WLe(){const t=lr();return a.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:a.jsxs(lt,{className:"w-96 text-center p-6",children:[a.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Persona Not Found"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"The persona you're looking for couldn't be found."}),a.jsx(X,{onClick:()=>t("/synthetic-users"),children:"Return to Personas"})]})})}function Ut({className:t,...e}){return a.jsx("div",{className:Pe("animate-pulse rounded-md bg-muted",t),...e})}function qLe(){return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(ja,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex items-center mb-6 relative",children:[a.jsx(Ut,{className:"absolute left-0 top-0 h-10 w-20"}),a.jsx(Ut,{className:"h-8 w-48 mx-auto"}),a.jsx(Ut,{className:"absolute right-0 top-0 h-10 w-32"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[a.jsx("div",{className:"lg:col-span-1",children:a.jsxs(lt,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(Ut,{className:"h-16 w-16 rounded-full"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Ut,{className:"h-6 w-32 mb-2"}),a.jsx(Ut,{className:"h-4 w-24"})]})]}),a.jsxs("div",{className:"mt-6 space-y-4",children:[a.jsxs("div",{className:"flex items-start",children:[a.jsx(Ut,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Ut,{className:"h-4 w-20 mb-2"}),a.jsx(Ut,{className:"h-3 w-40 mb-1"}),a.jsx(Ut,{className:"h-3 w-36"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx(Ut,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Ut,{className:"h-4 w-16 mb-2"}),a.jsx(Ut,{className:"h-3 w-32"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx(Ut,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Ut,{className:"h-4 w-16 mb-2"}),a.jsx(Ut,{className:"h-3 w-full"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx(Ut,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Ut,{className:"h-4 w-12 mb-2"}),a.jsx(Ut,{className:"h-3 w-full"})]})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx(Ut,{className:"h-4 w-32 mb-3"}),a.jsx("div",{className:"space-y-3",children:[...Array(4)].map((t,e)=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx(Ut,{className:"h-3 w-24"}),a.jsx(Ut,{className:"h-3 w-8"})]}),a.jsx(Ut,{className:"h-1.5 w-full rounded-full"})]},e))})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx(Ut,{className:"h-4 w-36 mb-3"}),a.jsx("div",{className:"space-y-2",children:[...Array(3)].map((t,e)=>a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ut,{className:"h-4 w-4 mr-2"}),a.jsx(Ut,{className:"h-3 w-40"})]},e))})]})]})]})}),a.jsxs("div",{className:"lg:col-span-2",children:[a.jsxs("div",{className:"grid w-full grid-cols-3 gap-2 mb-6",children:[a.jsx(Ut,{className:"h-10 w-full"}),a.jsx(Ut,{className:"h-10 w-full"}),a.jsx(Ut,{className:"h-10 w-full"})]}),a.jsx(lt,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ut,{className:"h-6 w-48"}),a.jsx(Ut,{className:"h-4 w-full"}),a.jsx(Ut,{className:"h-4 w-full"}),a.jsx(Ut,{className:"h-4 w-3/4"}),a.jsxs("div",{className:"mt-8 space-y-4",children:[a.jsx(Ut,{className:"h-6 w-32"}),a.jsx(Ut,{className:"h-4 w-full"}),a.jsx(Ut,{className:"h-4 w-full"}),a.jsx(Ut,{className:"h-4 w-2/3"})]}),a.jsxs("div",{className:"mt-8 space-y-4",children:[a.jsx(Ut,{className:"h-6 w-40"}),a.jsx(Ut,{className:"h-4 w-full"}),a.jsx(Ut,{className:"h-4 w-full"}),a.jsx(Ut,{className:"h-4 w-5/6"})]})]})})]})]})]})]})}function YLe({message:t,onLoginSuccess:e,onCancel:n}){const{login:r}=Zo(),i=lr(),[s,o]=y.useState("user"),[c,l]=y.useState("pass"),[u,d]=y.useState(!1),f=async()=>{if(!s||!c){ne.error("Please enter username and password");return}d(!0);try{await r(s,c),ne.success("Login successful"),e&&e()}catch(p){console.error("Login error:",p),ne.error("Login failed",{description:"Please check your credentials and try again"})}finally{d(!1)}},h=()=>{n?n():i("/synthetic-users")};return a.jsxs(lt,{className:"max-w-md mx-auto shadow-lg",children:[a.jsxs(Ei,{children:[a.jsx(Yi,{children:"Login Required"}),a.jsx(fT,{children:t||"You need to log in to save personas to the database"})]}),a.jsxs(Ot,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(ms,{htmlFor:"username",children:"Username"}),a.jsx(Ht,{id:"username",placeholder:"Username",value:s,onChange:p=>o(p.target.value),disabled:u})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ms,{htmlFor:"password",children:"Password"}),a.jsx(Ht,{id:"password",type:"password",placeholder:"Password",value:c,onChange:p=>l(p.target.value),disabled:u})]}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Default credentials: user / pass"})]}),a.jsxs(hT,{className:"flex justify-between",children:[a.jsx(X,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),a.jsx(X,{onClick:f,disabled:u,children:u?a.jsxs(a.Fragment,{children:[a.jsx(eo,{className:"h-4 w-4 mr-2 animate-spin"}),"Logging in..."]}):"Login"})]})]})}function QLe({persona:t,onSave:e,onCancel:n}){var j,T,k,I,E,O,M,U,D,B,R,L,Y,q,J,me;const r={...t,education:t.education||"",interests:t.interests||"",brandLoyalty:t.brandLoyalty||0,priceConsciousness:t.priceConsciousness||0,environmentalConcern:t.environmentalConcern||0,hasPurchasingPower:t.hasPurchasingPower||!1,hasChildren:t.hasChildren||!1,goals:t.goals||[],frustrations:t.frustrations||[],motivations:t.motivations||[],scenarios:t.scenarios||[],oceanTraits:t.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:t.thinkFeelDo||{thinks:[],feels:[],does:[]}},[i,s]=y.useState(r),[o,c]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(null);y.useState(!1);const{isAuthenticated:h,token:p}=Zo();y.useEffect(()=>{(async()=>{l&&h&&p&&(u(!1),d&&await A())})()},[h,p,l]);const g=(F,oe)=>{s(se=>({...se,[F]:oe}))},m=(F,oe)=>{s(se=>({...se,oceanTraits:{...se.oceanTraits,[F]:oe}}))},v=F=>{s(oe=>({...oe,[F]:[...oe[F]||[],""]}))},b=(F,oe,se)=>{s(le=>{const ke=[...le[F]||[]];return ke[oe]=se,{...le,[F]:ke}})},x=(F,oe)=>{s(se=>{const le=[...se[F]||[]];return le.splice(oe,1),{...se,[F]:le}})},w=(F,oe,se)=>{s(le=>{const ke={...le.thinkFeelDo},ue=[...ke[F]||[]];return ue[oe]=se,ke[F]=ue,{...le,thinkFeelDo:ke}})},S=F=>{s(oe=>{var le;const se={...oe.thinkFeelDo,[F]:[...((le=oe.thinkFeelDo)==null?void 0:le[F])||[],""]};return{...oe,thinkFeelDo:se}})},C=(F,oe)=>{s(se=>{const le={...se.thinkFeelDo},ke=[...le[F]||[]];return ke.splice(oe,1),le[F]=ke,{...se,thinkFeelDo:le}})},_=()=>{d&&(ne.error("Login canceled - Persona changes not saved"),u(!1),f(null),n())},A=async()=>{if(d){c(!0);try{const F={...d};delete F._id,delete F.isDbPersona;const oe=await $r.create(F),se={...d,id:oe.data._id||oe.data.id,_id:oe.data._id||oe.data.id,isDbPersona:!0};ne.success("Persona saved to database successfully"),u(!1),f(null),e(se)}catch(F){console.error("Error saving after login:",F),ne.error("Failed to save to database after login"),u(!1),f(null)}finally{c(!1)}}};return l?a.jsxs("div",{className:"max-w-5xl mx-auto bg-background p-6",children:[a.jsx("div",{className:"flex justify-between items-center mb-6",children:a.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Authentication Required"})}),a.jsx("p",{className:"mb-6 text-muted-foreground",children:"Login is required to save personas to the database. You can either:"}),a.jsxs("ul",{className:"list-disc ml-6 mt-2 mb-6",children:[a.jsx("li",{children:"Log in to save this persona to the database"}),a.jsx("li",{children:"Cancel to discard your changes"})]}),a.jsx(YLe,{message:"Login is required to save your persona to the database",onLoginSuccess:A,onCancel:_})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(X,{variant:"ghost",onClick:n,className:"mr-2",children:a.jsx(Wp,{className:"h-5 w-5"})}),a.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Edit Persona"})]}),a.jsxs(X,{onClick:async()=>{c(!0);try{const F=i._id||i.id,oe={...i};oe._id&&delete oe._id,delete oe.isDbPersona;let se;if(F&&typeof F=="string"&&F.startsWith("local-")){console.log("Creating new persona instead of updating local ID"),se=await $r.create(oe),ne.success("Persona saved to database");const le={...i,id:se.data._id||se.data.id,_id:se.data._id||se.data.id,isDbPersona:!0};e(le)}else if(F){se=await $r.update(F,oe),ne.success("Persona updated successfully");const le={...i,isDbPersona:!0};e(le)}else{se=await $r.create(oe);const le={...i,id:se.data._id||se.data.id,_id:se.data._id||se.data.id,isDbPersona:!0};ne.success("Persona created successfully"),e(le)}}catch(F){console.error("Error saving persona:",F),F.response&&F.response.status===401?h&&p?(console.log("Auth error despite having token - token likely invalid"),ne.error("Authentication error - saving locally instead"),e(i)):(f(i),u(!0)):(ne.error("Failed to save persona"),e(i))}finally{c(!1)}},disabled:o,children:[o?a.jsx(eo,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(LE,{className:"h-4 w-4 mr-2"}),o?"Saving...":"Save Changes"]})]}),a.jsxs(hl,{defaultValue:"basic",children:[a.jsxs(Ka,{className:"grid w-full grid-cols-6",children:[a.jsx(gn,{value:"basic",children:"Basic"}),a.jsx(gn,{value:"cooper",children:"Cooper"}),a.jsx(gn,{value:"personality",children:"Personality"}),a.jsx(gn,{value:"demographics",children:"Demographics"}),a.jsx(gn,{value:"lifestyle",children:"Lifestyle"}),a.jsx(gn,{value:"extended",children:"Extended"})]}),a.jsx(vn,{value:"basic",className:"mt-6",children:a.jsx(lt,{children:a.jsx(Ot,{className:"p-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Name"}),a.jsx(Ht,{value:i.name||"",onChange:F=>g("name",F.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Age Range"}),a.jsxs(Bn,{value:i.age||"",onValueChange:F=>g("age",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select age range"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"18-24",children:"18-24"}),a.jsx(ie,{value:"25-34",children:"25-34"}),a.jsx(ie,{value:"35-44",children:"35-44"}),a.jsx(ie,{value:"45-54",children:"45-54"}),a.jsx(ie,{value:"55-64",children:"55-64"}),a.jsx(ie,{value:"65+",children:"65+"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Gender"}),a.jsxs(Bn,{value:i.gender||"",onValueChange:F=>g("gender",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select gender"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Male",children:"Male"}),a.jsx(ie,{value:"Female",children:"Female"}),a.jsx(ie,{value:"Non-binary",children:"Non-binary"}),a.jsx(ie,{value:"Other",children:"Other"})]})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Occupation"}),a.jsx(Ht,{value:i.occupation||"",onChange:F=>g("occupation",F.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Education"}),a.jsxs(Bn,{value:i.education||"",onValueChange:F=>g("education",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select education level"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"High School",children:"High School"}),a.jsx(ie,{value:"Some College",children:"Some College"}),a.jsx(ie,{value:"Associate's Degree",children:"Associate's Degree"}),a.jsx(ie,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),a.jsx(ie,{value:"Master's Degree",children:"Master's Degree"}),a.jsx(ie,{value:"PhD",children:"PhD"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Location"}),a.jsx(Ht,{value:i.location||"",onChange:F=>g("location",F.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Ethnicity (Optional)"}),a.jsxs(Bn,{value:i.ethnicity||"",onValueChange:F=>g("ethnicity",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select ethnicity"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"white",children:"White"}),a.jsx(ie,{value:"black",children:"Black"}),a.jsx(ie,{value:"asian",children:"Asian"}),a.jsx(ie,{value:"hispanic",children:"Hispanic/Latino"}),a.jsx(ie,{value:"native-american",children:"Native American"}),a.jsx(ie,{value:"middle-eastern",children:"Middle Eastern"}),a.jsx(ie,{value:"mixed",children:"Mixed"}),a.jsx(ie,{value:"other",children:"Other"}),a.jsx(ie,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personality"}),a.jsx(ht,{value:i.personality||"",onChange:F=>g("personality",F.target.value),rows:3})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Interests"}),a.jsx(ht,{value:i.interests||"",onChange:F=>g("interests",F.target.value),rows:3,placeholder:"Tech, travel, cooking, etc."})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Tech Savviness"}),a.jsxs("span",{className:"text-sm",children:[i.techSavviness,"%"]})]}),a.jsx(Sr,{value:[i.techSavviness],onValueChange:F=>g("techSavviness",F[0]),max:100,step:1})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Brand Loyalty"}),a.jsxs("span",{className:"text-sm",children:[i.brandLoyalty||0,"%"]})]}),a.jsx(Sr,{value:[i.brandLoyalty||0],onValueChange:F=>g("brandLoyalty",F[0]),max:100,step:1})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Price Consciousness"}),a.jsxs("span",{className:"text-sm",children:[i.priceConsciousness||0,"%"]})]}),a.jsx(Sr,{value:[i.priceConsciousness||0],onValueChange:F=>g("priceConsciousness",F[0]),max:100,step:1})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Environmental Concern"}),a.jsxs("span",{className:"text-sm",children:[i.environmentalConcern||0,"%"]})]}),a.jsx(Sr,{value:[i.environmentalConcern||0],onValueChange:F=>g("environmentalConcern",F[0]),max:100,step:1})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-sm font-medium",children:"Purchasing Power"}),a.jsx(bm,{checked:i.hasPurchasingPower||!1,onCheckedChange:F=>g("hasPurchasingPower",F)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-sm font-medium",children:"Has Children"}),a.jsx(bm,{checked:i.hasChildren||!1,onCheckedChange:F=>g("hasChildren",F)})]})]})]})]})})})}),a.jsxs(vn,{value:"cooper",className:"mt-6 space-y-6",children:[a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(i.goals||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:F||"",onChange:se=>b("goals",oe,se.target.value)}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>x("goals",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>v("goals"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(i.frustrations||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:F||"",onChange:se=>b("frustrations",oe,se.target.value)}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>x("frustrations",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>v("frustrations"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(i.motivations||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:F||"",onChange:se=>b("motivations",oe,se.target.value)}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>x("motivations",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>v("motivations"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),(((j=i.thinkFeelDo)==null?void 0:j.thinks)||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:F||"",onChange:se=>w("thinks",oe,se.target.value)}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>C("thinks",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>S("thinks"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),(((T=i.thinkFeelDo)==null?void 0:T.feels)||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:F||"",onChange:se=>w("feels",oe,se.target.value)}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>C("feels",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>S("feels"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),(((k=i.thinkFeelDo)==null?void 0:k.does)||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:F||"",onChange:se=>w("does",oe,se.target.value)}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>C("does",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>S("does"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("div",{className:"space-y-4 mb-6",children:a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Scenario Section Title"}),a.jsx(Ht,{value:i.scenarioType||"",onChange:F=>g("scenarioType",F.target.value),placeholder:"Life Scenarios"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'})]})}),a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(i.scenarios||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[a.jsx(ht,{value:F||"",onChange:se=>b("scenarios",oe,se.target.value),rows:2}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>x("scenarios",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>v("scenarios"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})})]}),a.jsx(vn,{value:"personality",className:"mt-6",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),a.jsxs("span",{className:"text-sm",children:[((I=i.oceanTraits)==null?void 0:I.openness)||50,"%"]})]}),a.jsx(Sr,{value:[((E=i.oceanTraits)==null?void 0:E.openness)||50],onValueChange:F=>m("openness",F[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),a.jsxs("span",{className:"text-sm",children:[((O=i.oceanTraits)==null?void 0:O.conscientiousness)||50,"%"]})]}),a.jsx(Sr,{value:[((M=i.oceanTraits)==null?void 0:M.conscientiousness)||50],onValueChange:F=>m("conscientiousness",F[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),a.jsxs("span",{className:"text-sm",children:[((U=i.oceanTraits)==null?void 0:U.extraversion)||50,"%"]})]}),a.jsx(Sr,{value:[((D=i.oceanTraits)==null?void 0:D.extraversion)||50],onValueChange:F=>m("extraversion",F[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),a.jsxs("span",{className:"text-sm",children:[((B=i.oceanTraits)==null?void 0:B.agreeableness)||50,"%"]})]}),a.jsx(Sr,{value:[((R=i.oceanTraits)==null?void 0:R.agreeableness)||50],onValueChange:F=>m("agreeableness",F[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),a.jsxs("span",{className:"text-sm",children:[((L=i.oceanTraits)==null?void 0:L.neuroticism)||50,"%"]})]}),a.jsx(Sr,{value:[((Y=i.oceanTraits)==null?void 0:Y.neuroticism)||50],onValueChange:F=>m("neuroticism",F[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),a.jsx(vn,{value:"demographics",className:"mt-6",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Grade"}),a.jsxs(Bn,{value:i.socialGrade||"",onValueChange:F=>g("socialGrade",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select social grade"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"A",children:"A - Higher managerial"}),a.jsx(ie,{value:"B",children:"B - Intermediate managerial"}),a.jsx(ie,{value:"C1",children:"C1 - Supervisory or clerical"}),a.jsx(ie,{value:"C2",children:"C2 - Skilled manual workers"}),a.jsx(ie,{value:"D",children:"D - Semi and unskilled manual workers"}),a.jsx(ie,{value:"E",children:"E - State pensioners, unemployed"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Income"}),a.jsxs(Bn,{value:i.householdIncome||"",onValueChange:F=>g("householdIncome",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select income range"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Under $25k",children:"Under $25,000"}),a.jsx(ie,{value:"$25k-$50k",children:"$25,000 - $50,000"}),a.jsx(ie,{value:"$50k-$75k",children:"$50,000 - $75,000"}),a.jsx(ie,{value:"$75k-$100k",children:"$75,000 - $100,000"}),a.jsx(ie,{value:"$100k-$150k",children:"$100,000 - $150,000"}),a.jsx(ie,{value:"$150k-$250k",children:"$150,000 - $250,000"}),a.jsx(ie,{value:"Over $250k",children:"Over $250,000"}),a.jsx(ie,{value:"Prefer not to say",children:"Prefer not to say"})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Composition"}),a.jsxs(Bn,{value:i.householdComposition||"",onValueChange:F=>g("householdComposition",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select household type"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Single person",children:"Single person"}),a.jsx(ie,{value:"Couple without children",children:"Couple without children"}),a.jsx(ie,{value:"Couple with children",children:"Couple with children"}),a.jsx(ie,{value:"Single parent",children:"Single parent"}),a.jsx(ie,{value:"Multi-generational",children:"Multi-generational"}),a.jsx(ie,{value:"Shared housing",children:"Shared housing"}),a.jsx(ie,{value:"Other",children:"Other"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Living Situation"}),a.jsxs(Bn,{value:i.livingSituation||"",onValueChange:F=>g("livingSituation",F),children:[a.jsx($n,{children:a.jsx(Hn,{placeholder:"Select living situation"})}),a.jsxs(Ln,{children:[a.jsx(ie,{value:"Own home",children:"Own home"}),a.jsx(ie,{value:"Rent apartment",children:"Rent apartment"}),a.jsx(ie,{value:"Rent house",children:"Rent house"}),a.jsx(ie,{value:"Live with family",children:"Live with family"}),a.jsx(ie,{value:"Student housing",children:"Student housing"}),a.jsx(ie,{value:"Assisted living",children:"Assisted living"}),a.jsx(ie,{value:"Other",children:"Other"})]})]})]})]})]})]})})}),a.jsx(vn,{value:"lifestyle",className:"mt-6",children:a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Media Consumption"}),a.jsx(ht,{value:i.mediaConsumption||"",onChange:F=>g("mediaConsumption",F.target.value),rows:3,placeholder:"TV shows, podcasts, news sources, social media platforms"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Describe media consumption habits and preferences"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Device Usage"}),a.jsx(ht,{value:i.deviceUsage||"",onChange:F=>g("deviceUsage",F.target.value),rows:3,placeholder:"Smartphone, laptop, tablet, smart TV, gaming console"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Primary devices and usage patterns"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Shopping Habits"}),a.jsx(ht,{value:i.shoppingHabits||"",onChange:F=>g("shoppingHabits",F.target.value),rows:3,placeholder:"Online vs in-store, frequency, preferred retailers"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Shopping behavior and preferences"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Brand Preferences"}),a.jsx(ht,{value:i.brandPreferences||"",onChange:F=>g("brandPreferences",F.target.value),rows:3,placeholder:"Favorite brands, brand values alignment"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred brands and reasoning"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Communication Preferences"}),a.jsx(ht,{value:i.communicationPreferences||"",onChange:F=>g("communicationPreferences",F.target.value),rows:3,placeholder:"Email, phone, text, video calls, in-person"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred communication methods and channels"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Payment Methods"}),a.jsx(ht,{value:i.paymentMethods||"",onChange:F=>g("paymentMethods",F.target.value),rows:3,placeholder:"Credit cards, digital wallets, cash, BNPL"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred payment methods and financial tools"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Purchase Behavior"}),a.jsx(ht,{value:i.purchaseBehaviour||"",onChange:F=>g("purchaseBehaviour",F.target.value),rows:3,placeholder:"Research habits, decision factors, impulse vs planned buying"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"How they approach making purchase decisions"})]})]})]})]})})}),a.jsxs(vn,{value:"extended",className:"mt-6 space-y-6",children:[a.jsx(lt,{children:a.jsxs(Ot,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Core Values"}),a.jsx(ht,{value:i.coreValues||"",onChange:F=>g("coreValues",F.target.value),rows:3,placeholder:"Key principles and values that guide decisions"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Lifestyle Choices"}),a.jsx(ht,{value:i.lifestyleChoices||"",onChange:F=>g("lifestyleChoices",F.target.value),rows:3,placeholder:"Health, fitness, diet, work-life balance preferences"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Activities"}),a.jsx(ht,{value:i.socialActivities||"",onChange:F=>g("socialActivities",F.target.value),rows:3,placeholder:"Social hobbies, community involvement, networking"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Category Knowledge"}),a.jsx(ht,{value:i.categoryKnowledge||"",onChange:F=>g("categoryKnowledge",F.target.value),rows:3,placeholder:"Expertise in specific product/service categories"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Decision Influences"}),a.jsx(ht,{value:i.decisionInfluences||"",onChange:F=>g("decisionInfluences",F.target.value),rows:3,placeholder:"What factors most influence their decisions"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Pain Points"}),a.jsx(ht,{value:i.painPoints||"",onChange:F=>g("painPoints",F.target.value),rows:3,placeholder:"Common challenges and friction points"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Journey Context"}),a.jsx(ht,{value:i.journeyContext||"",onChange:F=>g("journeyContext",F.target.value),rows:3,placeholder:"Current life stage and contextual factors"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Key Touchpoints"}),a.jsx(ht,{value:i.keyTouchpoints||"",onChange:F=>g("keyTouchpoints",F.target.value),rows:3,placeholder:"Important interaction points and channels"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Autonomy"}),a.jsx(ht,{value:((q=i.selfDeterminationNeeds)==null?void 0:q.autonomy)||"",onChange:F=>g("selfDeterminationNeeds",{...i.selfDeterminationNeeds,autonomy:F.target.value}),rows:2,placeholder:"Need for independence and self-direction"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Competence"}),a.jsx(ht,{value:((J=i.selfDeterminationNeeds)==null?void 0:J.competence)||"",onChange:F=>g("selfDeterminationNeeds",{...i.selfDeterminationNeeds,competence:F.target.value}),rows:2,placeholder:"Need to feel capable and effective"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Relatedness"}),a.jsx(ht,{value:((me=i.selfDeterminationNeeds)==null?void 0:me.relatedness)||"",onChange:F=>g("selfDeterminationNeeds",{...i.selfDeterminationNeeds,relatedness:F.target.value}),rows:2,placeholder:"Need for connection and belonging"})]})]})]})]})]})}),a.jsx(lt,{children:a.jsx(Ot,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(i.fears||[]).map((F,oe)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ht,{value:F,onChange:se=>b("fears",oe,se.target.value),placeholder:"Enter a fear or concern"}),a.jsx(X,{variant:"ghost",size:"icon",onClick:()=>x("fears",oe),children:a.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})})]},oe)),a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>v("fears"),className:"mt-2",children:[a.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personal Narrative"}),a.jsx(ht,{value:i.narrative||"",onChange:F=>g("narrative",F.target.value),rows:4,placeholder:"Personal story, background, key life experiences"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"A brief narrative that captures their personal story"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Additional Information"}),a.jsx(ht,{value:i.additionalInformation||"",onChange:F=>g("additionalInformation",F.target.value),rows:4,placeholder:"Any other relevant details or context"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Additional context or details not covered elsewhere"})]})]})})})]})]})]})}function XLe(){const{id:t}=RE(),e=Bi(),n=lr(),{navigationState:r,clearNavigationState:i}=ow(),[s,o]=y.useState(void 0),[c,l]=y.useState(!1),[u,d]=y.useState(!1),[f,h]=y.useState(!0);return y.useEffect(()=>{if(!t){h(!1);return}let m=!0;const b=new URLSearchParams(e.search).get("fromReview")==="true";return l(b),h(!0),(async()=>{try{const w=t.startsWith("local-")?t.substring(6):t,S=await $r.getById(w);if(S&&S.data){const C=S.data;if(m){console.log("Found persona in database:",C),o({...C,id:C.id||C._id,isDbPersona:!0}),h(!1);return}}console.error("Could not find persona with id:",t),m&&(o(void 0),h(!1),ne.error("Persona not found"))}catch(w){console.error("Error fetching persona:",w),m&&(o(void 0),h(!1),ne.error("Failed to load persona details"))}})(),()=>{m=!1}},[t,e.search]),{currentPersona:s,isEditing:u,isFromReview:c,isLoading:f,setIsEditing:d,handleGoBack:()=>{r.previousRoute&&r.previousRoute.startsWith("/focus-groups/")&&r.focusGroupId?n(`/focus-groups/${r.focusGroupId}`):r.previousRoute==="/focus-groups"&&r.focusGroupTab?r.isNewFocusGroup?n(`/focus-groups?mode=create&tab=${r.focusGroupTab}`):r.focusGroupId?n(`/focus-groups?mode=edit&id=${r.focusGroupId}&tab=${r.focusGroupTab}`):n("/focus-groups?mode=create&tab=participants"):n(c?"/synthetic-users?mode=create&tab=ai&step=review":"/synthetic-users")},handleSaveEdit:async m=>{try{d(!1);const v=m.isDbPersona||t&&t.length===24&&/^[0-9a-f]{24}$/i.test(t),b={...m};if(b._id&&delete b._id,delete b.isDbPersona,v&&t&&t.length===24&&/^[0-9a-f]{24}$/i.test(t)){const x=await $r.update(t,b);console.log("Updated persona in database:",x);const w={...m,isDbPersona:!0};o(w),ne.success("Persona updated in database successfully")}else{const x=await $r.create(b);console.log("Created new persona in database:",x.data);const w={...m,id:x.data._id||x.data.id,_id:x.data._id||x.data.id,isDbPersona:!0};o(w),ne.success("Persona saved to database successfully")}}catch(v){return console.error("Error saving persona:",v),v.response&&v.response.status===401?ne.error("Authentication error - Please log in to save personas"):v.response&&v.response.status===404?ne.error("API endpoint not found - Database service may be unavailable"):ne.error("Failed to save persona to database: "+(v.message||"Unknown error")),!1}return!0}}}function U$(){var g;const{currentPersona:t,isEditing:e,isFromReview:n,isLoading:r,setIsEditing:i,handleGoBack:s,handleSaveEdit:o}=XLe(),{navigationState:c}=ow(),[l,u]=y.useState(""),[d,f]=y.useState(!1);y.useEffect(()=>{var m;c.focusGroupId&&((m=c.previousRoute)!=null&&m.startsWith("/focus-groups/"))&&(async()=>{var b;try{const x=await bt.getById(c.focusGroupId);(b=x==null?void 0:x.data)!=null&&b.name&&u(x.data.name)}catch(x){console.error("Error fetching focus group name:",x)}})()},[c.focusGroupId,c.previousRoute]);const h=((g=c.previousRoute)==null?void 0:g.startsWith("/focus-groups/"))&&c.focusGroupId,p=async()=>{var m;if(t){f(!0);try{Fe.info("Generating persona profile...",{description:"Using GPT-4.1 to create a beautifully formatted markdown profile"});const v=t._id||t.id;console.log(`🔽 Frontend: Exporting profile for persona ${t.name} (ID: ${v})`);const b=await $r.exportProfile(v,{llm_model:"gpt-4.1",temperature:.3}),{markdown_content:x,persona_name:w,model_used:S,warning:C}=b.data;if(x){const _=new Date().toISOString().split("T")[0],j=`${w.replace(/[^a-zA-Z0-9\-\s]/g,"").replace(/\s+/g,"-").toLowerCase()}-profile-${_}.md`,T=document.createElement("a"),k=new Blob([x],{type:"text/markdown"});if(T.href=URL.createObjectURL(k),T.download=j,document.body.appendChild(T),T.click(),document.body.removeChild(T),C)Fe.success("Profile downloaded with fallback formatting",{description:`${w} profile saved as ${j}`});else{const I=S==="gpt-4.1"?"GPT-4.1":S;Fe.success("Profile downloaded successfully",{description:`${w} profile processed with ${I} and saved as ${j}`})}}else throw new Error("No markdown content received")}catch(v){console.error("Error exporting persona profile:",v),v.response?Fe.error("Failed to export profile",{description:((m=v.response.data)==null?void 0:m.error)||"Server error occurred"}):v.request?Fe.error("Network error",{description:"Unable to connect to the server"}):Fe.error("Export failed",{description:v.message||"An unexpected error occurred"})}finally{f(!1)}}};return r?a.jsx(qLe,{}):t?a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(ja,{}),a.jsx("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:e?a.jsx(QLe,{persona:t,onSave:o,onCancel:()=>i(!1)}):a.jsxs(a.Fragment,{children:[h&&a.jsx("div",{className:"mb-4",children:a.jsx(LW,{children:a.jsxs(FW,{children:[a.jsx(py,{children:a.jsxs(vj,{href:"/focus-groups",className:"flex items-center",children:[a.jsx(Ky,{className:"h-4 w-4 mr-1"}),"Focus Groups"]})}),a.jsx(yj,{}),a.jsx(py,{children:a.jsxs(vj,{href:`/focus-groups/${c.focusGroupId}`,className:"flex items-center",children:[a.jsx(Fr,{className:"h-4 w-4 mr-1"}),l||"Focus Group Session"]})}),a.jsx(yj,{}),a.jsx(py,{children:a.jsxs(UW,{className:"flex items-center",children:[a.jsx(Qp,{className:"h-4 w-4 mr-1"}),(t==null?void 0:t.name)||"Participant"]})})]})})}),a.jsxs("div",{className:"flex items-center mb-6 relative",children:[a.jsx(X,{variant:"ghost",onClick:s,className:"absolute left-0 top-0 flex items-center",children:a.jsx(Wp,{className:"h-5 w-5"})}),a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900 mx-auto",children:"Persona Profile"}),a.jsxs("div",{className:"absolute right-0 top-0 flex items-center gap-3",children:[a.jsxs(X,{variant:"outline",onClick:p,disabled:d,className:"hover-transition",children:[a.jsx(Jc,{className:"h-4 w-4 mr-2"}),d?"Generating...":"Download Profile"]}),a.jsxs(X,{onClick:()=>i(!0),children:[a.jsx(fZ,{className:"h-4 w-4 mr-2"}),"Edit Persona"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[a.jsx("div",{className:"lg:col-span-1",children:a.jsx(zLe,{persona:t})}),a.jsx("div",{className:"lg:col-span-2",children:a.jsxs(hl,{defaultValue:"cooper-profile",children:[a.jsxs(Ka,{className:"grid w-full grid-cols-3",children:[a.jsx(gn,{value:"cooper-profile",children:"Cooper Profile"}),a.jsx(gn,{value:"personality",children:"Personality"}),a.jsx(gn,{value:"scenarios",children:"Scenarios"})]}),a.jsx(vn,{value:"cooper-profile",className:"mt-6",children:a.jsx(VLe,{persona:t})}),a.jsx(vn,{value:"personality",className:"mt-6",children:a.jsx(GLe,{persona:t})}),a.jsx(vn,{value:"scenarios",className:"mt-6",children:a.jsx(KLe,{persona:t})})]})})]})]})})]}):a.jsx(WLe,{})}const JLe=Re.object({username:Re.string().min(3,"Username must be at least 3 characters"),password:Re.string().min(4,"Password must be at least 4 characters")});function ZLe(){var h;const t=lr(),e=Bi(),{login:n,loginWithMicrosoft:r,isAuthenticated:i,isMsalLoading:s}=Zo(),[o,c]=y.useState(!1),l=((h=e.state)==null?void 0:h.from)||"/";console.log("Login page - destination path:",l),y.useEffect(()=>{i&&(console.log("User already authenticated, redirecting from login page"),t("/",{replace:!0}))},[i,t]);const u=V0({resolver:G0(JLe),defaultValues:{username:"",password:""}});async function d(p){c(!0);try{await n(p.username,p.password)?(console.log("Login successful, received token, navigating to:",l),t(l,{replace:!0})):(console.error("Login succeeded but no token received"),c(!1))}catch(g){console.error("Login error in form handler:",g),c(!1)}}async function f(){try{await r(),console.log("Microsoft login successful, navigating to:",l),t(l,{replace:!0})}catch(p){console.error("Microsoft login error in form handler:",p)}}return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-gray-100 to-gray-200 dark:from-gray-900 dark:to-gray-800 px-4",children:a.jsxs(lt,{className:"w-full max-w-md",children:[a.jsxs(Ei,{className:"space-y-1",children:[a.jsx(Yi,{className:"text-2xl font-bold text-center",children:"Sign In"}),a.jsx(fT,{className:"text-center",children:"Enter your credentials to access your account"})]}),a.jsxs(Ot,{children:[a.jsx("div",{className:"mb-6",children:a.jsx(X,{type:"button",variant:"outline",className:"w-full bg-[#0078d4] hover:bg-[#106ebe] text-white border-[#0078d4] hover:border-[#106ebe]",onClick:f,disabled:o||s,children:s?a.jsxs(a.Fragment,{children:[a.jsx(eo,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in with Microsoft..."]}):a.jsxs(a.Fragment,{children:[a.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 21 21",fill:"currentColor",children:[a.jsx("path",{d:"M10 0H0v10h10V0z"}),a.jsx("path",{d:"M21 0H11v10h10V0z"}),a.jsx("path",{d:"M10 11H0v10h10V11z"}),a.jsx("path",{d:"M21 11H11v10h10V11z"})]}),"Sign in with Microsoft"]})})}),a.jsxs("div",{className:"relative mb-6",children:[a.jsx("div",{className:"absolute inset-0 flex items-center",children:a.jsx("div",{className:"w-full border-t border-gray-200"})}),a.jsx("div",{className:"relative flex justify-center text-sm",children:a.jsx("span",{className:"bg-white px-2 text-gray-500 dark:bg-gray-800 dark:text-gray-400",children:"Or continue with username"})})]}),a.jsx(W0,{...u,children:a.jsxs("form",{onSubmit:u.handleSubmit(d),className:"space-y-4",children:[a.jsx(yt,{control:u.control,name:"username",render:({field:p})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Username"}),a.jsx(gt,{children:a.jsx(Ht,{placeholder:"Enter your username",...p,disabled:o,autoComplete:"username"})}),a.jsx(vt,{})]})}),a.jsx(yt,{control:u.control,name:"password",render:({field:p})=>a.jsxs(pt,{children:[a.jsx(mt,{children:"Password"}),a.jsx(gt,{children:a.jsx(Ht,{placeholder:"Enter your password",type:"password",...p,disabled:o,autoComplete:"current-password"})}),a.jsx(vt,{})]})}),a.jsx(X,{type:"submit",className:"w-full",disabled:o||s,children:o?"Signing in...":"Sign In"})]})})]}),a.jsxs(hT,{className:"flex flex-col space-y-2",children:[a.jsx("div",{className:"text-sm text-center text-gray-500 mb-2",children:"Default account: user / pass"}),!o&&!s&&a.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[a.jsx(X,{variant:"outline",onClick:()=>t("/",{replace:!0}),className:"mt-2",children:"Return to Home"}),a.jsx(X,{variant:"link",onClick:()=>{localStorage.setItem("offline_mode","true");const p={username:"guest",email:"guest@example.com",role:"user"};localStorage.setItem("auth_token","offline-mode-token"),localStorage.setItem("user",JSON.stringify(p)),Fe.success("Offline mode activated",{description:"Using demo account with limited functionality"}),t("/",{replace:!0})},className:"text-sm text-gray-500",children:"Use offline mode"})]})]})]})})}function qu({children:t}){const{isAuthenticated:e,isLoading:n}=Zo(),r=Bi();return console.log("ProtectedRoute check:",{isAuthenticated:e,isLoading:n,path:r.pathname}),n?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary"})}):e?(console.log("User is authenticated, showing protected content"),a.jsx(a.Fragment,{children:t})):(console.log("Not authenticated, redirecting to login"),a.jsx(l5,{to:"/login",state:{from:r.pathname},replace:!0}))}const eFe=y.createContext({});let B$=!1;function tFe({children:t}){const{token:e}=Zo(),n=()=>{const i=e||localStorage.getItem("auth_token");return console.log("🔧 [GPT-5 Context] Getting token:",i?"Found":"Missing"),i||""};y.useEffect(()=>(B$||(console.log("🔧 [GPT-5 Context] Initializing singleton socket"),DW(n),B$=!0),console.log("🔧 [GPT-5 Context] Connecting socket"),$W(),()=>{}),[e]);const r={};return a.jsx(eFe.Provider,{value:r,children:t})}const BW=new XN(Qie);BW.initialize().catch(t=>{console.error("MSAL initialization error:",t)});function nFe({children:t}){return a.jsx(qie,{instance:BW,children:t})}const rFe=new $X,iFe=()=>a.jsx(FX,{client:rFe,children:a.jsx(MJ,{basename:"/semblance",children:a.jsx(nFe,{children:a.jsx(Jie,{children:a.jsx(tFe,{children:a.jsx(ide,{children:a.jsxs(pX,{children:[a.jsx(H9,{}),a.jsxs(EJ,{children:[a.jsx($s,{path:"/",element:a.jsx(ese,{})}),a.jsx($s,{path:"/login",element:a.jsx(ZLe,{})}),a.jsx($s,{path:"/synthetic-users",element:a.jsx(qu,{children:a.jsx(rde,{})})}),a.jsx($s,{path:"/synthetic-users/:id",element:a.jsx(qu,{children:a.jsx(U$,{})})}),a.jsx($s,{path:"/personas/:id",element:a.jsx(qu,{children:a.jsx(U$,{})})}),a.jsx($s,{path:"/focus-groups",element:a.jsx(qu,{children:a.jsx(dde,{})})}),a.jsx($s,{path:"/focus-groups/:id",element:a.jsx(qu,{children:a.jsx(OLe,{})})}),a.jsx($s,{path:"/dashboard",element:a.jsx(qu,{children:a.jsx(HLe,{})})}),a.jsx($s,{path:"/old-path",element:a.jsx(l5,{to:"/",replace:!0})}),a.jsx($s,{path:"*",element:a.jsx(tse,{})})]})]})})})})})})});u4(document.getElementById("root")).render(a.jsx(iFe,{})); diff --git a/dist/assets/index-KiCc6bNq.js b/dist/assets/index-KiCc6bNq.js new file mode 100644 index 00000000..6e6b742d --- /dev/null +++ b/dist/assets/index-KiCc6bNq.js @@ -0,0 +1,715 @@ +var ck=t=>{throw TypeError(t)};var tS=(t,e,n)=>e.has(t)||ck("Cannot "+n);var xe=(t,e,n)=>(tS(t,e,"read from private field"),n?n.call(t):e.get(t)),fn=(t,e,n)=>e.has(t)?ck("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Gt=(t,e,n,r)=>(tS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Wr=(t,e,n)=>(tS(t,e,"access private method"),n);var Bg=(t,e,n,r)=>({set _(i){Gt(t,e,i,n)},get _(){return xe(t,e,r)}});function UW(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Hg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function un(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var q$={exports:{}},Kb={},Y$={exports:{}},Jt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ag=Symbol.for("react.element"),BW=Symbol.for("react.portal"),HW=Symbol.for("react.fragment"),zW=Symbol.for("react.strict_mode"),VW=Symbol.for("react.profiler"),GW=Symbol.for("react.provider"),KW=Symbol.for("react.context"),WW=Symbol.for("react.forward_ref"),qW=Symbol.for("react.suspense"),YW=Symbol.for("react.memo"),QW=Symbol.for("react.lazy"),lk=Symbol.iterator;function XW(t){return t===null||typeof t!="object"?null:(t=lk&&t[lk]||t["@@iterator"],typeof t=="function"?t:null)}var Q$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X$=Object.assign,J$={};function Tf(t,e,n){this.props=t,this.context=e,this.refs=J$,this.updater=n||Q$}Tf.prototype.isReactComponent={};Tf.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Tf.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Z$(){}Z$.prototype=Tf.prototype;function vj(t,e,n){this.props=t,this.context=e,this.refs=J$,this.updater=n||Q$}var yj=vj.prototype=new Z$;yj.constructor=vj;X$(yj,Tf.prototype);yj.isPureReactComponent=!0;var uk=Array.isArray,eL=Object.prototype.hasOwnProperty,xj={current:null},tL={key:!0,ref:!0,__self:!0,__source:!0};function nL(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)eL.call(e,r)&&!tL.hasOwnProperty(r)&&(i[r]=e[r]);var c=arguments.length-2;if(c===1)i.children=n;else if(1>>1,J=I[Q];if(0>>1;Qi(ne,X))uei(F,ne)?(I[Q]=F,I[ue]=X,Q=ue):(I[Q]=ne,I[U]=X,Q=U);else if(uei(F,X))I[Q]=F,I[ue]=X,Q=ue;else break e}}return D}function i(I,D){var X=I.sortIndex-D.sortIndex;return X!==0?X:I.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var l=[],u=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(I){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=I)r(u),D.sortIndex=D.expirationTime,e(l,D);else break;D=n(u)}}function S(I){if(m=!1,w(I),!g)if(n(l)!==null)g=!0,L(C);else{var D=n(u);D!==null&&V(S,D.startTime-I)}}function C(I,D){g=!1,m&&(m=!1,b(j),j=-1),p=!0;var X=h;try{for(w(D),f=n(l);f!==null&&(!(f.expirationTime>D)||I&&!O());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,h=f.priorityLevel;var J=Q(f.expirationTime<=D);D=t.unstable_now(),typeof J=="function"?f.callback=J:f===n(l)&&r(l),w(D)}else r(l);f=n(l)}if(f!==null)var ye=!0;else{var U=n(u);U!==null&&V(S,U.startTime-D),ye=!1}return ye}finally{f=null,h=X,p=!1}}var _=!1,A=null,j=-1,P=5,k=-1;function O(){return!(t.unstable_now()-kI||125Q?(I.sortIndex=X,e(u,I),n(l)===null&&I===n(u)&&(m?(b(j),j=-1):m=!0,V(S,X-Q))):(I.sortIndex=J,e(l,I),g||p||(g=!0,L(C))),I},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(I){var D=h;return function(){var X=h;h=D;try{return I.apply(this,arguments)}finally{h=X}}}})(cL);aL.exports=cL;var cq=aL.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var lq=v,rs=cq;function Ae(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),RC=Object.prototype.hasOwnProperty,uq=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fk={},hk={};function dq(t){return RC.call(hk,t)?!0:RC.call(fk,t)?!1:uq.test(t)?hk[t]=!0:(fk[t]=!0,!1)}function fq(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function hq(t,e,n,r){if(e===null||typeof e>"u"||fq(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function wi(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Vr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Vr[t]=new wi(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Vr[e]=new wi(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Vr[t]=new wi(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Vr[t]=new wi(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Vr[t]=new wi(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Vr[t]=new wi(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Vr[t]=new wi(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Vr[t]=new wi(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Vr[t]=new wi(t,5,!1,t.toLowerCase(),null,!1,!1)});var wj=/[\-:]([a-z])/g;function Sj(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(wj,Sj);Vr[e]=new wi(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(wj,Sj);Vr[e]=new wi(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(wj,Sj);Vr[e]=new wi(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Vr[t]=new wi(t,1,!1,t.toLowerCase(),null,!1,!1)});Vr.xlinkHref=new wi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Vr[t]=new wi(t,1,!1,t.toLowerCase(),null,!0,!0)});function Cj(t,e,n,r){var i=Vr.hasOwnProperty(e)?Vr[e]:null;(i!==null?i.type!==0:r||!(2c||i[o]!==s[c]){var l=` +`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=c);break}}}finally{iS=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?$h(t):""}function pq(t){switch(t.tag){case 5:return $h(t.type);case 16:return $h("Lazy");case 13:return $h("Suspense");case 19:return $h("SuspenseList");case 0:case 2:case 15:return t=sS(t.type,!1),t;case 11:return t=sS(t.type.render,!1),t;case 1:return t=sS(t.type,!0),t;default:return""}}function LC(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Xu:return"Fragment";case Qu:return"Portal";case MC:return"Profiler";case _j:return"StrictMode";case DC:return"Suspense";case $C:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case dL:return(t.displayName||"Context")+".Consumer";case uL:return(t._context.displayName||"Context")+".Provider";case Aj:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case jj:return e=t.displayName||null,e!==null?e:LC(t.type)||"Memo";case nc:e=t._payload,t=t._init;try{return LC(t(e))}catch{}}return null}function mq(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return LC(e);case 8:return e===_j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Gc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function hL(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function gq(t){var e=hL(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Gg(t){t._valueTracker||(t._valueTracker=gq(t))}function pL(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=hL(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function my(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function FC(t,e){var n=e.checked;return Qn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function mk(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Gc(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function mL(t,e){e=e.checked,e!=null&&Cj(t,"checked",e,!1)}function UC(t,e){mL(t,e);var n=Gc(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?BC(t,e.type,n):e.hasOwnProperty("defaultValue")&&BC(t,e.type,Gc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function gk(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function BC(t,e,n){(e!=="number"||my(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Lh=Array.isArray;function hd(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Kg.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Cp(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Xh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vq=["Webkit","ms","Moz","O"];Object.keys(Xh).forEach(function(t){vq.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Xh[e]=Xh[t]})});function xL(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Xh.hasOwnProperty(t)&&Xh[t]?(""+e).trim():e+"px"}function bL(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=xL(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var yq=Qn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function VC(t,e){if(e){if(yq[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ae(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ae(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ae(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ae(62))}}function GC(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var KC=null;function Ej(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var WC=null,pd=null,md=null;function xk(t){if(t=ug(t)){if(typeof WC!="function")throw Error(Ae(280));var e=t.stateNode;e&&(e=Xb(e),WC(t.stateNode,t.type,e))}}function wL(t){pd?md?md.push(t):md=[t]:pd=t}function SL(){if(pd){var t=pd,e=md;if(md=pd=null,xk(t),e)for(t=0;t>>=0,t===0?32:31-(Tq(t)/Pq|0)|0}var Wg=64,qg=4194304;function Fh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function xy(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var c=o&~i;c!==0?r=Fh(c):(s&=o,s!==0&&(r=Fh(s)))}else o=n&~i,o!==0?r=Fh(o):s!==0&&(r=Fh(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function cg(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ys(e),t[e]=n}function Rq(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Zh),Nk=" ",Tk=!1;function HL(t,e){switch(t){case"keyup":return c7.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zL(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ju=!1;function u7(t,e){switch(t){case"compositionend":return zL(e);case"keypress":return e.which!==32?null:(Tk=!0,Nk);case"textInput":return t=e.data,t===Nk&&Tk?null:t;default:return null}}function d7(t,e){if(Ju)return t==="compositionend"||!Mj&&HL(t,e)?(t=UL(),Bv=Oj=vc=null,Ju=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ik(n)}}function WL(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?WL(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function qL(){for(var t=window,e=my();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=my(t.document)}return e}function Dj(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function b7(t){var e=qL(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&WL(n.ownerDocument.documentElement,n)){if(r!==null&&Dj(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=Rk(n,s);var o=Rk(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Zu=null,ZC=null,tp=null,e_=!1;function Mk(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;e_||Zu==null||Zu!==my(r)||(r=Zu,"selectionStart"in r&&Dj(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),tp&&Tp(tp,r)||(tp=r,r=Sy(ZC,"onSelect"),0nd||(t.current=o_[nd],o_[nd]=null,nd--)}function Pn(t,e){nd++,o_[nd]=t.current,t.current=e}var Kc={},ri=al(Kc),ki=al(!1),ru=Kc;function Hd(t,e){var n=t.type.contextTypes;if(!n)return Kc;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Oi(t){return t=t.childContextTypes,t!=null}function _y(){Ln(ki),Ln(ri)}function Hk(t,e,n){if(ri.current!==Kc)throw Error(Ae(168));Pn(ri,e),Pn(ki,n)}function rF(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ae(108,mq(t)||"Unknown",i));return Qn({},n,r)}function Ay(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Kc,ru=ri.current,Pn(ri,t),Pn(ki,ki.current),!0}function zk(t,e,n){var r=t.stateNode;if(!r)throw Error(Ae(169));n?(t=rF(t,e,ru),r.__reactInternalMemoizedMergedChildContext=t,Ln(ki),Ln(ri),Pn(ri,t)):Ln(ki),Pn(ki,n)}var fa=null,Jb=!1,xS=!1;function iF(t){fa===null?fa=[t]:fa.push(t)}function O7(t){Jb=!0,iF(t)}function cl(){if(!xS&&fa!==null){xS=!0;var t=0,e=xn;try{var n=fa;for(xn=1;t>=o,i-=o,ma=1<<32-Ys(e)+i|n<j?(P=A,A=null):P=A.sibling;var k=h(b,A,w[j],S);if(k===null){A===null&&(A=P);break}t&&A&&k.alternate===null&&e(b,A),x=s(k,x,j),_===null?C=k:_.sibling=k,_=k,A=P}if(j===w.length)return n(b,A),zn&&Cl(b,j),C;if(A===null){for(;jj?(P=A,A=null):P=A.sibling;var O=h(b,A,k.value,S);if(O===null){A===null&&(A=P);break}t&&A&&O.alternate===null&&e(b,A),x=s(O,x,j),_===null?C=O:_.sibling=O,_=O,A=P}if(k.done)return n(b,A),zn&&Cl(b,j),C;if(A===null){for(;!k.done;j++,k=w.next())k=f(b,k.value,S),k!==null&&(x=s(k,x,j),_===null?C=k:_.sibling=k,_=k);return zn&&Cl(b,j),C}for(A=r(b,A);!k.done;j++,k=w.next())k=p(A,b,j,k.value,S),k!==null&&(t&&k.alternate!==null&&A.delete(k.key===null?j:k.key),x=s(k,x,j),_===null?C=k:_.sibling=k,_=k);return t&&A.forEach(function(E){return e(b,E)}),zn&&Cl(b,j),C}function y(b,x,w,S){if(typeof w=="object"&&w!==null&&w.type===Xu&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Vg:e:{for(var C=w.key,_=x;_!==null;){if(_.key===C){if(C=w.type,C===Xu){if(_.tag===7){n(b,_.sibling),x=i(_,w.props.children),x.return=b,b=x;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===nc&&Kk(C)===_.type){n(b,_.sibling),x=i(_,w.props),x.ref=vh(b,_,w),x.return=b,b=x;break e}n(b,_);break}else e(b,_);_=_.sibling}w.type===Xu?(x=ql(w.props.children,b.mode,S,w.key),x.return=b,b=x):(S=Yv(w.type,w.key,w.props,null,b.mode,S),S.ref=vh(b,x,w),S.return=b,b=S)}return o(b);case Qu:e:{for(_=w.key;x!==null;){if(x.key===_)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(b,x.sibling),x=i(x,w.children||[]),x.return=b,b=x;break e}else{n(b,x);break}else e(b,x);x=x.sibling}x=ES(w,b.mode,S),x.return=b,b=x}return o(b);case nc:return _=w._init,y(b,x,_(w._payload),S)}if(Lh(w))return g(b,x,w,S);if(fh(w))return m(b,x,w,S);tv(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(b,x.sibling),x=i(x,w),x.return=b,b=x):(n(b,x),x=jS(w,b.mode,S),x.return=b,b=x),o(b)):n(b,x)}return y}var Vd=cF(!0),lF=cF(!1),Ny=al(null),Ty=null,sd=null,Uj=null;function Bj(){Uj=sd=Ty=null}function Hj(t){var e=Ny.current;Ln(Ny),t._currentValue=e}function l_(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function vd(t,e){Ty=t,Uj=sd=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ti=!0),t.firstContext=null)}function As(t){var e=t._currentValue;if(Uj!==t)if(t={context:t,memoizedValue:e,next:null},sd===null){if(Ty===null)throw Error(Ae(308));sd=t,Ty.dependencies={lanes:0,firstContext:t}}else sd=sd.next=t;return e}var kl=null;function zj(t){kl===null?kl=[t]:kl.push(t)}function uF(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,zj(e)):(n.next=i.next,i.next=n),e.interleaved=n,Pa(t,r)}function Pa(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var rc=!1;function Vj(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dF(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ca(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Nc(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,sn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Pa(t,n)}return i=r.interleaved,i===null?(e.next=e,zj(r)):(e.next=i.next,i.next=e),r.interleaved=e,Pa(t,n)}function zv(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Tj(t,n)}}function Wk(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Py(t,e,n,r){var i=t.updateQueue;rc=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,c=i.shared.pending;if(c!==null){i.shared.pending=null;var l=c,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==o&&(c===null?d.firstBaseUpdate=u:c.next=u,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,d=u=l=null,c=s;do{var h=c.lane,p=c.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var g=t,m=c;switch(h=e,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=Qn({},f,h);break e;case 2:rc=!0}}c.callback!==null&&c.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[c]:h.push(c))}else p={eventTime:p,lane:h,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,o|=h;if(c=c.next,c===null){if(c=i.shared.pending,c===null)break;h=c,c=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ou|=o,t.lanes=o,t.memoizedState=f}}function qk(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=wS.transition;wS.transition={};try{t(!1),e()}finally{xn=n,wS.transition=r}}function NF(){return js().memoizedState}function D7(t,e,n){var r=Pc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},TF(t))PF(e,n);else if(n=uF(t,e,n,r),n!==null){var i=yi();Qs(n,t,r,i),kF(n,e,r)}}function $7(t,e,n){var r=Pc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(TF(t))PF(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,c=s(o,n);if(i.hasEagerState=!0,i.eagerState=c,io(c,o)){var l=e.interleaved;l===null?(i.next=i,zj(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=uF(t,e,i,r),n!==null&&(i=yi(),Qs(n,t,r,i),kF(n,e,r))}}function TF(t){var e=t.alternate;return t===Yn||e!==null&&e===Yn}function PF(t,e){np=Oy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function kF(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Tj(t,n)}}var Iy={readContext:As,useCallback:qr,useContext:qr,useEffect:qr,useImperativeHandle:qr,useInsertionEffect:qr,useLayoutEffect:qr,useMemo:qr,useReducer:qr,useRef:qr,useState:qr,useDebugValue:qr,useDeferredValue:qr,useTransition:qr,useMutableSource:qr,useSyncExternalStore:qr,useId:qr,unstable_isNewReconciler:!1},L7={readContext:As,useCallback:function(t,e){return wo().memoizedState=[t,e===void 0?null:e],t},useContext:As,useEffect:Qk,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Gv(4194308,4,CF.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Gv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Gv(4,2,t,e)},useMemo:function(t,e){var n=wo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=wo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=D7.bind(null,Yn,t),[r.memoizedState,t]},useRef:function(t){var e=wo();return t={current:t},e.memoizedState=t},useState:Yk,useDebugValue:Jj,useDeferredValue:function(t){return wo().memoizedState=t},useTransition:function(){var t=Yk(!1),e=t[0];return t=M7.bind(null,t[1]),wo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Yn,i=wo();if(zn){if(n===void 0)throw Error(Ae(407));n=n()}else{if(n=e(),Mr===null)throw Error(Ae(349));su&30||mF(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Qk(vF.bind(null,r,s,t),[t]),r.flags|=2048,$p(9,gF.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=wo(),e=Mr.identifierPrefix;if(zn){var n=ga,r=ma;n=(r&~(1<<32-Ys(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Mp++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[No]=e,t[Op]=r,BF(t,e,!1,!1),e.stateNode=t;e:{switch(o=GC(n,r),n){case"dialog":On("cancel",t),On("close",t),i=r;break;case"iframe":case"object":case"embed":On("load",t),i=r;break;case"video":case"audio":for(i=0;iWd&&(e.flags|=128,r=!0,yh(s,!1),e.lanes=4194304)}else{if(!r)if(t=ky(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),yh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!zn)return Yr(e),null}else 2*rr()-s.renderingStartTime>Wd&&n!==1073741824&&(e.flags|=128,r=!0,yh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=rr(),e.sibling=null,n=Wn.current,Pn(Wn,r?n&1|2:n&1),e):(Yr(e),null);case 22:case 23:return iE(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ki&1073741824&&(Yr(e),e.subtreeFlags&6&&(e.flags|=8192)):Yr(e),null;case 24:return null;case 25:return null}throw Error(Ae(156,e.tag))}function K7(t,e){switch(Lj(e),e.tag){case 1:return Oi(e.type)&&_y(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Gd(),Ln(ki),Ln(ri),Wj(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Kj(e),null;case 13:if(Ln(Wn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ae(340));zd()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ln(Wn),null;case 4:return Gd(),null;case 10:return Hj(e.type._context),null;case 22:case 23:return iE(),null;case 24:return null;default:return null}}var rv=!1,ei=!1,W7=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function od(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Zn(t,e,r)}else n.current=null}function y_(t,e,n){try{n()}catch(r){Zn(t,e,r)}}var aO=!1;function q7(t,e){if(t_=by,t=qL(),Dj(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,c=-1,l=-1,u=0,d=0,f=t,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(c=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===t)break t;if(h===n&&++u===i&&(c=o),h===s&&++d===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(n_={focusedElem:t,selectionRange:n},by=!1,Qe=e;Qe!==null;)if(e=Qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Qe=t;else for(;Qe!==null;){e=Qe;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,b=e.stateNode,x=b.getSnapshotBeforeUpdate(e.elementType===e.type?m:$s(e.type,m),y);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ae(163))}}catch(S){Zn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,Qe=t;break}Qe=e.return}return g=aO,aO=!1,g}function rp(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&y_(e,n,s)}i=i.next}while(i!==r)}}function t0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function x_(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function VF(t){var e=t.alternate;e!==null&&(t.alternate=null,VF(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[No],delete e[Op],delete e[s_],delete e[P7],delete e[k7])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function GF(t){return t.tag===5||t.tag===3||t.tag===4}function cO(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||GF(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function b_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Cy));else if(r!==4&&(t=t.child,t!==null))for(b_(t,e,n),t=t.sibling;t!==null;)b_(t,e,n),t=t.sibling}function w_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(w_(t,e,n),t=t.sibling;t!==null;)w_(t,e,n),t=t.sibling}var Ur=null,Us=!1;function Ya(t,e,n){for(n=n.child;n!==null;)KF(t,e,n),n=n.sibling}function KF(t,e,n){if(Mo&&typeof Mo.onCommitFiberUnmount=="function")try{Mo.onCommitFiberUnmount(Wb,n)}catch{}switch(n.tag){case 5:ei||od(n,e);case 6:var r=Ur,i=Us;Ur=null,Ya(t,e,n),Ur=r,Us=i,Ur!==null&&(Us?(t=Ur,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ur.removeChild(n.stateNode));break;case 18:Ur!==null&&(Us?(t=Ur,n=n.stateNode,t.nodeType===8?yS(t.parentNode,n):t.nodeType===1&&yS(t,n),Ep(t)):yS(Ur,n.stateNode));break;case 4:r=Ur,i=Us,Ur=n.stateNode.containerInfo,Us=!0,Ya(t,e,n),Ur=r,Us=i;break;case 0:case 11:case 14:case 15:if(!ei&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&y_(n,e,o),i=i.next}while(i!==r)}Ya(t,e,n);break;case 1:if(!ei&&(od(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Zn(n,e,c)}Ya(t,e,n);break;case 21:Ya(t,e,n);break;case 22:n.mode&1?(ei=(r=ei)||n.memoizedState!==null,Ya(t,e,n),ei=r):Ya(t,e,n);break;default:Ya(t,e,n)}}function lO(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new W7),e.forEach(function(r){var i=r9.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Is(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=rr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Q7(r/1960))-r,10t?16:t,yc===null)var r=!1;else{if(t=yc,yc=null,Dy=0,sn&6)throw Error(Ae(331));var i=sn;for(sn|=4,Qe=t.current;Qe!==null;){var s=Qe,o=s.child;if(Qe.flags&16){var c=s.deletions;if(c!==null){for(var l=0;lrr()-nE?Wl(t,0):tE|=n),Ii(t,e)}function e4(t,e){e===0&&(t.mode&1?(e=qg,qg<<=1,!(qg&130023424)&&(qg=4194304)):e=1);var n=yi();t=Pa(t,e),t!==null&&(cg(t,e,n),Ii(t,n))}function n9(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),e4(t,n)}function r9(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Ae(314))}r!==null&&r.delete(e),e4(t,n)}var t4;t4=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ki.current)Ti=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ti=!1,V7(t,e,n);Ti=!!(t.flags&131072)}else Ti=!1,zn&&e.flags&1048576&&sF(e,Ey,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Kv(t,e),t=e.pendingProps;var i=Hd(e,ri.current);vd(e,n),i=Yj(null,e,r,t,i,n);var s=Qj();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Oi(r)?(s=!0,Ay(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Vj(e),i.updater=e0,e.stateNode=i,i._reactInternals=e,d_(e,r,t,n),e=p_(null,e,r,!0,s,n)):(e.tag=0,zn&&s&&$j(e),ui(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Kv(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=s9(r),t=$s(r,t),i){case 0:e=h_(null,e,r,t,n);break e;case 1:e=iO(null,e,r,t,n);break e;case 11:e=nO(null,e,r,t,n);break e;case 14:e=rO(null,e,r,$s(r.type,t),n);break e}throw Error(Ae(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$s(r,i),h_(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$s(r,i),iO(t,e,r,i,n);case 3:e:{if(LF(e),t===null)throw Error(Ae(387));r=e.pendingProps,s=e.memoizedState,i=s.element,dF(t,e),Py(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Kd(Error(Ae(423)),e),e=sO(t,e,r,n,i);break e}else if(r!==i){i=Kd(Error(Ae(424)),e),e=sO(t,e,r,n,i);break e}else for(Xi=Ec(e.stateNode.containerInfo.firstChild),Ji=e,zn=!0,Vs=null,n=lF(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zd(),r===i){e=ka(t,e,n);break e}ui(t,e,r,n)}e=e.child}return e;case 5:return fF(e),t===null&&c_(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,r_(r,i)?o=null:s!==null&&r_(r,s)&&(e.flags|=32),$F(t,e),ui(t,e,o,n),e.child;case 6:return t===null&&c_(e),null;case 13:return FF(t,e,n);case 4:return Gj(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Vd(e,null,r,n):ui(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$s(r,i),nO(t,e,r,i,n);case 7:return ui(t,e,e.pendingProps,n),e.child;case 8:return ui(t,e,e.pendingProps.children,n),e.child;case 12:return ui(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Pn(Ny,r._currentValue),r._currentValue=o,s!==null)if(io(s.value,o)){if(s.children===i.children&&!ki.current){e=ka(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){o=s.child;for(var l=c.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Ca(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),l_(s.return,n,e),c.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ae(341));o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),l_(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ui(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,vd(e,n),i=As(i),r=r(i),e.flags|=1,ui(t,e,r,n),e.child;case 14:return r=e.type,i=$s(r,e.pendingProps),i=$s(r.type,i),rO(t,e,r,i,n);case 15:return MF(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$s(r,i),Kv(t,e),e.tag=1,Oi(r)?(t=!0,Ay(e)):t=!1,vd(e,n),OF(e,r,i),d_(e,r,i,n),p_(null,e,r,!0,t,n);case 19:return UF(t,e,n);case 22:return DF(t,e,n)}throw Error(Ae(156,e.tag))};function n4(t,e){return TL(t,e)}function i9(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bs(t,e,n,r){return new i9(t,e,n,r)}function oE(t){return t=t.prototype,!(!t||!t.isReactComponent)}function s9(t){if(typeof t=="function")return oE(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Aj)return 11;if(t===jj)return 14}return 2}function kc(t,e){var n=t.alternate;return n===null?(n=bs(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Yv(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")oE(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Xu:return ql(n.children,i,s,e);case _j:o=8,i|=8;break;case MC:return t=bs(12,n,e,i|2),t.elementType=MC,t.lanes=s,t;case DC:return t=bs(13,n,e,i),t.elementType=DC,t.lanes=s,t;case $C:return t=bs(19,n,e,i),t.elementType=$C,t.lanes=s,t;case fL:return r0(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case uL:o=10;break e;case dL:o=9;break e;case Aj:o=11;break e;case jj:o=14;break e;case nc:o=16,r=null;break e}throw Error(Ae(130,t==null?t:typeof t,""))}return e=bs(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function ql(t,e,n,r){return t=bs(7,t,r,e),t.lanes=n,t}function r0(t,e,n,r){return t=bs(22,t,r,e),t.elementType=fL,t.lanes=n,t.stateNode={isHidden:!1},t}function jS(t,e,n){return t=bs(6,t,null,e),t.lanes=n,t}function ES(t,e,n){return e=bs(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function o9(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=aS(0),this.expirationTimes=aS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aS(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function aE(t,e,n,r,i,s,o,c,l){return t=new o9(t,e,n,c,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=bs(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vj(s),t}function a9(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o4)}catch(t){console.error(t)}}o4(),oL.exports=is;var Of=oL.exports;const a4=un(Of);var c4,vO=Of;c4=vO.createRoot,vO.hydrateRoot;var yO=["light","dark"],f9="(prefers-color-scheme: dark)",h9=v.createContext(void 0),p9={setTheme:t=>{},themes:[]},m9=()=>{var t;return(t=v.useContext(h9))!=null?t:p9};v.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:c,nonce:l})=>{let u=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=i?yO.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,m=!1,y=!0)=>{let b=o?o[g]:g,x=m?g+"|| ''":`'${b}'`,w="";return i&&y&&!m&&yO.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?m||b?w+=`c.add(${x})`:w+="null":b&&(w+=`d[s](n,${x})`),w},p=t?`!function(){${d}${h(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${f9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(s,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(s,!1,!1)};}${f}}catch(t){}}();`;return v.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var g9=t=>{switch(t){case"success":return x9;case"info":return w9;case"warning":return b9;case"error":return S9;default:return null}},v9=Array(12).fill(0),y9=({visible:t})=>T.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},T.createElement("div",{className:"sonner-spinner"},v9.map((e,n)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),x9=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),b9=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),w9=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),S9=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),C9=()=>{let[t,e]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},j_=1,_9=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:j_++,s=this.toasts.find(c=>c.id===i),o=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:n}),{...c,...t,id:i,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0;return r.then(async s=>{if(j9(s)&&!s.ok){i=!1;let o=typeof e.error=="function"?await e.error(`HTTP error! status: ${s.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${s.status}`):e.description;this.create({id:n,type:"error",message:o,description:c})}else if(e.success!==void 0){i=!1;let o=typeof e.success=="function"?await e.success(s):e.success,c=typeof e.description=="function"?await e.description(s):e.description;this.create({id:n,type:"success",message:o,description:c})}}).catch(async s=>{if(e.error!==void 0){i=!1;let o=typeof e.error=="function"?await e.error(s):e.error,c=typeof e.description=="function"?await e.description(s):e.description;this.create({id:n,type:"error",message:o,description:c})}}).finally(()=>{var s;i&&(this.dismiss(n),n=void 0),(s=e.finally)==null||s.call(e)}),n},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||j_++;return this.create({jsx:t(n),id:n,...e}),n},this.subscribers=[],this.toasts=[]}},Gi=new _9,A9=(t,e)=>{let n=(e==null?void 0:e.id)||j_++;return Gi.addToast({title:t,...e,id:n}),n},j9=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",E9=A9,N9=()=>Gi.toasts,se=Object.assign(E9,{success:Gi.success,info:Gi.info,warning:Gi.warning,error:Gi.error,custom:Gi.custom,message:Gi.message,promise:Gi.promise,dismiss:Gi.dismiss,loading:Gi.loading},{getHistory:N9});function T9(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}T9(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;background:var(--gray1);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}: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:0;right:0;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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--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-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%)} +`);function ov(t){return t.label!==void 0}var P9=3,k9="32px",O9=4e3,I9=356,R9=14,M9=20,D9=200;function $9(...t){return t.filter(Boolean).join(" ")}var L9=t=>{var e,n,r,i,s,o,c,l,u,d;let{invert:f,toast:h,unstyled:p,interacting:g,setHeights:m,visibleToasts:y,heights:b,index:x,toasts:w,expanded:S,removeToast:C,defaultRichColors:_,closeButton:A,style:j,cancelButtonStyle:P,actionButtonStyle:k,className:O="",descriptionClassName:E="",duration:R,position:M,gap:G,loadingIcon:L,expandByDefault:V,classNames:I,icons:D,closeButtonAriaLabel:X="Close toast",pauseWhenPageIsHidden:Q,cn:J}=t,[ye,U]=T.useState(!1),[ne,ue]=T.useState(!1),[F,ce]=T.useState(!1),[te,pe]=T.useState(!1),[we,Y]=T.useState(0),[nt,Ue]=T.useState(0),at=T.useRef(null),Be=T.useRef(null),Bt=x===0,N=x+1<=y,$=h.type,B=h.dismissible!==!1,K=h.className||"",Z=h.descriptionClassName||"",H=T.useMemo(()=>b.findIndex(ct=>ct.toastId===h.id)||0,[b,h.id]),re=T.useMemo(()=>{var ct;return(ct=h.closeButton)!=null?ct:A},[h.closeButton,A]),me=T.useMemo(()=>h.duration||R||O9,[h.duration,R]),be=T.useRef(0),ke=T.useRef(0),Se=T.useRef(0),qe=T.useRef(null),[st,Dt]=M.split("-"),We=T.useMemo(()=>b.reduce((ct,jt,ot)=>ot>=H?ct:ct+jt.height,0),[b,H]),Je=C9(),At=h.invert||f,Yt=$==="loading";ke.current=T.useMemo(()=>H*G+We,[H,We]),T.useEffect(()=>{U(!0)},[]),T.useLayoutEffect(()=>{if(!ye)return;let ct=Be.current,jt=ct.style.height;ct.style.height="auto";let ot=ct.getBoundingClientRect().height;ct.style.height=jt,Ue(ot),m(Ze=>Ze.find(gn=>gn.toastId===h.id)?Ze.map(gn=>gn.toastId===h.id?{...gn,height:ot}:gn):[{toastId:h.id,height:ot,position:h.position},...Ze])},[ye,h.title,h.description,m,h.id]);let Xn=T.useCallback(()=>{ue(!0),Y(ke.current),m(ct=>ct.filter(jt=>jt.toastId!==h.id)),setTimeout(()=>{C(h)},D9)},[h,C,m,ke]);T.useEffect(()=>{if(h.promise&&$==="loading"||h.duration===1/0||h.type==="loading")return;let ct,jt=me;return S||g||Q&&Je?(()=>{if(Se.current{var ot;(ot=h.onAutoClose)==null||ot.call(h,h),Xn()},jt)),()=>clearTimeout(ct)},[S,g,V,h,me,Xn,h.promise,$,Q,Je]),T.useEffect(()=>{let ct=Be.current;if(ct){let jt=ct.getBoundingClientRect().height;return Ue(jt),m(ot=>[{toastId:h.id,height:jt,position:h.position},...ot]),()=>m(ot=>ot.filter(Ze=>Ze.toastId!==h.id))}},[m,h.id]),T.useEffect(()=>{h.delete&&Xn()},[Xn,h.delete]);function cr(){return D!=null&&D.loading?T.createElement("div",{className:"sonner-loader","data-visible":$==="loading"},D.loading):L?T.createElement("div",{className:"sonner-loader","data-visible":$==="loading"},L):T.createElement(y9,{visible:$==="loading"})}return T.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Be,className:J(O,K,I==null?void 0:I.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,I==null?void 0:I.default,I==null?void 0:I[$],(n=h==null?void 0:h.classNames)==null?void 0:n[$]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:_,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":ye,"data-promise":!!h.promise,"data-removed":ne,"data-visible":N,"data-y-position":st,"data-x-position":Dt,"data-index":x,"data-front":Bt,"data-swiping":F,"data-dismissible":B,"data-type":$,"data-invert":At,"data-swipe-out":te,"data-expanded":!!(S||V&&ye),style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${ne?we:ke.current}px`,"--initial-height":V?"auto":`${nt}px`,...j,...h.style},onPointerDown:ct=>{Yt||!B||(at.current=new Date,Y(ke.current),ct.target.setPointerCapture(ct.pointerId),ct.target.tagName!=="BUTTON"&&(ce(!0),qe.current={x:ct.clientX,y:ct.clientY}))},onPointerUp:()=>{var ct,jt,ot,Ze;if(te||!B)return;qe.current=null;let gn=Number(((ct=Be.current)==null?void 0:ct.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Os=new Date().getTime()-((jt=at.current)==null?void 0:jt.getTime()),ea=Math.abs(gn)/Os;if(Math.abs(gn)>=M9||ea>.11){Y(ke.current),(ot=h.onDismiss)==null||ot.call(h,h),Xn(),pe(!0);return}(Ze=Be.current)==null||Ze.style.setProperty("--swipe-amount","0px"),ce(!1)},onPointerMove:ct=>{var jt;if(!qe.current||!B)return;let ot=ct.clientY-qe.current.y,Ze=ct.clientX-qe.current.x,gn=(st==="top"?Math.min:Math.max)(0,ot),Os=ct.pointerType==="touch"?10:2;Math.abs(gn)>Os?(jt=Be.current)==null||jt.style.setProperty("--swipe-amount",`${ot}px`):Math.abs(Ze)>Os&&(qe.current=null)}},re&&!h.jsx?T.createElement("button",{"aria-label":X,"data-disabled":Yt,"data-close-button":!0,onClick:Yt||!B?()=>{}:()=>{var ct;Xn(),(ct=h.onDismiss)==null||ct.call(h,h)},className:J(I==null?void 0:I.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||T.isValidElement(h.title)?h.jsx||h.title:T.createElement(T.Fragment,null,$||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:J(I==null?void 0:I.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||cr():null,h.type!=="loading"?h.icon||(D==null?void 0:D[$])||g9($):null):null,T.createElement("div",{"data-content":"",className:J(I==null?void 0:I.content,(o=h==null?void 0:h.classNames)==null?void 0:o.content)},T.createElement("div",{"data-title":"",className:J(I==null?void 0:I.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},h.title),h.description?T.createElement("div",{"data-description":"",className:J(E,Z,I==null?void 0:I.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),T.isValidElement(h.cancel)?h.cancel:h.cancel&&ov(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:ct=>{var jt,ot;ov(h.cancel)&&B&&((ot=(jt=h.cancel).onClick)==null||ot.call(jt,ct),Xn())},className:J(I==null?void 0:I.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,T.isValidElement(h.action)?h.action:h.action&&ov(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||k,onClick:ct=>{var jt,ot;ov(h.action)&&(ct.defaultPrevented||((ot=(jt=h.action).onClick)==null||ot.call(jt,ct),Xn()))},className:J(I==null?void 0:I.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function xO(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var F9=t=>{let{invert:e,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:s,className:o,offset:c,theme:l="light",richColors:u,duration:d,style:f,visibleToasts:h=P9,toastOptions:p,dir:g=xO(),gap:m=R9,loadingIcon:y,icons:b,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:w,cn:S=$9}=t,[C,_]=T.useState([]),A=T.useMemo(()=>Array.from(new Set([n].concat(C.filter(Q=>Q.position).map(Q=>Q.position)))),[C,n]),[j,P]=T.useState([]),[k,O]=T.useState(!1),[E,R]=T.useState(!1),[M,G]=T.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=T.useRef(null),V=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=T.useRef(null),D=T.useRef(!1),X=T.useCallback(Q=>{var J;(J=C.find(ye=>ye.id===Q.id))!=null&&J.delete||Gi.dismiss(Q.id),_(ye=>ye.filter(({id:U})=>U!==Q.id))},[C]);return T.useEffect(()=>Gi.subscribe(Q=>{if(Q.dismiss){_(J=>J.map(ye=>ye.id===Q.id?{...ye,delete:!0}:ye));return}setTimeout(()=>{a4.flushSync(()=>{_(J=>{let ye=J.findIndex(U=>U.id===Q.id);return ye!==-1?[...J.slice(0,ye),{...J[ye],...Q},...J.slice(ye+1)]:[Q,...J]})})})}),[]),T.useEffect(()=>{if(l!=="system"){G(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Q})=>{G(Q?"dark":"light")})},[l]),T.useEffect(()=>{C.length<=1&&O(!1)},[C]),T.useEffect(()=>{let Q=J=>{var ye,U;r.every(ne=>J[ne]||J.code===ne)&&(O(!0),(ye=L.current)==null||ye.focus()),J.code==="Escape"&&(document.activeElement===L.current||(U=L.current)!=null&&U.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[r]),T.useEffect(()=>{if(L.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,D.current=!1)}},[L.current]),C.length?T.createElement("section",{"aria-label":`${x} ${V}`,tabIndex:-1},A.map((Q,J)=>{var ye;let[U,ne]=Q.split("-");return T.createElement("ol",{key:Q,dir:g==="auto"?xO():g,tabIndex:-1,ref:L,className:o,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":U,"data-x-position":ne,style:{"--front-toast-height":`${((ye=j[0])==null?void 0:ye.height)||0}px`,"--offset":typeof c=="number"?`${c}px`:c||k9,"--width":`${I9}px`,"--gap":`${m}px`,...f},onBlur:ue=>{D.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(D.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||D.current||(D.current=!0,I.current=ue.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{E||O(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||R(!0)},onPointerUp:()=>R(!1)},C.filter(ue=>!ue.position&&J===0||ue.position===Q).map((ue,F)=>{var ce,te;return T.createElement(L9,{key:ue.id,icons:b,index:F,toast:ue,defaultRichColors:u,duration:(ce=p==null?void 0:p.duration)!=null?ce:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:e,visibleToasts:h,closeButton:(te=p==null?void 0:p.closeButton)!=null?te:s,interacting:E,position:Q,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:X,toasts:C.filter(pe=>pe.position==ue.position),heights:j.filter(pe=>pe.position==ue.position),setHeights:P,expandByDefault:i,gap:m,loadingIcon:y,expanded:k,pauseWhenPageIsHidden:w,cn:S})}))})):null};const U9=({...t})=>{const{theme:e="system"}=m9();return a.jsx(F9,{theme:e,className:"toaster group",position:"bottom-right",visibleToasts:2,closeButton:!0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:pr-8",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",closeButton:"group-[.toast]:absolute group-[.toast]:left-3 group-[.toast]:top-3 group-[.toast]:h-5 group-[.toast]:w-5 group-[.toast]:rounded-md group-[.toast]:p-1 group-[.toast]:text-foreground/70 group-[.toast]:opacity-100 group-[.toast]:transition-opacity hover:group-[.toast]:text-foreground hover:group-[.toast]:bg-muted/50 focus:group-[.toast]:opacity-100 focus:group-[.toast]:outline-none focus:group-[.toast]:ring-1 focus:group-[.toast]:ring-ring"}},...t})};function Ne(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function B9(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function c0(...t){return e=>t.forEach(n=>B9(n,e))}function Ot(...t){return v.useCallback(c0(...t),t)}function H9(t,e){const n=v.createContext(e),r=s=>{const{children:o,...c}=s,l=v.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function i(s){const o=v.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function Fi(t,e=[]){let n=[];function r(s,o){const c=v.createContext(o),l=n.length;n=[...n,o];const u=f=>{var b;const{scope:h,children:p,...g}=f,m=((b=h==null?void 0:h[t])==null?void 0:b[l])||c,y=v.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:y,children:p})};u.displayName=s+"Provider";function d(f,h){var m;const p=((m=h==null?void 0:h[t])==null?void 0:m[l])||c,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(o=>v.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,z9(i,...e)]}function z9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Ho=v.forwardRef((t,e)=>{const{children:n,...r}=t,i=v.Children.toArray(n),s=i.find(V9);if(s){const o=s.props.children,c=i.map(l=>l===s?v.Children.count(o)>1?v.Children.only(null):v.isValidElement(o)?o.props.children:null:l);return a.jsx(E_,{...r,ref:e,children:v.isValidElement(o)?v.cloneElement(o,void 0,c):null})}return a.jsx(E_,{...r,ref:e,children:n})});Ho.displayName="Slot";var E_=v.forwardRef((t,e)=>{const{children:n,...r}=t;if(v.isValidElement(n)){const i=K9(n);return v.cloneElement(n,{...G9(r,n.props),ref:e?c0(e,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});E_.displayName="SlotClone";var dE=({children:t})=>a.jsx(a.Fragment,{children:t});function V9(t){return v.isValidElement(t)&&t.type===dE}function G9(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{s(...c),i(...c)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function K9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var W9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],it=W9.reduce((t,e)=>{const n=v.forwardRef((r,i)=>{const{asChild:s,...o}=r,c=s?Ho:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function l4(t,e){t&&Of.flushSync(()=>t.dispatchEvent(e))}function Cr(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function q9(t,e=globalThis==null?void 0:globalThis.document){const n=Cr(t);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Y9="DismissableLayer",N_="dismissableLayer.update",Q9="dismissableLayer.pointerDownOutside",X9="dismissableLayer.focusOutside",bO,u4=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fg=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:c,...l}=t,u=v.useContext(u4),[d,f]=v.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),g=Ot(e,A=>f(A)),m=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),x=d?m.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=eY(A=>{const j=A.target,P=[...u.branches].some(k=>k.contains(j));!S||P||(i==null||i(A),o==null||o(A),A.defaultPrevented||c==null||c())},h),_=tY(A=>{const j=A.target;[...u.branches].some(k=>k.contains(j))||(s==null||s(A),o==null||o(A),A.defaultPrevented||c==null||c())},h);return q9(A=>{x===u.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&c&&(A.preventDefault(),c()))},h),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(bO=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),wO(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=bO)}},[d,h,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),wO())},[d,u]),v.useEffect(()=>{const A=()=>p({});return document.addEventListener(N_,A),()=>document.removeEventListener(N_,A)},[]),a.jsx(it.div,{...l,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:Ne(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Ne(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Ne(t.onPointerDownCapture,C.onPointerDownCapture)})});fg.displayName=Y9;var J9="DismissableLayerBranch",Z9=v.forwardRef((t,e)=>{const n=v.useContext(u4),r=v.useRef(null),i=Ot(e,r);return v.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),a.jsx(it.div,{...t,ref:i})});Z9.displayName=J9;function eY(t,e=globalThis==null?void 0:globalThis.document){const n=Cr(t),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let l=function(){d4(Q9,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function tY(t,e=globalThis==null?void 0:globalThis.document){const n=Cr(t),r=v.useRef(!1);return v.useEffect(()=>{const i=s=>{s.target&&!r.current&&d4(X9,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wO(){const t=new CustomEvent(N_);document.dispatchEvent(t)}function d4(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?l4(i,s):i.dispatchEvent(s)}var Gr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},nY=iL.useId||(()=>{}),rY=0;function Xs(t){const[e,n]=v.useState(nY());return Gr(()=>{n(r=>r??String(rY++))},[t]),e?`radix-${e}`:""}const iY=["top","right","bottom","left"],Wc=Math.min,Yi=Math.max,Fy=Math.round,av=Math.floor,qc=t=>({x:t,y:t}),sY={left:"right",right:"left",bottom:"top",top:"bottom"},oY={start:"end",end:"start"};function T_(t,e,n){return Yi(t,Wc(e,n))}function Oa(t,e){return typeof t=="function"?t(e):t}function Ia(t){return t.split("-")[0]}function If(t){return t.split("-")[1]}function fE(t){return t==="x"?"y":"x"}function hE(t){return t==="y"?"height":"width"}function Yc(t){return["top","bottom"].includes(Ia(t))?"y":"x"}function pE(t){return fE(Yc(t))}function aY(t,e,n){n===void 0&&(n=!1);const r=If(t),i=pE(t),s=hE(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Uy(o)),[o,Uy(o)]}function cY(t){const e=Uy(t);return[P_(t),e,P_(e)]}function P_(t){return t.replace(/start|end/g,e=>oY[e])}function lY(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function uY(t,e,n,r){const i=If(t);let s=lY(Ia(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(P_)))),s}function Uy(t){return t.replace(/left|right|bottom|top/g,e=>sY[e])}function dY(t){return{top:0,right:0,bottom:0,left:0,...t}}function f4(t){return typeof t!="number"?dY(t):{top:t,right:t,bottom:t,left:t}}function By(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function SO(t,e,n){let{reference:r,floating:i}=t;const s=Yc(e),o=pE(e),c=hE(o),l=Ia(e),u=s==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[c]/2-i[c]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(If(e)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const fY=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,c=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=SO(u,r,l),h=r,p={},g=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:c,middlewareData:l}=e,{element:u,padding:d=0}=Oa(t,e)||{};if(u==null)return{};const f=f4(d),h={x:n,y:r},p=pE(i),g=hE(p),m=await o.getDimensions(u),y=p==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[p]-h[p]-s.floating[g],C=h[p]-s.reference[p],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let A=_?_[w]:0;(!A||!await(o.isElement==null?void 0:o.isElement(_)))&&(A=c.floating[w]||s.floating[g]);const j=S/2-C/2,P=A/2-m[g]/2-1,k=Wc(f[b],P),O=Wc(f[x],P),E=k,R=A-m[g]-O,M=A/2-m[g]/2+j,G=T_(E,M,R),L=!l.arrow&&If(i)!=null&&M!==G&&s.reference[g]/2-(MM<=0)){var O,E;const M=(((O=s.flip)==null?void 0:O.index)||0)+1,G=A[M];if(G)return{data:{index:M,overflows:k},reset:{placement:G}};let L=(E=k.filter(V=>V.overflows[0]<=0).sort((V,I)=>V.overflows[1]-I.overflows[1])[0])==null?void 0:E.placement;if(!L)switch(p){case"bestFit":{var R;const V=(R=k.filter(I=>{if(_){const D=Yc(I.placement);return D===x||D==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(D=>D>0).reduce((D,X)=>D+X,0)]).sort((I,D)=>I[1]-D[1])[0])==null?void 0:R[0];V&&(L=V);break}case"initialPlacement":L=c;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function CO(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _O(t){return iY.some(e=>t[e]>=0)}const mY=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Oa(t,e);switch(r){case"referenceHidden":{const s=await Fp(e,{...i,elementContext:"reference"}),o=CO(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:_O(o)}}}case"escaped":{const s=await Fp(e,{...i,altBoundary:!0}),o=CO(s,n.floating);return{data:{escapedOffsets:o,escaped:_O(o)}}}default:return{}}}}};async function gY(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ia(n),c=If(n),l=Yc(n)==="y",u=["left","top"].includes(o)?-1:1,d=s&&l?-1:1,f=Oa(e,t);let{mainAxis:h,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 c&&typeof g=="number"&&(p=c==="end"?g*-1:g),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const vY=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:c}=e,l=await gY(e,t);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},yY=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:c={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=Oa(t,e),u={x:n,y:r},d=await Fp(e,l),f=Yc(Ia(i)),h=fE(f);let p=u[h],g=u[f];if(s){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[y],w=p-d[b];p=T_(x,p,w)}if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=g+d[y],w=g-d[b];g=T_(x,g,w)}const m=c.fn({...e,[h]:p,[f]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[f]:o}}}}}},xY=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=Oa(t,e),d={x:n,y:r},f=Yc(i),h=fE(f);let p=d[h],g=d[f];const m=Oa(c,e),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=h==="y"?"height":"width",S=s.reference[h]-s.floating[w]+y.mainAxis,C=s.reference[h]+s.reference[w]-y.mainAxis;pC&&(p=C)}if(u){var b,x;const w=h==="y"?"width":"height",S=["top","left"].includes(Ia(i)),C=s.reference[f]-s.floating[w]+(S&&((b=o.offset)==null?void 0:b[f])||0)+(S?0:y.crossAxis),_=s.reference[f]+s.reference[w]+(S?0:((x=o.offset)==null?void 0:x[f])||0)-(S?y.crossAxis:0);g_&&(g=_)}return{[h]:p,[f]:g}}}},bY=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:c}=e,{apply:l=()=>{},...u}=Oa(t,e),d=await Fp(e,u),f=Ia(i),h=If(i),p=Yc(i)==="y",{width:g,height:m}=s.floating;let y,b;f==="top"||f==="bottom"?(y=f,b=h===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(b=f,y=h==="end"?"top":"bottom");const x=m-d.top-d.bottom,w=g-d.left-d.right,S=Wc(m-d[y],x),C=Wc(g-d[b],w),_=!e.middlewareData.shift;let A=S,j=C;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(A=x),_&&!h){const k=Yi(d.left,0),O=Yi(d.right,0),E=Yi(d.top,0),R=Yi(d.bottom,0);p?j=g-2*(k!==0||O!==0?k+O:Yi(d.left,d.right)):A=m-2*(E!==0||R!==0?E+R:Yi(d.top,d.bottom))}await l({...e,availableWidth:j,availableHeight:A});const P=await o.getDimensions(c.floating);return g!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function l0(){return typeof window<"u"}function Rf(t){return h4(t)?(t.nodeName||"").toLowerCase():"#document"}function Zi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Yo(t){var e;return(e=(h4(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function h4(t){return l0()?t instanceof Node||t instanceof Zi(t).Node:!1}function so(t){return l0()?t instanceof Element||t instanceof Zi(t).Element:!1}function zo(t){return l0()?t instanceof HTMLElement||t instanceof Zi(t).HTMLElement:!1}function AO(t){return!l0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zi(t).ShadowRoot}function hg(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=oo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function wY(t){return["table","td","th"].includes(Rf(t))}function u0(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function mE(t){const e=gE(),n=so(t)?oo(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function SY(t){let e=Qc(t);for(;zo(e)&&!qd(e);){if(mE(e))return e;if(u0(e))return null;e=Qc(e)}return null}function gE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function qd(t){return["html","body","#document"].includes(Rf(t))}function oo(t){return Zi(t).getComputedStyle(t)}function d0(t){return so(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Qc(t){if(Rf(t)==="html")return t;const e=t.assignedSlot||t.parentNode||AO(t)&&t.host||Yo(t);return AO(e)?e.host:e}function p4(t){const e=Qc(t);return qd(e)?t.ownerDocument?t.ownerDocument.body:t.body:zo(e)&&hg(e)?e:p4(e)}function Up(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=p4(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Zi(i);if(s){const c=k_(o);return e.concat(o,o.visualViewport||[],hg(i)?i:[],c&&n?Up(c):[])}return e.concat(i,Up(i,[],n))}function k_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function m4(t){const e=oo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=zo(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,c=Fy(n)!==s||Fy(r)!==o;return c&&(n=s,r=o),{width:n,height:r,$:c}}function vE(t){return so(t)?t:t.contextElement}function xd(t){const e=vE(t);if(!zo(e))return qc(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=m4(e);let o=(s?Fy(n.width):n.width)/r,c=(s?Fy(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const CY=qc(0);function g4(t){const e=Zi(t);return!gE()||!e.visualViewport?CY:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _Y(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Zi(t)?!1:e}function cu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=vE(t);let o=qc(1);e&&(r?so(r)&&(o=xd(r)):o=xd(t));const c=_Y(s,n,r)?g4(s):qc(0);let l=(i.left+c.x)/o.x,u=(i.top+c.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(s){const h=Zi(s),p=r&&so(r)?Zi(r):r;let g=h,m=k_(g);for(;m&&r&&p!==g;){const y=xd(m),b=m.getBoundingClientRect(),x=oo(m),w=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,S=b.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,f*=y.y,l+=w,u+=S,g=Zi(m),m=k_(g)}}return By({width:d,height:f,x:l,y:u})}function AY(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Yo(r),c=e?u0(e.floating):!1;if(r===o||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=qc(1);const d=qc(0),f=zo(r);if((f||!f&&!s)&&((Rf(r)!=="body"||hg(o))&&(l=d0(r)),zo(r))){const h=cu(r);u=xd(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function jY(t){return Array.from(t.getClientRects())}function O_(t,e){const n=d0(t).scrollLeft;return e?e.left+n:cu(Yo(t)).left+n}function EY(t){const e=Yo(t),n=d0(t),r=t.ownerDocument.body,i=Yi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Yi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+O_(t);const c=-n.scrollTop;return oo(r).direction==="rtl"&&(o+=Yi(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:c}}function NY(t,e){const n=Zi(t),r=Yo(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,c=0,l=0;if(i){s=i.width,o=i.height;const u=gE();(!u||u&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:c,y:l}}function TY(t,e){const n=cu(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=zo(t)?xd(t):qc(1),o=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:c,x:l,y:u}}function jO(t,e,n){let r;if(e==="viewport")r=NY(t,n);else if(e==="document")r=EY(Yo(t));else if(so(e))r=TY(e,n);else{const i=g4(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return By(r)}function v4(t,e){const n=Qc(t);return n===e||!so(n)||qd(n)?!1:oo(n).position==="fixed"||v4(n,e)}function PY(t,e){const n=e.get(t);if(n)return n;let r=Up(t,[],!1).filter(c=>so(c)&&Rf(c)!=="body"),i=null;const s=oo(t).position==="fixed";let o=s?Qc(t):t;for(;so(o)&&!qd(o);){const c=oo(o),l=mE(o);!l&&c.position==="fixed"&&(i=null),(s?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||hg(o)&&!l&&v4(t,o))?r=r.filter(d=>d!==o):i=c,o=Qc(o)}return e.set(t,r),r}function kY(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?u0(e)?[]:PY(e,this._c):[].concat(n),r],c=o[0],l=o.reduce((u,d)=>{const f=jO(e,d,i);return u.top=Yi(f.top,u.top),u.right=Wc(f.right,u.right),u.bottom=Wc(f.bottom,u.bottom),u.left=Yi(f.left,u.left),u},jO(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function OY(t){const{width:e,height:n}=m4(t);return{width:e,height:n}}function IY(t,e,n){const r=zo(e),i=Yo(e),s=n==="fixed",o=cu(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=qc(0);if(r||!r&&!s)if((Rf(e)!=="body"||hg(i))&&(c=d0(e)),r){const p=cu(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&(l.x=O_(i));let u=0,d=0;if(i&&!r&&!s){const p=i.getBoundingClientRect();d=p.top+c.scrollTop,u=p.left+c.scrollLeft-O_(i,p)}const f=o.left+c.scrollLeft-l.x-u,h=o.top+c.scrollTop-l.y-d;return{x:f,y:h,width:o.width,height:o.height}}function NS(t){return oo(t).position==="static"}function EO(t,e){if(!zo(t)||oo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Yo(t)===n&&(n=n.ownerDocument.body),n}function y4(t,e){const n=Zi(t);if(u0(t))return n;if(!zo(t)){let i=Qc(t);for(;i&&!qd(i);){if(so(i)&&!NS(i))return i;i=Qc(i)}return n}let r=EO(t,e);for(;r&&wY(r)&&NS(r);)r=EO(r,e);return r&&qd(r)&&NS(r)&&!mE(r)?n:r||SY(t)||n}const RY=async function(t){const e=this.getOffsetParent||y4,n=this.getDimensions,r=await n(t.floating);return{reference:IY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function MY(t){return oo(t).direction==="rtl"}const DY={convertOffsetParentRelativeRectToViewportRelativeRect:AY,getDocumentElement:Yo,getClippingRect:kY,getOffsetParent:y4,getElementRects:RY,getClientRects:jY,getDimensions:OY,getScale:xd,isElement:so,isRTL:MY};function $Y(t,e){let n=null,r;const i=Yo(t);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const{left:u,top:d,width:f,height:h}=t.getBoundingClientRect();if(c||e(),!f||!h)return;const p=av(d),g=av(i.clientWidth-(u+f)),m=av(i.clientHeight-(d+h)),y=av(u),x={rootMargin:-p+"px "+-g+"px "+-m+"px "+-y+"px",threshold:Yi(0,Wc(1,l))||1};let w=!0;function S(C){const _=C[0].intersectionRatio;if(_!==l){if(!w)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(t)}return o(!0),s}function LY(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=vE(t),d=i||s?[...u?Up(u):[],...Up(e)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=u&&c?$Y(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),n()}),u&&!l&&p.observe(u),p.observe(e));let g,m=l?cu(t):null;l&&y();function y(){const b=cu(t);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const FY=vY,UY=yY,BY=pY,HY=bY,zY=mY,NO=hY,VY=xY,GY=(t,e,n)=>{const r=new Map,i={platform:DY,...n},s={...i.platform,_c:r};return fY(t,e,{...i,platform:s})};var Qv=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Hy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Hy(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Hy(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function x4(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function TO(t,e){const n=x4(t);return Math.round(e*n)/n}function TS(t){const e=v.useRef(t);return Qv(()=>{e.current=t}),e}function KY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:c=!0,whileElementsMounted:l,open:u}=t,[d,f]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,p]=v.useState(r);Hy(h,r)||p(r);const[g,m]=v.useState(null),[y,b]=v.useState(null),x=v.useCallback(I=>{I!==_.current&&(_.current=I,m(I))},[]),w=v.useCallback(I=>{I!==A.current&&(A.current=I,b(I))},[]),S=s||g,C=o||y,_=v.useRef(null),A=v.useRef(null),j=v.useRef(d),P=l!=null,k=TS(l),O=TS(i),E=TS(u),R=v.useCallback(()=>{if(!_.current||!A.current)return;const I={placement:e,strategy:n,middleware:h};O.current&&(I.platform=O.current),GY(_.current,A.current,I).then(D=>{const X={...D,isPositioned:E.current!==!1};M.current&&!Hy(j.current,X)&&(j.current=X,Of.flushSync(()=>{f(X)}))})},[h,e,n,O,E]);Qv(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(I=>({...I,isPositioned:!1})))},[u]);const M=v.useRef(!1);Qv(()=>(M.current=!0,()=>{M.current=!1}),[]),Qv(()=>{if(S&&(_.current=S),C&&(A.current=C),S&&C){if(k.current)return k.current(S,C,R);R()}},[S,C,R,k,P]);const G=v.useMemo(()=>({reference:_,floating:A,setReference:x,setFloating:w}),[x,w]),L=v.useMemo(()=>({reference:S,floating:C}),[S,C]),V=v.useMemo(()=>{const I={position:n,left:0,top:0};if(!L.floating)return I;const D=TO(L.floating,d.x),X=TO(L.floating,d.y);return c?{...I,transform:"translate("+D+"px, "+X+"px)",...x4(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:X}},[n,c,L.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:R,refs:G,elements:L,floatingStyles:V}),[d,R,G,L,V])}const WY=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?NO({element:r.current,padding:i}).fn(n):{}:r?NO({element:r,padding:i}).fn(n):{}}}},qY=(t,e)=>({...FY(t),options:[t,e]}),YY=(t,e)=>({...UY(t),options:[t,e]}),QY=(t,e)=>({...VY(t),options:[t,e]}),XY=(t,e)=>({...BY(t),options:[t,e]}),JY=(t,e)=>({...HY(t),options:[t,e]}),ZY=(t,e)=>({...zY(t),options:[t,e]}),eQ=(t,e)=>({...WY(t),options:[t,e]});var tQ="Arrow",b4=v.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return a.jsx(it.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});b4.displayName=tQ;var nQ=b4;function rQ(t,e=[]){let n=[];function r(s,o){const c=v.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,y=v.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>v.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,iQ(i,...e)]}function iQ(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function pg(t){const[e,n]=v.useState(void 0);return Gr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,c;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,c=u.blockSize}else o=t.offsetWidth,c=t.offsetHeight;n({width:o,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var yE="Popper",[w4,Mf]=rQ(yE),[sQ,S4]=w4(yE),C4=t=>{const{__scopePopper:e,children:n}=t,[r,i]=v.useState(null);return a.jsx(sQ,{scope:e,anchor:r,onAnchorChange:i,children:n})};C4.displayName=yE;var _4="PopperAnchor",A4=v.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=S4(_4,n),o=v.useRef(null),c=Ot(e,o);return v.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:a.jsx(it.div,{...i,ref:c})});A4.displayName=_4;var xE="PopperContent",[oQ,aQ]=w4(xE),j4=v.forwardRef((t,e)=>{var F,ce,te,pe,we,Y;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=t,y=S4(xE,n),[b,x]=v.useState(null),w=Ot(e,nt=>x(nt)),[S,C]=v.useState(null),_=pg(S),A=(_==null?void 0:_.width)??0,j=(_==null?void 0:_.height)??0,P=r+(s!=="center"?"-"+s:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],E=O.length>0,R={padding:k,boundary:O.filter(lQ),altBoundary:E},{refs:M,floatingStyles:G,placement:L,isPositioned:V,middlewareData:I}=KY({strategy:"fixed",placement:P,whileElementsMounted:(...nt)=>LY(...nt,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[qY({mainAxis:i+j,alignmentAxis:o}),l&&YY({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?QY():void 0,...R}),l&&XY({...R}),JY({...R,apply:({elements:nt,rects:Ue,availableWidth:at,availableHeight:Be})=>{const{width:Bt,height:N}=Ue.reference,$=nt.floating.style;$.setProperty("--radix-popper-available-width",`${at}px`),$.setProperty("--radix-popper-available-height",`${Be}px`),$.setProperty("--radix-popper-anchor-width",`${Bt}px`),$.setProperty("--radix-popper-anchor-height",`${N}px`)}}),S&&eQ({element:S,padding:c}),uQ({arrowWidth:A,arrowHeight:j}),h&&ZY({strategy:"referenceHidden",...R})]}),[D,X]=T4(L),Q=Cr(g);Gr(()=>{V&&(Q==null||Q())},[V,Q]);const J=(F=I.arrow)==null?void 0:F.x,ye=(ce=I.arrow)==null?void 0:ce.y,U=((te=I.arrow)==null?void 0:te.centerOffset)!==0,[ne,ue]=v.useState();return Gr(()=>{b&&ue(window.getComputedStyle(b).zIndex)},[b]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:V?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(pe=I.transformOrigin)==null?void 0:pe.x,(we=I.transformOrigin)==null?void 0:we.y].join(" "),...((Y=I.hide)==null?void 0:Y.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(oQ,{scope:n,placedSide:D,onArrowChange:C,arrowX:J,arrowY:ye,shouldHideArrow:U,children:a.jsx(it.div,{"data-side":D,"data-align":X,...m,ref:w,style:{...m.style,animation:V?void 0:"none"}})})})});j4.displayName=xE;var E4="PopperArrow",cQ={top:"bottom",right:"left",bottom:"top",left:"right"},N4=v.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=aQ(E4,r),o=cQ[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(nQ,{...i,ref:n,style:{...i.style,display:"block"}})})});N4.displayName=E4;function lQ(t){return t!==null}var uQ=t=>({name:"transformOrigin",options:t,fn(e){var y,b,x;const{placement:n,rects:r,middlewareData:i}=e,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,c=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,d]=T4(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((b=i.arrow)==null?void 0:b.x)??0)+c/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=o?f:`${h}px`,m=`${-l}px`):u==="top"?(g=o?f:`${h}px`,m=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=o?f:`${p}px`):u==="left"&&(g=`${r.floating.width+l}px`,m=o?f:`${p}px`),{data:{x:g,y:m}}}});function T4(t){const[e,n="center"]=t.split("-");return[e,n]}var P4=C4,bE=A4,wE=j4,SE=N4,dQ="Portal",f0=v.forwardRef((t,e)=>{var c;const{container:n,...r}=t,[i,s]=v.useState(!1);Gr(()=>s(!0),[]);const o=n||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return o?a4.createPortal(a.jsx(it.div,{...r,ref:e}),o):null});f0.displayName=dQ;function fQ(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}var Kr=t=>{const{present:e,children:n}=t,r=hQ(e),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),s=Ot(r.ref,pQ(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:s}):null};Kr.displayName="Presence";function hQ(t){const[e,n]=v.useState(),r=v.useRef({}),i=v.useRef(t),s=v.useRef("none"),o=t?"mounted":"unmounted",[c,l]=fQ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=cv(r.current);s.current=c==="mounted"?u:"none"},[c]),Gr(()=>{const u=r.current,d=i.current;if(d!==t){const h=s.current,p=cv(u);t?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Gr(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=p=>{const m=cv(r.current).includes(p.animationName);if(p.target===e&&m&&(l("ANIMATION_END"),!i.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},h=p=>{p.target===e&&(s.current=cv(r.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function cv(t){return(t==null?void 0:t.animationName)||"none"}function pQ(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function ao({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=mQ({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,c=Cr(n),l=v.useCallback(u=>{if(s){const f=typeof u=="function"?u(t):u;f!==t&&c(f)}else i(u)},[s,t,i,c]);return[o,l]}function mQ({defaultProp:t,onChange:e}){const n=v.useState(t),[r]=n,i=v.useRef(r),s=Cr(e);return v.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var gQ="VisuallyHidden",CE=v.forwardRef((t,e)=>a.jsx(it.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));CE.displayName=gQ;var vQ=CE,[h0,sFe]=Fi("Tooltip",[Mf]),_E=Mf(),k4="TooltipProvider",yQ=700,PO="tooltip.open",[xQ,O4]=h0(k4),I4=t=>{const{__scopeTooltip:e,delayDuration:n=yQ,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,[o,c]=v.useState(!0),l=v.useRef(!1),u=v.useRef(0);return v.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),a.jsx(xQ,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(u.current),c(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:v.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:s})};I4.displayName=k4;var R4="Tooltip",[oFe,p0]=h0(R4),I_="TooltipTrigger",bQ=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=p0(I_,n),s=O4(I_,n),o=_E(n),c=v.useRef(null),l=Ot(e,c,i.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),f=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),a.jsx(bE,{asChild:!0,...o,children:a.jsx(it.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Ne(t.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ne(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Ne(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ne(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:Ne(t.onBlur,i.onClose),onClick:Ne(t.onClick,i.onClose)})})});bQ.displayName=I_;var wQ="TooltipPortal",[aFe,SQ]=h0(wQ,{forceMount:void 0}),Yd="TooltipContent",M4=v.forwardRef((t,e)=>{const n=SQ(Yd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=p0(Yd,t.__scopeTooltip);return a.jsx(Kr,{present:r||o.open,children:o.disableHoverableContent?a.jsx(D4,{side:i,...s,ref:e}):a.jsx(CQ,{side:i,...s,ref:e})})}),CQ=v.forwardRef((t,e)=>{const n=p0(Yd,t.__scopeTooltip),r=O4(Yd,t.__scopeTooltip),i=v.useRef(null),s=Ot(e,i),[o,c]=v.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,h=v.useCallback(()=>{c(null),f(!1)},[f]),p=v.useCallback((g,m)=>{const y=g.currentTarget,b={x:g.clientX,y:g.clientY},x=EQ(b,y.getBoundingClientRect()),w=NQ(b,x),S=TQ(m.getBoundingClientRect()),C=kQ([...w,...S]);c(C),f(!0)},[f]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(l&&d){const g=y=>p(y,d),m=y=>p(y,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[l,d,p,h]),v.useEffect(()=>{if(o){const g=m=>{const y=m.target,b={x:m.clientX,y:m.clientY},x=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),w=!PQ(b,o);x?h():w&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,o,u,h]),a.jsx(D4,{...t,ref:s})}),[_Q,AQ]=h0(R4,{isInside:!1}),D4=v.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...c}=t,l=p0(Yd,n),u=_E(n),{onClose:d}=l;return v.useEffect(()=>(document.addEventListener(PO,d),()=>document.removeEventListener(PO,d)),[d]),v.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),a.jsx(fg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:a.jsxs(wE,{"data-state":l.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(dE,{children:r}),a.jsx(_Q,{scope:n,isInside:!0,children:a.jsx(vQ,{id:l.contentId,role:"tooltip",children:i||r})})]})})});M4.displayName=Yd;var $4="TooltipArrow",jQ=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=_E(n);return AQ($4,n).isInside?null:a.jsx(SE,{...i,...r,ref:e})});jQ.displayName=$4;function EQ(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function NQ(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function TQ(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function PQ(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function kQ(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),OQ(e)}function OQ(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var IQ=I4,L4=M4;function F4(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const e=DQ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const c=o.split(AE);return c[0]===""&&c.length!==1&&c.shift(),U4(c,e)||MQ(o)},getConflictingClassGroupIds:(o,c)=>{const l=n[o]||[];return c&&r[o]?[...l,...r[o]]:l}}},U4=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?U4(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(AE);return(o=e.validators.find(({validator:c})=>c(s)))==null?void 0:o.classGroupId},kO=/^\[(.+)\]$/,MQ=t=>{if(kO.test(t)){const e=kO.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},DQ=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return LQ(Object.entries(t.classGroups),n).forEach(([s,o])=>{R_(o,r,s,e)}),r},R_=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:OO(e,i);s.classGroupId=n;return}if(typeof i=="function"){if($Q(i)){R_(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{R_(o,OO(e,s),n,r)})})},OO=(t,e)=>{let n=t;return e.split(AE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$Q=t=>t.isThemeGetter,LQ=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,c])=>[e+o,c])):s);return[n,i]}):t,FQ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},B4="!",UQ=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=c=>{const l=[];let u=0,d=0,f;for(let y=0;yd?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?c=>n({className:c,parseClassName:o}):o},BQ=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},HQ=t=>({cache:FQ(t.cacheSize),parseClassName:UQ(t),...RQ(t)}),zQ=/\s+/,VQ=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(zQ);let c="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,m=r(g?h.substring(0,p):h);if(!m){if(!g){c=u+(c.length>0?" "+c:c);continue}if(m=r(h),!m){c=u+(c.length>0?" "+c:c);continue}g=!1}const y=BQ(d).join(":"),b=f?y+B4:y,x=b+m;if(s.includes(x))continue;s.push(x);const w=i(m,g);for(let S=0;S0?" "+c:c)}return c};function GQ(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rf(d),t());return n=HQ(u),r=n.cache.get,i=n.cache.set,s=c,c(l)}function c(l){const u=r(l);if(u)return u;const d=VQ(l,n);return i(l,d),d}return function(){return s(GQ.apply(null,arguments))}}const kn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},z4=/^\[(?:([a-z-]+):)?(.+)\]$/i,WQ=/^\d+\/\d+$/,qQ=new Set(["px","full","screen"]),YQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QQ=/\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$/,XQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,JQ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZQ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=t=>bd(t)||qQ.has(t)||WQ.test(t),Qa=t=>Df(t,"length",aX),bd=t=>!!t&&!Number.isNaN(Number(t)),PS=t=>Df(t,"number",bd),bh=t=>!!t&&Number.isInteger(Number(t)),eX=t=>t.endsWith("%")&&bd(t.slice(0,-1)),Ht=t=>z4.test(t),Xa=t=>YQ.test(t),tX=new Set(["length","size","percentage"]),nX=t=>Df(t,tX,V4),rX=t=>Df(t,"position",V4),iX=new Set(["image","url"]),sX=t=>Df(t,iX,lX),oX=t=>Df(t,"",cX),wh=()=>!0,Df=(t,e,n)=>{const r=z4.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},aX=t=>QQ.test(t)&&!XQ.test(t),V4=()=>!1,cX=t=>JQ.test(t),lX=t=>ZQ.test(t),uX=()=>{const t=kn("colors"),e=kn("spacing"),n=kn("blur"),r=kn("brightness"),i=kn("borderColor"),s=kn("borderRadius"),o=kn("borderSpacing"),c=kn("borderWidth"),l=kn("contrast"),u=kn("grayscale"),d=kn("hueRotate"),f=kn("invert"),h=kn("gap"),p=kn("gradientColorStops"),g=kn("gradientColorStopPositions"),m=kn("inset"),y=kn("margin"),b=kn("opacity"),x=kn("padding"),w=kn("saturate"),S=kn("scale"),C=kn("sepia"),_=kn("skew"),A=kn("space"),j=kn("translate"),P=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Ht,e],E=()=>[Ht,e],R=()=>["",na,Qa],M=()=>["auto",bd,Ht],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Ht],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[bd,Ht];return{cacheSize:500,separator:":",theme:{colors:[wh],spacing:[na,Qa],blur:["none","",Xa,Ht],brightness:Q(),borderColor:[t],borderRadius:["none","","full",Xa,Ht],borderSpacing:E(),borderWidth:R(),contrast:Q(),grayscale:D(),hueRotate:Q(),invert:D(),gap:E(),gradientColorStops:[t],gradientColorStopPositions:[eX,Qa],inset:O(),margin:O(),opacity:Q(),padding:E(),saturate:Q(),scale:Q(),sepia:D(),skew:Q(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Ht]}],container:["container"],columns:[{columns:[Xa]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:[...G(),Ht]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bh,Ht]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ht]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",bh,Ht]}],"grid-cols":[{"grid-cols":[wh]}],"col-start-end":[{col:["auto",{span:["full",bh,Ht]},Ht]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[wh]}],"row-start-end":[{row:["auto",{span:[bh,Ht]},Ht]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ht]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ht]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ht,e]}],"min-w":[{"min-w":[Ht,e,"min","max","fit"]}],"max-w":[{"max-w":[Ht,e,"none","full","min","max","fit","prose",{screen:[Xa]},Xa]}],h:[{h:[Ht,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ht,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ht,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ht,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Xa,Qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",PS]}],"font-family":[{font:[wh]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ht]}],"line-clamp":[{"line-clamp":["none",bd,PS]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,Ht]}],"list-image":[{"list-image":["none",Ht]}],"list-style-type":[{list:["none","disc","decimal",Ht]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,Qa]}],"underline-offset":[{"underline-offset":["auto",na,Ht]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ht]}],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",Ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),rX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sX]}],"bg-color":[{bg:[t]}],"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:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:L()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[na,Ht]}],"outline-w":[{outline:[na,Qa]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[na,Qa]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Xa,oX]}],"shadow-color":[{shadow:[wh]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Xa,Ht]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ht]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",Ht]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ht]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[bh,Ht]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ht]}],accent:[{accent:["auto",t]}],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",Ht]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",Ht]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[na,Qa,PS]}],stroke:[{stroke:[t,"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"]}}},dX=KQ(uX);function Pe(...t){return dX(Mt(t))}const fX=IQ,hX=v.forwardRef(({className:t,sideOffset:e=4,...n},r)=>a.jsx(L4,{ref:r,sideOffset:e,className:Pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));hX.displayName=L4.displayName;var m0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},g0=typeof window>"u"||"Deno"in globalThis;function Ls(){}function pX(t,e){return typeof t=="function"?t(e):t}function mX(t){return typeof t=="number"&&t>=0&&t!==1/0}function gX(t,e){return Math.max(t+(e||0)-Date.now(),0)}function IO(t,e){return typeof t=="function"?t(e):t}function vX(t,e){return typeof t=="function"?t(e):t}function RO(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:c}=t;if(o){if(r){if(e.queryHash!==jE(o,e.options))return!1}else if(!Hp(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||s&&!s(e))}function MO(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Bp(e.options.mutationKey)!==Bp(s))return!1}else if(!Hp(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function jE(t,e){return((e==null?void 0:e.queryKeyHashFn)||Bp)(t)}function Bp(t){return JSON.stringify(t,(e,n)=>M_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Hp(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Hp(t[n],e[n])):!1}function G4(t,e){if(t===e)return t;const n=DO(t)&&DO(e);if(n||M_(t)&&M_(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,c=n?[]:{};let l=0;for(let u=0;u{setTimeout(e,t)})}function xX(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?G4(t,e):e}function bX(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function wX(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var EE=Symbol();function K4(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===EE?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var zl,fc,Od,U$,SX=(U$=class extends m0{constructor(){super();fn(this,zl);fn(this,fc);fn(this,Od);Gt(this,Od,e=>{if(!g0&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){xe(this,fc)||this.setEventListener(xe(this,Od))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,fc))==null||e.call(this),Gt(this,fc,void 0))}setEventListener(e){var n;Gt(this,Od,e),(n=xe(this,fc))==null||n.call(this),Gt(this,fc,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){xe(this,zl)!==e&&(Gt(this,zl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof xe(this,zl)=="boolean"?xe(this,zl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},zl=new WeakMap,fc=new WeakMap,Od=new WeakMap,U$),W4=new SX,Id,hc,Rd,B$,CX=(B$=class extends m0{constructor(){super();fn(this,Id,!0);fn(this,hc);fn(this,Rd);Gt(this,Rd,e=>{if(!g0&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){xe(this,hc)||this.setEventListener(xe(this,Rd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,hc))==null||e.call(this),Gt(this,hc,void 0))}setEventListener(e){var n;Gt(this,Rd,e),(n=xe(this,hc))==null||n.call(this),Gt(this,hc,e(this.setOnline.bind(this)))}setOnline(e){xe(this,Id)!==e&&(Gt(this,Id,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return xe(this,Id)}},Id=new WeakMap,hc=new WeakMap,Rd=new WeakMap,B$),zy=new CX;function _X(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function AX(t){return Math.min(1e3*2**t,3e4)}function q4(t){return(t??"online")==="online"?zy.isOnline():!0}var Y4=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function kS(t){return t instanceof Y4}function Q4(t){let e=!1,n=0,r=!1,i;const s=_X(),o=m=>{var y;r||(h(new Y4(m)),(y=t.abort)==null||y.call(t))},c=()=>{e=!0},l=()=>{e=!1},u=()=>W4.isFocused()&&(t.networkMode==="always"||zy.isOnline())&&t.canRun(),d=()=>q4(t.networkMode)&&t.canRun(),f=m=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,m),i==null||i(),s.resolve(m))},h=m=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,m),i==null||i(),s.reject(m))},p=()=>new Promise(m=>{var y;i=b=>{(r||u())&&m(b)},(y=t.onPause)==null||y.call(t)}).then(()=>{var m;i=void 0,r||(m=t.onContinue)==null||m.call(t)}),g=()=>{if(r)return;let m;const y=n===0?t.initialPromise:void 0;try{m=y??t.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(f).catch(b=>{var _;if(r)return;const x=t.retry??(g0?0:3),w=t.retryDelay??AX,S=typeof w=="function"?w(n,b):w,C=x===!0||typeof x=="number"&&nu()?void 0:p()).then(()=>{e?h(b):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}function jX(){let t=[],e=0,n=c=>{c()},r=c=>{c()},i=c=>setTimeout(c,0);const s=c=>{e?t.push(c):i(()=>{n(c)})},o=()=>{const c=t;t=[],c.length&&i(()=>{r(()=>{c.forEach(l=>{n(l)})})})};return{batch:c=>{let l;e++;try{l=c()}finally{e--,e||o()}return l},batchCalls:c=>(...l)=>{s(()=>{c(...l)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var hi=jX(),Vl,H$,X4=(H$=class{constructor(){fn(this,Vl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mX(this.gcTime)&&Gt(this,Vl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(g0?1/0:5*60*1e3))}clearGcTimeout(){xe(this,Vl)&&(clearTimeout(xe(this,Vl)),Gt(this,Vl,void 0))}},Vl=new WeakMap,H$),Md,Dd,ls,Qr,sg,Gl,Fs,oa,z$,EX=(z$=class extends X4{constructor(e){super();fn(this,Fs);fn(this,Md);fn(this,Dd);fn(this,ls);fn(this,Qr);fn(this,sg);fn(this,Gl);Gt(this,Gl,!1),Gt(this,sg,e.defaultOptions),this.setOptions(e.options),this.observers=[],Gt(this,ls,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Gt(this,Md,TX(this.options)),this.state=e.state??xe(this,Md),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=xe(this,Qr))==null?void 0:e.promise}setOptions(e){this.options={...xe(this,sg),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&xe(this,ls).remove(this)}setData(e,n){const r=xX(this.state.data,e,this.options);return Wr(this,Fs,oa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Wr(this,Fs,oa).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=xe(this,Qr))==null?void 0:r.promise;return(i=xe(this,Qr))==null||i.cancel(e),n?n.then(Ls).catch(Ls):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(xe(this,Md))}isActive(){return this.observers.some(e=>vX(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===EE||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!gX(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Qr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Qr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),xe(this,ls).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(xe(this,Qr)&&(xe(this,Gl)?xe(this,Qr).cancel({revert:!0}):xe(this,Qr).cancelRetry()),this.scheduleGc()),xe(this,ls).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Wr(this,Fs,oa).call(this,{type:"invalidate"})}fetch(e,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(xe(this,Qr))return xe(this,Qr).continueRetry(),xe(this,Qr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Gt(this,Gl,!0),r.signal)})},s=()=>{const f=K4(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return i(h),Gt(this,Gl,!1),this.options.persister?this.options.persister(f,h,this):f(h)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),Gt(this,Dd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&Wr(this,Fs,oa).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const c=f=>{var h,p,g,m;kS(f)&&f.silent||Wr(this,Fs,oa).call(this,{type:"error",error:f}),kS(f)||((p=(h=xe(this,ls).config).onError)==null||p.call(h,f,this),(m=(g=xe(this,ls).config).onSettled)==null||m.call(g,this.state.data,f,this)),this.scheduleGc()};return Gt(this,Qr,Q4({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,p,g,m;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(y){c(y);return}(p=(h=xe(this,ls).config).onSuccess)==null||p.call(h,f,this),(m=(g=xe(this,ls).config).onSettled)==null||m.call(g,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,h)=>{Wr(this,Fs,oa).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Wr(this,Fs,oa).call(this,{type:"pause"})},onContinue:()=>{Wr(this,Fs,oa).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),xe(this,Qr).start()}},Md=new WeakMap,Dd=new WeakMap,ls=new WeakMap,Qr=new WeakMap,sg=new WeakMap,Gl=new WeakMap,Fs=new WeakSet,oa=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...NX(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return kS(i)&&i.revert&&xe(this,Dd)?{...xe(this,Dd),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),hi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),xe(this,ls).notify({query:this,type:"updated",action:e})})},z$);function NX(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:q4(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function TX(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Co,V$,PX=(V$=class extends m0{constructor(e={}){super();fn(this,Co);this.config=e,Gt(this,Co,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??jE(i,n);let o=this.get(s);return o||(o=new EX({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){xe(this,Co).has(e.queryHash)||(xe(this,Co).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=xe(this,Co).get(e.queryHash);n&&(e.destroy(),n===e&&xe(this,Co).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){hi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return xe(this,Co).get(e)}getAll(){return[...xe(this,Co).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>RO(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>RO(e,r)):n}notify(e){hi.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){hi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){hi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Co=new WeakMap,V$),_o,ai,Kl,Ao,Ja,G$,kX=(G$=class extends X4{constructor(e){super();fn(this,Ao);fn(this,_o);fn(this,ai);fn(this,Kl);this.mutationId=e.mutationId,Gt(this,ai,e.mutationCache),Gt(this,_o,[]),this.state=e.state||OX(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){xe(this,_o).includes(e)||(xe(this,_o).push(e),this.clearGcTimeout(),xe(this,ai).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Gt(this,_o,xe(this,_o).filter(n=>n!==e)),this.scheduleGc(),xe(this,ai).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){xe(this,_o).length||(this.state.status==="pending"?this.scheduleGc():xe(this,ai).remove(this))}continue(){var e;return((e=xe(this,Kl))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,c,l,u,d,f,h,p,g,m,y,b,x,w,S,C,_,A;Gt(this,Kl,Q4({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(j,P)=>{Wr(this,Ao,Ja).call(this,{type:"failed",failureCount:j,error:P})},onPause:()=>{Wr(this,Ao,Ja).call(this,{type:"pause"})},onContinue:()=>{Wr(this,Ao,Ja).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>xe(this,ai).canRun(this)}));const n=this.state.status==="pending",r=!xe(this,Kl).canStart();try{if(!n){Wr(this,Ao,Ja).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=xe(this,ai).config).onMutate)==null?void 0:s.call(i,e,this));const P=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,e));P!==this.state.context&&Wr(this,Ao,Ja).call(this,{type:"pending",context:P,variables:e,isPaused:r})}const j=await xe(this,Kl).start();return await((u=(l=xe(this,ai).config).onSuccess)==null?void 0:u.call(l,j,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,j,e,this.state.context)),await((p=(h=xe(this,ai).config).onSettled)==null?void 0:p.call(h,j,null,this.state.variables,this.state.context,this)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,j,null,e,this.state.context)),Wr(this,Ao,Ja).call(this,{type:"success",data:j}),j}catch(j){try{throw await((b=(y=xe(this,ai).config).onError)==null?void 0:b.call(y,j,e,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,j,e,this.state.context)),await((C=(S=xe(this,ai).config).onSettled)==null?void 0:C.call(S,void 0,j,this.state.variables,this.state.context,this)),await((A=(_=this.options).onSettled)==null?void 0:A.call(_,void 0,j,e,this.state.context)),j}finally{Wr(this,Ao,Ja).call(this,{type:"error",error:j})}}finally{xe(this,ai).runNext(this)}}},_o=new WeakMap,ai=new WeakMap,Kl=new WeakMap,Ao=new WeakSet,Ja=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),hi.batch(()=>{xe(this,_o).forEach(r=>{r.onMutationUpdate(e)}),xe(this,ai).notify({mutation:this,type:"updated",action:e})})},G$);function OX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vi,og,K$,IX=(K$=class extends m0{constructor(e={}){super();fn(this,Vi);fn(this,og);this.config=e,Gt(this,Vi,new Map),Gt(this,og,Date.now())}build(e,n,r){const i=new kX({mutationCache:this,mutationId:++Bg(this,og)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){const n=lv(e),r=xe(this,Vi).get(n)??[];r.push(e),xe(this,Vi).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=lv(e);if(xe(this,Vi).has(n)){const i=(r=xe(this,Vi).get(n))==null?void 0:r.filter(s=>s!==e);i&&(i.length===0?xe(this,Vi).delete(n):xe(this,Vi).set(n,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=xe(this,Vi).get(lv(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=xe(this,Vi).get(lv(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){hi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...xe(this,Vi).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>MO(n,r))}findAll(e={}){return this.getAll().filter(n=>MO(e,n))}notify(e){hi.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return hi.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ls))))}},Vi=new WeakMap,og=new WeakMap,K$);function lv(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function LO(t){return{onFetch:(e,n)=>{var d,f,h,p,g;const r=e.options,i=(h=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,s=((p=e.state.data)==null?void 0:p.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let c={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},b=K4(e.options,e.fetchOptions),x=async(w,S,C)=>{if(m)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const _={queryKey:e.queryKey,pageParam:S,direction:C?"backward":"forward",meta:e.options.meta};y(_);const A=await b(_),{maxPages:j}=e.options,P=C?wX:bX;return{pages:P(w.pages,A,j),pageParams:P(w.pageParams,S,j)}};if(i&&s.length){const w=i==="backward",S=w?RX:FO,C={pages:s,pageParams:o},_=S(r,C);c=await x(C,_,w)}else{const w=t??s.length;do{const S=l===0?o[0]??r.initialPageParam:FO(r,c);if(l>0&&S==null)break;c=await x(c,S),l++}while(l{var m,y;return(y=(m=e.options).persister)==null?void 0:y.call(m,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function FO(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function RX(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Jn,pc,mc,$d,Ld,gc,Fd,Ud,W$,MX=(W$=class{constructor(t={}){fn(this,Jn);fn(this,pc);fn(this,mc);fn(this,$d);fn(this,Ld);fn(this,gc);fn(this,Fd);fn(this,Ud);Gt(this,Jn,t.queryCache||new PX),Gt(this,pc,t.mutationCache||new IX),Gt(this,mc,t.defaultOptions||{}),Gt(this,$d,new Map),Gt(this,Ld,new Map),Gt(this,gc,0)}mount(){Bg(this,gc)._++,xe(this,gc)===1&&(Gt(this,Fd,W4.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Jn).onFocus())})),Gt(this,Ud,zy.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Jn).onOnline())})))}unmount(){var t,e;Bg(this,gc)._--,xe(this,gc)===0&&((t=xe(this,Fd))==null||t.call(this),Gt(this,Fd,void 0),(e=xe(this,Ud))==null||e.call(this),Gt(this,Ud,void 0))}isFetching(t){return xe(this,Jn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return xe(this,pc).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Jn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=xe(this,Jn).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(IO(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return xe(this,Jn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=xe(this,Jn).get(r.queryHash),s=i==null?void 0:i.state.data,o=pX(e,s);if(o!==void 0)return xe(this,Jn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return hi.batch(()=>xe(this,Jn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Jn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=xe(this,Jn);hi.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=xe(this,Jn),r={type:"active",...t};return hi.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=hi.batch(()=>xe(this,Jn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Ls).catch(Ls)}invalidateQueries(t={},e={}){return hi.batch(()=>{if(xe(this,Jn).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=hi.batch(()=>xe(this,Jn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ls)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ls)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=xe(this,Jn).build(this,e);return n.isStaleByTime(IO(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ls).catch(Ls)}fetchInfiniteQuery(t){return t.behavior=LO(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ls).catch(Ls)}ensureInfiniteQueryData(t){return t.behavior=LO(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return zy.isOnline()?xe(this,pc).resumePausedMutations():Promise.resolve()}getQueryCache(){return xe(this,Jn)}getMutationCache(){return xe(this,pc)}getDefaultOptions(){return xe(this,mc)}setDefaultOptions(t){Gt(this,mc,t)}setQueryDefaults(t,e){xe(this,$d).set(Bp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...xe(this,$d).values()];let n={};return e.forEach(r=>{Hp(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){xe(this,Ld).set(Bp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...xe(this,Ld).values()];let n={};return e.forEach(r=>{Hp(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...xe(this,mc).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=jE(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===EE&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...xe(this,mc).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){xe(this,Jn).clear(),xe(this,pc).clear()}},Jn=new WeakMap,pc=new WeakMap,mc=new WeakMap,$d=new WeakMap,Ld=new WeakMap,gc=new WeakMap,Fd=new WeakMap,Ud=new WeakMap,W$),DX=v.createContext(void 0),$X=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a.jsx(DX.Provider,{value:t,children:e}));/** + * @remix-run/router v1.20.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function zp(){return zp=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function J4(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function FX(){return Math.random().toString(36).substr(2,8)}function BO(t,e){return{usr:t.state,key:t.key,idx:e}}function D_(t,e,n,r){return n===void 0&&(n=null),zp({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?$f(e):e,{state:n,key:e&&e.key||r||FX()})}function Vy(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function $f(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function UX(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,c=xc.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(zp({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){c=xc.Pop;let y=d(),b=y==null?null:y-u;u=y,l&&l({action:c,location:m.location,delta:b})}function h(y,b){c=xc.Push;let x=D_(m.location,y,b);u=d()+1;let w=BO(x,u),S=m.createHref(x);try{o.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(S)}s&&l&&l({action:c,location:m.location,delta:1})}function p(y,b){c=xc.Replace;let x=D_(m.location,y,b);u=d();let w=BO(x,u),S=m.createHref(x);o.replaceState(w,"",S),s&&l&&l({action:c,location:m.location,delta:0})}function g(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof y=="string"?y:Vy(y);return x=x.replace(/ $/,"%20"),sr(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let m={get action(){return c},get location(){return t(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(UO,f),l=y,()=>{i.removeEventListener(UO,f),l=null}},createHref(y){return e(i,y)},createURL:g,encodeLocation(y){let b=g(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var HO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(HO||(HO={}));function BX(t,e,n){return n===void 0&&(n="/"),HX(t,e,n,!1)}function HX(t,e,n,r){let i=typeof e=="string"?$f(e):e,s=NE(i.pathname||"/",n);if(s==null)return null;let o=Z4(t);zX(o);let c=null;for(let l=0;c==null&&l{let l={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(sr(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Oc([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(sr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Z4(s.children,e,d,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:QX(u,s.index),routesMeta:d})};return t.forEach((s,o)=>{var c;if(s.path===""||!((c=s.path)!=null&&c.includes("?")))i(s,o);else for(let l of e5(s.path))i(s,o,l)}),e}function e5(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=e5(r.join("/")),c=[];return c.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&c.push(...o),c.map(l=>t.startsWith("/")&&l===""?"/":l)}function zX(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:XX(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const VX=/^:[\w-]+$/,GX=3,KX=2,WX=1,qX=10,YX=-2,zO=t=>t==="*";function QX(t,e){let n=t.split("/"),r=n.length;return n.some(zO)&&(r+=YX),e&&(r+=KX),n.filter(i=>!zO(i)).reduce((i,s)=>i+(VX.test(s)?GX:s===""?WX:qX),r)}function XX(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function JX(t,e,n){let{routesMeta:r}=t,i={},s="/",o=[];for(let c=0;c{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=c[f]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const g=c[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:t}}function ZX(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),J4(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,l)=>(r.push({paramName:c,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function eJ(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return J4(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function NE(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function tJ(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?$f(t):t;return{pathname:n?n.startsWith("/")?n:nJ(n,e):e,search:sJ(r),hash:oJ(i)}}function nJ(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function OS(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function rJ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function TE(t,e){let n=rJ(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function PE(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=$f(t):(i=zp({},t),sr(!i.pathname||!i.pathname.includes("?"),OS("?","pathname","search",i)),sr(!i.pathname||!i.pathname.includes("#"),OS("#","pathname","hash",i)),sr(!i.search||!i.search.includes("#"),OS("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,c;if(o==null)c=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}c=f>=0?e[f]:"/"}let l=tJ(i,c),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Oc=t=>t.join("/").replace(/\/\/+/g,"/"),iJ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),sJ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,oJ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function aJ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const t5=["post","put","patch","delete"];new Set(t5);const cJ=["get",...t5];new Set(cJ);/** + * React Router v6.27.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Vp(){return Vp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{c.current=!0}),v.useCallback(function(u,d){if(d===void 0&&(d={}),!c.current)return;if(typeof u=="number"){r.go(u);return}let f=PE(u,JSON.parse(o),s,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Oc([e,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[e,r,o,s,t])}function OE(){let{matches:t}=v.useContext(za),e=t[t.length-1];return e?e.params:{}}function i5(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=v.useContext(ll),{matches:i}=v.useContext(za),{pathname:s}=Ui(),o=JSON.stringify(TE(i,r.v7_relativeSplatPath));return v.useMemo(()=>PE(t,JSON.parse(o),s,n==="path"),[t,o,s,n])}function fJ(t,e){return hJ(t,e)}function hJ(t,e,n,r){Lf()||sr(!1);let{navigator:i}=v.useContext(ll),{matches:s}=v.useContext(za),o=s[s.length-1],c=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Ui(),d;if(e){var f;let y=typeof e=="string"?$f(e):e;l==="/"||(f=y.pathname)!=null&&f.startsWith(l)||sr(!1),d=y}else d=u;let h=d.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=BX(t,{pathname:p}),m=yJ(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Oc([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Oc([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return e&&m?v.createElement(v0.Provider,{value:{location:Vp({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:xc.Pop}},m):m}function pJ(){let t=SJ(),e=aJ(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},e),n?v.createElement("pre",{style:i},n):null,null)}const mJ=v.createElement(pJ,null);class gJ extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?v.createElement(za.Provider,{value:this.props.routeContext},v.createElement(n5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vJ(t){let{routeContext:e,match:n,children:r}=t,i=v.useContext(kE);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(za.Provider,{value:e},r)}function yJ(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,c=(i=n)==null?void 0:i.errors;if(c!=null){let d=o.findIndex(f=>f.route.id&&(c==null?void 0:c[f.route.id])!==void 0);d>=0||sr(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,m=null,y=null;n&&(p=c&&f.route.id?c[f.route.id]:void 0,m=f.route.errorElement||mJ,l&&(u<0&&h===0?(g=!0,y=null):u===h&&(g=!0,y=f.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,h+1)),x=()=>{let w;return p?w=m:g?w=y:f.route.Component?w=v.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,v.createElement(vJ,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?v.createElement(gJ,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var s5=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(s5||{}),Gy=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Gy||{});function xJ(t){let e=v.useContext(kE);return e||sr(!1),e}function bJ(t){let e=v.useContext(lJ);return e||sr(!1),e}function wJ(t){let e=v.useContext(za);return e||sr(!1),e}function o5(t){let e=wJ(),n=e.matches[e.matches.length-1];return n.route.id||sr(!1),n.route.id}function SJ(){var t;let e=v.useContext(n5),n=bJ(Gy.UseRouteError),r=o5(Gy.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function CJ(){let{router:t}=xJ(s5.UseNavigateStable),e=o5(Gy.UseNavigateStable),n=v.useRef(!1);return r5(()=>{n.current=!0}),v.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Vp({fromRouteId:e},s)))},[t,e])}function a5(t){let{to:e,replace:n,state:r,relative:i}=t;Lf()||sr(!1);let{future:s,static:o}=v.useContext(ll),{matches:c}=v.useContext(za),{pathname:l}=Ui(),u=ar(),d=PE(e,TE(c,s.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(d);return v.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function Ms(t){sr(!1)}function _J(t){let{basename:e="/",children:n=null,location:r,navigationType:i=xc.Pop,navigator:s,static:o=!1,future:c}=t;Lf()&&sr(!1);let l=e.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:l,navigator:s,static:o,future:Vp({v7_relativeSplatPath:!1},c)}),[l,c,s,o]);typeof r=="string"&&(r=$f(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=v.useMemo(()=>{let y=NE(d,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:g},navigationType:i}},[l,d,f,h,p,g,i]);return m==null?null:v.createElement(ll.Provider,{value:u},v.createElement(v0.Provider,{children:n,value:m}))}function AJ(t){let{children:e,location:n}=t;return fJ($_(e),n)}new Promise(()=>{});function $_(t,e){e===void 0&&(e=[]);let n=[];return v.Children.forEach(t,(r,i)=>{if(!v.isValidElement(r))return;let s=[...e,i];if(r.type===v.Fragment){n.push.apply(n,$_(r.props.children,s));return}r.type!==Ms&&sr(!1),!r.props.index||!r.props.children||sr(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=$_(r.props.children,s)),n.push(o)}),n}/** + * React Router DOM v6.27.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function L_(){return L_=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function EJ(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function NJ(t,e){return t.button===0&&(!e||e==="_self")&&!EJ(t)}function F_(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function TJ(t,e){let n=F_(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}const PJ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],kJ="6";try{window.__reactRouterVersion=kJ}catch{}const OJ="startTransition",GO=iL[OJ];function IJ(t){let{basename:e,children:n,future:r,window:i}=t,s=v.useRef();s.current==null&&(s.current=LX({window:i,v5Compat:!0}));let o=s.current,[c,l]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=v.useCallback(f=>{u&&GO?GO(()=>l(f)):l(f)},[l,u]);return v.useLayoutEffect(()=>o.listen(d),[o,d]),v.createElement(_J,{basename:e,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const RJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MJ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ys=v.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f}=e,h=jJ(e,PJ),{basename:p}=v.useContext(ll),g,m=!1;if(typeof u=="string"&&MJ.test(u)&&(g=u,RJ))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=NE(S.pathname,p);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:m=!0}catch{}let y=uJ(u,{relative:i}),b=DJ(u,{replace:o,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f});function x(w){r&&r(w),w.defaultPrevented||b(w)}return v.createElement("a",L_({},h,{href:g||y,onClick:m||s?r:x,ref:n,target:l}))});var KO;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(KO||(KO={}));var WO;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(WO||(WO={}));function DJ(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:c}=e===void 0?{}:e,l=ar(),u=Ui(),d=i5(t,{relative:o});return v.useCallback(f=>{if(NJ(f,n)){f.preventDefault();let h=r!==void 0?r:Vy(u)===Vy(d);l(t,{replace:h,state:i,preventScrollReset:s,relative:o,viewTransition:c})}},[u,l,d,r,i,n,t,s,o,c])}function $J(t){let e=v.useRef(F_(t)),n=v.useRef(!1),r=Ui(),i=v.useMemo(()=>TJ(r.search,n.current?null:e.current),[r.search]),s=ar(),o=v.useCallback((c,l)=>{const u=F_(typeof c=="function"?c(i):c);n.current=!0,s("?"+u,l)},[s,i]);return[i,o]}/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LJ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c5=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var FJ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UJ=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...c},l)=>v.createElement("svg",{ref:l,...FJ,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:c5("lucide",i),...c},[...o.map(([u,d])=>v.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Me=(t,e)=>{const n=v.forwardRef(({className:r,...i},s)=>v.createElement(UJ,{ref:s,iconNode:e,className:c5(`lucide-${LJ(t)}`,r),...i}));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ha=Me("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qO=Me("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gp=Me("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IS=Me("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const va=Me("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lu=Me("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YO=Me("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const BJ=Me("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HJ=Me("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U_=Me("ChartNoAxesColumnIncreasing",[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zJ=Me("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Es=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ra=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const us=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uu=Me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VJ=Me("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IE=Me("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bh=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l5=Me("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GJ=Me("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KJ=Me("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RE=Me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WJ=Me("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kp=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qJ=Me("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QO=Me("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xc=Me("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B_=Me("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YJ=Me("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wp=Me("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QJ=Me("FileVideo",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ME=Me("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u5=Me("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ds=Me("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XJ=Me("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H_=Me("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ky=Me("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const op=Me("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JJ=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZJ=Me("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z_=Me("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eZ=Me("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const du=Me("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uv=Me("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Js=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tZ=Me("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XO=Me("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JO=Me("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nZ=Me("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rZ=Me("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jo=Me("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vo=Me("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iZ=Me("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZO=Me("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V_=Me("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sZ=Me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oZ=Me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Br=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aZ=Me("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yl=Me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DE=Me("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $E=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LE=Me("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cZ=Me("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lZ=Me("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uZ=Me("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dZ=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fZ=Me("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wy=Me("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hZ=Me("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xv=Me("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qn=Me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pZ=Me("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mZ=Me("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gZ=Me("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qp=Me("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dr=Me("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vZ=Me("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ri=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d5=Me("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"}]]);function f5(t,e){return function(){return t.apply(e,arguments)}}const{toString:yZ}=Object.prototype,{getPrototypeOf:FE}=Object,{iterator:y0,toStringTag:h5}=Symbol,x0=(t=>e=>{const n=yZ.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),po=t=>(t=t.toLowerCase(),e=>x0(e)===t),b0=t=>e=>typeof e===t,{isArray:Ff}=Array,Yp=b0("undefined");function xZ(t){return t!==null&&!Yp(t)&&t.constructor!==null&&!Yp(t.constructor)&&Mi(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const p5=po("ArrayBuffer");function bZ(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&p5(t.buffer),e}const wZ=b0("string"),Mi=b0("function"),m5=b0("number"),w0=t=>t!==null&&typeof t=="object",SZ=t=>t===!0||t===!1,Jv=t=>{if(x0(t)!=="object")return!1;const e=FE(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(h5 in t)&&!(y0 in t)},CZ=po("Date"),_Z=po("File"),AZ=po("Blob"),jZ=po("FileList"),EZ=t=>w0(t)&&Mi(t.pipe),NZ=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Mi(t.append)&&((e=x0(t))==="formdata"||e==="object"&&Mi(t.toString)&&t.toString()==="[object FormData]"))},TZ=po("URLSearchParams"),[PZ,kZ,OZ,IZ]=["ReadableStream","Request","Response","Headers"].map(po),RZ=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mg(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Ff(t))for(r=0,i=t.length;r0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Il=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,v5=t=>!Yp(t)&&t!==Il;function G_(){const{caseless:t}=v5(this)&&this||{},e={},n=(r,i)=>{const s=t&&g5(e,i)||i;Jv(e[s])&&Jv(r)?e[s]=G_(e[s],r):Jv(r)?e[s]=G_({},r):Ff(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r(mg(e,(i,s)=>{n&&Mi(i)?t[s]=f5(i,n):t[s]=i},{allOwnKeys:r}),t),DZ=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),$Z=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},LZ=(t,e,n,r)=>{let i,s,o;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!r||r(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=n!==!1&&FE(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},FZ=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},UZ=t=>{if(!t)return null;if(Ff(t))return t;let e=t.length;if(!m5(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},BZ=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&FE(Uint8Array)),HZ=(t,e)=>{const r=(t&&t[y0]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},zZ=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},VZ=po("HTMLFormElement"),GZ=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),eI=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),KZ=po("RegExp"),y5=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};mg(n,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(r[s]=o||i)}),Object.defineProperties(t,r)},WZ=t=>{y5(t,(e,n)=>{if(Mi(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Mi(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},qZ=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Ff(t)?r(t):r(String(t).split(e)),n},YZ=()=>{},QZ=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function XZ(t){return!!(t&&Mi(t.append)&&t[h5]==="FormData"&&t[y0])}const JZ=t=>{const e=new Array(10),n=(r,i)=>{if(w0(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=Ff(r)?[]:{};return mg(r,(o,c)=>{const l=n(o,i+1);!Yp(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},ZZ=po("AsyncFunction"),eee=t=>t&&(w0(t)||Mi(t))&&Mi(t.then)&&Mi(t.catch),x5=((t,e)=>t?setImmediate:e?((n,r)=>(Il.addEventListener("message",({source:i,data:s})=>{i===Il&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Il.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Mi(Il.postMessage)),tee=typeof queueMicrotask<"u"?queueMicrotask.bind(Il):typeof process<"u"&&process.nextTick||x5,nee=t=>t!=null&&Mi(t[y0]),oe={isArray:Ff,isArrayBuffer:p5,isBuffer:xZ,isFormData:NZ,isArrayBufferView:bZ,isString:wZ,isNumber:m5,isBoolean:SZ,isObject:w0,isPlainObject:Jv,isReadableStream:PZ,isRequest:kZ,isResponse:OZ,isHeaders:IZ,isUndefined:Yp,isDate:CZ,isFile:_Z,isBlob:AZ,isRegExp:KZ,isFunction:Mi,isStream:EZ,isURLSearchParams:TZ,isTypedArray:BZ,isFileList:jZ,forEach:mg,merge:G_,extend:MZ,trim:RZ,stripBOM:DZ,inherits:$Z,toFlatObject:LZ,kindOf:x0,kindOfTest:po,endsWith:FZ,toArray:UZ,forEachEntry:HZ,matchAll:zZ,isHTMLForm:VZ,hasOwnProperty:eI,hasOwnProp:eI,reduceDescriptors:y5,freezeMethods:WZ,toObjectSet:qZ,toCamelCase:GZ,noop:YZ,toFiniteNumber:QZ,findKey:g5,global:Il,isContextDefined:v5,isSpecCompliantForm:XZ,toJSONObject:JZ,isAsyncFn:ZZ,isThenable:eee,setImmediate:x5,asap:tee,isIterable:nee};function Ft(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}oe.inherits(Ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const b5=Ft.prototype,w5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{w5[t]={value:t}});Object.defineProperties(Ft,w5);Object.defineProperty(b5,"isAxiosError",{value:!0});Ft.from=(t,e,n,r,i,s)=>{const o=Object.create(b5);return oe.toFlatObject(t,o,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),Ft.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const ree=null;function K_(t){return oe.isPlainObject(t)||oe.isArray(t)}function S5(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function tI(t,e,n){return t?t.concat(e).map(function(i,s){return i=S5(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function iee(t){return oe.isArray(t)&&!t.some(K_)}const see=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function S0(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!oe.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||d,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(i))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(oe.isDate(g))return g.toISOString();if(!l&&oe.isBlob(g))throw new Ft("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(g)||oe.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,y){let b=g;if(g&&!y&&typeof g=="object"){if(oe.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(oe.isArray(g)&&iee(g)||(oe.isFileList(g)||oe.endsWith(m,"[]"))&&(b=oe.toArray(g)))return m=S5(m),b.forEach(function(w,S){!(oe.isUndefined(w)||w===null)&&e.append(o===!0?tI([m],S,s):o===null?m:m+"[]",u(w))}),!1}return K_(g)?!0:(e.append(tI(y,m,s),u(g)),!1)}const f=[],h=Object.assign(see,{defaultVisitor:d,convertValue:u,isVisitable:K_});function p(g,m){if(!oe.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(g),oe.forEach(g,function(b,x){(!(oe.isUndefined(b)||b===null)&&i.call(e,b,oe.isString(x)?x.trim():x,m,h))===!0&&p(b,m?m.concat(x):[x])}),f.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return p(t),e}function nI(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function UE(t,e){this._pairs=[],t&&S0(t,this,e)}const C5=UE.prototype;C5.append=function(e,n){this._pairs.push([e,n])};C5.toString=function(e){const n=e?function(r){return e.call(this,r,nI)}:nI;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function oee(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _5(t,e,n){if(!e)return t;const r=n&&n.encode||oee;oe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(e,n):s=oe.isURLSearchParams(e)?e.toString():new UE(e,n).toString(r),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class rI{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const A5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},aee=typeof URLSearchParams<"u"?URLSearchParams:UE,cee=typeof FormData<"u"?FormData:null,lee=typeof Blob<"u"?Blob:null,uee={isBrowser:!0,classes:{URLSearchParams:aee,FormData:cee,Blob:lee},protocols:["http","https","file","blob","url","data"]},BE=typeof window<"u"&&typeof document<"u",W_=typeof navigator=="object"&&navigator||void 0,dee=BE&&(!W_||["ReactNative","NativeScript","NS"].indexOf(W_.product)<0),fee=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hee=BE&&window.location.href||"http://localhost",pee=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:BE,hasStandardBrowserEnv:dee,hasStandardBrowserWebWorkerEnv:fee,navigator:W_,origin:hee},Symbol.toStringTag,{value:"Module"})),ni={...pee,...uee};function mee(t,e){return S0(t,new ni.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return ni.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function gee(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function vee(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r=n.length;return o=!o&&oe.isArray(i)?i.length:o,l?(oe.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!c):((!i[o]||!oe.isObject(i[o]))&&(i[o]=[]),e(n,r,i[o],s)&&oe.isArray(i[o])&&(i[o]=vee(i[o])),!c)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,i)=>{e(gee(r),i,n,0)}),n}return null}function yee(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(t)}const gg={transitional:A5,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=oe.isObject(e);if(s&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return i?JSON.stringify(j5(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mee(e,this.formSerializer).toString();if((c=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return S0(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),yee(e)):e}],transformResponse:[function(e){const n=this.transitional||gg.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(o)throw c.name==="SyntaxError"?Ft.from(c,Ft.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ni.classes.FormData,Blob:ni.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{gg.headers[t]={}});const xee=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bee=t=>{const e={};let n,r,i;return t&&t.split(` +`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||e[n]&&xee[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},iI=Symbol("internals");function Sh(t){return t&&String(t).trim().toLowerCase()}function Zv(t){return t===!1||t==null?t:oe.isArray(t)?t.map(Zv):String(t)}function wee(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const See=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function RS(t,e,n,r,i){if(oe.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function Cee(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function _ee(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,o){return this[r].call(this,e,i,s,o)},configurable:!0})})}class Di{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(c,l,u){const d=Sh(l);if(!d)throw new Error("header name must be a non-empty string");const f=oe.findKey(i,d);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(i[f||l]=Zv(c))}const o=(c,l)=>oe.forEach(c,(u,d)=>s(u,d,l));if(oe.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(oe.isString(e)&&(e=e.trim())&&!See(e))o(bee(e),n);else if(oe.isObject(e)&&oe.isIterable(e)){let c={},l,u;for(const d of e){if(!oe.isArray(d))throw TypeError("Object iterator must return a key-value pair");c[u=d[0]]=(l=c[u])?oe.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}o(c,n)}else e!=null&&s(n,e,r);return this}get(e,n){if(e=Sh(e),e){const r=oe.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return wee(i);if(oe.isFunction(n))return n.call(this,i,r);if(oe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Sh(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||RS(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(o){if(o=Sh(o),o){const c=oe.findKey(r,o);c&&(!n||RS(r,r[c],c,n))&&(delete r[c],i=!0)}}return oe.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||RS(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return oe.forEach(this,(i,s)=>{const o=oe.findKey(r,s);if(o){n[o]=Zv(i),delete n[s];return}const c=e?Cee(s):String(s).trim();c!==s&&delete n[s],n[c]=Zv(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[iI]=this[iI]={accessors:{}}).accessors,i=this.prototype;function s(o){const c=Sh(o);r[c]||(_ee(i,o),r[c]=!0)}return oe.isArray(e)?e.forEach(s):s(e),this}}Di.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);oe.reduceDescriptors(Di.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});oe.freezeMethods(Di);function MS(t,e){const n=this||gg,r=e||n,i=Di.from(r.headers);let s=r.data;return oe.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function E5(t){return!!(t&&t.__CANCEL__)}function Uf(t,e,n){Ft.call(this,t??"canceled",Ft.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(Uf,Ft,{__CANCEL__:!0});function N5(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Ft("Request failed with status code "+n.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Aee(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function jee(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),d=r[s];o||(o=u),n[i]=l,r[i]=u;let f=s,h=0;for(;f!==i;)h+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o{n=d,i=null,s&&(clearTimeout(s),s=null),t.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-f)))},()=>i&&o(i)]}const qy=(t,e,n=3)=>{let r=0;const i=jee(50,250);return Eee(s=>{const o=s.loaded,c=s.lengthComputable?s.total:void 0,l=o-r,u=i(l),d=o<=c;r=o;const f={loaded:o,total:c,progress:c?o/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&d?(c-o)/u:void 0,event:s,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},sI=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},oI=t=>(...e)=>oe.asap(()=>t(...e)),Nee=ni.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ni.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ni.origin),ni.navigator&&/(msie|trident)/i.test(ni.navigator.userAgent)):()=>!0,Tee=ni.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&o.push("path="+r),oe.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Pee(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function kee(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function T5(t,e,n){let r=!Pee(e);return t&&(r||n==!1)?kee(t,e):e}const aI=t=>t instanceof Di?{...t}:t;function fu(t,e){e=e||{};const n={};function r(u,d,f,h){return oe.isPlainObject(u)&&oe.isPlainObject(d)?oe.merge.call({caseless:h},u,d):oe.isPlainObject(d)?oe.merge({},d):oe.isArray(d)?d.slice():d}function i(u,d,f,h){if(oe.isUndefined(d)){if(!oe.isUndefined(u))return r(void 0,u,f,h)}else return r(u,d,f,h)}function s(u,d){if(!oe.isUndefined(d))return r(void 0,d)}function o(u,d){if(oe.isUndefined(d)){if(!oe.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function c(u,d,f){if(f in e)return r(u,d);if(f in t)return r(void 0,u)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,d,f)=>i(aI(u),aI(d),f,!0)};return oe.forEach(Object.keys(Object.assign({},t,e)),function(d){const f=l[d]||i,h=f(t[d],e[d],d);oe.isUndefined(h)&&f!==c||(n[d]=h)}),n}const P5=t=>{const e=fu({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:c}=e;e.headers=o=Di.from(o),e.url=_5(T5(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(oe.isFormData(n)){if(ni.hasStandardBrowserEnv||ni.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(ni.hasStandardBrowserEnv&&(r&&oe.isFunction(r)&&(r=r(e)),r||r!==!1&&Nee(e.url))){const u=i&&s&&Tee.read(s);u&&o.set(i,u)}return e},Oee=typeof XMLHttpRequest<"u",Iee=Oee&&function(t){return new Promise(function(n,r){const i=P5(t);let s=i.data;const o=Di.from(i.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:u}=i,d,f,h,p,g;function m(){p&&p(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function b(){if(!y)return;const w=Di.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:t,request:y};N5(function(A){n(A),m()},function(A){r(A),m()},C),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new Ft("Request aborted",Ft.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new Ft("Network Error",Ft.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const C=i.transitional||A5;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),r(new Ft(S,C.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,t,y)),y=null},s===void 0&&o.setContentType(null),"setRequestHeader"in y&&oe.forEach(o.toJSON(),function(S,C){y.setRequestHeader(C,S)}),oe.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),c&&c!=="json"&&(y.responseType=i.responseType),u&&([h,g]=qy(u,!0),y.addEventListener("progress",h)),l&&y.upload&&([f,p]=qy(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(d=w=>{y&&(r(!w||w.type?new Uf(null,t,y):w),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const x=Aee(i.url);if(x&&ni.protocols.indexOf(x)===-1){r(new Ft("Unsupported protocol "+x+":",Ft.ERR_BAD_REQUEST,t));return}y.send(s||null)})},Ree=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,c();const d=u instanceof Error?u:this.reason;r.abort(d instanceof Ft?d:new Uf(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,s(new Ft(`timeout ${e} of ms exceeded`,Ft.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),t=null)};t.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>oe.asap(c),l}},Mee=function*(t,e){let n=t.byteLength;if(n{const i=Dee(t,e);let s=0,o,c=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await i.next();if(u){c(),l.close();return}let f=d.byteLength;if(n){let h=s+=f;n(h)}l.enqueue(new Uint8Array(d))}catch(u){throw c(u),u}},cancel(l){return c(l),i.return()}},{highWaterMark:2})},C0=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",k5=C0&&typeof ReadableStream=="function",Lee=C0&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),O5=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Fee=k5&&O5(()=>{let t=!1;const e=new Request(ni.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),lI=64*1024,q_=k5&&O5(()=>oe.isReadableStream(new Response("").body)),Yy={stream:q_&&(t=>t.body)};C0&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Yy[e]&&(Yy[e]=oe.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new Ft(`Response type '${e}' is not supported`,Ft.ERR_NOT_SUPPORT,r)})})})(new Response);const Uee=async t=>{if(t==null)return 0;if(oe.isBlob(t))return t.size;if(oe.isSpecCompliantForm(t))return(await new Request(ni.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(t)||oe.isArrayBuffer(t))return t.byteLength;if(oe.isURLSearchParams(t)&&(t=t+""),oe.isString(t))return(await Lee(t)).byteLength},Bee=async(t,e)=>{const n=oe.toFiniteNumber(t.getContentLength());return n??Uee(e)},Hee=C0&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:c,onUploadProgress:l,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=P5(t);u=u?(u+"").toLowerCase():"text";let p=Ree([i,s&&s.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(l&&Fee&&n!=="get"&&n!=="head"&&(y=await Bee(d,r))!==0){let C=new Request(e,{method:"POST",body:r,duplex:"half"}),_;if(oe.isFormData(r)&&(_=C.headers.get("content-type"))&&d.setContentType(_),C.body){const[A,j]=sI(y,qy(oI(l)));r=cI(C.body,lI,A,j)}}oe.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;g=new Request(e,{...h,signal:p,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:b?f:void 0});let x=await fetch(g);const w=q_&&(u==="stream"||u==="response");if(q_&&(c||w&&m)){const C={};["status","statusText","headers"].forEach(P=>{C[P]=x[P]});const _=oe.toFiniteNumber(x.headers.get("content-length")),[A,j]=c&&sI(_,qy(oI(c),!0))||[];x=new Response(cI(x.body,lI,A,()=>{j&&j(),m&&m()}),C)}u=u||"text";let S=await Yy[oe.findKey(Yy,u)||"text"](x,t);return!w&&m&&m(),await new Promise((C,_)=>{N5(C,_,{data:S,headers:Di.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,t,g),{cause:b.cause||b}):Ft.from(b,b&&b.code,t,g)}}),Y_={http:ree,xhr:Iee,fetch:Hee};oe.forEach(Y_,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const uI=t=>`- ${t}`,zee=t=>oe.isFunction(t)||t===null||t===!1,I5={getAdapter:t=>{t=oe.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : +`+s.map(uI).join(` +`):" "+uI(s[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Y_};function DS(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Uf(null,t)}function dI(t){return DS(t),t.headers=Di.from(t.headers),t.data=MS.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),I5.getAdapter(t.adapter||gg.adapter)(t).then(function(r){return DS(t),r.data=MS.call(t,t.transformResponse,r),r.headers=Di.from(r.headers),r},function(r){return E5(r)||(DS(t),r&&r.response&&(r.response.data=MS.call(t,t.transformResponse,r.response),r.response.headers=Di.from(r.response.headers))),Promise.reject(r)})}const R5="1.9.0",_0={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{_0[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const fI={};_0.transitional=function(e,n,r){function i(s,o){return"[Axios v"+R5+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,c)=>{if(e===!1)throw new Ft(i(o," has been removed"+(n?" in "+n:"")),Ft.ERR_DEPRECATED);return n&&!fI[o]&&(fI[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,c):!0}};_0.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Vee(t,e,n){if(typeof t!="object")throw new Ft("options must be an object",Ft.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const c=t[s],l=c===void 0||o(c,s,t);if(l!==!0)throw new Ft("option "+s+" must be "+l,Ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ft("Unknown option "+s,Ft.ERR_BAD_OPTION)}}const ey={assertOptions:Vee,validators:_0},xo=ey.validators;class Ql{constructor(e){this.defaults=e||{},this.interceptors={request:new rI,response:new rI}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=fu(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&ey.assertOptions(r,{silentJSONParsing:xo.transitional(xo.boolean),forcedJSONParsing:xo.transitional(xo.boolean),clarifyTimeoutError:xo.transitional(xo.boolean)},!1),i!=null&&(oe.isFunction(i)?n.paramsSerializer={serialize:i}:ey.assertOptions(i,{encode:xo.function,serialize:xo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ey.assertOptions(n,{baseUrl:xo.spelling("baseURL"),withXsrfToken:xo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&oe.merge(s.common,s[n.method]);s&&oe.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Di.concat(o,s);const c=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!l){const g=[dI.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,u),h=g.length,d=Promise.resolve(n);f{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(c=>{r.subscribe(c),s=c}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,c){r.reason||(r.reason=new Uf(s,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new HE(function(i){e=i}),cancel:e}}}function Gee(t){return function(n){return t.apply(null,n)}}function Kee(t){return oe.isObject(t)&&t.isAxiosError===!0}const Q_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Q_).forEach(([t,e])=>{Q_[e]=t});function M5(t){const e=new Ql(t),n=f5(Ql.prototype.request,e);return oe.extend(n,Ql.prototype,e,{allOwnKeys:!0}),oe.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return M5(fu(t,i))},n}const vr=M5(gg);vr.Axios=Ql;vr.CanceledError=Uf;vr.CancelToken=HE;vr.isCancel=E5;vr.VERSION=R5;vr.toFormData=S0;vr.AxiosError=Ft;vr.Cancel=vr.CanceledError;vr.all=function(e){return Promise.all(e)};vr.spread=Gee;vr.isAxiosError=Kee;vr.mergeConfig=fu;vr.AxiosHeaders=Di;vr.formToJSON=t=>j5(oe.isHTMLForm(t)?new FormData(t):t);vr.getAdapter=I5.getAdapter;vr.HttpStatusCode=Q_;vr.default=vr;const D5="https://ai-sandbox.oliver.solutions/semblance_back/api",Le=vr.create({baseURL:D5,headers:{"Content-Type":"application/json"},timeout:6e5});Le.interceptors.request.use(t=>{var n,r;const e=localStorage.getItem("auth_token");return e&&(t.headers.Authorization=`Bearer ${e}`),t.method==="put"&&((n=t.url)!=null&&n.includes("/focus-groups/"))&&console.log("🌐 API Request:",{method:t.method,url:t.url,baseURL:t.baseURL,fullURL:`${t.baseURL}${t.url}`,data:t.data}),(r=t.url)!=null&&r.includes("/folders/")&&console.log("🌐 API Folder Request:",{method:t.method,url:t.url,baseURL:t.baseURL,fullURL:`${t.baseURL}${t.url}`,data:t.data}),t},t=>Promise.reject(t));const X_="auth_error",Wee=t=>{t!=null&&t.isPersonaCreation||(localStorage.removeItem("auth_token"),localStorage.removeItem("user"));const e=new CustomEvent(X_,{detail:t||{}});window.dispatchEvent(e)};Le.interceptors.response.use(t=>t,t=>{var e,n,r,i,s,o;if(t.response&&t.response.status===401){const c=t.config&&(((e=t.config.url)==null?void 0:e.includes("/personas"))||((n=t.config.url)==null?void 0:n.includes("/personas/batch"))||t.config.method&&((r=t.config.url)==null?void 0:r.startsWith("/personas")));console.log("API Error:",{url:(i=t.config)==null?void 0:i.url,method:(s=t.config)==null?void 0:s.method,isPersonaRequest:c}),c?console.warn("Authentication error in persona request, letting component handle it"):Wee({source:(o=t.config)==null?void 0:o.url,isPersonaCreation:!1})}return Promise.reject(t)});const ty={login:(t,e)=>Le.post("/auth/login",{username:t,password:e}),loginWithMicrosoft:t=>Le.post("/auth/microsoft",{id_token:t}),register:(t,e,n)=>Le.post("/auth/register",{username:t,email:e,password:n}),getProfile:()=>Le.get("/auth/me")},Rr={getAll:()=>Le.get("/personas/all"),getById:t=>Le.get(`/personas/${t}`),create:t=>Le.post("/personas",t),update:(t,e)=>t&&t.startsWith("local-")?(console.log("Cannot update with local ID, creating new instead:",t),Le.post("/personas",e)):Le.put(`/personas/${t}`,e),delete:t=>{const e=typeof t=="object"&&t!==null&&t._id||t;return console.log(`Deleting persona with ID: ${e}`),Le.delete(`/personas/${e}`)},createBatch:t=>Le.post("/personas/batch",t),exportProfile:(t,e)=>Le.post(`/personas/${t}/export-profile`,e||{},{timeout:3e5})},la={generate:t=>Le.post("/ai-personas/generate",t||{},{timeout:6e5}),generateAndSave:t=>Le.post("/ai-personas/generate-and-save",t||{},{timeout:6e5}),batchGenerate:t=>Le.post("/ai-personas/batch-generate",t,{timeout:6e5}),batchGenerateAndSave:t=>Le.post("/ai-personas/batch-generate-and-save",t,{timeout:6e5}),generateBasicProfiles:(t,e=5,n=.8)=>Le.post("/ai-personas/generate-basic-profiles",{audience_brief:t,count:e,temperature:n},{timeout:6e5}),completePersona:(t,e=.7)=>Le.post("/ai-personas/complete-persona",{basic_profile:t,temperature:e},{timeout:6e5}),completeAndSavePersona:(t,e=.7)=>Le.post("/ai-personas/complete-and-save-persona",{basic_profile:t,temperature:e},{timeout:6e5}),generatePersonaSummary:(t,e=.7)=>Le.post("/ai-personas/generate-persona-summary",{persona_data:t,temperature:e},{timeout:6e5}),batchGenerateWithStages:async(t,e,n=5,r=.7,i,s)=>{var o;try{console.log(`📡 API call to generate-basic-profiles with model: ${s||"gemini-2.5-pro"}`);const l=(await Le.post("/ai-personas/generate-basic-profiles",{audience_brief:t,research_objective:e,count:n,temperature:.7,customer_data_session_id:i,llm_model:s||"gemini-2.5-pro"},{timeout:6e5})).data.profiles,u=[],d=[],f=[];console.log(`📡 API call to complete-and-save-persona with model: ${s||"gemini-2.5-pro"}`);const h=l.map(g=>Le.post("/ai-personas/complete-and-save-persona",{basic_profile:g,temperature:r,customer_data_session_id:i,llm_model:s||"gemini-2.5-pro"},{timeout:6e5}));if((await Promise.allSettled(h)).forEach((g,m)=>{if(g.status==="fulfilled")u.push(g.value.data.persona),d.push(g.value.data.persona_id);else{const y=l[m],b={index:m,name:y.name||`Persona ${m+1}`,error:g.reason};f.push(b),console.error(`Failed to complete persona ${m+1} (${y.name||"unnamed"}):`,g.reason)}}),u.length===0&&f.length>0)throw new Error(`Failed to generate any personas. ${f.length} profile(s) failed.`);return{data:{message:`Generated and saved ${u.length} personas${f.length>0?` (${f.length} failed)`:""}`,personas:u,persona_ids:d,errors:f.length>0?f:void 0,partial_success:f.length>0&&u.length>0}}}catch(c){throw((o=c.response)==null?void 0:o.status)===504||c.code==="ECONNABORTED"?new Error("Timeout error: The server took too long to generate personas. Please try with fewer personas or try again later."):c}},enhanceAudienceBrief:(t,e,n=.7)=>Le.post("/ai-personas/enhance-audience-brief",{audience_brief:t,research_objective:e,temperature:n},{timeout:6e5}),batchGenerateSummaries:(t,e=.7,n)=>(console.log(`📡 Frontend: API call to batch-generate-summaries with model: ${n||"gemini-2.5-pro"}`),Le.post("/ai-personas/batch-generate-summaries",{persona_ids:t,temperature:e,llm_model:n||"gemini-2.5-pro"},{timeout:9e5})),uploadCustomerData:t=>{const e=new FormData;for(let n=0;nLe.delete(`/ai-personas/cleanup-customer-data/${t}`)},pt={getAll:()=>Le.get("/focus-groups"),getById:t=>Le.get(`/focus-groups/${t}`),create:t=>Le.post("/focus-groups",t),update:(t,e)=>Le.put(`/focus-groups/${t}`,e),delete:t=>Le.delete(`/focus-groups/${t}`),addParticipant:(t,e)=>Le.post(`/focus-groups/${t}/participants`,{persona_id:e}),removeParticipant:(t,e)=>Le.delete(`/focus-groups/${t}/participants/${e}`),sendMessage:(t,e)=>Le.post(`/focus-groups/${t}/messages`,e),getMessages:t=>Le.get(`/focus-groups/${t}/messages`),updateMessageHighlight:(t,e,n)=>Le.patch(`/focus-groups/${t}/messages/${e}`,{highlighted:n}),describeAsset:(t,e)=>Le.post(`/focus-groups/${t}/describe-asset`,{asset_filename:e},{timeout:12e4}),generateDiscussionGuide:t=>Le.post("/focus-groups/generate-discussion-guide",t,{timeout:6e5}),generateDiscussionGuideForGroup:(t,e)=>Le.post(`/focus-groups/${t}/generate-discussion-guide`,e,{timeout:6e5}),downloadDiscussionGuide:async t=>{try{const e=await Le.get(`/focus-groups/${t}/discussion-guide/download`,{responseType:"blob",timeout:3e4}),n=e.headers["content-disposition"];let r="discussion-guide.md";if(n){const c=n.match(/filename="([^"]+)"/);c&&(r=c[1])}const i=new Blob([e.data],{type:"text/markdown"}),s=URL.createObjectURL(i),o=document.createElement("a");return o.href=s,o.download=r,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s),{success:!0,filename:r}}catch(e){throw console.error("Error downloading discussion guide:",e),new Error("Failed to download discussion guide")}},createNote:(t,e)=>Le.post(`/focus-groups/${t}/notes`,e),getNotes:t=>Le.get(`/focus-groups/${t}/notes`),deleteNote:(t,e)=>Le.delete(`/focus-groups/${t}/notes/${e}`),uploadAssets:(t,e,n)=>(n===!0&&e.append("replace","true"),Le.post(`/focus-groups/${t}/assets`,e,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4})),getAssets:t=>Le.get(`/focus-groups/${t}/assets`),getAssetUrl:(t,e)=>`${D5}/focus-groups/${t}/assets/${e}`,updateAssetName:(t,e,n)=>Le.patch(`/focus-groups/${t}/assets/${e}`,{user_assigned_name:n}),deleteAsset:(t,e)=>Le.delete(`/focus-groups/${t}/assets/${e}`)},er={generateResponse:(t,e,n,r=.7)=>Le.post("/focus-group-ai/generate-response",{focus_group_id:t,persona_id:e,current_topic:n,temperature:r},{timeout:6e5}),generateKeyThemes:(t,e=.7)=>Le.post("/focus-group-ai/generate-key-themes",{focus_group_id:t,temperature:e},{timeout:6e5}),getKeyThemes:t=>Le.get(`/focus-group-ai/key-themes/${t}`),deleteKeyTheme:(t,e)=>Le.delete(`/focus-group-ai/key-themes/${t}/${e}`),getModeratorStatus:t=>Le.get(`/focus-group-ai/moderator/status/${t}`),advanceModeratorDiscussion:t=>Le.post(`/focus-group-ai/moderator/advance/${t}`,{},{timeout:6e5}),setModeratorPosition:(t,e,n)=>Le.put(`/focus-group-ai/moderator/position/${t}`,{section_id:e,item_id:n}),startAutonomousConversation:(t,e)=>Le.post(`/focus-group-ai/autonomous/start/${t}`,{initial_prompt:e},{timeout:6e5}),stopAutonomousConversation:(t,e)=>Le.post(`/focus-group-ai/autonomous/stop/${t}`,{reason:e}),getAutonomousConversationStatus:t=>Le.get(`/focus-group-ai/autonomous/status/${t}`),getConversationState:t=>Le.get(`/focus-group-ai/conversation/state/${t}`),getConversationAnalytics:t=>Le.get(`/focus-group-ai/conversation/analytics/${t}`),makeConversationDecision:(t,e=.7,n="ai")=>Le.post(`/focus-group-ai/conversation/decision/${t}`,{temperature:e,mode:n},{timeout:6e5}),getConversationInsights:t=>Le.get(`/focus-group-ai/conversation/insights/${t}`,{timeout:6e5}),manualIntervention:(t,e,n,r)=>Le.post(`/focus-group-ai/conversation/intervene/${t}`,{action:e,message:n,participant_id:r}),getReasoningHistory:t=>Le.get(`/focus-group-ai/conversation/reasoning-history/${t}`),endSession:(t,e)=>Le.post(`/focus-group-ai/moderator/end-session/${t}`,{reason:e||"session_ended"})},Eo={getAll:()=>Le.get("/folders"),getById:t=>Le.get(`/folders/${t}`),create:t=>Le.post("/folders",t),update:(t,e)=>Le.put(`/folders/${t}`,e),delete:t=>Le.delete(`/folders/${t}`),addPersona:(t,e)=>Le.post(`/folders/${t}/personas`,{persona_id:e}),removePersona:(t,e)=>Le.delete(`/folders/${t}/personas/${e}`),addPersonasBatch:(t,e)=>Le.post(`/folders/${t}/personas/batch`,{persona_ids:e}),removePersonasBatch:(t,e)=>(console.log(`🌐 API removePersonasBatch: Sending POST to /folders/${t}/personas/remove-batch with persona_ids:`,e),Le.post(`/folders/${t}/personas/remove-batch`,{persona_ids:e})),addPersonaToMultipleFolders:(t,e)=>{const n=e.map(r=>Le.post(`/folders/${r}/personas`,{persona_id:t}));return Promise.all(n)},removePersonaFromAllFolders:t=>{throw new Error("Use removePersona for specific folders")}};/*! @azure/msal-common v15.10.0 2025-08-05 */const ve={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},bc={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,GONE:410,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},Rl={GET:"GET",POST:"POST"},vg=[ve.OPENID_SCOPE,ve.PROFILE_SCOPE,ve.OFFLINE_ACCESS_SCOPE],hI=[...vg,ve.EMAIL_SCOPE],di={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},pI={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},Ic={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},dv={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},pi={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},zE={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},A0={QUERY:"query",FRAGMENT:"fragment"},qee={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},$5={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},fv={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},Qp={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},Hr={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},VE="appmetadata",Yee="client_info",Qy="1",Xy={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Hi={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Lr={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},yn={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},ap={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},mI={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},$u={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},$S={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},Al={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},Qee={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},L5=300;/*! @azure/msal-common v15.10.0 2025-08-05 */const Jy="unexpected_error",Xee="post_request_failed";/*! @azure/msal-common v15.10.0 2025-08-05 */const gI={[Jy]:"Unexpected error in authentication.",[Xee]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class Cn extends Error{constructor(e,n,r){const i=n?`${e}: ${n}`:e;super(i),Object.setPrototypeOf(this,Cn.prototype),this.errorCode=e||ve.EMPTY_STRING,this.errorMessage=n||ve.EMPTY_STRING,this.subError=r||ve.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function J_(t,e){return new Cn(t,e?`${gI[t]} ${e}`:gI[t])}/*! @azure/msal-common v15.10.0 2025-08-05 */const GE="client_info_decoding_error",F5="client_info_empty_error",KE="token_parsing_error",U5="null_or_empty_token",ua="endpoints_resolution_error",B5="network_error",H5="openid_config_error",z5="hash_not_deserialized",Qd="invalid_state",V5="state_mismatch",Z_="state_not_found",G5="nonce_mismatch",WE="auth_time_not_found",K5="max_age_transpired",Jee="multiple_matching_tokens",Zee="multiple_matching_accounts",W5="multiple_matching_appMetadata",q5="request_cannot_be_made",Y5="cannot_remove_empty_scope",Q5="cannot_append_scopeset",e1="empty_input_scopeset",ete="device_code_polling_cancelled",tte="device_code_expired",nte="device_code_unknown_error",qE="no_account_in_silent_request",X5="invalid_cache_record",YE="invalid_cache_environment",t1="no_account_found",n1="no_crypto_object",rte="unexpected_credential_type",ite="invalid_assertion",ste="invalid_client_credential",Rc="token_refresh_required",ote="user_timeout_reached",J5="token_claims_cnf_required_for_signedjwt",Z5="authorization_code_missing_from_server_response",eU="binding_key_not_removed",tU="end_session_endpoint_not_supported",QE="key_id_missing",ate="no_network_connectivity",cte="user_canceled",lte="missing_tenant_id_error",Kt="method_not_implemented",ute="nested_app_auth_bridge_disabled";/*! @azure/msal-common v15.10.0 2025-08-05 */const vI={[GE]:"The client info could not be parsed/decoded correctly",[F5]:"The client info was empty",[KE]:"Token cannot be parsed",[U5]:"The token is null or empty",[ua]:"Endpoints cannot be resolved",[B5]:"Network request failed",[H5]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[z5]:"The hash parameters could not be deserialized",[Qd]:"State was not the expected format",[V5]:"State mismatch error",[Z_]:"State not found",[G5]:"Nonce mismatch error",[WE]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[K5]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[Jee]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[Zee]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[W5]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[q5]:"Token request cannot be made without authorization code or refresh token.",[Y5]:"Cannot remove null or empty scope from ScopeSet",[Q5]:"Cannot append ScopeSet",[e1]:"Empty input ScopeSet cannot be processed",[ete]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[tte]:"Device code is expired.",[nte]:"Device code stopped polling for unknown reasons.",[qE]:"Please pass an account object, silent flow is not supported without account information",[X5]:"Cache record object was null or undefined.",[YE]:"Invalid environment when attempting to create cache entry",[t1]:"No account found in cache for given key.",[n1]:"No crypto object detected.",[rte]:"Unexpected credential type.",[ite]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[ste]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[Rc]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[ote]:"User defined timeout for device code polling reached",[J5]:"Cannot generate a POP jwt if the token_claims are not populated",[Z5]:"Server response does not contain an authorization code to proceed",[eU]:"Could not remove the credential's binding key from storage.",[tU]:"The provided authority does not support logout",[QE]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[ate]:"No network connectivity. Check your internet connection.",[cte]:"User cancelled the flow.",[lte]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Kt]:"This method has not been implemented",[ute]:"The nested app auth bridge is disabled"};class XE extends Cn{constructor(e,n){super(e,n?`${vI[e]}: ${n}`:vI[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,XE.prototype)}}function _e(t,e){return new XE(t,e)}/*! @azure/msal-common v15.10.0 2025-08-05 */const Zy={createNewGuid:()=>{throw _e(Kt)},base64Decode:()=>{throw _e(Kt)},base64Encode:()=>{throw _e(Kt)},base64UrlEncode:()=>{throw _e(Kt)},encodeKid:()=>{throw _e(Kt)},async getPublicKeyThumbprint(){throw _e(Kt)},async removeTokenBindingKey(){throw _e(Kt)},async clearKeystore(){throw _e(Kt)},async signJwt(){throw _e(Kt)},async hashString(){throw _e(Kt)}};/*! @azure/msal-common v15.10.0 2025-08-05 */var Rn;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(Rn||(Rn={}));class Ma{constructor(e,n,r){this.level=Rn.Info;const i=()=>{},s=e||Ma.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||i,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:Rn.Info,this.correlationId=s.correlationId||ve.EMPTY_STRING,this.packageName=n||ve.EMPTY_STRING,this.packageVersion=r||ve.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Rn.Info}}clone(e,n,r){return new Ma({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,n)}logMessage(e,n){if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const s=`${`[${new Date().toUTCString()}] : [${n.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${Rn[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,s,n.containsPii||!1)}executeCallback(e,n,r){this.localCallback&&this.localCallback(e,n,r)}error(e,n){this.logMessage(e,{logLevel:Rn.Error,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}errorPii(e,n){this.logMessage(e,{logLevel:Rn.Error,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}warning(e,n){this.logMessage(e,{logLevel:Rn.Warning,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}warningPii(e,n){this.logMessage(e,{logLevel:Rn.Warning,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}info(e,n){this.logMessage(e,{logLevel:Rn.Info,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}infoPii(e,n){this.logMessage(e,{logLevel:Rn.Info,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}verbose(e,n){this.logMessage(e,{logLevel:Rn.Verbose,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}verbosePii(e,n){this.logMessage(e,{logLevel:Rn.Verbose,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}trace(e,n){this.logMessage(e,{logLevel:Rn.Trace,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}tracePii(e,n){this.logMessage(e,{logLevel:Rn.Trace,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v15.10.0 2025-08-05 */const nU="@azure/msal-common",JE="15.10.0";/*! @azure/msal-common v15.10.0 2025-08-05 */const ZE={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};/*! @azure/msal-common v15.10.0 2025-08-05 */const rU="redirect_uri_empty",dte="claims_request_parsing_error",iU="authority_uri_insecure",Hh="url_parse_error",sU="empty_url_error",oU="empty_input_scopes_error",eN="invalid_claims",aU="token_request_empty",cU="logout_request_empty",fte="invalid_code_challenge_method",tN="pkce_params_missing",nN="invalid_cloud_discovery_metadata",lU="invalid_authority_metadata",uU="untrusted_authority",j0="missing_ssh_jwk",dU="missing_ssh_kid",hte="missing_nonce_authentication_header",pte="invalid_authentication_header",fU="cannot_set_OIDCOptions",hU="cannot_allow_platform_broker",pU="authority_mismatch",mU="invalid_request_method_for_EAR",gU="invalid_authorize_post_body_parameters";/*! @azure/msal-common v15.10.0 2025-08-05 */const mte={[rU]:"A redirect URI is required for all calls, and none has been set.",[dte]:"Could not parse the given claims request object.",[iU]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Hh]:"URL could not be parsed into appropriate segments.",[sU]:"URL was empty or null.",[oU]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[eN]:"Given claims parameter must be a stringified JSON object.",[aU]:"Token request was empty and not found in cache.",[cU]:"The logout request was null or undefined.",[fte]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[tN]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[nN]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[lU]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[uU]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[j0]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[dU]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[hte]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[pte]:"Invalid authentication header provided",[fU]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[hU]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[pU]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",[gU]:"Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",[mU]:"Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST."};class rN extends Cn{constructor(e){super(e,mte[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,rN.prototype)}}function jn(t){return new rN(t)}/*! @azure/msal-common v15.10.0 2025-08-05 */class $o{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},r=e.split("&"),i=s=>decodeURIComponent(s.replace(/\+/g," "));return r.forEach(s=>{if(s.trim()){const[o,c]=s.split(/=(.+)/g,2);o&&c&&(n[i(o)]=i(c))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class Ar{constructor(e){const n=e?$o.trimArrayEntries([...e]):[],r=n?$o.removeEmptyStringsFromArray(n):[];if(!r||!r.length)throw jn(oU);this.scopes=new Set,r.forEach(i=>this.scopes.add(i))}static fromString(e){const r=(e||ve.EMPTY_STRING).split(" ");return new Ar(r)}static createSearchScopes(e){const n=new Ar(e);return n.containsOnlyOIDCScopes()?n.removeScope(ve.OFFLINE_ACCESS_SCOPE):n.removeOIDCScopes(),n}containsScope(e){const n=this.printScopesLowerCase().split(" "),r=new Ar(n);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return hI.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw _e(Q5)}}removeScope(e){if(!e)throw _e(Y5);this.scopes.delete(e.trim())}removeOIDCScopes(){hI.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw _e(e1);const n=new Set;return e.scopes.forEach(r=>n.add(r.toLowerCase())),this.scopes.forEach(r=>n.add(r.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw _e(e1);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),r=e.getScopeCount(),i=this.getScopeCount();return n.sizee.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):ve.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v15.10.0 2025-08-05 */function yI(t,e){return!!t&&!!e&&t===e.split(".")[1]}function iN(t,e,n,r){if(r){const{oid:i,sub:s,tid:o,name:c,tfp:l,acr:u,preferred_username:d,upn:f,login_hint:h}=r,p=o||l||u||"";return{tenantId:p,localAccountId:i||s||"",name:c,username:d||f||"",loginHint:h,isHomeTenant:yI(p,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:yI(n,t)}}function sN(t,e,n,r){let i=t;if(e){const{isHomeTenant:s,...o}=e;i={...t,...o}}if(n){const{isHomeTenant:s,...o}=iN(t.homeAccountId,t.localAccountId,t.tenantId,n);return i={...i,...o,idTokenClaims:n,idToken:r},i}return i}/*! @azure/msal-common v15.10.0 2025-08-05 */function Bf(t,e){const n=gte(t);try{const r=e(n);return JSON.parse(r)}catch{throw _e(KE)}}function gte(t){if(!t)throw _e(U5);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw _e(KE);return n[2]}function vU(t,e){if(e===0||Date.now()-3e5>t+e)throw _e(K5)}/*! @azure/msal-common v15.10.0 2025-08-05 */function yU(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function ex(t){if(!t||t.indexOf("=")<0)return null;try{const e=yU(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw _e(z5)}return null}function Xp(t,e=!0,n){const r=new Array;return t.forEach((i,s)=>{!e&&n&&s in n?r.push(`${s}=${i}`):r.push(`${s}=${encodeURIComponent(i)}`)}),r.join("&")}/*! @azure/msal-common v15.10.0 2025-08-05 */class en{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw jn(sU);e.includes("#")||(this._urlString=en.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return $o.endsWith(n,"?")?n=n.slice(0,-1):$o.endsWith(n,"?/")&&(n=n.slice(0,-2)),$o.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw jn(Hh)}if(!e.HostNameAndPort||!e.PathSegments)throw jn(Hh);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw jn(iU)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return en.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),r=n.PathSegments;return e&&r.length!==0&&(r[0]===Ic.COMMON||r[0]===Ic.ORGANIZATIONS)&&(r[0]=e),en.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw jn(Hh);const r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let i=r.AbsolutePath.split("/");return i=i.filter(s=>s&&s.length>0),r.PathSegments=i,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(n);if(!r)throw jn(Hh);return r[2]}static getAbsoluteUrl(e,n){if(e[0]===ve.FORWARD_SLASH){const i=new en(n).getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new en(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!ex(e)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const xU={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},xI=xU.endpointMetadata,oN=xU.instanceDiscoveryMetadata,bU=new Set;oN.metadata.forEach(t=>{t.aliases.forEach(e=>{bU.add(e)})});function vte(t,e){var i;let n;const r=t.canonicalAuthority;if(r){const s=new en(r).getUrlComponents().HostNameAndPort;n=bI(s,(i=t.cloudDiscoveryMetadata)==null?void 0:i.metadata,Hi.CONFIG,e)||bI(s,oN.metadata,Hi.HARDCODED_VALUES,e)||t.knownAuthorities}return n||[]}function bI(t,e,n,r){if(r==null||r.trace(`getAliasesFromMetadata called with source: ${n}`),t&&e){const i=tx(e,t);if(i)return r==null||r.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${n}, returning aliases`),i.aliases;r==null||r.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${n}`)}return null}function yte(t){return tx(oN.metadata,t)}function tx(t,e){for(let n=0;n1?r.sort(s=>s.idTokenClaims?-1:1)[0]:r.length===1?r[0]:null}getBaseAccountInfo(e,n){const r=this.getAccountsFilteredBy(e,n);return r.length>0?r[0].getAccountInfo():null}buildTenantProfiles(e,n,r){return e.flatMap(i=>this.getTenantProfilesFromAccountEntity(i,n,r==null?void 0:r.tenantId,r))}getTenantedAccountInfoByFilter(e,n,r,i,s){let o=null,c;if(s&&!this.tenantProfileMatchesFilter(r,s))return null;const l=this.getIdToken(e,i,n,r.tenantId);return l&&(c=Bf(l.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(c,s))?null:(o=sN(e,r,c,l==null?void 0:l.secret),o)}getTenantProfilesFromAccountEntity(e,n,r,i){const s=e.getAccountInfo();let o=s.tenantProfiles||new Map;const c=this.getTokenKeys();if(r){const u=o.get(r);if(u)o=new Map([[r,u]]);else return[]}const l=[];return o.forEach(u=>{const d=this.getTenantedAccountInfoByFilter(s,c,u,n,i);d&&l.push(d)}),l}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,r){var i;if(!e)throw _e(X5);try{e.account&&await this.setAccount(e.account,n),e.idToken&&(r==null?void 0:r.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,n),e.accessToken&&(r==null?void 0:r.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,n),e.refreshToken&&(r==null?void 0:r.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(s){throw(i=this.commonLogger)==null||i.error("CacheManager.saveCacheRecord: failed"),s instanceof Cn?s:r1(s)}}async saveAccessToken(e,n){const r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),s=Ar.fromString(e.target);i.accessToken.forEach(o=>{if(!this.accessTokenKeyMatchesFilter(o,r,!1))return;const c=this.getAccessTokenCredential(o,n);c&&this.credentialMatchesFilter(c,r)&&Ar.fromString(c.target).intersectingScopeSets(s)&&this.removeAccessToken(o,n)}),await this.setAccessTokenCredential(e,n)}getAccountsFilteredBy(e,n){const r=this.getAccountKeys(),i=[];return r.forEach(s=>{var u;const o=this.getAccount(s,n);if(!o||e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId)||e.username&&!this.matchUsername(o.username,e.username)||e.environment&&!this.matchEnvironment(o,e.environment)||e.realm&&!this.matchRealm(o,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(o,e.authorityType))return;const c={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},l=(u=o.tenantProfiles)==null?void 0:u.filter(d=>this.tenantProfileMatchesFilter(d,c));l&&l.length===0||i.push(o)}),i}credentialMatchesFilter(e,n){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||(n.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==n.requestedClaimsHash||e.credentialType===Hr.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===yn.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e){const n=this.getKeys(),r={};return n.forEach(i=>{if(!this.isAppMetadata(i))return;const s=this.getAppMetadata(i);s&&(e.environment&&!this.matchEnvironment(s,e.environment)||e.clientId&&!this.matchClientId(s,e.clientId)||(r[i]=s))}),r}getAuthorityMetadataByAlias(e){const n=this.getAuthorityMetadataKeys();let r=null;return n.forEach(i=>{if(!this.isAuthorityMetadata(i)||i.indexOf(this.clientId)===-1)return;const s=this.getAuthorityMetadata(i);s&&s.aliases.indexOf(e)!==-1&&(r=s)}),r}removeAllAccounts(e){this.getAllAccounts({},e).forEach(r=>{this.removeAccount(r,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const r=this.getAccountKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.filter(i).forEach(s=>{this.removeItem(s,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const r=this.getTokenKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.idToken.filter(i).forEach(s=>{this.removeIdToken(s,n)}),r.accessToken.filter(i).forEach(s=>{this.removeAccessToken(s,n)}),r.refreshToken.filter(i).forEach(s=>{this.removeRefreshToken(s,n)})}removeAccessToken(e,n){const r=this.getAccessTokenCredential(e,n);if(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),!r||r.credentialType.toLowerCase()!==Hr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||r.tokenType!==yn.POP)return;const i=r.keyId;i&&this.cryptoImpl.removeTokenBindingKey(i).catch(()=>{var s;this.commonLogger.error(`Failed to remove token binding key ${i}`,n),(s=this.performanceClient)==null||s.incrementFields({removeTokenBindingKeyFailure:1},n)})}removeAppMetadata(e){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r,e)}),!0}getIdToken(e,n,r,i,s){this.commonLogger.trace("CacheManager - getIdToken called");const o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Hr.ID_TOKEN,clientId:this.clientId,realm:i},c=this.getIdTokensByFilter(o,n,r),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(l>1){let u=c;if(!i){const d=new Map;c.forEach((h,p)=>{h.realm===e.tenantId&&d.set(p,h)});const f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),u.forEach((d,f)=>{this.removeIdToken(f,n)}),s&&n&&s.addFields({multiMatchedID:c.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),c.values().next().value}getIdTokensByFilter(e,n,r){const i=r&&r.idToken||this.getTokenKeys().idToken,s=new Map;return i.forEach(o=>{if(!this.idTokenKeyMatchesFilter(o,{clientId:this.clientId,...e}))return;const c=this.getIdTokenCredential(o,n);c&&this.credentialMatchesFilter(c,e)&&s.set(o,c)}),s}idTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,r,i){const s=n.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);const o=Ar.createSearchScopes(n.scopes),c=n.authenticationScheme||yn.BEARER,l=c&&c.toLowerCase()!==yn.BEARER.toLowerCase()?Hr.ACCESS_TOKEN_WITH_AUTH_SCHEME:Hr.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:l,clientId:this.clientId,realm:i||e.tenantId,target:o,tokenType:c,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},d=r&&r.accessToken||this.getTokenKeys().accessToken,f=[];d.forEach(p=>{if(this.accessTokenKeyMatchesFilter(p,u,!0)){const g=this.getAccessTokenCredential(p,s);g&&this.credentialMatchesFilter(g,u)&&f.push(g)}});const h=f.length;return h<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):h>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),f.forEach(p=>{this.removeAccessToken(this.generateCredentialKey(p),s)}),this.performanceClient.addFields({multiMatchedAT:f.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),f[0])}accessTokenKeyMatchesFilter(e,n,r){const i=e.toLowerCase();if(n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&i.indexOf(n.realm.toLowerCase())===-1||n.requestedClaimsHash&&i.indexOf(n.requestedClaimsHash.toLowerCase())===-1)return!1;if(n.target){const s=n.target.asArray();for(let o=0;o{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;const o=this.getAccessTokenCredential(s,n);o&&this.credentialMatchesFilter(o,e)&&i.push(o)}),i}getRefreshToken(e,n,r,i,s){this.commonLogger.trace("CacheManager - getRefreshToken called");const o=n?Qy:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Hr.REFRESH_TOKEN,clientId:this.clientId,familyId:o},l=i&&i.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){const h=this.getRefreshTokenCredential(f,r);h&&this.credentialMatchesFilter(h,c)&&u.push(h)}});const d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(d>1&&s&&r&&s.addFields({multiMatchedRT:d},r),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),u[0])}refreshTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.familyId&&r.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const n={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(n),i=Object.keys(r).map(o=>r[o]),s=i.length;if(s<1)return null;if(s>1)throw _e(W5);return i[0]}isAppMetadataFOCI(e){const n=this.readAppMetadataFromCache(e);return!!(n&&n.familyId===Qy)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const r=e.oid||e.sub;return n===r}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){var r;return n.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,n){return!!(e&&typeof e=="string"&&(n==null?void 0:n.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n){if(this.staticAuthorityOptions){const i=vte(this.staticAuthorityOptions,this.commonLogger);if(i.includes(n)&&i.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(n);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==Hr.ACCESS_TOKEN&&e.credentialType!==Hr.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Ar.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(VE)!==-1}isAuthorityMetadata(e){return e.indexOf(Xy.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${Xy.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,n){for(const r in n)e[r]=n[r];return e}}class xte extends i1{async setAccount(){throw _e(Kt)}getAccount(){throw _e(Kt)}async setIdTokenCredential(){throw _e(Kt)}getIdTokenCredential(){throw _e(Kt)}async setAccessTokenCredential(){throw _e(Kt)}getAccessTokenCredential(){throw _e(Kt)}async setRefreshTokenCredential(){throw _e(Kt)}getRefreshTokenCredential(){throw _e(Kt)}setAppMetadata(){throw _e(Kt)}getAppMetadata(){throw _e(Kt)}setServerTelemetry(){throw _e(Kt)}getServerTelemetry(){throw _e(Kt)}setAuthorityMetadata(){throw _e(Kt)}getAuthorityMetadata(){throw _e(Kt)}getAuthorityMetadataKeys(){throw _e(Kt)}setThrottlingCache(){throw _e(Kt)}getThrottlingCache(){throw _e(Kt)}removeItem(){throw _e(Kt)}getKeys(){throw _e(Kt)}getAccountKeys(){throw _e(Kt)}getTokenKeys(){throw _e(Kt)}generateCredentialKey(){throw _e(Kt)}generateAccountKey(){throw _e(Kt)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const $i={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v15.10.0 2025-08-05 */const W={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},bte={NotStarted:0,InProgress:1,Completed:2};/*! @azure/msal-common v15.10.0 2025-08-05 */class wI{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class wU{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:bte.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new wI}}startPerformanceMeasurement(){return new wI}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-common v15.10.0 2025-08-05 */const SU={tokenRenewalOffsetSeconds:L5,preventCorsPreflight:!1},wte={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Rn.Info,correlationId:ve.EMPTY_STRING},Ste={claimsBasedCachingEnabled:!1},Cte={async sendGetRequestAsync(){throw _e(Kt)},async sendPostRequestAsync(){throw _e(Kt)}},_te={sku:ve.SKU,version:JE,cpu:ve.EMPTY_STRING,os:ve.EMPTY_STRING},Ate={clientSecret:ve.EMPTY_STRING,clientAssertion:void 0},jte={azureCloudInstance:ZE.None,tenant:`${ve.DEFAULT_COMMON_TENANT}`},Ete={application:{appName:"",appVersion:""}};function Nte({authOptions:t,systemOptions:e,loggerOptions:n,cacheOptions:r,storageInterface:i,networkInterface:s,cryptoInterface:o,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){const p={...wte,...n};return{authOptions:Tte(t),systemOptions:{...SU,...e},loggerOptions:p,cacheOptions:{...Ste,...r},storageInterface:i||new xte(t.clientId,Zy,new Ma(p),new wU),networkInterface:s||Cte,cryptoInterface:o||Zy,clientCredentials:c||Ate,libraryInfo:{..._te,...l},telemetry:{...Ete,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}function Tte(t){return{clientCapabilities:[],azureCloudOptions:jte,skipAuthorityMetadataCache:!1,instanceAware:!1,encodeExtraQueryParams:!1,...t}}function CU(t){return t.authOptions.authority.options.protocolMode===$i.OIDC}/*! @azure/msal-common v15.10.0 2025-08-05 */const Ws={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v15.10.0 2025-08-05 */function rx(t,e){if(!t)throw _e(F5);try{const n=e(t);return JSON.parse(n)}catch{throw _e(GE)}}function Sd(t){if(!t)throw _e(GE);const e=t.split(Qp.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?ve.EMPTY_STRING:e[1]}}/*! @azure/msal-common v15.10.0 2025-08-05 */const hu="client_id",_U="redirect_uri",Pte="response_type",kte="response_mode",Ote="grant_type",Ite="claims",Rte="scope",Mte="refresh_token",Dte="state",$te="nonce",Lte="prompt",Fte="code",Ute="code_challenge",Bte="code_challenge_method",Hte="code_verifier",zte="client-request-id",Vte="x-client-SKU",Gte="x-client-VER",Kte="x-client-OS",Wte="x-client-CPU",qte="x-client-current-telemetry",Yte="x-client-last-telemetry",Qte="x-ms-lib-capability",Xte="x-app-name",Jte="x-app-ver",Zte="post_logout_redirect_uri",ene="id_token_hint",tne="client_secret",nne="client_assertion",rne="client_assertion_type",AU="token_type",jU="req_cnf",SI="return_spa_code",ine="nativebroker",sne="logout_hint",one="sid",ane="login_hint",cne="domain_hint",lne="x-client-xtra-sku",ix="brk_client_id",sx="brk_redirect_uri",s1="instance_aware",une="ear_jwk",dne="ear_jwe_crypto";/*! @azure/msal-common v15.10.0 2025-08-05 */function E0(t,e,n){if(!e)return;const r=t.get(hu);r&&t.has(ix)&&(n==null||n.addFields({embeddedClientId:r,embeddedRedirectUri:t.get(_U)},e))}function cN(t,e){t.set(Pte,e)}function fne(t,e){t.set(kte,e||qee.QUERY)}function hne(t){t.set(ine,"1")}function lN(t,e,n=!0,r=vg){n&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const i=n?[...e||[],...r]:e||[],s=new Ar(i);t.set(Rte,s.printScopes())}function uN(t,e){t.set(hu,e)}function dN(t,e){t.set(_U,e)}function pne(t,e){t.set(Zte,e)}function mne(t,e){t.set(ene,e)}function gne(t,e){t.set(cne,e)}function hv(t,e){t.set(ane,e)}function ox(t,e){t.set(di.CCS_HEADER,`UPN:${e}`)}function cp(t,e){t.set(di.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function CI(t,e){t.set(one,e)}function fN(t,e,n){const r=Sne(e,n);try{JSON.parse(r)}catch{throw jn(eN)}t.set(Ite,r)}function hN(t,e){t.set(zte,e)}function pN(t,e){t.set(Vte,e.sku),t.set(Gte,e.version),e.os&&t.set(Kte,e.os),e.cpu&&t.set(Wte,e.cpu)}function mN(t,e){e!=null&&e.appName&&t.set(Xte,e.appName),e!=null&&e.appVersion&&t.set(Jte,e.appVersion)}function vne(t,e){t.set(Lte,e)}function EU(t,e){e&&t.set(Dte,e)}function yne(t,e){t.set($te,e)}function NU(t,e,n){if(e&&n)t.set(Ute,e),t.set(Bte,n);else throw jn(tN)}function xne(t,e){t.set(Fte,e)}function bne(t,e){t.set(Mte,e)}function wne(t,e){t.set(Hte,e)}function TU(t,e){t.set(tne,e)}function PU(t,e){e&&t.set(nne,e)}function kU(t,e){e&&t.set(rne,e)}function OU(t,e){t.set(Ote,e)}function gN(t){t.set(Yee,"1")}function IU(t){t.has(s1)||t.set(s1,"true")}function Mc(t,e){Object.entries(e).forEach(([n,r])=>{!t.has(n)&&r&&t.set(n,r)})}function Sne(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw jn(eN)}return e&&e.length>0&&(n.hasOwnProperty(dv.ACCESS_TOKEN)||(n[dv.ACCESS_TOKEN]={}),n[dv.ACCESS_TOKEN][dv.XMS_CC]={values:e}),JSON.stringify(n)}function vN(t,e){e&&(t.set(AU,yn.POP),t.set(jU,e))}function RU(t,e){e&&(t.set(AU,yn.SSH),t.set(jU,e))}function MU(t,e){t.set(qte,e.generateCurrentRequestHeaderValue()),t.set(Yte,e.generateLastRequestHeaderValue())}function DU(t){t.set(Qte,ap.X_MS_LIB_CAPABILITY_VALUE)}function Cne(t,e){t.set(sne,e)}function N0(t,e,n){t.has(ix)||t.set(ix,e),t.has(sx)||t.set(sx,n)}function _ne(t,e){t.set(une,encodeURIComponent(e)),t.set(dne,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function Ane(t,e){Object.entries(e).forEach(([n,r])=>{r&&t.set(n,r)})}/*! @azure/msal-common v15.10.0 2025-08-05 */const Bs={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v15.10.0 2025-08-05 */function jne(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v15.10.0 2025-08-05 */function Ene(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}/*! @azure/msal-common v15.10.0 2025-08-05 */function Nne(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}/*! @azure/msal-common v15.10.0 2025-08-05 */const es=(t,e,n,r,i)=>(...s)=>{n.trace(`Executing function ${e}`);const o=r==null?void 0:r.startMeasurement(e,i);if(i){const c=e+"CallCount";r==null||r.incrementFields({[c]:1},i)}try{const c=t(...s);return o==null||o.end({success:!0}),n.trace(`Returning result from ${e}`),c}catch(c){n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(c))}catch{n.trace("Unable to print error message.")}throw o==null||o.end({success:!1},c),c}},ge=(t,e,n,r,i)=>(...s)=>{n.trace(`Executing function ${e}`);const o=r==null?void 0:r.startMeasurement(e,i);if(i){const c=e+"CallCount";r==null||r.incrementFields({[c]:1},i)}return r==null||r.setPreQueueTime(e,i),t(...s).then(c=>(n.trace(`Returning result from ${e}`),o==null||o.end({success:!0}),c)).catch(c=>{n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(c))}catch{n.trace("Unable to print error message.")}throw o==null||o.end({success:!1},c),c})};/*! @azure/msal-common v15.10.0 2025-08-05 */class T0{constructor(e,n,r,i){this.networkInterface=e,this.logger=n,this.performanceClient=r,this.correlationId=i}async detectRegion(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(W.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)n.region_source=$u.ENVIRONMENT_VARIABLE;else{const s=T0.IMDS_OPTIONS;try{const o=await ge(this.getRegionFromIMDS.bind(this),W.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(ve.IMDS_VERSION,s);if(o.status===bc.SUCCESS&&(r=o.body,n.region_source=$u.IMDS),o.status===bc.BAD_REQUEST){const c=await ge(this.getCurrentVersion.bind(this),W.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(s);if(!c)return n.region_source=$u.FAILED_AUTO_DETECTION,null;const l=await ge(this.getRegionFromIMDS.bind(this),W.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(c,s);l.status===bc.SUCCESS&&(r=l.body,n.region_source=$u.IMDS)}}catch{return n.region_source=$u.FAILED_AUTO_DETECTION,null}}return r||(n.region_source=$u.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,n){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(W.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${ve.IMDS_ENDPOINT}?api-version=${e}&format=text`,n,ve.IMDS_TIMEOUT)}async getCurrentVersion(e){var n;(n=this.performanceClient)==null||n.addQueueMeasurement(W.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${ve.IMDS_ENDPOINT}?format=json`,e);return r.status===bc.BAD_REQUEST&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}}T0.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v15.10.0 2025-08-05 */function Li(){return Math.round(new Date().getTime()/1e3)}function _I(t){return t.getTime()/1e3}function Cd(t){return t?new Date(Number(t)*1e3):new Date}function ax(t,e){const n=Number(t)||0;return Li()+e>n}function Tne(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function Pne(t){return Number(t)>Li()}/*! @azure/msal-common v15.10.0 2025-08-05 */function P0(t,e,n,r,i){return{credentialType:Hr.ID_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,realm:i,lastUpdatedAt:Date.now().toString()}}function k0(t,e,n,r,i,s,o,c,l,u,d,f,h,p,g){var y,b;const m={homeAccountId:t,credentialType:Hr.ACCESS_TOKEN,secret:n,cachedAt:Li().toString(),expiresOn:o.toString(),extendedExpiresOn:c.toString(),environment:e,clientId:r,realm:i,target:s,tokenType:d||yn.BEARER,lastUpdatedAt:Date.now().toString()};if(f&&(m.userAssertionHash=f),u&&(m.refreshOn=u.toString()),p&&(m.requestedClaims=p,m.requestedClaimsHash=g),((y=m.tokenType)==null?void 0:y.toLowerCase())!==yn.BEARER.toLowerCase())switch(m.credentialType=Hr.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case yn.POP:const x=Bf(n,l);if(!((b=x==null?void 0:x.cnf)!=null&&b.kid))throw _e(J5);m.keyId=x.cnf.kid;break;case yn.SSH:m.keyId=h}return m}function $U(t,e,n,r,i,s,o){const c={credentialType:Hr.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,lastUpdatedAt:Date.now().toString()};return s&&(c.userAssertionHash=s),i&&(c.familyId=i),o&&(c.expiresOn=o.toString()),c}function yN(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function AI(t){return t?yN(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===Hr.ACCESS_TOKEN||t.credentialType===Hr.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function kne(t){return t?yN(t)&&t.hasOwnProperty("realm")&&t.credentialType===Hr.ID_TOKEN:!1}function jI(t){return t?yN(t)&&t.credentialType===Hr.REFRESH_TOKEN:!1}function One(t,e){const n=t.indexOf(Lr.CACHE_KEY)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&r}function Ine(t,e){let n=!1;t&&(n=t.indexOf(ap.THROTTLING_PREFIX)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),n&&r}function Rne({environment:t,clientId:e}){return[VE,t,e].join(Qp.CACHE_KEY_SEPARATOR).toLowerCase()}function Mne(t,e){return e?t.indexOf(VE)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function Dne(t,e){return e?t.indexOf(Xy.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function EI(){return Li()+Xy.REFRESH_TIME_SECONDS}function pv(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function FS(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function NI(t){return t.expiresAt<=Li()}/*! @azure/msal-common v15.10.0 2025-08-05 */class Jr{constructor(e,n,r,i,s,o,c,l){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=r,this.authorityOptions=i,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=c,this.correlationId=o,this.managedIdentity=l||!1,this.regionDiscovery=new T0(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(ve.CIAM_AUTH_URL))return Bs.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case ve.ADFS:return Bs.Adfs;case ve.DSTS:return Bs.Dsts}return Bs.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new en(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw _e(ua)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw _e(ua)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw _e(ua)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw _e(tU);return this.replacePath(this.metadata.end_session_endpoint)}else throw _e(ua)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw _e(ua)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw _e(ua)}canReplaceTenant(e){return e.PathSegments.length===1&&!Jr.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Bs.Default&&this.protocolMode!==$i.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const i=new en(this.metadata.canonical_authority).getUrlComponents(),s=i.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((c,l)=>{let u=s[l];if(l===0&&this.canReplaceTenant(i)){const d=new en(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];u!==d&&(this.logger.verbose(`Replacing tenant domain name ${u} with id ${d}`),u=d)}c!==u&&(n=n.replace(`/${u}/`,`/${c}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Bs.Adfs||this.protocolMode===$i.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var i,s;(i=this.performanceClient)==null||i.addQueueMeasurement(W.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),n=await ge(this.updateCloudDiscoveryMetadata.bind(this),W.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await ge(this.updateEndpointMetadata.bind(this),W.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:r}),(s=this.performanceClient)==null||s.addFields({cloudDiscoverySource:n,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:EI(),jwks_uri:""}),e}updateCachedMetadata(e,n,r){n!==Hi.CACHE&&(r==null?void 0:r.source)!==Hi.CACHE&&(e.expiresAt=EI(),e.canonical_authority=this.canonicalAuthority);const i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(i,e),this.metadata=e}async updateEndpointMetadata(e){var i,s,o;(i=this.performanceClient)==null||i.addQueueMeasurement(W.AuthorityUpdateEndpointMetadata,this.correlationId);const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===Hi.HARDCODED_VALUES&&(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&n.metadata){const c=await ge(this.updateMetadataWithRegionalInformation.bind(this),W.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(n.metadata);pv(e,c,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let r=await ge(this.getEndpointMetadataFromNetwork.bind(this),W.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return(o=this.authorityOptions.azureRegionConfiguration)!=null&&o.azureRegion&&(r=await ge(this.updateMetadataWithRegionalInformation.bind(this),W.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),pv(e,r,!0),Hi.NETWORK;throw _e(H5,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("Found endpoint metadata in authority configuration"),pv(e,n,!1),{source:Hi.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const i=this.getEndpointMetadataFromHardcodedValues();if(i)return pv(e,i,!1),{source:Hi.HARDCODED_VALUES,metadata:i};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=NI(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:Hi.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new en(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw jn(lU)}return null}async getEndpointMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(W.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${n}`);try{const i=await this.networkInterface.sendGetRequestAsync(n,e);return jne(i.body)?i.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(i){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${i}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in xI?xI[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,i,s;(r=this.performanceClient)==null||r.addQueueMeasurement(W.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const n=(i=this.authorityOptions.azureRegionConfiguration)==null?void 0:i.azureRegion;if(n){if(n!==ve.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=$S.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,Jr.replaceWithRegionalInformation(e,n);const o=await ge(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),W.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((s=this.authorityOptions.azureRegionConfiguration)==null?void 0:s.environmentRegion,this.regionDiscoveryMetadata);if(o)return this.regionDiscoveryMetadata.region_outcome=$S.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=o,Jr.replaceWithRegionalInformation(e,o);this.regionDiscoveryMetadata.region_outcome=$S.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(W.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const r=await ge(this.getCloudDiscoveryMetadataFromNetwork.bind(this),W.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return FS(e,r,!0),Hi.NETWORK;throw jn(uU)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||ve.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||ve.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||ve.NOT_APPLICABLE}`);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),FS(e,n,!1),Hi.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const i=yte(this.hostnameAndPort);if(i)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),FS(e,i,!1),Hi.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const r=NI(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r?(this.logger.verbose("Found cloud discovery metadata in the cache."),Hi.CACHE):(r&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Bs.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),Jr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=tx(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),n)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),n;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),jn(nN)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Jr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(W.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${ve.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let r=null;try{const s=await this.networkInterface.sendGetRequestAsync(e,n);let o,c;if(Ene(s.body))o=s.body,c=o.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${o.tenant_discovery_endpoint}`);else if(Nne(s.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${s.status}`),o=s.body,o.error===ve.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${o.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${o.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=tx(c,this.hostnameAndPort)}catch(s){if(s instanceof Cn)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +Error: ${s.errorCode} +Error Description: ${s.errorMessage}`);else{const o=s;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. +Error: ${o.name} +Error Description: ${o.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=Jr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&en.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==ZE.None){const i=n.tenant?n.tenant:ve.DEFAULT_COMMON_TENANT;r=`${n.azureCloudInstance}/${i}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return ve.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw _e(ua)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return bU.has(e)}static isPublicCloudAuthority(e){return ve.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const i=new en(e);i.validateAsUri();const s=i.getUrlComponents();let o=`${n}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(o=`${n}.${ve.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const c=en.constructAuthorityUriFromObject({...i.getUrlComponents(),HostNameAndPort:o}).urlString;return r?`${c}?${r}`:c}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=Jr.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=Jr.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=Jr.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const i=new en(e).getUrlComponents();if(i.PathSegments.length===0&&i.HostNameAndPort.endsWith(ve.CIAM_AUTH_URL)){const s=i.HostNameAndPort.split(".")[0];n=`${n}${s}${ve.AAD_TENANT_DOMAIN_SUFFIX}`}return n}}Jr.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Ic.COMMON,Ic.CONSUMERS,Ic.ORGANIZATIONS]);function $ne(t){var i;const r=(i=new en(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:i.toLowerCase();switch(r){case Ic.COMMON:case Ic.ORGANIZATIONS:case Ic.CONSUMERS:return;default:return r}}function LU(t){return t.endsWith(ve.FORWARD_SLASH)?t:`${t}${ve.FORWARD_SLASH}`}function Lne(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw jn(nN)}return{canonicalAuthority:t.authority?LU(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v15.10.0 2025-08-05 */async function FU(t,e,n,r,i,s,o){o==null||o.addQueueMeasurement(W.AuthorityFactoryCreateDiscoveredInstance,s);const c=Jr.transformCIAMAuthority(LU(t)),l=new Jr(c,e,n,r,i,s,o);try{return await ge(l.resolveEndpointsAsync.bind(l),W.AuthorityResolveEndpointsAsync,i,o,s)(),l}catch{throw _e(ua)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class Tu extends Cn{constructor(e,n,r,i,s){super(e,n,r),this.name="ServerError",this.errorNo=i,this.status=s,Object.setPrototypeOf(this,Tu.prototype)}}/*! @azure/msal-common v15.10.0 2025-08-05 */function O0(t,e,n){var r;return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.tokenBodyParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class To{static generateThrottlingStorageKey(e){return`${ap.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,r){var o;const i=To.generateThrottlingStorageKey(n),s=e.getThrottlingCache(i);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(di.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||ap.DEFAULT_THROTTLE_TIME_SECONDS),r+ap.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,r,i){const s=O0(n,r,i),o=this.generateThrottlingStorageKey(s);e.removeItem(o,r.correlationId)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class I0 extends Cn{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,I0.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function zh(t,e,n,r){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${r==null?void 0:r.name}, error.message:${r==null?void 0:r.message}`,new I0(t,e,n)}/*! @azure/msal-common v15.10.0 2025-08-05 */class xN{constructor(e,n){this.config=Nte(e),this.logger=new Ma(this.config.loggerOptions,nU,JE),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){const n={};if(n[di.CONTENT_TYPE]=ve.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Ws.HOME_ACCOUNT_ID:try{const r=Sd(e.credential);n[di.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Ws.UPN:n[di.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,r,i,s,o){var l;o&&((l=this.performanceClient)==null||l.addQueueMeasurement(o,s));const c=await this.sendPostRequest(i,e,{body:n,headers:r},s);return this.config.serverTelemetryManager&&c.status<500&&c.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),c}async sendPostRequest(e,n,r,i){var o,c,l;To.preProcess(this.cacheManager,e,i);let s;try{s=await ge(this.networkClient.sendPostRequestAsync.bind(this.networkClient),W.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,i)(n,r);const u=s.headers||{};(c=this.performanceClient)==null||c.addFields({refreshTokenSize:((o=s.body.refresh_token)==null?void 0:o.length)||0,httpVerToken:u[di.X_MS_HTTP_VERSION]||"",requestId:u[di.X_MS_REQUEST_ID]||""},i)}catch(u){if(u instanceof I0){const d=u.responseHeaders;throw d&&((l=this.performanceClient)==null||l.addFields({httpVerToken:d[di.X_MS_HTTP_VERSION]||"",requestId:d[di.X_MS_REQUEST_ID]||"",contentTypeHeader:d[di.CONTENT_TYPE]||void 0,contentLengthHeader:d[di.CONTENT_LENGTH]||void 0,httpStatus:u.httpStatus},i)),u.error}throw u instanceof Cn?u:_e(B5)}return To.postProcess(this.cacheManager,e,s,i),s}async updateAuthority(e,n){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(W.UpdateTokenEndpointAuthority,n);const r=`https://${e}/${this.authority.tenant}/`,i=await FU(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=i}createTokenQueryParameters(e){const n=new Map;return e.embeddedClientId&&N0(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&Mc(n,e.tokenQueryParameters),hN(n,e.correlationId),E0(n,e.correlationId,this.performanceClient),Xp(n)}}/*! @azure/msal-common v15.10.0 2025-08-05 */function UU(t){return t&&(t.tid||t.tfp||t.acr)||null}/*! @azure/msal-common v15.10.0 2025-08-05 */class co{getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,loginHint:this.loginHint,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e]))}}isSingleTenant(){return!this.tenantProfiles}static createAccount(e,n,r){var u,d,f,h,p,g,m;const i=new co;n.authorityType===Bs.Adfs?i.authorityType=fv.ADFS_ACCOUNT_TYPE:n.protocolMode===$i.OIDC?i.authorityType=fv.GENERIC_ACCOUNT_TYPE:i.authorityType=fv.MSSTS_ACCOUNT_TYPE;let s;e.clientInfo&&r&&(s=rx(e.clientInfo,r)),i.clientInfo=e.clientInfo,i.homeAccountId=e.homeAccountId,i.nativeAccountId=e.nativeAccountId;const o=e.environment||n&&n.getPreferredCache();if(!o)throw _e(YE);i.environment=o,i.realm=(s==null?void 0:s.utid)||UU(e.idTokenClaims)||"",i.localAccountId=(s==null?void 0:s.uid)||((u=e.idTokenClaims)==null?void 0:u.oid)||((d=e.idTokenClaims)==null?void 0:d.sub)||"";const c=((f=e.idTokenClaims)==null?void 0:f.preferred_username)||((h=e.idTokenClaims)==null?void 0:h.upn),l=(p=e.idTokenClaims)!=null&&p.emails?e.idTokenClaims.emails[0]:null;if(i.username=c||l||"",i.loginHint=(g=e.idTokenClaims)==null?void 0:g.login_hint,i.name=((m=e.idTokenClaims)==null?void 0:m.name)||"",i.cloudGraphHostName=e.cloudGraphHostName,i.msGraphHost=e.msGraphHost,e.tenantProfiles)i.tenantProfiles=e.tenantProfiles;else{const y=iN(e.homeAccountId,i.localAccountId,i.realm,e.idTokenClaims);i.tenantProfiles=[y]}return i}static createFromAccountInfo(e,n,r){var s;const i=new co;return i.authorityType=e.authorityType||fv.GENERIC_ACCOUNT_TYPE,i.homeAccountId=e.homeAccountId,i.localAccountId=e.localAccountId,i.nativeAccountId=e.nativeAccountId,i.realm=e.tenantId,i.environment=e.environment,i.username=e.username,i.name=e.name,i.loginHint=e.loginHint,i.cloudGraphHostName=n,i.msGraphHost=r,i.tenantProfiles=Array.from(((s=e.tenantProfiles)==null?void 0:s.values())||[]),i}static generateHomeAccountId(e,n,r,i,s){if(!(n===Bs.Adfs||n===Bs.Dsts)){if(e)try{const o=rx(e,i.base64Decode);if(o.uid&&o.utid)return`${o.uid}.${o.utid}`}catch{}r.warning("No client info in response")}return(s==null?void 0:s.sub)||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,n,r){if(!e||!n)return!1;let i=!0;if(r){const s=e.idTokenClaims||{},o=n.idTokenClaims||{};i=s.iat===o.iat&&s.nonce===o.nonce}return e.homeAccountId===n.homeAccountId&&e.localAccountId===n.localAccountId&&e.username===n.username&&e.tenantId===n.tenantId&&e.loginHint===n.loginHint&&e.environment===n.environment&&e.nativeAccountId===n.nativeAccountId&&i}}/*! @azure/msal-common v15.10.0 2025-08-05 */const cx="no_tokens_found",BU="native_account_unavailable",bN="refresh_token_expired",wN="ux_not_allowed",Fne="interaction_required",Une="consent_required",Bne="login_required",R0="bad_token";/*! @azure/msal-common v15.10.0 2025-08-05 */const TI=[Fne,Une,Bne,R0,wN],Hne=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],zne={[cx]:"No refresh token found in the cache. Please sign-in.",[BU]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[bN]:"Refresh token has expired.",[R0]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[wN]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve."};class lo extends Cn{constructor(e,n,r,i,s,o,c,l){super(e,n,r),Object.setPrototypeOf(this,lo.prototype),this.timestamp=i||ve.EMPTY_STRING,this.traceId=s||ve.EMPTY_STRING,this.correlationId=o||ve.EMPTY_STRING,this.claims=c||ve.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=l}}function HU(t,e,n){const r=!!t&&TI.indexOf(t)>-1,i=!!n&&Hne.indexOf(n)>-1,s=!!e&&TI.some(o=>e.indexOf(o)>-1);return r||s||i}function lx(t){return new lo(t,zne[t])}/*! @azure/msal-common v15.10.0 2025-08-05 */class Hf{static setRequestState(e,n,r){const i=Hf.generateLibraryState(e,r);return n?`${i}${ve.RESOURCE_DELIM}${n}`:i}static generateLibraryState(e,n){if(!e)throw _e(n1);const r={id:e.createNewGuid()};n&&(r.meta=n);const i=JSON.stringify(r);return e.base64Encode(i)}static parseRequestState(e,n){if(!e)throw _e(n1);if(!n)throw _e(Qd);try{const r=n.split(ve.RESOURCE_DELIM),i=r[0],s=r.length>1?r.slice(1).join(ve.RESOURCE_DELIM):ve.EMPTY_STRING,o=e.base64Decode(i),c=JSON.parse(o);return{userRequestState:s||ve.EMPTY_STRING,libraryState:c}}catch{throw _e(Qd)}}}/*! @azure/msal-common v15.10.0 2025-08-05 */const Vne={SW:"sw"};class Xd{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(W.PopTokenGenerateCnf,e.correlationId);const r=await ge(this.generateKid.bind(this),W.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),i=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:i}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(W.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Vne.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,i){const{resourceRequestMethod:s,resourceRequestUri:o,shrClaims:c,shrNonce:l,shrOptions:u}=r,d=o?new en(o):void 0,f=d==null?void 0:d.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Li(),m:s==null?void 0:s.toUpperCase(),u:f==null?void 0:f.HostNameAndPort,nonce:l||this.cryptoUtils.createNewGuid(),p:f==null?void 0:f.AbsolutePath,q:f!=null&&f.QueryString?[[],f.QueryString]:void 0,client_claims:c||void 0,...i},n,u,r.correlationId)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class Gne{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v15.10.0 2025-08-05 */class pu{constructor(e,n,r,i,s,o,c){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=i,this.serializableCache=s,this.persistencePlugin=o,this.performanceClient=c}validateTokenResponse(e,n){var r;if(e.error||e.error_description||e.suberror){const i=`Error(s): ${e.error_codes||ve.NOT_AVAILABLE} - Timestamp: ${e.timestamp||ve.NOT_AVAILABLE} - Description: ${e.error_description||ve.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||ve.NOT_AVAILABLE} - Trace ID: ${e.trace_id||ve.NOT_AVAILABLE}`,s=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,o=new Tu(e.error,i,e.suberror,s,e.status);if(n&&e.status&&e.status>=bc.SERVER_ERROR_RANGE_START&&e.status<=bc.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. +${o}`);return}else if(n&&e.status&&e.status>=bc.CLIENT_ERROR_RANGE_START&&e.status<=bc.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. +${o}`);return}throw HU(e.error,e.error_description,e.suberror)?new lo(e.error,e.error_description,e.suberror,e.timestamp||ve.EMPTY_STRING,e.trace_id||ve.EMPTY_STRING,e.correlation_id||ve.EMPTY_STRING,e.claims||ve.EMPTY_STRING,s):o}}async handleServerTokenResponse(e,n,r,i,s,o,c,l,u){var g;(g=this.performanceClient)==null||g.addQueueMeasurement(W.HandleServerTokenResponse,e.correlation_id);let d;if(e.id_token){if(d=Bf(e.id_token||ve.EMPTY_STRING,this.cryptoObj.base64Decode),s&&s.nonce&&d.nonce!==s.nonce)throw _e(G5);if(i.maxAge||i.maxAge===0){const m=d.auth_time;if(!m)throw _e(WE);vU(m,i.maxAge)}}this.homeAccountIdentifier=co.generateHomeAccountId(e.client_info||ve.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,d);let f;s&&s.state&&(f=Hf.parseRequestState(this.cryptoObj,s.state)),e.key_id=e.key_id||i.sshKid||void 0;const h=this.generateCacheRecord(e,n,r,i,d,o,s);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),p=new Gne(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),c&&!l&&h.account){const m=this.cacheStorage.generateAccountKey(h.account.getAccountInfo());if(!this.cacheStorage.getAccount(m,i.correlationId))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await pu.generateAuthenticationResult(this.cryptoObj,n,h,!1,i,d,f,void 0,u)}await this.cacheStorage.saveCacheRecord(h,i.correlationId,i.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(p))}return pu.generateAuthenticationResult(this.cryptoObj,n,h,!1,i,d,f,e,u)}generateCacheRecord(e,n,r,i,s,o,c){const l=n.getPreferredCache();if(!l)throw _e(YE);const u=UU(s);let d,f;e.id_token&&s&&(d=P0(this.homeAccountIdentifier,l,e.id_token,this.clientId,u||""),f=SN(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,i.correlationId,s,e.client_info,l,u,c,void 0,this.logger));let h=null;if(e.access_token){const m=e.scope?Ar.fromString(e.scope):new Ar(i.scopes||[]),y=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,b=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,x=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,w=r+y,S=w+b,C=x&&x>0?r+x:void 0;h=k0(this.homeAccountIdentifier,l,e.access_token,this.clientId,u||n.tenant||"",m.printScopes(),w,S,this.cryptoObj.base64Decode,C,e.token_type,o,e.key_id,i.claims,i.requestedClaimsHash)}let p=null;if(e.refresh_token){let m;if(e.refresh_token_expires_in){const y=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;m=r+y}p=$U(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,o,m)}let g=null;return e.foci&&(g={clientId:this.clientId,environment:l,familyId:e.foci}),{account:f,idToken:d,accessToken:h,refreshToken:p,appMetadata:g}}static async generateAuthenticationResult(e,n,r,i,s,o,c,l,u){var w,S,C,_,A;let d=ve.EMPTY_STRING,f=[],h=null,p,g,m=ve.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===yn.POP&&!s.popKid){const j=new Xd(e),{secret:P,keyId:k}=r.accessToken;if(!k)throw _e(QE);d=await j.signPopToken(P,k,s)}else d=r.accessToken.secret;f=Ar.fromString(r.accessToken.target).asArray(),h=Cd(r.accessToken.expiresOn),p=Cd(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(g=Cd(r.accessToken.refreshOn))}r.appMetadata&&(m=r.appMetadata.familyId===Qy?Qy:"");const y=(o==null?void 0:o.oid)||(o==null?void 0:o.sub)||"",b=(o==null?void 0:o.tid)||"";l!=null&&l.spa_accountid&&r.account&&(r.account.nativeAccountId=l==null?void 0:l.spa_accountid);const x=r.account?sN(r.account.getAccountInfo(),void 0,o,(w=r.idToken)==null?void 0:w.secret):null;return{authority:n.canonicalAuthority,uniqueId:y,tenantId:b,scopes:f,account:x,idToken:((S=r==null?void 0:r.idToken)==null?void 0:S.secret)||"",idTokenClaims:o||{},accessToken:d,fromCache:i,expiresOn:h,extExpiresOn:p,refreshOn:g,correlationId:s.correlationId,requestId:u||ve.EMPTY_STRING,familyId:m,tokenType:((C=r.accessToken)==null?void 0:C.tokenType)||ve.EMPTY_STRING,state:c?c.userRequestState:ve.EMPTY_STRING,cloudGraphHostName:((_=r.account)==null?void 0:_.cloudGraphHostName)||ve.EMPTY_STRING,msGraphHost:((A=r.account)==null?void 0:A.msGraphHost)||ve.EMPTY_STRING,code:l==null?void 0:l.spa_code,fromNativeBroker:!1}}}function SN(t,e,n,r,i,s,o,c,l,u,d,f){f==null||f.verbose("setCachedAccount called");const p=t.getAccountKeys().find(x=>x.startsWith(n));let g=null;p&&(g=t.getAccount(p,i));const m=g||co.createAccount({homeAccountId:n,idTokenClaims:s,clientInfo:o,environment:c,cloudGraphHostName:u==null?void 0:u.cloud_graph_host_name,msGraphHost:u==null?void 0:u.msgraph_host,nativeAccountId:d},e,r),y=m.tenantProfiles||[],b=l||m.realm;if(b&&!y.find(x=>x.tenantId===b)){const x=iN(n,m.localAccountId,b,s);y.push(x)}return m.tenantProfiles=y,m}/*! @azure/msal-common v15.10.0 2025-08-05 */async function zU(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v15.10.0 2025-08-05 */class VU extends xN{constructor(e,n){var r;super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,n){var c,l;if((c=this.performanceClient)==null||c.addQueueMeasurement(W.AuthClientAcquireToken,e.correlationId),!e.code)throw _e(q5);const r=Li(),i=await ge(this.executeTokenRequest.bind(this),W.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),s=(l=i.headers)==null?void 0:l[di.X_MS_REQUEST_ID],o=new pu(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return o.validateTokenResponse(i.body),ge(o.handleServerTokenResponse.bind(o),W.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,r,e,n,void 0,void 0,void 0,s)}getLogoutUri(e){if(!e)throw jn(cU);const n=this.createLogoutUrlQueryString(e);return en.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){var u;(u=this.performanceClient)==null||u.addQueueMeasurement(W.AuthClientExecuteTokenRequest,n.correlationId);const r=this.createTokenQueryParameters(n),i=en.appendQueryString(e.tokenEndpoint,r),s=await ge(this.createTokenRequestBody.bind(this),W.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n);let o;if(n.clientInfo)try{const d=rx(n.clientInfo,this.cryptoUtils.base64Decode);o={credential:`${d.uid}${Qp.CLIENT_INFO_SEPARATOR}${d.utid}`,type:Ws.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const c=this.createTokenRequestHeaders(o||n.ccsCredential),l=O0(this.config.authOptions.clientId,n);return ge(this.executePostToTokenEndpoint.bind(this),W.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(i,s,c,l,n.correlationId,W.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var i,s;(i=this.performanceClient)==null||i.addQueueMeasurement(W.AuthClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(uN(n,e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[hu])||this.config.authOptions.clientId),this.includeRedirectUri)dN(n,e.redirectUri);else if(!e.redirectUri)throw jn(rU);if(lN(n,e.scopes,!0,this.oidcDefaultScopes),xne(n,e.code),pN(n,this.config.libraryInfo),mN(n,this.config.telemetry.application),DU(n),this.serverTelemetryManager&&!CU(this.config)&&MU(n,this.serverTelemetryManager),e.codeVerifier&&wne(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&TU(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const o=this.config.clientCredentials.clientAssertion;PU(n,await zU(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kU(n,o.assertionType)}if(OU(n,$5.AUTHORIZATION_CODE_GRANT),gN(n),e.authenticationScheme===yn.POP){const o=new Xd(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await ge(o.generateCnf.bind(o),W.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,vN(n,c)}else if(e.authenticationScheme===yn.SSH)if(e.sshJwk)RU(n,e.sshJwk);else throw jn(j0);(!$o.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&fN(n,e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const o=rx(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${o.uid}${Qp.CLIENT_INFO_SEPARATOR}${o.utid}`,type:Ws.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose("Could not parse client info for CCS Header: "+o)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Ws.HOME_ACCOUNT_ID:try{const o=Sd(r.credential);cp(n,o)}catch(o){this.logger.verbose("Could not parse home account ID for CCS Header: "+o)}break;case Ws.UPN:ox(n,r.credential);break}return e.embeddedClientId&&N0(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Mc(n,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[SI])&&Mc(n,{[SI]:"1"}),E0(n,e.correlationId,this.performanceClient),Xp(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&pne(n,e.postLogoutRedirectUri),e.correlationId&&hN(n,e.correlationId),e.idTokenHint&&mne(n,e.idTokenHint),e.state&&EU(n,e.state),e.logoutHint&&Cne(n,e.logoutHint),e.extraQueryParameters&&Mc(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&IU(n),Xp(n,this.config.authOptions.encodeExtraQueryParams,e.extraQueryParameters)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const Kne=300;class Wne extends xN{constructor(e,n){super(e,n)}async acquireToken(e){var o,c;(o=this.performanceClient)==null||o.addQueueMeasurement(W.RefreshTokenClientAcquireToken,e.correlationId);const n=Li(),r=await ge(this.executeTokenRequest.bind(this),W.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),i=(c=r.headers)==null?void 0:c[di.X_MS_REQUEST_ID],s=new pu(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(r.body),ge(s.handleServerTokenResponse.bind(s),W.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,i)}async acquireTokenByRefreshToken(e){var r;if(!e)throw jn(aU);if((r=this.performanceClient)==null||r.addQueueMeasurement(W.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw _e(qE);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await ge(this.acquireTokenWithCachedRefreshToken.bind(this),W.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(i){const s=i instanceof lo&&i.errorCode===cx,o=i instanceof Tu&&i.errorCode===mI.INVALID_GRANT_ERROR&&i.subError===mI.CLIENT_MISMATCH_ERROR;if(s||o)return ge(this.acquireTokenWithCachedRefreshToken.bind(this),W.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw i}return ge(this.acquireTokenWithCachedRefreshToken.bind(this),W.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){var s,o,c;(s=this.performanceClient)==null||s.addQueueMeasurement(W.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=es(this.cacheManager.getRefreshToken.bind(this.cacheManager),W.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!r)throw lx(cx);if(r.expiresOn&&ax(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||Kne))throw(o=this.performanceClient)==null||o.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),lx(bN);const i={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||yn.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Ws.HOME_ACCOUNT_ID}};try{return await ge(this.acquireToken.bind(this),W.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(i)}catch(l){if(l instanceof lo&&((c=this.performanceClient)==null||c.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),l.subError===R0)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const u=this.cacheManager.generateCredentialKey(r);this.cacheManager.removeRefreshToken(u,e.correlationId)}throw l}}async executeTokenRequest(e,n){var l;(l=this.performanceClient)==null||l.addQueueMeasurement(W.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),i=en.appendQueryString(n.tokenEndpoint,r),s=await ge(this.createTokenRequestBody.bind(this),W.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),o=this.createTokenRequestHeaders(e.ccsCredential),c=O0(this.config.authOptions.clientId,e);return ge(this.executePostToTokenEndpoint.bind(this),W.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(i,s,o,c,e.correlationId,W.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,i,s;(r=this.performanceClient)==null||r.addQueueMeasurement(W.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(uN(n,e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[hu])||this.config.authOptions.clientId),e.redirectUri&&dN(n,e.redirectUri),lN(n,e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),OU(n,$5.REFRESH_TOKEN_GRANT),gN(n),pN(n,this.config.libraryInfo),mN(n,this.config.telemetry.application),DU(n),this.serverTelemetryManager&&!CU(this.config)&&MU(n,this.serverTelemetryManager),bne(n,e.refreshToken),this.config.clientCredentials.clientSecret&&TU(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const o=this.config.clientCredentials.clientAssertion;PU(n,await zU(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kU(n,o.assertionType)}if(e.authenticationScheme===yn.POP){const o=new Xd(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await ge(o.generateCnf.bind(o),W.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,vN(n,c)}else if(e.authenticationScheme===yn.SSH)if(e.sshJwk)RU(n,e.sshJwk);else throw jn(j0);if((!$o.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&fN(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Ws.HOME_ACCOUNT_ID:try{const o=Sd(e.ccsCredential.credential);cp(n,o)}catch(o){this.logger.verbose("Could not parse home account ID for CCS Header: "+o)}break;case Ws.UPN:ox(n,e.ccsCredential.credential);break}return e.embeddedClientId&&N0(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Mc(n,e.tokenBodyParameters),E0(n,e.correlationId,this.performanceClient),Xp(n)}}/*! @azure/msal-common v15.10.0 2025-08-05 */class qne extends xN{constructor(e,n){super(e,n)}async acquireCachedToken(e){var l;(l=this.performanceClient)==null||l.addQueueMeasurement(W.SilentFlowClientAcquireCachedToken,e.correlationId);let n=Al.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!$o.isEmptyObj(e.claims))throw this.setCacheOutcome(Al.FORCE_REFRESH_OR_CLAIMS,e.correlationId),_e(Rc);if(!e.account)throw _e(qE);const r=e.account.tenantId||$ne(e.authority),i=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,i,r);if(s){if(Pne(s.cachedAt)||ax(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Al.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),_e(Rc);s.refreshOn&&ax(s.refreshOn,0)&&(n=Al.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Al.NO_CACHED_ACCESS_TOKEN,e.correlationId),_e(Rc);const o=e.authority||this.authority.getPreferredCache(),c={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,i,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(o)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await ge(this.generateResultFromCacheRecord.bind(this),W.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(c,e),n]}setCacheOutcome(e,n){var r,i;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(i=this.performanceClient)==null||i.addFields({cacheOutcome:e},n),e!==Al.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(W.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let r;if(e.idToken&&(r=Bf(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const s=r==null?void 0:r.auth_time;if(!s)throw _e(WE);vU(s,n.maxAge)}return pu.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,r)}}/*! @azure/msal-common v15.10.0 2025-08-05 */const Yne={sendGetRequestAsync:()=>Promise.reject(_e(Kt)),sendPostRequestAsync:()=>Promise.reject(_e(Kt))};/*! @azure/msal-common v15.10.0 2025-08-05 */function Qne(t,e,n,r){var c,l;const i=e.correlationId,s=new Map;uN(s,e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[hu])||t.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(lN(s,o,!0,(l=t.authority.options.OIDCOptions)==null?void 0:l.defaultScopes),dN(s,e.redirectUri),hN(s,i),fne(s,e.responseMode),gN(s),e.prompt&&(vne(s,e.prompt),r==null||r.addFields({prompt:e.prompt},i)),e.domainHint&&(gne(s,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},i)),e.prompt!==pi.SELECT_ACCOUNT)if(e.sid&&e.prompt===pi.NONE)n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),CI(s,e.sid),r==null||r.addFields({sidFromRequest:!0},i);else if(e.account){const u=Zne(e.account);let d=ere(e.account);if(d&&e.domainHint&&(n.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),d=null),d){n.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),hv(s,d),r==null||r.addFields({loginHintFromClaim:!0},i);try{const f=Sd(e.account.homeAccountId);cp(s,f)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(u&&e.prompt===pi.NONE){n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),CI(s,u),r==null||r.addFields({sidFromClaim:!0},i);try{const f=Sd(e.account.homeAccountId);cp(s,f)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)n.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),hv(s,e.loginHint),ox(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i);else if(e.account.username){n.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),hv(s,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},i);try{const f=Sd(e.account.homeAccountId);cp(s,f)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(n.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),hv(s,e.loginHint),ox(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i));else n.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&yne(s,e.nonce),e.state&&EU(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&fN(s,e.claims,t.clientCapabilities),e.embeddedClientId&&N0(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(s1))&&IU(s),s}function CN(t,e,n,r){const i=Xp(e,n,r);return en.appendQueryString(t.authorizationEndpoint,i)}function Xne(t,e){if(GU(t,e),!t.code)throw _e(Z5);return t}function GU(t,e){if(!t.state||!e)throw t.state?_e(Z_,"Cached State"):_e(Z_,"Server State");let n,r;try{n=decodeURIComponent(t.state)}catch{throw _e(Qd,t.state)}try{r=decodeURIComponent(e)}catch{throw _e(Qd,t.state)}if(n!==r)throw _e(V5);if(t.error||t.error_description||t.suberror){const i=Jne(t);throw HU(t.error,t.error_description,t.suberror)?new lo(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",i):new Tu(t.error||"",t.error_description,t.suberror,i)}}function Jne(t){var r,i;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(i=t.error_uri)==null?void 0:i.substring(n+e.length):void 0}function Zne(t){var e;return((e=t.idTokenClaims)==null?void 0:e.sid)||null}function ere(t){var e;return t.loginHint||((e=t.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v15.10.0 2025-08-05 */const PI=",",KU="|";function tre(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:i,extensionVersion:s}=t,o=new Map([[0,[n,r]],[2,[i,s]]]);let c=[];if(e!=null&&e.length){if(c=e.split(PI),c.length<4)return e}else c=Array.from({length:4},()=>KU);return o.forEach((l,u)=>{var d,f;l.length===2&&((d=l[0])!=null&&d.length)&&((f=l[1])!=null&&f.length)&&nre({skuArr:c,index:u,skuName:l[0],skuVersion:l[1]})}),c.join(PI)}function nre(t){const{skuArr:e,index:n,skuName:r,skuVersion:i}=t;n>=e.length||(e[n]=[r,i].join(KU))}class Jp{constructor(e,n){this.cacheOutcome=Al.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||ve.EMPTY_STRING,this.wrapperVer=e.wrapperVer||ve.EMPTY_STRING,this.telemetryCacheKey=Lr.CACHE_KEY+Qp.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Lr.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const i=n.join(Lr.VALUE_SEPARATOR),s=this.getRegionDiscoveryFields(),o=[e,s].join(Lr.VALUE_SEPARATOR);return[Lr.SCHEMA_VERSION,o,i].join(Lr.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=Jp.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(Lr.VALUE_SEPARATOR),i=e.errors.slice(0,n).join(Lr.VALUE_SEPARATOR),s=e.errors.length,o=n=Lr.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Cn?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(Lr.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=Jp.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const i={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,i=0;const s=e.errors.length;for(n=0;nString.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v4.19.0 2025-08-05 */function Zs(t){return new TextDecoder().decode(Dc(t))}function Dc(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Ve(bB)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const pre="RSASSA-PKCS1-v1_5",zf="AES-GCM",jB="HKDF",ON="SHA-256",mre=2048,gre=new Uint8Array([1,0,1]),RI="0123456789abcdef",MI=new Uint32Array(1),IN="raw",EB="encrypt",RN="decrypt",vre="deriveKey",yre="crypto_subtle_undefined",MN={name:pre,hash:ON,modulusLength:mre,publicExponent:gre};function xre(t){if(!window)throw Ve($0);if(!window.crypto)throw Ve(o1);if(!t&&!window.crypto.subtle)throw Ve(o1,yre)}async function NB(t,e,n){e==null||e.addQueueMeasurement(W.Sha256Digest,n);const i=new TextEncoder().encode(t);return window.crypto.subtle.digest(ON,i)}function bre(t){return window.crypto.getRandomValues(t)}function US(){return window.crypto.getRandomValues(MI),MI[0]}function uo(){const t=Date.now(),e=US()*1024+(US()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),i=e&2**30-1,s=US();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s;let o="";for(let c=0;c>>4),o+=RI.charAt(n[c]&15),(c===3||c===5||c===7||c===9)&&(o+="-");return o}async function wre(t,e){return window.crypto.subtle.generateKey(MN,t,e)}async function BS(t){return window.crypto.subtle.exportKey(_B,t)}async function Sre(t,e,n){return window.crypto.subtle.importKey(_B,t,MN,e,n)}async function Cre(t,e){return window.crypto.subtle.sign(MN,t,e)}async function DN(){const t=await TB(),n={alg:"dir",kty:"oct",k:Jc(new Uint8Array(t))};return em(JSON.stringify(n))}async function _re(t){const e=Zs(t),r=JSON.parse(e).k,i=Dc(r);return window.crypto.subtle.importKey(IN,i,zf,!1,[RN])}async function Are(t,e){const n=e.split(".");if(n.length!==5)throw Ve(ny,"jwe_length");const r=await _re(t).catch(()=>{throw Ve(ny,"import_key")});try{const i=new TextEncoder().encode(n[0]),s=Dc(n[2]),o=Dc(n[3]),c=Dc(n[4]),l=c.byteLength*8,u=new Uint8Array(o.length+c.length);u.set(o),u.set(c,o.length);const d=await window.crypto.subtle.decrypt({name:zf,iv:s,tagLength:l,additionalData:i},r,u);return new TextDecoder().decode(d)}catch{throw Ve(ny,"decrypt")}}async function TB(){const t=await window.crypto.subtle.generateKey({name:zf,length:256},!0,[EB,RN]);return window.crypto.subtle.exportKey(IN,t)}async function DI(t){return window.crypto.subtle.importKey(IN,t,jB,!1,[vre])}async function PB(t,e,n){return window.crypto.subtle.deriveKey({name:jB,salt:e,hash:ON,info:new TextEncoder().encode(n)},t,{name:zf,length:256},!1,[EB,RN])}async function jre(t,e,n){const r=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(16)),s=await PB(t,i,n),o=await window.crypto.subtle.encrypt({name:zf,iv:new Uint8Array(12)},s,r);return{data:Jc(new Uint8Array(o)),nonce:Jc(i)}}async function $I(t,e,n,r){const i=Dc(r),s=await PB(t,Dc(e),n),o=await window.crypto.subtle.decrypt({name:zf,iv:new Uint8Array(12)},s,i);return new TextDecoder().decode(o)}async function kB(t){const e=await NB(t),n=new Uint8Array(e);return Jc(n)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const tm="storage_not_supported",ur="stubbed_public_client_application_called",fx="in_mem_redirect_unavailable";/*! @azure/msal-browser v4.19.0 2025-08-05 */const ry={[tm]:"Given storage configuration option was not supported.",[ur]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[fx]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};ry[tm],ry[ur],ry[fx];class $N extends Cn{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,$N.prototype)}}function dr(t){return new $N(t,ry[t])}/*! @azure/msal-browser v4.19.0 2025-08-05 */function OB(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function Ere(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function LN(){return window.parent!==window}function Nre(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Ni.POPUP_NAME_PREFIX}.`)===0}function ya(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function Tre(){const e=new en(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Pre(){if(en.hashContainsKnownProperties(window.location.hash)&&LN())throw Ve(sB)}function kre(t){if(LN()&&!t)throw Ve(iB)}function Ore(){if(Nre())throw Ve(oB)}function IB(){if(typeof window>"u")throw Ve($0)}function RB(t){if(!t)throw Ve(lp)}function FN(t){IB(),Pre(),Ore(),RB(t)}function LI(t,e){if(FN(t),kre(e.system.allowRedirectInIframe),e.cache.cacheLocation===jr.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw dr(fx)}function MB(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function Ire(){return uo()}/*! @azure/msal-browser v4.19.0 2025-08-05 */class hx{navigateInternal(e,n){return hx.defaultNavigateWindow(e,n)}navigateExternal(e,n){return hx.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((r,i)=>{setTimeout(()=>{i(Ve(dx,"failed_to_redirect"))},n.timeout)})}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Rre{async sendGetRequestAsync(e,n){let r,i={},s=0;const o=FI(n);try{r=await fetch(e,{method:OI.GET,headers:o})}catch(c){throw zh(Ve(window.navigator.onLine?dB:ux),void 0,void 0,c)}i=UI(r.headers);try{return s=r.status,{headers:i,body:await r.json(),status:s}}catch(c){throw zh(Ve(a1),s,i,c)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",i=FI(n);let s,o=0,c={};try{s=await fetch(e,{method:OI.POST,headers:i,body:r})}catch(l){throw zh(Ve(window.navigator.onLine?uB:ux),void 0,void 0,l)}c=UI(s.headers);try{return o=s.status,{headers:c,body:await s.json(),status:o}}catch(l){throw zh(Ve(a1),o,c,l)}}}function FI(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,i])=>{e.append(r,i)}),e}catch(e){throw zh(Ve(SB),void 0,void 0,e)}}function UI(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw Ve(CB)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Mre=6e4,l1=1e4,Dre=3e4,DB=2e3;function $re({auth:t,cache:e,system:n,telemetry:r},i){const s={clientId:ve.EMPTY_STRING,authority:`${ve.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:ve.EMPTY_STRING,authorityMetadata:ve.EMPTY_STRING,redirectUri:typeof window<"u"?ya():"",postLogoutRedirectUri:ve.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:$i.AAD,OIDCOptions:{serverResponseType:A0.FRAGMENT,defaultScopes:[ve.OPENID_SCOPE,ve.PROFILE_SCOPE,ve.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:ZE.None,tenant:ve.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1,encodeExtraQueryParams:!1},o={cacheLocation:jr.SessionStorage,cacheRetentionDays:5,temporaryCacheLocation:jr.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===jr.LocalStorage),claimsBasedCachingEnabled:!1},c={loggerCallback:()=>{},logLevel:Rn.Info,piiLoggingEnabled:!1},u={...{...SU,loggerOptions:c,networkClient:i?new Rre:Yne,navigationClient:new hx,loadFrameTimeout:0,windowHashTimeout:(n==null?void 0:n.loadFrameTimeout)||Mre,iframeHashTimeout:(n==null?void 0:n.loadFrameTimeout)||l1,navigateFrameWait:0,redirectNavigationTimeout:Dre,asyncPopups:!1,allowRedirectInIframe:!1,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||DB,pollIntervalMilliseconds:Ni.DEFAULT_POLL_INTERVAL_MS},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||c},d={application:{appName:ve.EMPTY_STRING,appVersion:ve.EMPTY_STRING},client:new wU};if((t==null?void 0:t.protocolMode)!==$i.OIDC&&(t!=null&&t.OIDCOptions)&&new Ma(u.loggerOptions).warning(JSON.stringify(jn(fU))),t!=null&&t.protocolMode&&t.protocolMode===$i.OIDC&&(u!=null&&u.allowPlatformBroker))throw jn(hU);return{auth:{...s,...t,OIDCOptions:{...s.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...o,...e},system:u,telemetry:{...d,...r}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Lre="@azure/msal-browser",mu="4.19.0";/*! @azure/msal-browser v4.19.0 2025-08-05 */const Tr="msal",UN="browser",HS="-",Za=1,u1=1,Fre=`${Tr}.${UN}.log.level`,Ure=`${Tr}.${UN}.log.pii`,Bre=`${Tr}.${UN}.platform.auth.dom`,BI=`${Tr}.version`,HI="account.keys",zI="token.keys";function So(t=u1){return t<1?`${Tr}.${HI}`:`${Tr}.${t}.${HI}`}function Ml(t,e=Za){return e<1?`${Tr}.${zI}.${t}`:`${Tr}.${e}.${zI}.${t}`}/*! @azure/msal-browser v4.19.0 2025-08-05 */class BN{static loggerCallback(e,n){switch(e){case Rn.Error:console.error(n);return;case Rn.Info:console.info(n);return;case Rn.Verbose:console.debug(n);return;case Rn.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var l;this.browserEnvironment=typeof window<"u",this.config=$re(e,this.browserEnvironment);let n;try{n=window[jr.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(Fre),i=(l=n==null?void 0:n.getItem(Ure))==null?void 0:l.toLowerCase(),s=i==="true"?!0:i==="false"?!1:void 0,o={...this.config.system.loggerOptions},c=r&&Object.keys(Rn).includes(r)?Rn[r]:void 0;c&&(o.loggerCallback=BN.loggerCallback,o.logLevel=c),s!==void 0&&(o.piiLoggingEnabled=s),this.logger=new Ma(o,Lre,mu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class gu extends BN{getModuleName(){return gu.MODULE_NAME}getId(){return gu.ID}async initialize(){return this.available=typeof window<"u",this.available}}gu.MODULE_NAME="";gu.ID="StandardOperatingContext";/*! @azure/msal-browser v4.19.0 2025-08-05 */class Hre{constructor(){this.dbName=c1,this.version=dre,this.tableName=fre,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",i=>{i.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",i=>{const s=i;this.db=s.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(Ve(PN)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Ve(Wu));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);o.addEventListener("success",c=>{const l=c;this.closeConnection(),n(l.target.result)}),o.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,i)=>{if(!this.db)return i(Ve(Wu));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);c.addEventListener("success",()=>{this.closeConnection(),r()}),c.addEventListener("error",l=>{this.closeConnection(),i(l)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Ve(Wu));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);o.addEventListener("success",()=>{this.closeConnection(),n()}),o.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(Ve(Wu));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();s.addEventListener("success",o=>{const c=o;this.closeConnection(),e(c.target.result)}),s.addEventListener("error",o=>{this.closeConnection(),n(o)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Ve(Wu));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);o.addEventListener("success",c=>{const l=c;this.closeConnection(),n(l.target.result===1)}),o.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(c1),i=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(i),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(i),e(!0))),r.addEventListener("error",()=>(clearTimeout(i),n(!1)))})}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class L0{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class zre{constructor(e){this.inMemoryCache=new L0,this.indexedDBCache=new Hre,this.logger=e}handleDatabaseAccessError(e){if(e instanceof yg&&e.errorCode===PN)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const n=this.inMemoryCache.getItem(e);if(!n)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return n}async setItem(e,n){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(n){this.handleDatabaseAccessError(n)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(n){this.handleDatabaseAccessError(n)}return e}async containsKey(e){const n=this.inMemoryCache.containsKey(e);if(!n)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return n}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Da{constructor(e,n,r){this.logger=e,xre(r??!1),this.cache=new zre(this.logger),this.performanceClient=n}createNewGuid(){return uo()}base64Encode(e){return em(e)}base64Decode(e){return Zs(e)}base64UrlEncode(e){return gv(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var d;const n=(d=this.performanceClient)==null?void 0:d.startMeasurement(W.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await wre(Da.EXTRACTABLE,Da.POP_KEY_USAGES),i=await BS(r.publicKey),s={e:i.e,kty:i.kty,n:i.n},o=VI(s),c=await this.hashString(o),l=await BS(r.privateKey),u=await Sre(l,!1,["sign"]);return await this.cache.setItem(c,{privateKey:u,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),n&&n.end({success:!0}),c}async removeTokenBindingKey(e){if(await this.cache.removeItem(e),await this.cache.containsKey(e))throw _e(eU)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,n,r,i){var w;const s=(w=this.performanceClient)==null?void 0:w.startMeasurement(W.CryptoOptsSignJwt,i),o=await this.cache.getItem(n);if(!o)throw Ve(TN);const c=await BS(o.publicKey),l=VI(c),u=gv(JSON.stringify({kid:n})),d=AN.getShrHeaderString({...r==null?void 0:r.header,alg:c.alg,kid:u}),f=gv(d);e.cnf={jwk:JSON.parse(l)};const h=gv(JSON.stringify(e)),p=`${f}.${h}`,m=new TextEncoder().encode(p),y=await Cre(o.privateKey,m),b=Jc(new Uint8Array(y)),x=`${p}.${b}`;return s&&s.end({success:!0}),x}async hashString(e){return kB(e)}}Da.POP_KEY_USAGES=["sign","verify"];Da.EXTRACTABLE=!0;function VI(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Vre=24*60*60*1e3,d1={Lax:"Lax",None:"None"};class $B{initialize(){return Promise.resolve()}getItem(e){const n=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let i=0;i{const i=decodeURIComponent(r).trim().split("=");n.push(i[0])}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function Gre(t){const e=new Date;return new Date(e.getTime()+t*Vre).toUTCString()}/*! @azure/msal-browser v4.19.0 2025-08-05 */function up(t,e){const n=t.getItem(So(e));return n?JSON.parse(n):[]}function dp(t,e,n){const r=e.getItem(Ml(t,n));if(r){const i=JSON.parse(r);if(i&&i.hasOwnProperty("idToken")&&i.hasOwnProperty("accessToken")&&i.hasOwnProperty("refreshToken"))return i}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function f1(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}/*! @azure/msal-browser v4.19.0 2025-08-05 */const GI="msal.cache.encryption",Kre="msal.broadcast.cache";class Wre{constructor(e,n,r){if(!window.localStorage)throw dr(tm);this.memoryStorage=new L0,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=r,this.broadcast=new BroadcastChannel(Kre)}async initialize(e){const n=new $B,r=n.getItem(GI);let i={key:"",id:""};if(r)try{i=JSON.parse(r)}catch{}if(i.key&&i.id){const s=es(Dc,W.Base64Decode,this.logger,this.performanceClient,e)(i.key);this.encryptionCookie={id:i.id,key:await ge(DI,W.GenerateHKDF,this.logger,this.performanceClient,e)(s)}}else{const s=uo(),o=await ge(TB,W.GenerateBaseKey,this.logger,this.performanceClient,e)(),c=es(Jc,W.UrlEncodeArr,this.logger,this.performanceClient,e)(new Uint8Array(o));this.encryptionCookie={id:s,key:await ge(DI,W.GenerateHKDF,this.logger,this.performanceClient,e)(o)};const l={id:s,key:c};n.setItem(GI,JSON.stringify(l),0,!0,d1.None)}await ge(this.importExistingCache.bind(this),W.ImportExistingCache,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",this.updateCache.bind(this)),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw Ve(lp);return this.memoryStorage.getItem(e)}async decryptData(e,n,r){if(!this.initialized||!this.encryptionCookie)throw Ve(lp);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const i=await ge($I,W.Decrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!i)return null;try{return JSON.parse(i)}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,r,i){if(!this.initialized||!this.encryptionCookie)throw Ve(lp);const{data:s,nonce:o}=await ge(jre,W.Encrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n,this.getContext(e)),c={id:this.encryptionCookie.id,nonce:o,data:s,lastUpdatedAt:i};this.memoryStorage.setItem(e,n),this.setItem(e,JSON.stringify(c)),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),up(this).forEach(r=>this.removeItem(r));const n=dp(this.clientId,this);n.idToken.forEach(r=>this.removeItem(r)),n.accessToken.forEach(r=>this.removeItem(r)),n.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(Tr)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=up(this);n=await this.importArray(n,e),n.length?this.setItem(So(),JSON.stringify(n)):this.removeItem(So());const r=dp(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(Ml(this.clientId),JSON.stringify(r)):this.removeItem(Ml(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let i;try{i=JSON.parse(r)}catch{return null}return f1(i)?i.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):ge($I,W.Decrypt,this.logger,this.performanceClient,n)(this.encryptionCookie.key,i.nonce,this.getContext(e),i.data):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),i)}async importArray(e,n){const r=[],i=[];return e.forEach(s=>{const o=this.getItemFromEncryptedCache(s,n).then(c=>{c?(this.memoryStorage.setItem(s,c),r.push(s)):this.removeItem(s)});i.push(o)}),await Promise.all(i),r}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e){this.logger.trace("Updating internal cache from broadcast event");const n=this.performanceClient.startMeasurement(W.LocalStorageUpdated);n.add({isBackground:!0});const{key:r,value:i,context:s}=e.data;if(!r){this.logger.error("Broadcast event missing key"),n.end({success:!1,errorCode:"noKey"});return}if(s&&s!==this.clientId){this.logger.trace(`Ignoring broadcast event from clientId: ${s}`),n.end({success:!1,errorCode:"contextMismatch"});return}i?(this.memoryStorage.setItem(r,i),this.logger.verbose("Updated item in internal cache")):(this.memoryStorage.removeItem(r),this.logger.verbose("Removed item from internal cache")),n.end({success:!0})}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class qre{constructor(){if(!window.sessionStorage)throw dr(tm)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Ye={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};/*! @azure/msal-browser v4.19.0 2025-08-05 */function KI(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class h1 extends i1{constructor(e,n,r,i,s,o,c){super(e,r,i,s,c),this.cacheConfig=n,this.logger=i,this.internalStorage=new L0,this.browserStorage=WI(e,n.cacheLocation,i,s),this.temporaryCacheStorage=WI(e,n.temporaryCacheLocation,i,s),this.cookieStorage=new $B,this.eventHandler=o}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){const n=up(this.browserStorage,0),r=dp(this.clientId,this.browserStorage,0);this.performanceClient.addFields({oldAccountCount:n.length,oldAccessCount:r.accessToken.length,oldIdCount:r.idToken.length,oldRefreshCount:r.refreshToken.length},e);const i=up(this.browserStorage,1),s=dp(this.clientId,this.browserStorage,1);this.performanceClient.addFields({currAccountCount:i.length,currAccessCount:s.accessToken.length,currIdCount:s.idToken.length,currRefreshCount:s.refreshToken.length},e),await Promise.all([this.updateV0ToCurrent(u1,n,i,e),this.updateV0ToCurrent(Za,r.idToken,s.idToken,e),this.updateV0ToCurrent(Za,r.accessToken,s.accessToken,e),this.updateV0ToCurrent(Za,r.refreshToken,s.refreshToken,e)]),n.length>0?this.browserStorage.setItem(So(0),JSON.stringify(n)):this.browserStorage.removeItem(So(0)),i.length>0?this.browserStorage.setItem(So(1),JSON.stringify(i)):this.browserStorage.removeItem(So(1)),this.setTokenKeys(r,e,0),this.setTokenKeys(s,e,1)}async updateV0ToCurrent(e,n,r,i){const s=[];for(const o of[...n]){const c=this.browserStorage.getItem(o),l=this.validateAndParseJson(c||"");if(!l){KI(n,o);continue}l.lastUpdatedAt||(l.lastUpdatedAt=Date.now().toString(),this.setItem(o,JSON.stringify(l),i));const u=f1(l)?await this.browserStorage.decryptData(o,l,i):l;let d;if(u&&(AI(u)||jI(u))&&(d=u.expiresOn),!u||Tne(l.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)||d&&ax(d,L5)){this.browserStorage.removeItem(o),KI(n,o),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},i);continue}if(this.cacheConfig.cacheLocation!==jr.LocalStorage||f1(l)){const f=`${Tr}.${e}${HS}${o}`,h=this.browserStorage.getItem(f);if(h){const p=this.validateAndParseJson(h);if(Number(l.lastUpdatedAt)>Number(p.lastUpdatedAt)){s.push(this.setUserData(f,JSON.stringify(u),i,l.lastUpdatedAt).then(()=>{this.performanceClient.incrementFields({updatedCacheFromV0Count:1},i)}));continue}}else{s.push(this.setUserData(f,JSON.stringify(u),i,l.lastUpdatedAt).then(()=>{r.push(f),this.performanceClient.incrementFields({upgradedCacheCount:1},i)}));continue}}}return Promise.all(s)}trackVersionChanges(e){const n=this.browserStorage.getItem(BI);n&&(this.logger.info(`MSAL.js was last initialized by version: ${n}`),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==mu&&this.setItem(BI,mu,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,r){let i=0,s=[];const o=20;for(let c=0;c<=o;c++)try{this.browserStorage.setItem(e,n),c>0&&(c<=i?this.removeAccessTokenKeys(s.slice(0,c),r,0):(this.removeAccessTokenKeys(s.slice(0,i),r,0),this.removeAccessTokenKeys(s.slice(i,c),r)));break}catch(l){const u=r1(l);if(u.errorCode===nx&&c0&&(l<=s?this.removeAccessTokenKeys(o.slice(0,l),r,0):(this.removeAccessTokenKeys(o.slice(0,s),r,0),this.removeAccessTokenKeys(o.slice(s,l),r)));break}catch(u){const d=r1(u);if(d.errorCode===nx&&l-1){if(r.splice(i,1),r.length===0){this.removeItem(So());return}else this.setItem(So(),JSON.stringify(r),n);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}removeAccount(e,n){const r=this.getActiveAccount(n);(r==null?void 0:r.homeAccountId)===e.homeAccountId&&(r==null?void 0:r.environment)===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(i=>{i.includes(e.homeAccountId)&&i.includes(e.environment)&&this.browserStorage.removeItem(i)}),this.cacheConfig.cacheLocation===jr.LocalStorage&&this.eventHandler.emitEvent(Ye.ACCOUNT_REMOVED,void 0,e)}removeIdToken(e,n){super.removeIdToken(e,n);const r=this.getTokenKeys(),i=r.idToken.indexOf(e);i>-1&&(this.logger.info("idToken removed from tokenKeys map"),r.idToken.splice(i,1),this.setTokenKeys(r,n))}removeAccessToken(e,n,r=!0){super.removeAccessToken(e,n),r&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,r=Za){this.logger.trace("removeAccessTokenKey called");const i=this.getTokenKeys(r);let s=0;if(e.forEach(o=>{const c=i.accessToken.indexOf(o);c>-1&&(i.accessToken.splice(c,1),s++)}),s>0){this.logger.info(`removed ${s} accessToken keys from tokenKeys map`),this.setTokenKeys(i,n,r);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const r=this.getTokenKeys(),i=r.refreshToken.indexOf(e);i>-1&&(this.logger.info("refreshToken removed from tokenKeys map"),r.refreshToken.splice(i,1),this.setTokenKeys(r,n))}getTokenKeys(e=Za){return dp(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,r=Za){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(Ml(this.clientId,r));return}else this.setItem(Ml(this.clientId,r),JSON.stringify(e),n)}getIdTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!kne(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i)}async setIdTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(r,JSON.stringify(e),n,i);const s=this.getTokenKeys();s.idToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),s.idToken.push(r),this.setTokenKeys(s,n))}getAccessTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeAccessTokenKeys([e],n),null;const i=this.validateAndParseJson(r);return!i||!AI(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i)}async setAccessTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(r,JSON.stringify(e),n,i);const s=this.getTokenKeys(),o=s.accessToken.indexOf(r);o!==-1&&s.accessToken.splice(o,1),this.logger.trace(`access token ${o===-1?"added to":"updated in"} map`),s.accessToken.push(r),this.setTokenKeys(s,n)}getRefreshTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeRefreshToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!jI(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i)}async setRefreshTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(r,JSON.stringify(e),n,i);const s=this.getTokenKeys();s.refreshToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),s.refreshToken.push(r),this.setTokenKeys(s,n))}getAppMetadata(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Mne(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,n){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=Rne(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!One(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,n,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e){const n=this.internalStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return r&&Dne(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(mv.WRAPPER_SKU,e),this.internalStorage.setItem(mv.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(mv.WRAPPER_SKU)||ve.EMPTY_STRING,n=this.internalStorage.getItem(mv.WRAPPER_VER)||ve.EMPTY_STRING;return[e,n]}setAuthorityMetadata(e,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(pI.ACTIVE_ACCOUNT_FILTERS),r=this.browserStorage.getItem(n);if(!r)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found"),null;const i=this.validateAndParseJson(r);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId,tenantId:i.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,n){const r=this.generateCacheKey(pI.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:Li().toString()};this.setItem(r,JSON.stringify(i),n)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(Ye.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Ine(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,n,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n){const r=n?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const s=this.cookieStorage.getItem(r);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),s}const i=this.temporaryCacheStorage.getItem(r);if(!i){if(this.cacheConfig.cacheLocation===jr.LocalStorage){const s=this.browserStorage.getItem(r);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),s}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),i}setTemporaryCache(e,n,r){const i=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(i,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(i,n,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(Tr)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(Tr)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}clearTokensAndKeysWithClaims(e){this.performanceClient.addQueueMeasurement(W.ClearTokensAndKeysWithClaims,e);const n=this.getTokenKeys();let r=0;n.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i,e);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(i,e),r++)}),r>0&&this.logger.warning(`${r} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return $o.startsWith(e,Tr)?e:`${Tr}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===Hr.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==yn.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${Tr}.${Za}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",e.requestedClaimsHash||"",r].join(HS).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${Tr}.${u1}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(HS).toLowerCase()}resetRequestCache(){this.logger.trace("BrowserCacheManager.resetRequestCache called"),this.removeTemporaryItem(this.generateCacheKey(hr.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(hr.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(hr.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(hr.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(hr.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cacheAuthorizeRequest(e,n){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called");const r=em(JSON.stringify(e));if(this.setTemporaryCache(hr.REQUEST_PARAMS,r,!0),n){const i=em(n);this.setTemporaryCache(hr.VERIFIER,i,!0)}}getCachedRequest(){this.logger.trace("BrowserCacheManager.getCachedRequest called");const e=this.getTemporaryCache(hr.REQUEST_PARAMS,!0);if(!e)throw Ve(cB);const n=this.getTemporaryCache(hr.VERIFIER,!0);let r,i="";try{r=JSON.parse(Zs(e)),n&&(i=Zs(n))}catch(s){throw this.logger.errorPii(`Attempted to parse: ${e}`),this.logger.error(`Parsing cached token request threw with error: ${s}`),Ve(lB)}return[r,i]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(hr.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){var r;const n=(r=this.getInteractionInProgress())==null?void 0:r.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${Tr}.${hr.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("Cannot parse interaction status. Removing temporary cache items and clearing url hash. Retrying interaction should fix the error"),this.removeTemporaryItem(e),this.resetRequestCache(),OB(window),null}}setInteractionInProgress(e,n=cc.SIGNIN){var i;const r=`${Tr}.${hr.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw Ve(eB);this.setTemporaryCache(r,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&((i=this.getInteractionInProgress())==null?void 0:i.clientId)===this.clientId&&this.removeTemporaryItem(r)}async hydrateCache(e,n){var c,l,u;const r=P0((c=e.account)==null?void 0:c.homeAccountId,(l=e.account)==null?void 0:l.environment,e.idToken,this.clientId,e.tenantId);let i;n.claims&&(i=await this.cryptoImpl.hashString(n.claims));const s=k0((u=e.account)==null?void 0:u.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?_I(e.expiresOn):0,e.extExpiresOn?_I(e.extExpiresOn):0,Zs,void 0,e.tokenType,void 0,n.sshKid,n.claims,i),o={idToken:r,accessToken:s};return this.saveCacheRecord(o,e.correlationId)}async saveCacheRecord(e,n,r){try{await super.saveCacheRecord(e,n,r)}catch(i){if(i instanceof wd&&this.performanceClient&&n)try{const s=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:s.refreshToken.length,cacheIdCount:s.idToken.length,cacheAtCount:s.accessToken.length},n)}catch{}throw i}}}function WI(t,e,n,r){try{switch(e){case jr.LocalStorage:return new Wre(t,n,r);case jr.SessionStorage:return new qre;case jr.MemoryStorage:default:break}}catch(i){n.error(i)}return new L0}const Yre=(t,e,n,r)=>{const i={cacheLocation:jr.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:jr.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new h1(t,i,Zy,e,n,r)};/*! @azure/msal-browser v4.19.0 2025-08-05 */function Qre(t,e,n,r,i){return t.verbose("getAllAccounts called"),n?e.getAllAccounts(i||{},r):[]}function Xre(t,e,n,r){if(e.trace("getAccount called"),Object.keys(t).length===0)return e.warning("getAccount: No accountFilter provided"),null;const i=n.getAccountInfoFilteredBy(t,r);return i?(e.verbose("getAccount: Account matching provided filter found, returning"),i):(e.verbose("getAccount: No matching account found, returning null"),null)}function Jre(t,e,n,r){if(e.trace("getAccountByUsername called"),!t)return e.warning("getAccountByUsername: No username provided"),null;const i=n.getAccountInfoFilteredBy({username:t},r);return i?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${t}`),i):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function Zre(t,e,n,r){if(e.trace("getAccountByHomeId called"),!t)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const i=n.getAccountInfoFilteredBy({homeAccountId:t},r);return i?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${t}`),i):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function eie(t,e,n,r){if(e.trace("getAccountByLocalId called"),!t)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const i=n.getAccountInfoFilteredBy({localAccountId:t},r);return i?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${t}`),i):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function tie(t,e,n){e.setActiveAccount(t,n)}function nie(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const rie="msal.broadcast.event";class iie{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Ma({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(rie)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,r){if(typeof window<"u"){const i=r||Ire();return this.eventCallbacks.has(i)?(this.logger.error(`Event callback with id: ${i} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(i,[e,n||[]]),this.logger.verbose(`Event callback registered with id: ${i}`),i)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,n,r,i){var o;const s={eventType:e,interactionType:n||null,payload:r||null,error:i||null,timestamp:Date.now()};switch(e){case Ye.ACCOUNT_ADDED:case Ye.ACCOUNT_REMOVED:case Ye.ACTIVE_ACCOUNT_CHANGED:(o=this.broadcastChannel)==null||o.postMessage(s);break;default:this.invokeCallbacks(s);break}}invokeCallbacks(e){this.eventCallbacks.forEach(([n,r],i)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback ${i}: ${e.eventType}`),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class LB{constructor(e,n,r,i,s,o,c,l,u){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=o,this.platformAuthProvider=l,this.correlationId=u||uo(),this.logger=i.clone(Ni.MSAL_SKU,mu,this.correlationId),this.performanceClient=c}async clearCacheOnLogout(e,n){if(n)try{this.browserStorage.removeAccount(n,e),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),this.browserStorage.clear(e),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const n=e||this.config.auth.redirectUri;return en.getAbsoluteUrl(n,ya())}initializeServerTelemetryManager(e,n){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:n||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Jp(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:n}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(W.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const i={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},s=e.requestAuthority||this.config.auth.authority,o=r!=null&&r.length?r==="true":this.config.auth.instanceAware,c=n&&o?this.config.auth.authority.replace(en.getDomainFromUrl(s),n.environment):s,l=Jr.generateAuthority(c,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),u=await ge(FU,W.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(l,this.config.system.networkClient,this.browserStorage,i,this.logger,this.correlationId,this.performanceClient);if(n&&!u.isAlias(n.environment))throw jn(pU);return u}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function HN(t,e,n,r){n.addQueueMeasurement(W.InitializeBaseRequest,t.correlationId);const i=t.authority||e.auth.authority,s=[...t&&t.scopes||[]],o={...t,correlationId:t.correlationId,authority:i,scopes:s};if(!o.authenticationScheme)o.authenticationScheme=yn.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(o.authenticationScheme===yn.SSH){if(!t.sshJwk)throw jn(j0);if(!t.sshKid)throw jn(dU)}r.verbose(`Authentication Scheme set to "${o.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&t.claims&&!$o.isEmptyObj(t.claims)&&(o.requestedClaimsHash=await kB(t.claims)),o}async function sie(t,e,n,r,i){r.addQueueMeasurement(W.InitializeSilentRequest,t.correlationId);const s=await ge(HN,W.InitializeBaseRequest,i,r,t.correlationId)(t,n,r,i);return{...t,...s,account:e,forceRefresh:t.forceRefresh||!1}}function FB(t,e){let n;const r=t.httpMethod;if(e===$i.EAR){if(n=r||Rl.POST,n!==Rl.POST)throw jn(mU)}else n=r||Rl.GET;if(t.authorizePostBodyParameters&&n!==Rl.POST)throw jn(gU);return n}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Vf extends LB{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const n={correlationId:this.correlationId||uo(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=en.getAbsoluteUrl(e.postLogoutRedirectUri,ya())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=en.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,ya())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=en.getAbsoluteUrl(ya(),ya())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(W.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const n=await ge(this.getClientConfiguration.bind(this),W.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new VU(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:o}=e;this.performanceClient.addQueueMeasurement(W.StandardInteractionClientGetClientConfiguration,this.correlationId);const c=await ge(this.getDiscoveredAuthority.bind(this),W.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:o}),l=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:c,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:l.loggerCallback,piiLoggingEnabled:l.piiLoggingEnabled,logLevel:l.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:Ni.MSAL_SKU,version:mu,cpu:ve.EMPTY_STRING,os:ve.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,n){this.performanceClient.addQueueMeasurement(W.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),i={interactionType:n},s=Hf.setRequestState(this.browserCrypto,e&&e.state||ve.EMPTY_STRING,i),c={...await ge(HN,W.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:s,nonce:e.nonce||uo(),responseMode:this.config.auth.OIDCOptions.serverResponseType},l={...c,httpMethod:FB(c,this.config.auth.protocolMode)};if(e.loginHint||e.sid)return l;const u=e.account||this.browserStorage.getActiveAccount(this.correlationId);return u&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${u.homeAccountId}`,this.correlationId),l.account=u),l}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function oie(t,e){if(!e)return null;try{return Hf.parseRequestState(t,e).libraryState.meta}catch{throw _e(Qd)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function fp(t,e,n){const r=ex(t);if(!r)throw yU(t)?(n.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),n.errorPii(`The ${e} detected is: ${t}`),Ve(XU)):(n.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),Ve(QU));return r}function aie(t,e,n){if(!t.state)throw Ve(NN);const r=oie(e,t.state);if(!r)throw Ve(JU);if(r.interactionType!==n)throw Ve(ZU)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class UB{constructor(e,n,r,i,s){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=i,this.performanceClient=s}async handleCodeResponse(e,n){this.performanceClient.addQueueMeasurement(W.HandleCodeResponse,n.correlationId);let r;try{r=Xne(e,n.state)}catch(i){throw i instanceof Tu&&i.subError===Zp?Ve(Zp):i}return ge(this.handleCodeResponseFromServer.bind(this),W.HandleCodeResponseFromServer,this.logger,this.performanceClient,n.correlationId)(r,n)}async handleCodeResponseFromServer(e,n,r=!0){if(this.performanceClient.addQueueMeasurement(W.HandleCodeResponseFromServer,n.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await ge(this.authModule.updateAuthority.bind(this.authModule),W.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,n.correlationId)(e.cloud_instance_host_name,n.correlationId),r&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const s=this.createCcsCredentials(n);s&&(this.authCodeRequest.ccsCredential=s)}return await ge(this.authModule.acquireToken.bind(this.authModule),W.AuthClientAcquireToken,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Ws.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Ws.UPN}:null}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const cie="ContentError",BB="user_switch";/*! @azure/msal-browser v4.19.0 2025-08-05 */const lie="USER_INTERACTION_REQUIRED",uie="USER_CANCEL",die="NO_NETWORK",fie="PERSISTENT_ERROR",hie="DISABLED",pie="ACCOUNT_UNAVAILABLE",mie="UX_NOT_ALLOWED";/*! @azure/msal-browser v4.19.0 2025-08-05 */const gie=-2147186943,vie={[BB]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Po extends Cn{constructor(e,n,r){super(e,n),Object.setPrototypeOf(this,Po.prototype),this.name="NativeAuthError",this.ext=r}}function qu(t){if(t.ext&&t.ext.status&&(t.ext.status===fie||t.ext.status===hie)||t.ext&&t.ext.error&&t.ext.error===gie)return!0;switch(t.errorCode){case cie:return!0;default:return!1}}function px(t,e,n){if(n&&n.status)switch(n.status){case pie:return lx(BU);case lie:return new lo(t,e);case uie:return Ve(Zp);case die:return Ve(ux);case mie:return lx(wN)}return new Po(t,vie[t]||e,n)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class HB extends Vf{async acquireToken(e){this.performanceClient.addQueueMeasurement(W.SilentCacheClientAcquireToken,e.correlationId);const n=this.initializeServerTelemetryManager(Sn.acquireTokenSilent_silentFlow),r=await ge(this.getClientConfiguration.bind(this),W.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),i=new qne(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const o=(await ge(i.acquireCachedToken.bind(i),W.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(s){throw s instanceof yg&&s.errorCode===TN&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),s}}logout(e){this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(n.correlationId,n==null?void 0:n.account)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class iy extends LB{constructor(e,n,r,i,s,o,c,l,u,d,f,h){super(e,n,r,i,s,o,l,u,h),this.apiId=c,this.accountId=d,this.platformAuthProvider=u,this.nativeStorageManager=f,this.silentCacheClient=new HB(e,this.nativeStorageManager,r,i,s,o,l,u,h);const p=this.platformAuthProvider.getExtensionName();this.skus=Jp.makeExtraSkuString({libraryName:Ni.MSAL_SKU,libraryVersion:mu,extensionName:p,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[lne]:this.skus}}async acquireToken(e,n){this.performanceClient.addQueueMeasurement(W.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const r=this.performanceClient.startMeasurement(W.NativeInteractionClientAcquireToken,e.correlationId),i=Li(),s=this.initializeServerTelemetryManager(this.apiId);try{const o=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch(l){if(n===ci.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy"),l;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const c=await this.platformAuthProvider.sendMessage(o);return await this.handleNativeResponse(c,o,i).then(l=>(r.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),s.clearNativeBrokerErrorCode(),l)).catch(l=>{throw r.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}catch(o){throw o instanceof Po&&s.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:Ar.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),_e(t1);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},this.correlationId);if(!r)throw _e(t1);try{const i=this.createSilentCacheRequest(n,r),s=await this.silentCacheClient.acquireToken(i),o={...r,idTokenClaims:s==null?void 0:s.idTokenClaims,idToken:s==null?void 0:s.idToken};return{...s,account:o}}catch(i){throw i}}async acquireTokenRedirect(e,n){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const i=await this.initializeNativeRequest(r);try{await this.platformAuthProvider.sendMessage(i)}catch(c){if(c instanceof Po&&(this.initializeServerTelemetryManager(this.apiId).setNativeBrokerErrorCode(c.errorCode),qu(c)))throw c}this.browserStorage.setTemporaryCache(hr.NATIVE_REQUEST,JSON.stringify(i),!0);const s={apiId:Sn.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);n.end({success:!0}),await this.navigationClient.navigateExternal(o,s)}async handleRedirectPromise(e,n){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&n&&(e==null||e.addFields({errorCode:"no_cached_request"},n)),null;const{prompt:i,...s}=r;i&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(hr.NATIVE_REQUEST));const o=Li();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.platformAuthProvider.sendMessage(s),l=await this.handleNativeResponse(c,s,o);return this.initializeServerTelemetryManager(this.apiId).clearNativeBrokerErrorCode(),l}catch(c){throw c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var d,f;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const i=Bf(e.id_token,Zs),s=this.createHomeAccountIdentifier(e,i),o=(d=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:d.homeAccountId;if((f=n.extraParameters)!=null&&f.child_client_id&&e.account.id!==n.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch");else if(s!==o&&e.account.id!==n.accountId)throw px(BB);const c=await this.getDiscoveredAuthority({requestAuthority:n.authority}),l=SN(this.browserStorage,c,s,Zs,this.correlationId,i,e.client_info,void 0,i.tid,void 0,e.account.id,this.logger);e.expires_in=Number(e.expires_in);const u=await this.generateAuthenticationResult(e,n,i,l,c.canonicalAuthority,r);return await this.cacheAccount(l,this.correlationId),await this.cacheNativeTokens(e,n,s,i,e.access_token,u.tenantId,r),u}createHomeAccountIdentifier(e,n){return co.generateHomeAccountId(e.client_info||ve.EMPTY_STRING,Bs.Default,this.logger,this.browserCrypto,n)}generateScopes(e,n){return n?Ar.fromString(n):Ar.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===yn.POP&&n.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Xd(this.browserCrypto),i={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce};if(!n.keyId)throw _e(QE);return r.signPopToken(e.access_token,n.keyId,i)}else return e.access_token}async generateAuthenticationResult(e,n,r,i,s,o){const c=this.addTelemetryFromNativeResponse(e.properties.MATS),l=this.generateScopes(n.scope,e.scope),u=e.account.properties||{},d=u.UID||r.oid||r.sub||ve.EMPTY_STRING,f=u.TenantId||r.tid||ve.EMPTY_STRING,h=sN(i.getAccountInfo(),void 0,r,e.id_token);h.nativeAccountId!==e.account.id&&(h.nativeAccountId=e.account.id);const p=await this.generatePopAccessToken(e,n),g=n.tokenType===yn.POP?yn.POP:yn.BEARER;return{authority:s,uniqueId:d,tenantId:f,scopes:l.asArray(),account:h,idToken:e.id_token,idTokenClaims:r,accessToken:p,fromCache:c?this.isResponseFromCache(c):!1,expiresOn:Cd(o+e.expires_in),tokenType:g,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}async cacheAccount(e,n){await this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e.getAccountInfo(),n)}cacheNativeTokens(e,n,r,i,s,o,c){const l=P0(r,n.authority,e.id_token||"",n.clientId,i.tid||""),u=n.tokenType===yn.POP?ve.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,d=c+u,f=this.generateScopes(e.scope,n.scope),h=k0(r,n.authority,s,n.clientId,i.tid||o,f.printScopes(),d,0,Zs,void 0,n.tokenType,void 0,n.keyId),p={idToken:l,accessToken:h};return this.nativeStorageManager.saveCacheRecord(p,this.correlationId,n.storeInCache)}getExpiresInValue(e,n){return e===yn.POP?ve.SHR_NONCE_VALIDITY:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const n=await this.getCanonicalAuthority(e),{scopes:r,...i}=e,s=new Ar(r||[]);s.appendScopes(vg);const o={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(o.signPopToken&&e.popKid)throw Ve(wB);if(this.handleExtraBrokerParams(o),o.extraParameters=o.extraParameters||{},o.extraParameters.telemetry=gs.MATS_TELEMETRY,e.authenticationScheme===yn.POP){const c={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},l=new Xd(this.browserCrypto);let u;if(o.keyId)u=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:o.keyId})),o.signPopToken=!1;else{const d=await ge(l.generateCnf.bind(l),W.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(c,this.logger);u=d.reqCnfString,o.keyId=d.kid,o.signPopToken=!0}o.reqCnf=u}return this.addRequestSKUs(o),o}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:n,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new en(n);return r.validateAsUri(),r}getPrompt(e){switch(this.apiId){case Sn.ssoSilent:case Sn.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),pi.NONE}if(!e){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e){case pi.NONE:case pi.CONSENT:case pi.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e} is not compatible with native flow`),Ve(xB)}}handleExtraBrokerParams(e){var s;const n=e.extraParameters&&e.extraParameters.hasOwnProperty(ix)&&e.extraParameters.hasOwnProperty(sx)&&e.extraParameters.hasOwnProperty(hu);if(!e.embeddedClientId&&!n)return;let r="";const i=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[sx],r=e.extraParameters[hu]),e.extraParameters={child_client_id:r,child_redirect_uri:i},(s=this.performanceClient)==null||s.addFields({embeddedClientId:r,embeddedRedirectUri:i},e.correlationId)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function zN(t,e,n,r,i){const s=Qne({...t.auth,authority:e},n,r,i);if(pN(s,{sku:Ni.MSAL_SKU,version:mu,os:"",cpu:""}),t.auth.protocolMode!==$i.OIDC&&mN(s,t.telemetry.application),n.platformBroker&&(hne(s),n.authenticationScheme===yn.POP)){const o=new Da(r,i),c=new Xd(o);let l;n.popKid?l=o.encodeKid(n.popKid):l=(await ge(c.generateCnf.bind(c),W.PopTokenGenerateCnf,r,i,n.correlationId)(n,r)).reqCnfString,vN(s,l)}return E0(s,n.correlationId,i),s}async function VN(t,e,n,r,i){if(!n.codeChallenge)throw jn(tN);const s=await ge(zN,W.GetStandardParams,r,i,n.correlationId)(t,e,n,r,i);return cN(s,zE.CODE),NU(s,n.codeChallenge,ve.S256_CODE_CHALLENGE_METHOD),Mc(s,n.extraQueryParameters||{}),CN(e,s,t.auth.encodeExtraQueryParams,n.extraQueryParameters)}async function GN(t,e,n,r,i,s){if(!r.earJwk)throw Ve(EN);const o=await zN(e,n,r,i,s);cN(o,zE.IDTOKEN_TOKEN_REFRESHTOKEN),_ne(o,r.earJwk);const c=new Map;Mc(c,r.extraQueryParameters||{});const l=CN(n,c,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return zB(t,l,o)}async function KN(t,e,n,r,i,s){const o=await zN(e,n,r,i,s);cN(o,zE.CODE),NU(o,r.codeChallenge,r.codeChallengeMethod||ve.S256_CODE_CHALLENGE_METHOD),Ane(o,r.authorizePostBodyParameters||{});const c=new Map;Mc(c,r.extraQueryParameters||{});const l=CN(n,c,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return zB(t,l,o)}function zB(t,e,n){const r=t.createElement("form");return r.method="post",r.action=e,n.forEach((i,s)=>{const o=t.createElement("input");o.hidden=!0,o.name=s,o.value=i,r.appendChild(o)}),t.body.appendChild(r),r}async function VB(t,e,n,r,i,s,o,c,l,u){if(c.verbose("Account id found, calling WAM for token"),!u)throw Ve(kN);const d=new Da(c,l),f=new iy(r,i,d,c,o,r.system.navigationClient,n,l,u,e,s,t.correlationId),{userRequestState:h}=Hf.parseRequestState(d,t.state);return ge(f.acquireToken.bind(f),W.NativeInteractionClientAcquireToken,c,l,t.correlationId)({...t,state:h,prompt:void 0})}async function mx(t,e,n,r,i,s,o,c,l,u,d,f){if(To.removeThrottle(o,i.auth.clientId,t),e.accountId)return ge(VB,W.HandleResponsePlatformBroker,u,d,t.correlationId)(t,e.accountId,r,i,o,c,l,u,d,f);const h={...t,code:e.code||"",codeVerifier:n},p=new UB(s,o,h,u,d);return await ge(p.handleCodeResponse.bind(p),W.HandleCodeResponse,u,d,t.correlationId)(e,t)}async function WN(t,e,n,r,i,s,o,c,l,u,d){if(To.removeThrottle(s,r.auth.clientId,t),GU(e,t.state),!e.ear_jwe)throw Ve(YU);if(!t.earJwk)throw Ve(EN);const f=JSON.parse(await ge(Are,W.DecryptEarResponse,l,u,t.correlationId)(t.earJwk,e.ear_jwe));if(f.accountId)return ge(VB,W.HandleResponsePlatformBroker,l,u,t.correlationId)(t,f.accountId,n,r,s,o,c,l,u,d);const h=new pu(r.auth.clientId,s,new Da(l,u),l,null,null,u);h.validateTokenResponse(f);const p={code:"",state:t.state,nonce:t.nonce,client_info:f.client_info,cloud_graph_host_name:f.cloud_graph_host_name,cloud_instance_host_name:f.cloud_instance_host_name,cloud_instance_name:f.cloud_instance_name,msgraph_host:f.msgraph_host};return await ge(h.handleServerTokenResponse.bind(h),W.HandleServerTokenResponse,l,u,t.correlationId)(f,i,Li(),t,p,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v4.19.0 2025-08-05 */const yie=32;async function F0(t,e,n){t.addQueueMeasurement(W.GeneratePkceCodes,n);const r=es(xie,W.GenerateCodeVerifier,e,t,n)(t,e,n),i=await ge(bie,W.GenerateCodeChallengeFromVerifier,e,t,n)(r,t,e,n);return{verifier:r,challenge:i}}function xie(t,e,n){try{const r=new Uint8Array(yie);return es(bre,W.GetRandomValues,e,t,n)(r),Jc(r)}catch{throw Ve(jN)}}async function bie(t,e,n,r){e.addQueueMeasurement(W.GenerateCodeChallengeFromVerifier,r);try{const i=await ge(NB,W.Sha256Digest,n,e,r)(t,e,r);return Jc(new Uint8Array(i))}catch{throw Ve(jN)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class gx{constructor(e,n,r,i){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(W.NativeMessageHandlerHandshake),this.platformAuthType=gs.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace(this.platformAuthType+" - sendMessage called.");const n={method:Ch.GetToken,request:e},r={channel:gs.CHANNEL_ID,extensionId:this.extensionId,responseId:uo(),body:n};this.logger.trace(this.platformAuthType+" - Sending request to browser extension"),this.logger.tracePii(this.platformAuthType+` - Sending request to browser extension: ${JSON.stringify(r)}`),this.messageChannel.port1.postMessage(r);const i=await new Promise((o,c)=>{this.resolvers.set(r.responseId,{resolve:o,reject:c})});return this.validatePlatformBrokerResponse(i)}static async createProvider(e,n,r){e.trace("PlatformAuthExtensionHandler - createProvider called.");try{const i=new gx(e,n,r,gs.PREFERRED_EXTENSION_ID);return await i.sendHandshakeRequest(),i}catch{const s=new gx(e,n,r);return await s.sendHandshakeRequest(),s}}async sendHandshakeRequest(){this.logger.trace(this.platformAuthType+" - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:gs.CHANNEL_ID,extensionId:this.extensionId,responseId:uo(),body:{method:Ch.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=n=>{this.onChannelMessage(n)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((n,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:n,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(Ve(vB)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace(this.platformAuthType+" - onWindowMessage called"),e.source!==window)return;const n=e.data;if(!(!n.channel||n.channel!==gs.CHANNEL_ID)&&!(n.extensionId&&n.extensionId!==this.extensionId)&&n.body.method===Ch.HandshakeRequest){const r=this.handshakeResolvers.get(n.responseId);if(!r){this.logger.trace(this.platformAuthType+`.onWindowMessage - resolver can't be found for request ${n.responseId}`);return}this.logger.verbose(n.extensionId?`Extension with id: ${n.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(Ve(yB))}}onChannelMessage(e){this.logger.trace(this.platformAuthType+" - onChannelMessage called.");const n=e.data,r=this.resolvers.get(n.responseId),i=this.handshakeResolvers.get(n.responseId);try{const s=n.body.method;if(s===Ch.Response){if(!r)return;const o=n.body.response;if(this.logger.trace(this.platformAuthType+" - Received response from browser extension"),this.logger.tracePii(this.platformAuthType+` - Received response from browser extension: ${JSON.stringify(o)}`),o.status!=="Success")r.reject(px(o.code,o.description,o.ext));else if(o.result)o.result.code&&o.result.description?r.reject(px(o.result.code,o.result.description,o.result.ext)):r.resolve(o.result);else throw J_(Jy,"Event does not contain result.");this.resolvers.delete(n.responseId)}else if(s===Ch.HandshakeResponse){if(!i){this.logger.trace(this.platformAuthType+`.onChannelMessage - resolver can't be found for request ${n.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=n.extensionId,this.extensionVersion=n.body.version,this.logger.verbose(this.platformAuthType+` - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),i.resolve(),this.handshakeResolvers.delete(n.responseId)}}catch(s){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${s}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(s):i&&i.reject(s)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw J_(Jy,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){var e;return this.getExtensionId()===gs.PREFERRED_EXTENSION_ID?"chrome":(e=this.getExtensionId())!=null&&e.length?"unknown":void 0}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class qN{constructor(e,n,r){this.logger=e,this.performanceClient=n,this.correlationId=r,this.platformAuthType=gs.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,r){var i;if(e.trace("PlatformAuthDOMHandler: createProvider called"),(i=window.navigator)!=null&&i.platformAuthentication){const s=await window.navigator.platformAuthentication.getSupportedContracts(gs.MICROSOFT_ENTRA_BROKERID);if(s!=null&&s.includes(gs.PLATFORM_DOM_APIS))return e.trace("Platform auth api available in DOM"),new qN(e,n,r)}}getExtensionId(){return gs.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return gs.DOM_API_NAME}async sendMessage(e){this.logger.trace(this.platformAuthType+" - Sending request to browser DOM API");try{const n=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(r)}catch(n){throw this.logger.error(this.platformAuthType+" - executeGetToken DOM API error"),n}}initializePlatformDOMRequest(e){this.logger.trace(this.platformAuthType+" - initializeNativeDOMRequest called");const{accountId:n,clientId:r,authority:i,scope:s,redirectUri:o,correlationId:c,state:l,storeInCache:u,embeddedClientId:d,extraParameters:f,...h}=e,p=this.getDOMExtraParams(h);return{accountId:n,brokerId:this.getExtensionId(),authority:i,clientId:r,correlationId:c||this.correlationId,extraParameters:{...f,...p},isSecurityTokenService:!1,redirectUri:o,scope:s,state:l,storeInCache:u,embeddedClientId:d}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace(this.platformAuthType+" - platform broker returned successful and valid response"),this.convertToPlatformBrokerResponse(e);if(e.hasOwnProperty("error")){const n=e;if(n.isSuccess===!1&&n.error&&n.error.code)throw this.logger.trace(this.platformAuthType+" - platform broker returned error response"),px(n.error.code,n.error.description,{error:parseInt(n.error.errorCode),protocol_error:n.error.protocolError,status:n.error.status,properties:n.error.properties})}}throw J_(Jy,"Response missing expected properties.")}convertToPlatformBrokerResponse(e){return this.logger.trace(this.platformAuthType+" - convertToNativeResponse called"),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){return{...Object.entries(e).reduce((i,[s,o])=>(i[s]=String(o),i),{})}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function wie(t,e,n,r){t.trace("getPlatformAuthProvider called",n);const i=Sie();t.trace("Has client allowed platform auth via DOM API: "+i);let s;try{i&&(s=await qN.createProvider(t,e,n)),s||(t.trace("Platform auth via DOM API not available, checking for extension"),s=await gx.createProvider(t,r||DB,e))}catch(o){t.trace("Platform auth not available",o)}return s}function Sie(){let t;try{return t=window[jr.SessionStorage],(t==null?void 0:t.getItem(Bre))==="true"}catch{return!1}}function nm(t,e,n,r){if(e.trace("isPlatformAuthAllowed called"),!t.system.allowPlatformBroker)return e.trace("isPlatformAuthAllowed: allowPlatformBroker is not enabled, returning false"),!1;if(!n)return e.trace("isPlatformAuthAllowed: Platform auth provider is not initialized, returning false"),!1;if(r)switch(r){case yn.BEARER:case yn.POP:return e.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true"),!0;default:return e.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false"),!1}return!0}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Cie extends Vf{constructor(e,n,r,i,s,o,c,l,u,d){super(e,n,r,i,s,o,c,u,d),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=l,this.eventHandler=s}acquireToken(e,n){let r;try{if(r={popupName:this.generatePopupName(e.scopes||vg,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:this.config.system.asyncPopups},this.correlationId),this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r,n);{const s={...e,httpMethod:FB(e,this.config.auth.protocolMode)};return this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(s,r,n)}}catch(i){return Promise.reject(i)}}logout(e){try{this.logger.verbose("logoutPopup called");const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},i=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,r,i,s)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,i,s))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,r){this.logger.verbose("acquireTokenPopupAsync called");const i=await ge(this.initializeAuthorizationRequest.bind(this),W.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,bt.Popup);n.popup&&MB(i.authority);const s=nm(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);return i.platformBroker=s,this.config.auth.protocolMode===$i.EAR?this.executeEarFlow(i,n):this.executeCodeFlow(i,n,r)}async executeCodeFlow(e,n,r){var l;const i=e.correlationId,s=this.initializeServerTelemetryManager(Sn.acquireTokenPopup),o=r||await ge(F0,W.GeneratePkceCodes,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),c={...e,codeChallenge:o.challenge};try{const u=await ge(this.createAuthCodeClient.bind(this),W.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,i)({serverTelemetryManager:s,requestAuthority:c.authority,requestAzureCloudOptions:c.azureCloudOptions,requestExtraQueryParameters:c.extraQueryParameters,account:c.account});if(c.httpMethod===Rl.POST)return await this.executeCodeFlowWithPost(c,n,u,o.verifier);{const d=await ge(VN,W.GetAuthCodeUrl,this.logger,this.performanceClient,i)(this.config,u.authority,c,this.logger,this.performanceClient),f=this.initiateAuthRequest(d,n);this.eventHandler.emitEvent(Ye.POPUP_OPENED,bt.Popup,{popupWindow:f},null);const h=await this.monitorPopupForHash(f,n.popupWindowParent),p=es(fp,W.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);return await ge(mx,W.HandleResponseCode,this.logger,this.performanceClient,i)(e,p,o.verifier,Sn.acquireTokenPopup,this.config,u,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(u){throw(l=n.popup)==null||l.close(),u instanceof Cn&&(u.setCorrelationId(this.correlationId),s.cacheFailedRequest(u)),u}}async executeEarFlow(e,n){const r=e.correlationId,i=await ge(this.getDiscoveredAuthority.bind(this),W.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,r)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),s=await ge(DN,W.GenerateEarKey,this.logger,this.performanceClient,r)(),o={...e,earJwk:s},c=n.popup||this.openPopup("about:blank",n);(await GN(c.document,this.config,i,o,this.logger,this.performanceClient)).submit();const u=await ge(this.monitorPopupForHash.bind(this),W.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(c,n.popupWindowParent),d=es(fp,W.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(u,this.config.auth.OIDCOptions.serverResponseType,this.logger);return ge(WN,W.HandleResponseEar,this.logger,this.performanceClient,r)(o,d,Sn.acquireTokenPopup,this.config,i,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,r,i){const s=e.correlationId,o=await ge(this.getDiscoveredAuthority.bind(this),W.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,s)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),c=n.popup||this.openPopup("about:blank",n);(await KN(c.document,this.config,o,e,this.logger,this.performanceClient)).submit();const u=await ge(this.monitorPopupForHash.bind(this),W.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,s)(c,n.popupWindowParent),d=es(fp,W.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(u,this.config.auth.OIDCOptions.serverResponseType,this.logger);return ge(mx,W.HandleResponseCode,this.logger,this.performanceClient,s)(e,d,i,Sn.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,r,i){var o,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(Ye.LOGOUT_START,bt.Popup,e);const s=this.initializeServerTelemetryManager(Sn.logoutPopup);try{await this.clearCacheOnLogout(this.correlationId,e.account);const u=await ge(this.createAuthCodeClient.bind(this),W.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:r,account:e.account||void 0});try{u.authority.endSessionEndpoint}catch{if((o=e.account)!=null&&o.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===$i.OIDC){if(this.eventHandler.emitEvent(Ye.LOGOUT_SUCCESS,bt.Popup,e),i){const h={apiId:Sn.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=en.getAbsoluteUrl(i,ya());await this.navigationClient.navigateInternal(p,h)}(c=n.popup)==null||c.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(Ye.LOGOUT_SUCCESS,bt.Popup,e);const f=this.openPopup(d,n);if(this.eventHandler.emitEvent(Ye.POPUP_OPENED,bt.Popup,{popupWindow:f},null),await this.monitorPopupForHash(f,n.popupWindowParent).catch(()=>{}),i){const h={apiId:Sn.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=en.getAbsoluteUrl(i,ya());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${p}`),await this.navigationClient.navigateInternal(p,h)}else this.logger.verbose("No main window navigation requested")}catch(u){throw(l=n.popup)==null||l.close(),u instanceof Cn&&(u.setCorrelationId(this.correlationId),s.cacheFailedRequest(u)),this.eventHandler.emitEvent(Ye.LOGOUT_FAILURE,bt.Popup,null,u),this.eventHandler.emitEvent(Ye.LOGOUT_END,bt.Popup),u}this.eventHandler.emitEvent(Ye.LOGOUT_END,bt.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,n);throw this.logger.error("Navigate url is empty"),Ve(M0)}monitorPopupForHash(e,n){return new Promise((r,i)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(s),i(Ve(Zp));return}let o="";try{o=e.location.href}catch{}if(!o||o==="about:blank")return;clearInterval(s);let c="";const l=this.config.auth.OIDCOptions.serverResponseType;e&&(l===A0.QUERY?c=e.location.search:c=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(c)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,n)})}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,n)),!r)throw Ve(nB);return r.focus&&r.focus(),this.currentWindow=r,n.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),Ve(tB)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:i}){var p,g,m,y;const s=i.screenLeft?i.screenLeft:i.screenX,o=i.screenTop?i.screenTop:i.screenY,c=i.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=i.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let u=(p=r.popupSize)==null?void 0:p.width,d=(g=r.popupSize)==null?void 0:g.height,f=(m=r.popupPosition)==null?void 0:m.top,h=(y=r.popupPosition)==null?void 0:y.left;return(!u||u<0||u>c)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),u=Ni.POPUP_WIDTH),(!d||d<0||d>l)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),d=Ni.POPUP_HEIGHT),(!f||f<0||f>l)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),f=Math.max(0,l/2-Ni.POPUP_HEIGHT/2+o)),(!h||h<0||h>c)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),h=Math.max(0,c/2-Ni.POPUP_WIDTH/2+s)),i.open(e,n,`width=${u}, height=${d}, top=${f}, left=${h}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,n){e.close(),n.removeEventListener("beforeunload",this.unloadWindow)}generatePopupName(e,n){return`${Ni.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${Ni.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function _ie(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class Aie extends Vf{constructor(e,n,r,i,s,o,c,l,u,d){super(e,n,r,i,s,o,c,u,d),this.nativeStorage=l}async acquireToken(e){const n=await ge(this.initializeAuthorizationRequest.bind(this),W.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,bt.Redirect);n.platformBroker=nm(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);const r=s=>{s.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.resetRequestCache(),this.eventHandler.emitEvent(Ye.RESTORE_FROM_BFCACHE,bt.Redirect))},i=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii(`Redirect start page: ${i}`),this.browserStorage.setTemporaryCache(hr.ORIGIN_URI,i,!0),window.addEventListener("pageshow",r);try{this.config.auth.protocolMode===$i.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n,e.onRedirectNavigate)}catch(s){throw s instanceof Cn&&s.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),s}}async executeCodeFlow(e,n){const r=e.correlationId,i=this.initializeServerTelemetryManager(Sn.acquireTokenRedirect),s=await ge(F0,W.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),o={...e,codeChallenge:s.challenge};this.browserStorage.cacheAuthorizeRequest(o,s.verifier);try{if(o.httpMethod===Rl.POST)return await this.executeCodeFlowWithPost(o);{const c=await ge(this.createAuthCodeClient.bind(this),W.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),l=await ge(VN,W.GetAuthCodeUrl,this.logger,this.performanceClient,e.correlationId)(this.config,c.authority,o,this.logger,this.performanceClient);return await this.initiateAuthRequest(l,n)}}catch(c){throw c instanceof Cn&&(c.setCorrelationId(this.correlationId),i.cacheFailedRequest(c)),c}}async executeEarFlow(e){const n=e.correlationId,r=await ge(this.getDiscoveredAuthority.bind(this),W.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),i=await ge(DN,W.GenerateEarKey,this.logger,this.performanceClient,n)(),s={...e,earJwk:i};return this.browserStorage.cacheAuthorizeRequest(s),(await GN(document,this.config,r,s,this.logger,this.performanceClient)).submit(),new Promise((c,l)=>{setTimeout(()=>{l(Ve(dx,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,r=await ge(this.getDiscoveredAuthority.bind(this),W.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return this.browserStorage.cacheAuthorizeRequest(e),(await KN(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise((s,o)=>{setTimeout(()=>{o(Ve(dx,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e="",n,r,i){const s=this.initializeServerTelemetryManager(Sn.handleRedirectPromise);try{const[o,c]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.resetRequestCache(),_ie()!=="back_forward"?i.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const l=this.browserStorage.getTemporaryCache(hr.ORIGIN_URI,!0)||ve.EMPTY_STRING,u=en.removeHashFromUrl(l),d=en.removeHashFromUrl(window.location.href);if(u===d&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),l.indexOf("#")>-1&&Ere(l),await this.handleResponse(o,n,r,s);if(this.config.auth.navigateToLoginRequestUrl){if(!LN()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(hr.URL_HASH,c,!0);const f={apiId:Sn.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let h=!0;if(!l||l==="null"){const p=Tre();this.browserStorage.setTemporaryCache(hr.ORIGIN_URI,p,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),h=await this.navigationClient.navigateInternal(p,f)}else this.logger.verbose(`Navigating to loginRequestUrl: ${l}`),h=await this.navigationClient.navigateInternal(l,f);if(!h)return await this.handleResponse(o,n,r,s)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,n,r,s);return null}catch(o){throw o instanceof Cn&&(o.setCorrelationId(this.correlationId),s.cacheFailedRequest(o)),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let n=e;n||(this.config.auth.OIDCOptions.serverResponseType===A0.QUERY?n=window.location.search:n=window.location.hash);let r=ex(n);if(r){try{aie(r,this.browserCrypto,bt.Redirect)}catch(s){return s instanceof Cn&&this.logger.error(`Interaction type validation failed due to ${s.errorCode}: ${s.errorMessage}`),[null,""]}return OB(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,n]}const i=this.browserStorage.getTemporaryCache(hr.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(hr.URL_HASH)),i&&(r=ex(i),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,i]):[null,""]}async handleResponse(e,n,r,i){if(!e.state)throw Ve(NN);if(e.ear_jwe){const c=await ge(this.getDiscoveredAuthority.bind(this),W.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n.correlationId)({requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account});return ge(WN,W.HandleResponseEar,this.logger,this.performanceClient,n.correlationId)(n,e,Sn.acquireTokenRedirect,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const o=await ge(this.createAuthCodeClient.bind(this),W.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:n.authority});return ge(mx,W.HandleResponseCode,this.logger,this.performanceClient,n.correlationId)(n,e,r,Sn.acquireTokenRedirect,this.config,o,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e,n){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:Sn.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},i=n||this.config.auth.onRedirectNavigate;if(typeof i=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),i(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await this.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await this.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Ve(M0)}async logout(e){var i;this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(Sn.logout);try{this.eventHandler.emitEvent(Ye.LOGOUT_START,bt.Redirect,e),await this.clearCacheOnLogout(this.correlationId,n.account);const s={apiId:Sn.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=await ge(this.createAuthCodeClient.bind(this),W.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(o.authority.protocolMode===$i.OIDC)try{o.authority.endSessionEndpoint}catch{if((i=n.account)!=null&&i.homeAccountId){this.eventHandler.emitEvent(Ye.LOGOUT_SUCCESS,bt.Redirect,n);return}}const c=o.getLogoutUri(n);if(this.eventHandler.emitEvent(Ye.LOGOUT_SUCCESS,bt.Redirect,n),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,cc.SIGNOUT),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,cc.SIGNOUT),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof Cn&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(Ye.LOGOUT_FAILURE,bt.Redirect,null,s),this.eventHandler.emitEvent(Ye.LOGOUT_END,bt.Redirect),s}this.eventHandler.emitEvent(Ye.LOGOUT_END,bt.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return en.getAbsoluteUrl(n,ya())}}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function jie(t,e,n,r,i){if(e.addQueueMeasurement(W.SilentHandlerInitiateAuthRequest,r),!t)throw n.info("Navigate url is empty"),Ve(M0);return i?ge(Tie,W.SilentHandlerLoadFrame,n,e,r)(t,i,e,r):es(Pie,W.SilentHandlerLoadFrameSync,n,e,r)(t)}async function Eie(t,e,n,r,i){const s=U0();if(!s.contentDocument)throw"No document associated with iframe!";return(await KN(s.contentDocument,t,e,n,r,i)).submit(),s}async function Nie(t,e,n,r,i){const s=U0();if(!s.contentDocument)throw"No document associated with iframe!";return(await GN(s.contentDocument,t,e,n,r,i)).submit(),s}async function qI(t,e,n,r,i,s,o){return r.addQueueMeasurement(W.SilentHandlerMonitorIframeForHash,s),new Promise((c,l)=>{e{window.clearInterval(d),l(Ve(rB))},e),d=window.setInterval(()=>{let f="";const h=t.contentWindow;try{f=h?h.location.href:""}catch{}if(!f||f==="about:blank")return;let p="";h&&(o===A0.QUERY?p=h.location.search:p=h.location.hash),window.clearTimeout(u),window.clearInterval(d),c(p)},n)}).finally(()=>{es(kie,W.RemoveHiddenIframe,i,r,s)(t)})}function Tie(t,e,n,r){return n.addQueueMeasurement(W.SilentHandlerLoadFrame,r),new Promise((i,s)=>{const o=U0();window.setTimeout(()=>{if(!o){s("Unable to load iframe");return}o.src=t,i(o)},e)})}function Pie(t){const e=U0();return e.src=t,e}function U0(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(t),t}function kie(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Oie extends Vf{constructor(e,n,r,i,s,o,c,l,u,d,f){super(e,n,r,i,s,o,l,d,f),this.apiId=c,this.nativeStorage=u}async acquireToken(e){this.performanceClient.addQueueMeasurement(W.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const n={...e};n.prompt?n.prompt!==pi.NONE&&n.prompt!==pi.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${n.prompt} with ${pi.NONE}`),n.prompt=pi.NONE):n.prompt=pi.NONE;const r=await ge(this.initializeAuthorizationRequest.bind(this),W.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,bt.Silent);return r.platformBroker=nm(this.config,this.logger,this.platformAuthProvider,r.authenticationScheme),MB(r.authority),this.config.auth.protocolMode===$i.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let n;const r=this.initializeServerTelemetryManager(this.apiId);try{return n=await ge(this.createAuthCodeClient.bind(this),W.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await ge(this.silentTokenHelper.bind(this),W.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(i){if(i instanceof Cn&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),!n||!(i instanceof Cn)||i.errorCode!==Ni.INVALID_GRANT_ERROR)throw i;return this.performanceClient.addFields({retryError:i.errorCode},this.correlationId),await ge(this.silentTokenHelper.bind(this),W.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const n=e.correlationId,r=await ge(this.getDiscoveredAuthority.bind(this),W.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),i=await ge(DN,W.GenerateEarKey,this.logger,this.performanceClient,n)(),s={...e,earJwk:i},o=await ge(Nie,W.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,n)(this.config,r,s,this.logger,this.performanceClient),c=this.config.auth.OIDCOptions.serverResponseType,l=await ge(qI,W.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,n)(o,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,n,c),u=es(fp,W.DeserializeResponse,this.logger,this.performanceClient,n)(l,c,this.logger);return ge(WN,W.HandleResponseEar,this.logger,this.performanceClient,n)(s,u,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}logout(){return Promise.reject(Ve(D0))}async silentTokenHelper(e,n){const r=n.correlationId;this.performanceClient.addQueueMeasurement(W.SilentIframeClientTokenHelper,r);const i=await ge(F0,W.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...n,codeChallenge:i.challenge};let o;if(n.httpMethod===Rl.POST)o=await ge(Eie,W.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);else{const d=await ge(VN,W.GetAuthCodeUrl,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);o=await ge(jie,W.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(d,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait)}const c=this.config.auth.OIDCOptions.serverResponseType,l=await ge(qI,W.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(o,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),u=es(fp,W.DeserializeResponse,this.logger,this.performanceClient,r)(l,c,this.logger);return ge(mx,W.HandleResponseCode,this.logger,this.performanceClient,r)(n,u,i.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Iie extends Vf{async acquireToken(e){this.performanceClient.addQueueMeasurement(W.SilentRefreshClientAcquireToken,e.correlationId);const n=await ge(HN,W.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...n};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const i=this.initializeServerTelemetryManager(Sn.acquireTokenSilent_silentFlow),s=await this.createRefreshTokenClient({serverTelemetryManager:i,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return ge(s.acquireTokenByRefreshToken.bind(s),W.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(o=>{throw o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o),o})}logout(){return Promise.reject(Ve(D0))}async createRefreshTokenClient(e){const n=await ge(this.getClientConfiguration.bind(this),W.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Wne(n,this.performanceClient)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Rie{constructor(e,n,r,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=n,this.logger=r,this.cryptoObj=i}async loadExternalTokens(e,n,r){if(!this.isBrowserEnvironment)throw Ve($0);const i=e.correlationId||uo(),s=n.id_token?Bf(n.id_token,Zs):void 0,o={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new Jr(Jr.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,o,this.logger,e.correlationId||uo()):void 0,l=await this.loadAccount(e,r.clientInfo||n.client_info||"",i,s,c),u=await this.loadIdToken(n,l.homeAccountId,l.environment,l.realm,i),d=await this.loadAccessToken(e,n,l.homeAccountId,l.environment,l.realm,r,i),f=await this.loadRefreshToken(n,l.homeAccountId,l.environment,i);return this.generateAuthenticationResult(e,{account:l,idToken:u,accessToken:d,refreshToken:f},s,c)}async loadAccount(e,n,r,i,s){if(this.logger.verbose("TokenCache - loading account"),e.account){const u=co.createFromAccountInfo(e.account);return await this.storage.setAccount(u,r),u}else if(!s||!n&&!i)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),Ve(fB);const o=co.generateHomeAccountId(n,s.authorityType,this.logger,this.cryptoObj,i),c=i==null?void 0:i.tid,l=SN(this.storage,s,o,Zs,r,i,n,s.hostnameAndPort,c,void 0,void 0,this.logger);return await this.storage.setAccount(l,r),l}async loadIdToken(e,n,r,i,s){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const o=P0(n,r,e.id_token,this.config.auth.clientId,i);return await this.storage.setIdTokenCredential(o,s),o}async loadAccessToken(e,n,r,i,s,o,c){if(n.access_token)if(n.expires_in){if(!n.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const l=n.scope?Ar.fromString(n.scope):new Ar(e.scopes),u=o.expiresOn||n.expires_in+Li(),d=o.extendedExpiresOn||(n.ext_expires_in||n.expires_in)+Li(),f=k0(r,i,n.access_token,this.config.auth.clientId,s,l.printScopes(),u,d,Zs);return await this.storage.setAccessTokenCredential(f,c),f}async loadRefreshToken(e,n,r,i){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const s=$U(n,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return await this.storage.setRefreshTokenCredential(s,i),s}generateAuthenticationResult(e,n,r,i){var d,f,h;let s="",o=[],c=null,l;n!=null&&n.accessToken&&(s=n.accessToken.secret,o=Ar.fromString(n.accessToken.target).asArray(),c=Cd(n.accessToken.expiresOn),l=Cd(n.accessToken.extendedExpiresOn));const u=n.account;return{authority:i?i.canonicalAuthority:"",uniqueId:n.account.localAccountId,tenantId:n.account.realm,scopes:o,account:u.getAccountInfo(),idToken:((d=n.idToken)==null?void 0:d.secret)||"",idTokenClaims:r||{},accessToken:s,fromCache:!0,expiresOn:c,correlationId:e.correlationId||"",requestId:"",extExpiresOn:l,familyId:((f=n.refreshToken)==null?void 0:f.familyId)||"",tokenType:((h=n==null?void 0:n.accessToken)==null?void 0:h.tokenType)||"",state:e.state||"",cloudGraphHostName:u.cloudGraphHostName||"",msGraphHost:u.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Mie extends VU{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v4.19.0 2025-08-05 */class Die extends Vf{constructor(e,n,r,i,s,o,c,l,u,d){super(e,n,r,i,s,o,l,u,d),this.apiId=c}async acquireToken(e){if(!e.code)throw Ve(hB);const n=await ge(this.initializeAuthorizationRequest.bind(this),W.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,bt.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const i={...n,code:e.code},s=await ge(this.getClientConfiguration.bind(this),W.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),o=new Mie(s);this.logger.verbose("Auth code client created");const c=new UB(o,this.browserStorage,i,this.logger,this.performanceClient);return await ge(c.handleCodeResponseFromServer.bind(c),W.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,!1)}catch(i){throw i instanceof Cn&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),i}}logout(){return Promise.reject(Ve(D0))}}/*! @azure/msal-browser v4.19.0 2025-08-05 */function $ie(t,e,n){var o;const r=((o=window.msal)==null?void 0:o.clientIds)||[],i=r.length,s=r.filter(c=>c===t).length;s>1&&n.warning("There is already an instance of MSAL.js in the window with the same client id."),e.add({msalInstanceCount:i,sameClientIdInstanceCount:s})}/*! @azure/msal-browser v4.19.0 2025-08-05 */function bo(t){const e=t==null?void 0:t.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function vv(t,e){try{FN(t)}catch(n){throw e.end({success:!1},n),n}}class B0{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Da(this.logger,this.performanceClient):Zy,this.eventHandler=new iie(this.logger),this.browserStorage=this.isBrowserEnvironment?new h1(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,Lne(this.config.auth)):Yre(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:jr.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:jr.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new h1(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.tokenCache=new Rie(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,n){const r=new B0(e);return await r.initialize(n),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e,n){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(Ye.INITIALIZE_END);return}const r=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),i=this.config.system.allowPlatformBroker,s=this.performanceClient.startMeasurement(W.InitializeClientApplication,r);if(this.eventHandler.emitEvent(Ye.INITIALIZE_START),!n)try{this.logMultipleInstances(s)}catch{}if(await ge(this.browserStorage.initialize.bind(this.browserStorage),W.InitializeCache,this.logger,this.performanceClient,r)(r),i)try{this.platformAuthProvider=await wie(this.logger,this.performanceClient,r,this.config.system.nativeBrokerHandshakeTimeout)}catch(o){this.logger.verbose(o)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),es(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),W.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,r)(r)),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(r),this.initialized=!0,this.eventHandler.emitEvent(Ye.INITIALIZE_END),s.end({allowPlatformBroker:i,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),RB(this.initialized),this.isBrowserEnvironment){const n=e||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){var l;if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;if(((l=this.browserStorage.getInteractionInProgress())==null?void 0:l.type)===cc.SIGNOUT)return this.logger.verbose("handleRedirectPromise removing interaction_in_progress flag and returning null after sign-out"),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const r=this.getAllAccounts(),i=this.browserStorage.getCachedNativeRequest(),s=i&&this.platformAuthProvider&&!e;let o;this.eventHandler.emitEvent(Ye.HANDLE_REDIRECT_START,bt.Redirect);let c;try{if(s&&this.platformAuthProvider){o=this.performanceClient.startMeasurement(W.AcquireTokenRedirect,(i==null?void 0:i.correlationId)||""),this.logger.trace("handleRedirectPromise - acquiring token from native platform");const u=new iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,i.accountId,this.nativeInternalStorage,i.correlationId);c=ge(u.handleRedirectPromise.bind(u),W.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,o.event.correlationId)(this.performanceClient,o.event.correlationId)}else{const[u,d]=this.browserStorage.getCachedRequest(),f=u.correlationId;o=this.performanceClient.startMeasurement(W.AcquireTokenRedirect,f),this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(f);c=ge(h.handleRedirectPromise.bind(h),W.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,o.event.correlationId)(e,u,d,o)}}catch(u){throw this.browserStorage.resetRequestCache(),u}return c.then(u=>(u?(this.browserStorage.resetRequestCache(),r.length{this.browserStorage.resetRequestCache();const d=u;throw r.length>0?this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_FAILURE,bt.Redirect,null,d):this.eventHandler.emitEvent(Ye.LOGIN_FAILURE,bt.Redirect,null,d),this.eventHandler.emitEvent(Ye.HANDLE_REDIRECT_END,bt.Redirect),o.end({success:!1},d),u})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",n);const r=this.performanceClient.startMeasurement(W.AcquireTokenPreRedirect,n);r.add({accountType:bo(e.account),scenarioId:e.scenarioId});const i=e.onRedirectNavigate;if(i)e.onRedirectNavigate=o=>{const c=typeof i=="function"?i(o):void 0;return c!==!1?r.end({success:!0}):r.discard(),c};else{const o=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=c=>{const l=typeof o=="function"?o(c):void 0;return l!==!1?r.end({success:!0}):r.discard(),l}}const s=this.getAllAccounts().length>0;try{LI(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,cc.SIGNIN),s?this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_START,bt.Redirect,e):this.eventHandler.emitEvent(Ye.LOGIN_START,bt.Redirect,e);let o;return this.platformAuthProvider&&this.canUsePlatformBroker(e)?o=new iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,r).catch(l=>{if(l instanceof Po&&qu(l))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(l instanceof lo)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(n).acquireToken(e);throw l}):o=this.createRedirectClient(n).acquireToken(e),await o}catch(o){throw this.browserStorage.resetRequestCache(),r.end({success:!1},o),s?this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_FAILURE,bt.Redirect,null,o):this.eventHandler.emitEvent(Ye.LOGIN_FAILURE,bt.Redirect,null,o),o}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(W.AcquireTokenPopup,n);r.add({scenarioId:e.scenarioId,accountType:bo(e.account)});try{this.logger.verbose("acquireTokenPopup called",n),vv(this.initialized,r),this.browserStorage.setInteractionInProgress(!0,cc.SIGNIN)}catch(c){return Promise.reject(c)}const i=this.getAllAccounts();i.length>0?this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_START,bt.Popup,e):this.eventHandler.emitEvent(Ye.LOGIN_START,bt.Popup,e);let s;const o=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?s=this.acquireTokenNative({...e,correlationId:n},Sn.acquireTokenPopup).then(c=>(r.end({success:!0,isNativeBroker:!0,accountType:bo(c.account)}),c)).catch(c=>{if(c instanceof Po&&qu(c))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,o);if(c instanceof lo)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(n).acquireToken(e,o);throw c}):s=this.createPopupClient(n).acquireToken(e,o),s.then(c=>(i.length(i.length>0?this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_FAILURE,bt.Popup,null,c):this.eventHandler.emitEvent(Ye.LOGIN_FAILURE,bt.Popup,null,c),r.end({success:!1},c),Promise.reject(c))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(n)})}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var s,o;const n=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(W.SsoSilent,n),(s=this.ssoSilentMeasurement)==null||s.add({scenarioId:e.scenarioId,accountType:bo(e.account)}),vv(this.initialized,this.ssoSilentMeasurement),(o=this.ssoSilentMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(Ye.SSO_SILENT_START,bt.Silent,r);let i;return this.canUsePlatformBroker(r)?i=this.acquireTokenNative(r,Sn.ssoSilent).catch(c=>{if(c instanceof Po&&qu(c))return this.platformAuthProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw c}):i=this.createSilentIframeClient(r.correlationId).acquireToken(r),i.then(c=>{var l;return this.eventHandler.emitEvent(Ye.SSO_SILENT_SUCCESS,bt.Silent,c),(l=this.ssoSilentMeasurement)==null||l.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:bo(c.account)}),c}).catch(c=>{var l;throw this.eventHandler.emitEvent(Ye.SSO_SILENT_FAILURE,bt.Silent,null,c),(l=this.ssoSilentMeasurement)==null||l.end({success:!1},c),c}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",n);const r=this.performanceClient.startMeasurement(W.AcquireTokenByCode,n);vv(this.initialized,r),this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_BY_CODE_START,bt.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw Ve(mB);if(e.code){const i=e.code;let s=this.hybridAuthCodeResponses.get(i);return s?(this.logger.verbose("Existing acquireTokenByCode request found",n),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",n),s=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(o=>(this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_BY_CODE_SUCCESS,bt.Silent,o),this.hybridAuthCodeResponses.delete(i),r.end({success:!0,isNativeBroker:o.fromNativeBroker,accessTokenSize:o.accessToken.length,idTokenSize:o.idToken.length,accountType:bo(o.account)}),o)).catch(o=>{throw this.hybridAuthCodeResponses.delete(i),this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_BY_CODE_FAILURE,bt.Silent,null,o),r.end({success:!1},o),o}),this.hybridAuthCodeResponses.set(i,s)),await s}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){const i=await this.acquireTokenNative({...e,correlationId:n},Sn.acquireTokenByCode,e.nativeAccountId).catch(s=>{throw s instanceof Po&&qu(s)&&(this.platformAuthProvider=void 0),s});return r.end({accountType:bo(i.account),success:!0}),i}else throw Ve(gB);else throw Ve(pB)}catch(i){throw this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_BY_CODE_FAILURE,bt.Silent,null,i),r.end({success:!1},i),i}}async acquireTokenByCodeAsync(e){var i;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(W.AcquireTokenByCodeAsync,e.correlationId),(i=this.acquireTokenByCodeAsyncMeasurement)==null||i.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(s=>{var o;return(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.end({success:!0,fromCache:s.fromCache,isNativeBroker:s.fromNativeBroker}),s}).catch(s=>{var o;throw(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.end({success:!1},s),s}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,n){switch(this.performanceClient.addQueueMeasurement(W.AcquireTokenFromCache,e.correlationId),n){case ci.Default:case ci.AccessToken:case ci.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return ge(r.acquireToken.bind(r),W.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw _e(Rc)}}async acquireTokenByRefreshToken(e,n){switch(this.performanceClient.addQueueMeasurement(W.AcquireTokenByRefreshToken,e.correlationId),n){case ci.Default:case ci.AccessTokenAndRefreshToken:case ci.RefreshToken:case ci.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return ge(r.acquireToken.bind(r),W.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw _e(Rc)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(W.AcquireTokenBySilentIframe,e.correlationId);const n=this.createSilentIframeClient(e.correlationId);return ge(n.acquireToken.bind(n),W.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const n=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",n),this.logoutRedirect({correlationId:n,...e})}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return LI(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,cc.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return FN(this.initialized),this.browserStorage.setInteractionInProgress(!0,cc.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){const n=this.getRequestCorrelationId();return Qre(this.logger,this.browserStorage,this.isBrowserEnvironment,n,e)}getAccount(e){const n=this.getRequestCorrelationId();return Xre(e,this.logger,this.browserStorage,n)}getAccountByUsername(e){const n=this.getRequestCorrelationId();return Jre(e,this.logger,this.browserStorage,n)}getAccountByHomeId(e){const n=this.getRequestCorrelationId();return Zre(e,this.logger,this.browserStorage,n)}getAccountByLocalId(e){const n=this.getRequestCorrelationId();return eie(e,this.logger,this.browserStorage,n)}setActiveAccount(e){const n=this.getRequestCorrelationId();tie(e,this.browserStorage,n)}getActiveAccount(){const e=this.getRequestCorrelationId();return nie(this.browserStorage,e)}async hydrateCache(e,n){this.logger.verbose("hydrateCache called");const r=co.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r,i){if(this.logger.trace("acquireTokenNative called"),!this.platformAuthProvider)throw Ve(kN);return new iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e,i)}canUsePlatformBroker(e,n){if(this.logger.trace("canUsePlatformBroker called"),!this.platformAuthProvider)return this.logger.trace("canUsePlatformBroker: platform broker unavilable, returning false"),!1;if(!nm(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isBrokerAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case pi.NONE:case pi.CONSENT:case pi.LOGIN:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");break;default:return this.logger.trace(`canUsePlatformBroker: prompt = ${e.prompt} is not compatible with platform broker flow, returning false`),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new Cie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createRedirectClient(e){return new Aie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentIframeClient(e){return new Oie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentCacheClient(e){return new HB(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentRefreshClient(e){return new Iie(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentAuthCodeClient(e){return new Die(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Sn.acquireTokenByCode,this.performanceClient,this.platformAuthProvider,e)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return IB(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){if(this.config.cache.cacheLocation!==jr.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.subscribeCrossTab()}disableAccountStorageEvents(){if(this.config.cache.cacheLocation!==jr.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.unsubscribeCrossTab()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?uo():ve.EMPTY_STRING}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",n),this.acquireTokenRedirect({correlationId:n,...e||II})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup({correlationId:n,...e||II})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(W.AcquireTokenSilent,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),vv(this.initialized,r),this.logger.verbose("acquireTokenSilent called",n);const i=e.account||this.getActiveAccount();if(!i)throw Ve(aB);return r.add({accountType:bo(i)}),this.acquireTokenSilentDeduped(e,i,n).then(s=>(r.end({success:!0,fromCache:s.fromCache,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),{...s,state:e.state,correlationId:n})).catch(s=>{throw s instanceof Cn&&s.setCorrelationId(n),r.end({success:!1},s),s})}async acquireTokenSilentDeduped(e,n,r){const i=O0(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority,correlationId:r},n.homeAccountId),s=JSON.stringify(i),o=this.activeSilentTokenRequests.get(s);if(typeof o>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const c=ge(this.acquireTokenSilentAsync.bind(this),W.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},n);return this.activeSilentTokenRequests.set(s,c),c.finally(()=>{this.activeSilentTokenRequests.delete(s)})}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),o}async acquireTokenSilentAsync(e,n){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(W.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_START,bt.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const i=await ge(sie,W.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||ci.Default;return this.acquireTokenSilentNoIframe(i,s).catch(async c=>{if(Lie(c,s))if(this.activeIframeRequest)if(s!==ci.Skip){const[u,d]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${d}`,i.correlationId);const f=this.performanceClient.startMeasurement(W.AwaitConcurrentIframe,i.correlationId);f.add({awaitIframeCorrelationId:d});const h=await u;if(f.end({success:h}),h)return this.logger.verbose(`Parallel iframe request with correlationId: ${d} succeeded. Retrying cache and/or RT redemption`,i.correlationId),this.acquireTokenSilentNoIframe(i,s);throw this.logger.info(`Iframe request with correlationId: ${d} failed. Interaction is required.`),c}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",i.correlationId),ge(this.acquireTokenBySilentIframe.bind(this),W.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i);else{let u;return this.activeIframeRequest=[new Promise(d=>{u=d}),i.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",i.correlationId),ge(this.acquireTokenBySilentIframe.bind(this),W.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i).then(d=>(u(!0),d)).catch(d=>{throw u(!1),d}).finally(()=>{this.activeIframeRequest=void 0})}else throw c}).then(c=>(this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_SUCCESS,bt.Silent,c),e.correlationId&&this.performanceClient.addFields({fromCache:c.fromCache,isNativeBroker:c.fromNativeBroker},e.correlationId),c)).catch(c=>{throw this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_FAILURE,bt.Silent,null,c),c}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,n){return nm(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,Sn.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async r=>{throw r instanceof Po&&qu(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.platformAuthProvider=void 0,_e(Rc)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),n===ci.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache"),ge(this.acquireTokenFromCache.bind(this),W.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===ci.AccessToken)throw r;return this.eventHandler.emitEvent(Ye.ACQUIRE_TOKEN_NETWORK_START,bt.Silent,e),ge(this.acquireTokenByRefreshToken.bind(this),W.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes"),this.pkceCode=await ge(F0,W.GeneratePkceCodes,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes");const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`${n?"Found":"Did not find"} pre-generated PKCE codes`),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e){const n=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("There is already an instance of MSAL.js in the window."),window.msal.clientIds.push(n),$ie(n,e,this.logger)}}function Lie(t,e){const n=!(t instanceof lo&&t.subError!==R0),r=t.errorCode===Ni.INVALID_GRANT_ERROR||t.errorCode===Rc,i=n&&r||t.errorCode===cx||t.errorCode===bN,s=hre.includes(e);return i&&s}/*! @azure/msal-browser v4.19.0 2025-08-05 */async function Fie(t,e){const n=new gu(t);return await n.initialize(),B0.createController(n,e)}/*! @azure/msal-browser v4.19.0 2025-08-05 */class YN{static async createPublicClientApplication(e){const n=await Fie(e);return new YN(e,n)}constructor(e,n){this.isBroker=!1,this.controller=n||new B0(new gu(e))}async initialize(e){return this.controller.initialize(e,this.isBroker)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}/*! @azure/msal-browser v4.19.0 2025-08-05 */const Uie={initialize:()=>Promise.reject(dr(ur)),acquireTokenPopup:()=>Promise.reject(dr(ur)),acquireTokenRedirect:()=>Promise.reject(dr(ur)),acquireTokenSilent:()=>Promise.reject(dr(ur)),acquireTokenByCode:()=>Promise.reject(dr(ur)),getAllAccounts:()=>[],getAccount:()=>null,getAccountByHomeId:()=>null,getAccountByUsername:()=>null,getAccountByLocalId:()=>null,handleRedirectPromise:()=>Promise.reject(dr(ur)),loginPopup:()=>Promise.reject(dr(ur)),loginRedirect:()=>Promise.reject(dr(ur)),logout:()=>Promise.reject(dr(ur)),logoutRedirect:()=>Promise.reject(dr(ur)),logoutPopup:()=>Promise.reject(dr(ur)),ssoSilent:()=>Promise.reject(dr(ur)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,enableAccountStorageEvents:()=>{},disableAccountStorageEvents:()=>{},getTokenCache:()=>{throw dr(ur)},getLogger:()=>{throw dr(ur)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw dr(ur)},hydrateCache:()=>Promise.reject(dr(ur)),clearCache:()=>Promise.reject(dr(ur))};/*! @azure/msal-browser v4.19.0 2025-08-05 */class Bie{static getInteractionStatusFromEvent(e,n){switch(e.eventType){case Ye.LOGIN_START:return br.Login;case Ye.SSO_SILENT_START:return br.SsoSilent;case Ye.ACQUIRE_TOKEN_START:if(e.interactionType===bt.Redirect||e.interactionType===bt.Popup)return br.AcquireToken;break;case Ye.HANDLE_REDIRECT_START:return br.HandleRedirect;case Ye.LOGOUT_START:return br.Logout;case Ye.SSO_SILENT_SUCCESS:case Ye.SSO_SILENT_FAILURE:if(n&&n!==br.SsoSilent)break;return br.None;case Ye.LOGOUT_END:if(n&&n!==br.Logout)break;return br.None;case Ye.HANDLE_REDIRECT_END:if(n&&n!==br.HandleRedirect)break;return br.None;case Ye.LOGIN_SUCCESS:case Ye.LOGIN_FAILURE:case Ye.ACQUIRE_TOKEN_SUCCESS:case Ye.ACQUIRE_TOKEN_FAILURE:case Ye.RESTORE_FROM_BFCACHE:if(e.interactionType===bt.Redirect||e.interactionType===bt.Popup){if(n&&n!==br.Login&&n!==br.AcquireToken)break;return br.None}break}return null}}const Hie="modulepreload",zie=function(t){return"/semblance/"+t},YI={},Vie=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=zie(l),l in YI)return;YI[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Hie,u||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};/*! @azure/msal-react v3.0.17 2025-08-05 */const Gie={instance:Uie,inProgress:br.None,accounts:[],logger:new Ma({})},QN=v.createContext(Gie);QN.Consumer;/*! @azure/msal-react v3.0.17 2025-08-05 */function QI(t,e){if(t.length!==e.length)return!1;const n=[...e];return t.every(r=>{const i=n.shift();return!r||!i?!1:r.homeAccountId===i.homeAccountId&&r.localAccountId===i.localAccountId&&r.username===i.username})}/*! @azure/msal-react v3.0.17 2025-08-05 */const Kie="@azure/msal-react",XI="3.0.17";/*! @azure/msal-react v3.0.17 2025-08-05 */const vx={UNBLOCK_INPROGRESS:"UNBLOCK_INPROGRESS",EVENT:"EVENT"},Wie=(t,e)=>{const{type:n,payload:r}=e;let i=t.inProgress;switch(n){case vx.UNBLOCK_INPROGRESS:t.inProgress===br.Startup&&(i=br.None,r.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case vx.EVENT:const o=r.message,c=Bie.getInteractionStatusFromEvent(o,t.inProgress);c&&(r.logger.info(`MsalProvider - ${o.eventType} results in setting inProgress from ${t.inProgress} to ${c}`),i=c);break;default:throw new Error(`Unknown action type: ${n}`)}if(i===br.Startup)return t;const s=r.instance.getAllAccounts();return i!==t.inProgress&&!QI(s,t.accounts)?{...t,inProgress:i,accounts:s}:i!==t.inProgress?{...t,inProgress:i}:QI(s,t.accounts)?t:{...t,accounts:s}};function qie({instance:t,children:e}){v.useEffect(()=>{t.initializeWrapperLibrary(ure.React,XI)},[t]);const n=v.useMemo(()=>t.getLogger().clone(Kie,XI),[t]),[r,i]=v.useReducer(Wie,void 0,()=>({inProgress:br.Startup,accounts:[]}));v.useEffect(()=>{const o=t.addEventCallback(c=>{i({payload:{instance:t,logger:n,message:c},type:vx.EVENT})});return n.verbose(`MsalProvider - Registered event callback with id: ${o}`),t.initialize().then(()=>{t.handleRedirectPromise().catch(()=>{}).finally(()=>{i({payload:{instance:t,logger:n},type:vx.UNBLOCK_INPROGRESS})})}).catch(()=>{}),()=>{o&&(n.verbose(`MsalProvider - Removing event callback ${o}`),t.removeEventCallback(o))}},[t,n]);const s={instance:t,inProgress:r.inProgress,accounts:r.accounts,logger:n};return T.createElement(QN.Provider,{value:s},e)}/*! @azure/msal-react v3.0.17 2025-08-05 */const Yie=()=>v.useContext(QN),Qie={auth:{clientId:"7e9b250a-d984-4fba-8e1c-a0622242a595",authority:"https://login.microsoftonline.com/e519c2e6-bc6d-4fdf-8d9c-923c2f002385",redirectUri:"https://ai-sandbox.oliver.solutions/semblance",postLogoutRedirectUri:"https://ai-sandbox.oliver.solutions/semblance"},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(t,e,n)=>{n||console.log(e)},logLevel:Rn.Verbose,piiLoggingEnabled:!1},allowNativeBroker:!1}},Xie={scopes:["openid","profile","email"],prompt:"select_account",extraQueryParameters:{code_challenge_method:"S256"}},GB=v.createContext(void 0);function Jie({children:t}){const[e,n]=v.useState(null),[r,i]=v.useState(null),[s,o]=v.useState(!0),[c,l]=v.useState(!1),u=ar(),{instance:d,accounts:f,inProgress:h}=Yie();v.useEffect(()=>{const w=S=>{const _=S.detail||{};if(_.isPersonaCreation){console.log("Ignoring auth error from persona creation",_);return}i(null),n(null),se.error("Session expired",{description:"Please log in again"}),u("/login")};return window.addEventListener(X_,w),()=>{window.removeEventListener(X_,w)}},[u]),v.useEffect(()=>{const w=localStorage.getItem("auth_token"),S=localStorage.getItem("user");if(console.log("AuthContext initializing - stored data check:",{hasToken:!!w,hasUser:!!S}),w&&S)try{i(w),n(JSON.parse(S)),console.log("User session restored from localStorage")}catch(C){console.error("Failed to parse stored user data:",C),localStorage.removeItem("auth_token"),localStorage.removeItem("user")}else console.log("No stored authentication data found");o(!1)},[]),v.useEffect(()=>{if(r){console.log("Verifying token...");const w=`token_validated_${r.substring(0,10)}`;if(sessionStorage.getItem(w)==="true"&&e){console.log("Token already validated this session, skipping validation");return}ty.getProfile().then(C=>{C&&"data"in C&&(console.log("Profile verified successfully"),n(C.data),sessionStorage.setItem(w,"true"))}).catch(C=>{C.response&&C.response.status===401?(console.error("Token invalid (401):",C),localStorage.removeItem("auth_token"),localStorage.removeItem("user"),i(null),n(null)):(console.warn("Profile validation error (not clearing token):",C),sessionStorage.setItem(w,"true"))})}else console.log("No token available, not validating profile")},[r,e]);const p=async(w,S)=>{var C,_;o(!0),console.log("Attempting login for user:",w);try{const A=await ty.login(w,S);if(console.log("Login API response received"),!A.data.access_token)throw new Error("No access token received from server");return localStorage.setItem("auth_token",A.data.access_token),localStorage.setItem("user",JSON.stringify(A.data.user)),i(A.data.access_token),n(A.data.user),console.log("Authentication state updated"),se.success("Login successful!"),A.data.access_token}catch(A){throw console.error("Login failed:",A),se.error("Login failed",{description:((_=(C=A.response)==null?void 0:C.data)==null?void 0:_.message)||"Invalid username or password"}),A}finally{o(!1)}},g=async()=>{l(!0);try{console.log("Starting Microsoft authentication...");const w=await d.loginPopup(Xie);if(w&&w.account&&w.idToken){console.log("Microsoft authentication successful",w.account);const S=await ty.loginWithMicrosoft(w.idToken);S.data.access_token&&(localStorage.setItem("auth_token",S.data.access_token),localStorage.setItem("user",JSON.stringify(S.data.user)),localStorage.setItem("auth_type","microsoft"),i(S.data.access_token),n(S.data.user),console.log("Microsoft user authenticated and stored"),se.success("Successfully signed in with Microsoft!"))}}catch(w){throw console.error("Microsoft login failed:",w),w.name==="BrowserAuthError"&&w.errorCode==="popup_window_error"?se.error("Sign-in cancelled",{description:"The sign-in popup was closed before completing authentication."}):w.name==="InteractionRequiredAuthError"?se.error("Authentication required",{description:"Please complete the authentication process."}):se.error("Microsoft sign-in failed",{description:w.message||"An error occurred during authentication"}),w}finally{l(!1)}},m=async()=>{const w=localStorage.getItem("auth_type");if(localStorage.removeItem("auth_token"),localStorage.removeItem("user"),localStorage.removeItem("auth_type"),i(null),n(null),w==="microsoft"&&f.length>0)try{await d.logoutPopup({account:f[0],postLogoutRedirectUri:window.location.origin+"/semblance/"})}catch(S){console.error("Microsoft logout error:",S)}se.info("You have been logged out")},y=!!localStorage.getItem("auth_token"),x={user:e,token:r,isLoading:s,login:p,loginWithMicrosoft:g,logout:m,isAuthenticated:!!r||y,isMsalLoading:c};return a.jsx(GB.Provider,{value:x,children:t})}function Qo(){const t=v.useContext(GB);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}function _a(){const[t,e]=v.useState(!1),n=Ui(),r=ar(),{isAuthenticated:i,logout:s}=Qo(),o=[{name:"Home",href:"/",icon:Ky},{name:"Synthetic Personas",href:"/synthetic-users",icon:Dr},{name:"Focus Groups",href:"/focus-groups",icon:Vo},{name:"Dashboard",href:"/dashboard",icon:z_}],c=()=>{e(!t)},l=d=>n.pathname===d,u=d=>{if(d==="/synthetic-users"){const f=new CustomEvent("syntheticUsersNavigation");window.dispatchEvent(f)}r(d)};return a.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-md border-b border-slate-200/80",children:[a.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex h-16 items-center justify-between",children:[a.jsx("div",{className:"flex items-center",children:a.jsx(ys,{to:"/",className:"flex items-center",children:a.jsx("span",{className:"font-sf text-2xl font-semibold text-gradient",children:"Semblance"})})}),a.jsx("nav",{className:"hidden md:block",children:a.jsxs("ul",{className:"flex items-center space-x-8",children:[o.map(d=>a.jsx("li",{children:d.href==="/"?a.jsxs(ys,{to:d.href,className:Pe("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",l(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[a.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]}):a.jsxs("button",{onClick:()=>u(d.href),className:Pe("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",l(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[a.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]})},d.name)),a.jsx("li",{children:i?a.jsxs("button",{onClick:()=>{s(),r("/login")},className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[a.jsx(JO,{className:"mr-1 h-4 w-4"}),"Logout"]}):a.jsxs(ys,{to:"/login",className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[a.jsx(XO,{className:"mr-1 h-4 w-4"}),"Login"]})})]})}),a.jsx("div",{className:"flex md:hidden",children:a.jsxs("button",{type:"button",className:"inline-flex items-center justify-center rounded-md p-2 text-slate-700 hover:bg-slate-100 hover:text-slate-900 button-transition",onClick:c,children:[a.jsx("span",{className:"sr-only",children:"Open main menu"}),t?a.jsx(Ri,{className:"block h-6 w-6","aria-hidden":"true"}):a.jsx(rZ,{className:"block h-6 w-6","aria-hidden":"true"})]})})]})}),t&&a.jsx("div",{className:"md:hidden glass-panel animate-fade-in",children:a.jsxs("div",{className:"space-y-1 px-4 pb-3 pt-2",children:[o.map(d=>a.jsx("div",{children:d.href==="/"?a.jsxs(ys,{to:d.href,className:Pe("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition",l(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>e(!1),children:[a.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]}):a.jsxs("button",{className:Pe("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition w-full text-left",l(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>{e(!1),u(d.href)},children:[a.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]})},d.name)),i?a.jsxs("button",{onClick:()=>{s(),e(!1),r("/login")},className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900 w-full",children:[a.jsx(JO,{className:"mr-3 h-5 w-5"}),"Logout"]}):a.jsxs(ys,{to:"/login",className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900",onClick:()=>e(!1),children:[a.jsx(XO,{className:"mr-3 h-5 w-5"}),"Login"]})]})})]})}const JI=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,ZI=Mt,XN=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return ZI(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],f=s==null?void 0:s[u];if(d===null)return null;const h=JI(d)||JI(f);return i[u][h]}),c=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[m,y]=g;return Array.isArray(y)?y.includes({...s,...c}[m]):{...s,...c}[m]===y})?[...u,f,h]:u},[]);return ZI(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},JN=XN("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ee=v.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const o=r?Ho:"button";return a.jsx(o,{className:Pe(JN({variant:e,size:n,className:t})),ref:s,...i})});ee.displayName="Button";function Zie(){return a.jsxs("div",{className:"relative isolate overflow-hidden",children:[a.jsx("div",{className:"absolute inset-x-0 top-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[-20rem]","aria-hidden":"true",children:a.jsx("div",{className:"relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-primary to-blue-400 opacity-20 sm:left-[calc(50%-30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})}),a.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-24 sm:py-32 lg:flex lg:items-center lg:gap-x-10 lg:px-8 lg:py-40",children:[a.jsxs("div",{className:"mx-auto max-w-2xl lg:mx-0 lg:flex-auto",children:[a.jsx("div",{className:"flex",children:a.jsxs("div",{className:"relative flex items-center gap-x-4 rounded-full px-4 py-1 text-sm leading-6 text-gray-600 ring-1 ring-gray-900/10 hover:ring-gray-900/20",children:[a.jsx("span",{className:"font-semibold text-primary",children:"New"}),a.jsx("span",{className:"h-4 w-px bg-gray-900/10","aria-hidden":"true"}),a.jsx("span",{children:"Introducing AI-driven focus groups"})]})}),a.jsxs("h1",{className:"mt-10 max-w-lg text-4xl font-sf font-bold tracking-tight text-gray-900 sm:text-6xl",children:["Research with ",a.jsx("span",{className:"text-gradient",children:"synthetic personas"})]}),a.jsx("p",{className:"mt-6 text-lg leading-8 text-gray-600",children:"Conduct research using AI-powered synthetic personas and autonomous focus groups. Gain valuable insights without the limitations of traditional research methods."}),a.jsxs("div",{className:"mt-10 flex items-center gap-x-6",children:[a.jsx(ys,{to:"/synthetic-users",children:a.jsxs(ee,{className:"px-6 py-6 text-base hover:shadow-lg hover:translate-y-[-2px] button-transition",children:["Create synthetic personas",a.jsx(us,{className:"ml-2 h-4 w-4"})]})}),a.jsxs(ys,{to:"/focus-groups",className:"text-sm font-semibold leading-6 text-gray-900 hover:text-primary button-transition",children:["Set up focus groups ",a.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]}),a.jsx("div",{className:"mt-16 sm:mt-24 lg:mt-0 lg:flex-shrink-0 lg:flex-grow",children:a.jsxs("div",{className:"relative glass-card mx-auto w-[350px] h-[450px] rounded-2xl shadow-xl overflow-hidden animate-float",children:[a.jsxs("div",{className:"absolute top-4 left-4 right-4 h-12 bg-white/70 backdrop-blur-sm rounded-lg flex items-center px-4",children:[a.jsx("div",{className:"h-3 w-3 rounded-full bg-red-400 mr-2"}),a.jsx("div",{className:"h-3 w-3 rounded-full bg-yellow-400 mr-2"}),a.jsx("div",{className:"h-3 w-3 rounded-full bg-green-400 mr-2"}),a.jsx("div",{className:"text-xs text-gray-500 ml-2",children:"Shampoo Brand Perception"})]}),a.jsx("div",{className:"absolute top-20 left-4 right-4 bottom-4 bg-gray-50 rounded-lg overflow-hidden",children:[1,2,3,4].map(t=>a.jsx("div",{className:`flex ${t%2===0?"justify-end":"justify-start"} px-3 py-2`,children:a.jsxs("div",{className:`max-w-[70%] rounded-lg px-3 py-2 text-xs ${t%2===0?"bg-primary text-white":"bg-gray-200 text-gray-800"}`,children:[t===1&&"What qualities do you look for in a premium shampoo brand?",t===2&&"I value natural ingredients and a brand that feels luxurious but still eco-friendly.",t===3&&"How important is fragrance in your shampoo selection?",t===4&&"Very important - it affects my mood and how I feel about the product throughout the day."]})},t))})]})})]}),a.jsx("div",{className:"absolute inset-x-0 bottom-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:bottom-[-20rem]","aria-hidden":"true",children:a.jsx("div",{className:"relative left-[calc(50%+11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-blue-400 to-primary opacity-20 sm:left-[calc(50%+30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})})]})}function Lu({title:t,description:e,icon:n,className:r}){return a.jsxs("div",{className:Pe("relative group glass-card rounded-xl overflow-hidden p-6 hover:shadow-lg hover:translate-y-[-4px] button-transition",r),children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/5 to-blue-400/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-12 h-12 flex items-center justify-center mb-4",children:a.jsx(n,{className:"h-6 w-6 text-primary"})}),a.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:t}),a.jsx("p",{className:"text-gray-600 text-sm",children:e})]})]})}const ese=()=>(Qo(),ar(),a.jsxs("div",{className:"min-h-screen overflow-hidden bg-background",children:[a.jsx(_a,{}),a.jsx("main",{children:a.jsxs("div",{className:"pt-16",children:[a.jsx(Zie,{}),a.jsx("section",{className:"py-20 px-6 bg-white",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"Why Synthetic Personas?"}),a.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Our platform combines advanced AI with intuitive design to help researchers gain deeper insights faster than traditional methods."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[a.jsx(Lu,{title:"Scalable Research",description:"Create and test with thousands of synthetic personas, each with unique demographic profiles and behaviors.",icon:Dr}),a.jsx(Lu,{title:"AI-Driven Focus Groups",description:"Run autonomous focus groups moderated by AI that adapts to participant responses in real-time.",icon:Vo}),a.jsx(Lu,{title:"Instant Analysis",description:"Generate comprehensive reports and visualizations that highlight key insights and patterns.",icon:z_}),a.jsx(Lu,{title:"Diverse Perspectives",description:"Access synthetic personas from various backgrounds, ensuring representation across age, gender, and location.",icon:Dr}),a.jsx(Lu,{title:"Dynamic Discussions",description:"AI moderators guide conversations naturally, following up on interesting points without bias.",icon:uZ}),a.jsx(Lu,{title:"Comprehensive Reporting",description:"Export detailed reports with sentiment analysis, key themes, and actionable recommendations.",icon:z_})]})]})}),a.jsx("section",{className:"py-20 px-6 bg-gradient-to-b from-white to-slate-50",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"How It Works"}),a.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Just three simple steps to gather valuable insights from synthetic personas."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"text-center p-6",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-primary",children:"1"})}),a.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Create Synthetic Personas"}),a.jsx("p",{className:"text-gray-600",children:"Define your target audience with customizable demographic profiles and personality traits."})]}),a.jsxs("div",{className:"text-center p-6",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-primary",children:"2"})}),a.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Set Up Focus Groups"}),a.jsx("p",{className:"text-gray-600",children:"Configure your research objectives, topics, and parameters for the AI moderator."})]}),a.jsxs("div",{className:"text-center p-6",children:[a.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-primary",children:"3"})}),a.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Analyze Results"}),a.jsx("p",{className:"text-gray-600",children:"Review comprehensive visual reports and actionable insights from your synthetic research."})]})]}),a.jsx("div",{className:"text-center mt-12",children:a.jsx(ys,{to:"synthetic-users",className:"inline-flex items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-primary hover:bg-primary/90 button-transition",children:"Get Started"})})]})}),a.jsxs("footer",{className:"bg-white py-12 px-6",children:[a.jsxs("div",{className:"max-w-7xl mx-auto flex flex-col md:flex-row justify-between items-center",children:[a.jsxs("div",{className:"mb-6 md:mb-0",children:[a.jsx("span",{className:"text-xl font-sf font-semibold text-gradient",children:"Semblance"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"AI-powered synthetic persona research"})]}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Platform"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx(ys,{to:"/",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Home"})}),a.jsx("li",{children:a.jsx(ys,{to:"/synthetic-users",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Synthetic Personas"})}),a.jsx("li",{children:a.jsx(ys,{to:"/focus-groups",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Focus Groups"})}),a.jsx("li",{children:a.jsx(ys,{to:"/dashboard",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Dashboard"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Company"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"About"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Blog"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Careers"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Contact"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Legal"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Privacy"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Terms"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Security"})})]})]})]})]}),a.jsx("div",{className:"max-w-7xl mx-auto mt-8 pt-8 border-t border-gray-200",children:a.jsxs("p",{className:"text-sm text-gray-500 text-center",children:["© ",new Date().getFullYear()," Semblance. All rights reserved."]})})]})]})})]})),tse=()=>{const t=Ui(),e=ar();v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]);const n=t.pathname.startsWith("/synthetic-users/"),i=new URLSearchParams(t.search).get("fromReview")==="true";return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:a.jsxs("div",{className:"text-center p-8 max-w-md bg-white rounded-lg shadow-md",children:[a.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),n?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Persona Not Found"}),a.jsx("p",{className:"text-gray-500 mb-6",children:"The persona you're looking for may have been removed or doesn't exist."}),i?a.jsx(ee,{onClick:()=>e("/synthetic-users?mode=create&tab=ai&step=review"),className:"mb-2 w-full",children:"Return to Review Page"}):a.jsx(ee,{onClick:()=>e("/synthetic-users"),className:"mb-2 w-full",children:"View All Personas"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),a.jsx("p",{className:"text-gray-500 mb-6",children:"The page you're looking for doesn't exist or has been moved."})]}),a.jsx(ee,{variant:"outline",onClick:()=>e("/"),className:"w-full",children:"Return to Home"})]})})},KB=v.createContext(void 0),zS="synthetic-society-navigation-state",nse=({children:t})=>{const[e,n]=v.useState(()=>{try{const s=localStorage.getItem(zS);return s?JSON.parse(s):{}}catch{return{}}});v.useEffect(()=>{localStorage.setItem(zS,JSON.stringify(e))},[e]);const r=(s,o)=>{n({...e,previousRoute:s,...o})},i=()=>{n({}),localStorage.removeItem(zS)};return a.jsx(KB.Provider,{value:{navigationState:e,setNavigationState:n,clearNavigationState:i,setPreviousRoute:r},children:t})},xg=()=>{const t=v.useContext(KB);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t};function rse(t,e=[]){let n=[];function r(s,o){const c=v.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,y=v.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>v.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,ise(i,...e)]}function ise(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var ZN="Progress",eT=100,[sse,cFe]=rse(ZN),[ose,ase]=sse(ZN),WB=v.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:s=cse,...o}=t;(i||i===0)&&!eR(i)&&console.error(lse(`${i}`,"Progress"));const c=eR(i)?i:eT;r!==null&&!tR(r,c)&&console.error(use(`${r}`,"Progress"));const l=tR(r,c)?r:null,u=yx(l)?s(l,c):void 0;return a.jsx(ose,{scope:n,value:l,max:c,children:a.jsx(it.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":yx(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":QB(l,c),"data-value":l??void 0,"data-max":c,...o,ref:e})})});WB.displayName=ZN;var qB="ProgressIndicator",YB=v.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,i=ase(qB,n);return a.jsx(it.div,{"data-state":QB(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:e})});YB.displayName=qB;function cse(t,e){return`${Math.round(t/e*100)}%`}function QB(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function yx(t){return typeof t=="number"}function eR(t){return yx(t)&&!isNaN(t)&&t>0}function tR(t,e){return yx(t)&&!isNaN(t)&&t<=e&&t>=0}function lse(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${eT}\`.`}function use(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${eT} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var XB=WB,dse=YB;const wc=v.forwardRef(({className:t,value:e,...n},r)=>a.jsx(XB,{ref:r,className:Pe("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:a.jsx(dse,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));wc.displayName=XB.displayName;var bg=t=>t.type==="checkbox",Dl=t=>t instanceof Date,fi=t=>t==null;const JB=t=>typeof t=="object";var or=t=>!fi(t)&&!Array.isArray(t)&&JB(t)&&!Dl(t),ZB=t=>or(t)&&t.target?bg(t.target)?t.target.checked:t.target.value:t,fse=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,e3=(t,e)=>t.has(fse(e)),hse=t=>{const e=t.constructor&&t.constructor.prototype;return or(e)&&e.hasOwnProperty("isPrototypeOf")},tT=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function _i(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(tT&&(t instanceof Blob||t instanceof FileList))&&(n||or(t)))if(e=n?[]:{},!n&&!hse(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=_i(t[r]));else return t;return e}var H0=t=>Array.isArray(t)?t.filter(Boolean):[],tr=t=>t===void 0,Re=(t,e,n)=>{if(!e||!or(t))return n;const r=H0(e.split(/[,[\].]+?/)).reduce((i,s)=>fi(i)?i:i[s],t);return tr(r)||r===t?tr(t[e])?n:t[e]:r},fs=t=>typeof t=="boolean",nT=t=>/^\w*$/.test(t),t3=t=>H0(t.replace(/["|']|\]/g,"").split(/\.|\[/)),hn=(t,e,n)=>{let r=-1;const i=nT(e)?[e]:t3(e),s=i.length,o=s-1;for(;++rT.useContext(n3),pse=t=>{const{children:e,...n}=t;return T.createElement(n3.Provider,{value:n},e)};var r3=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(i,s,{get:()=>{const o=s;return e._proxyFormState[o]!==Gs.all&&(e._proxyFormState[o]=!r||Gs.all),n&&(n[o]=!0),t[o]}});return i},Ai=t=>or(t)&&!Object.keys(t).length,i3=(t,e,n,r)=>{n(t);const{name:i,...s}=t;return Ai(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(o=>e[o]===(!r||Gs.all))},hp=t=>Array.isArray(t)?t:[t],s3=(t,e,n)=>!t||!e||t===e||hp(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function rT(t){const e=T.useRef(t);e.current=t,T.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function mse(t){const e=z0(),{control:n=e.control,disabled:r,name:i,exact:s}=t||{},[o,c]=T.useState(n._formState),l=T.useRef(!0),u=T.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=T.useRef(i);return d.current=i,rT({disabled:r,next:f=>l.current&&s3(d.current,f.name,s)&&i3(f,u.current,n._updateFormState)&&c({...n._formState,...f}),subject:n._subjects.state}),T.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),r3(o,n,u.current,!1)}var Oo=t=>typeof t=="string",o3=(t,e,n,r,i)=>Oo(t)?(r&&e.watch.add(t),Re(n,t,i)):Array.isArray(t)?t.map(s=>(r&&e.watch.add(s),Re(n,s))):(r&&(e.watchAll=!0),n);function gse(t){const e=z0(),{control:n=e.control,name:r,defaultValue:i,disabled:s,exact:o}=t||{},c=T.useRef(r);c.current=r,rT({disabled:s,subject:n._subjects.values,next:d=>{s3(c.current,d.name,o)&&u(_i(o3(c.current,n._names,d.values||n._formValues,!1,i)))}});const[l,u]=T.useState(n._getWatch(r,i));return T.useEffect(()=>n._removeUnmounted()),l}function vse(t){const e=z0(),{name:n,disabled:r,control:i=e.control,shouldUnregister:s}=t,o=e3(i._names.array,n),c=gse({control:i,name:n,defaultValue:Re(i._formValues,n,Re(i._defaultValues,n,t.defaultValue)),exact:!0}),l=mse({control:i,name:n,exact:!0}),u=T.useRef(i.register(n,{...t.rules,value:c,...fs(t.disabled)?{disabled:t.disabled}:{}}));return T.useEffect(()=>{const d=i._options.shouldUnregister||s,f=(h,p)=>{const g=Re(i._fields,h);g&&g._f&&(g._f.mount=p)};if(f(n,!0),d){const h=_i(Re(i._options.defaultValues,n));hn(i._defaultValues,n,h),tr(Re(i._formValues,n))&&hn(i._formValues,n,h)}return()=>{(o?d&&!i._state.action:d)?i.unregister(n):f(n,!1)}},[n,i,o,s]),T.useEffect(()=>{Re(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:Re(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:c,...fs(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:T.useCallback(d=>u.current.onChange({target:{value:ZB(d),name:n},type:xx.CHANGE}),[n]),onBlur:T.useCallback(()=>u.current.onBlur({target:{value:Re(i._formValues,n),name:n},type:xx.BLUR}),[n,i]),ref:T.useCallback(d=>{const f=Re(i._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:h=>d.setCustomValidity(h),reportValidity:()=>d.reportValidity()})},[i._fields,n])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Re(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Re(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Re(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Re(l.validatingFields,n)},error:{enumerable:!0,get:()=>Re(l.errors,n)}})}}const yse=t=>t.render(vse(t));var a3=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},nR=t=>({isOnSubmit:!t||t===Gs.onSubmit,isOnBlur:t===Gs.onBlur,isOnChange:t===Gs.onChange,isOnAll:t===Gs.all,isOnTouch:t===Gs.onTouched}),rR=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const pp=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const s=Re(t,i);if(s){const{_f:o,...c}=s;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(pp(c,e))break}else if(or(c)&&pp(c,e))break}}};var xse=(t,e,n)=>{const r=hp(Re(t,n));return hn(r,"root",e[n]),hn(t,n,r),t},iT=t=>t.type==="file",xa=t=>typeof t=="function",bx=t=>{if(!tT)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},sy=t=>Oo(t),sT=t=>t.type==="radio",wx=t=>t instanceof RegExp;const iR={value:!1,isValid:!1},sR={value:!0,isValid:!0};var c3=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!tr(t[0].attributes.value)?tr(t[0].value)||t[0].value===""?sR:{value:t[0].value,isValid:!0}:sR:iR}return iR};const oR={isValid:!1,value:null};var l3=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,oR):oR;function aR(t,e,n="validate"){if(sy(t)||Array.isArray(t)&&t.every(sy)||fs(t)&&!t)return{type:n,message:sy(t)?t:"",ref:e}}var Fu=t=>or(t)&&!wx(t)?t:{value:t,message:""},cR=async(t,e,n,r,i)=>{const{ref:s,refs:o,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:h,validate:p,name:g,valueAsNumber:m,mount:y,disabled:b}=t._f,x=Re(e,g);if(!y||b)return{};const w=o?o[0]:s,S=E=>{r&&w.reportValidity&&(w.setCustomValidity(fs(E)?"":E||""),w.reportValidity())},C={},_=sT(s),A=bg(s),j=_||A,P=(m||iT(s))&&tr(s.value)&&tr(x)||bx(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,k=a3.bind(null,g,n,C),O=(E,R,M,G=ia.maxLength,L=ia.minLength)=>{const V=E?R:M;C[g]={type:E?G:L,message:V,ref:s,...k(E?G:L,V)}};if(i?!Array.isArray(x)||!x.length:c&&(!j&&(P||fi(x))||fs(x)&&!x||A&&!c3(o).isValid||_&&!l3(o).isValid)){const{value:E,message:R}=sy(c)?{value:!!c,message:c}:Fu(c);if(E&&(C[g]={type:ia.required,message:R,ref:w,...k(ia.required,R)},!n))return S(R),C}if(!P&&(!fi(d)||!fi(f))){let E,R;const M=Fu(f),G=Fu(d);if(!fi(x)&&!isNaN(x)){const L=s.valueAsNumber||x&&+x;fi(M.value)||(E=L>M.value),fi(G.value)||(R=Lnew Date(new Date().toDateString()+" "+X),I=s.type=="time",D=s.type=="week";Oo(M.value)&&x&&(E=I?V(x)>V(M.value):D?x>M.value:L>new Date(M.value)),Oo(G.value)&&x&&(R=I?V(x)+E.value,G=!fi(R.value)&&x.length<+R.value;if((M||G)&&(O(M,E.message,R.message),!n))return S(C[g].message),C}if(h&&!P&&Oo(x)){const{value:E,message:R}=Fu(h);if(wx(E)&&!x.match(E)&&(C[g]={type:ia.pattern,message:R,ref:s,...k(ia.pattern,R)},!n))return S(R),C}if(p){if(xa(p)){const E=await p(x,e),R=aR(E,w);if(R&&(C[g]={...R,...k(ia.validate,R.message)},!n))return S(R.message),C}else if(or(p)){let E={};for(const R in p){if(!Ai(E)&&!n)break;const M=aR(await p[R](x,e),w,R);M&&(E={...M,...k(R,M.message)},S(M.message),n&&(C[g]=E))}if(!Ai(E)&&(C[g]={ref:w,...E},!n))return C}}return S(!0),C};function bse(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{let t=[];return{get observers(){return t},next:i=>{for(const s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}},p1=t=>fi(t)||!JB(t);function lc(t,e){if(p1(t)||p1(e))return t===e;if(Dl(t)&&Dl(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const s=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=e[i];if(Dl(s)&&Dl(o)||or(s)&&or(o)||Array.isArray(s)&&Array.isArray(o)?!lc(s,o):s!==o)return!1}}return!0}var u3=t=>t.type==="select-multiple",Sse=t=>sT(t)||bg(t),GS=t=>bx(t)&&t.isConnected,d3=t=>{for(const e in t)if(xa(t[e]))return!0;return!1};function Sx(t,e={}){const n=Array.isArray(t);if(or(t)||n)for(const r in t)Array.isArray(t[r])||or(t[r])&&!d3(t[r])?(e[r]=Array.isArray(t[r])?[]:{},Sx(t[r],e[r])):fi(t[r])||(e[r]=!0);return e}function f3(t,e,n){const r=Array.isArray(t);if(or(t)||r)for(const i in t)Array.isArray(t[i])||or(t[i])&&!d3(t[i])?tr(e)||p1(n[i])?n[i]=Array.isArray(t[i])?Sx(t[i],[]):{...Sx(t[i])}:f3(t[i],fi(e)?{}:e[i],n[i]):n[i]=!lc(t[i],e[i]);return n}var _h=(t,e)=>f3(t,e,Sx(e)),h3=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>tr(t)?t:e?t===""?NaN:t&&+t:n&&Oo(t)?new Date(t):r?r(t):t;function KS(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return iT(e)?e.files:sT(e)?l3(t.refs).value:u3(e)?[...e.selectedOptions].map(({value:n})=>n):bg(e)?c3(t.refs).value:h3(tr(e.value)?t.ref.value:e.value,t)}var Cse=(t,e,n,r)=>{const i={};for(const s of t){const o=Re(e,s);o&&hn(i,s,o._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Ah=t=>tr(t)?t:wx(t)?t.source:or(t)?wx(t.value)?t.value.source:t.value:t;const lR="AsyncFunction";var _se=t=>(!t||!t.validate)&&!!(xa(t.validate)&&t.validate.constructor.name===lR||or(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===lR)),Ase=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function uR(t,e,n){const r=Re(t,n);if(r||nT(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=Re(e,s),c=Re(t,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};i.pop()}return{name:n}}var jse=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,Ese=(t,e)=>!H0(Re(t,e)).length&&xr(t,e);const Nse={mode:Gs.onSubmit,reValidateMode:Gs.onChange,shouldFocusError:!0};function Tse(t={}){let e={...Nse,...t},n={submitCount:0,isDirty:!1,isLoading:xa(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=or(e.defaultValues)||or(e.values)?_i(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:_i(i),o={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:VS(),array:VS(),state:VS()},h=nR(e.mode),p=nR(e.reValidateMode),g=e.criteriaMode===Gs.all,m=N=>$=>{clearTimeout(u),u=setTimeout(N,$)},y=async N=>{if(!t.disabled&&(d.isValid||N)){const $=e.resolver?Ai((await j()).errors):await k(r,!0);$!==n.isValid&&f.state.next({isValid:$})}},b=(N,$)=>{!t.disabled&&(d.isValidating||d.validatingFields)&&((N||Array.from(c.mount)).forEach(B=>{B&&($?hn(n.validatingFields,B,$):xr(n.validatingFields,B))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ai(n.validatingFields)}))},x=(N,$=[],B,K,Z=!0,H=!0)=>{if(K&&B&&!t.disabled){if(o.action=!0,H&&Array.isArray(Re(r,N))){const re=B(Re(r,N),K.argA,K.argB);Z&&hn(r,N,re)}if(H&&Array.isArray(Re(n.errors,N))){const re=B(Re(n.errors,N),K.argA,K.argB);Z&&hn(n.errors,N,re),Ese(n.errors,N)}if(d.touchedFields&&H&&Array.isArray(Re(n.touchedFields,N))){const re=B(Re(n.touchedFields,N),K.argA,K.argB);Z&&hn(n.touchedFields,N,re)}d.dirtyFields&&(n.dirtyFields=_h(i,s)),f.state.next({name:N,isDirty:E(N,$),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else hn(s,N,$)},w=(N,$)=>{hn(n.errors,N,$),f.state.next({errors:n.errors})},S=N=>{n.errors=N,f.state.next({errors:n.errors,isValid:!1})},C=(N,$,B,K)=>{const Z=Re(r,N);if(Z){const H=Re(s,N,tr(B)?Re(i,N):B);tr(H)||K&&K.defaultChecked||$?hn(s,N,$?H:KS(Z._f)):G(N,H),o.mount&&y()}},_=(N,$,B,K,Z)=>{let H=!1,re=!1;const me={name:N};if(!t.disabled){const be=!!(Re(r,N)&&Re(r,N)._f&&Re(r,N)._f.disabled);if(!B||K){d.isDirty&&(re=n.isDirty,n.isDirty=me.isDirty=E(),H=re!==me.isDirty);const ke=be||lc(Re(i,N),$);re=!!(!be&&Re(n.dirtyFields,N)),ke||be?xr(n.dirtyFields,N):hn(n.dirtyFields,N,!0),me.dirtyFields=n.dirtyFields,H=H||d.dirtyFields&&re!==!ke}if(B){const ke=Re(n.touchedFields,N);ke||(hn(n.touchedFields,N,B),me.touchedFields=n.touchedFields,H=H||d.touchedFields&&ke!==B)}H&&Z&&f.state.next(me)}return H?me:{}},A=(N,$,B,K)=>{const Z=Re(n.errors,N),H=d.isValid&&fs($)&&n.isValid!==$;if(t.delayError&&B?(l=m(()=>w(N,B)),l(t.delayError)):(clearTimeout(u),l=null,B?hn(n.errors,N,B):xr(n.errors,N)),(B?!lc(Z,B):Z)||!Ai(K)||H){const re={...K,...H&&fs($)?{isValid:$}:{},errors:n.errors,name:N};n={...n,...re},f.state.next(re)}},j=async N=>{b(N,!0);const $=await e.resolver(s,e.context,Cse(N||c.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return b(N),$},P=async N=>{const{errors:$}=await j(N);if(N)for(const B of N){const K=Re($,B);K?hn(n.errors,B,K):xr(n.errors,B)}else n.errors=$;return $},k=async(N,$,B={valid:!0})=>{for(const K in N){const Z=N[K];if(Z){const{_f:H,...re}=Z;if(H){const me=c.array.has(H.name),be=Z._f&&_se(Z._f);be&&d.validatingFields&&b([K],!0);const ke=await cR(Z,s,g,e.shouldUseNativeValidation&&!$,me);if(be&&d.validatingFields&&b([K]),ke[H.name]&&(B.valid=!1,$))break;!$&&(Re(ke,H.name)?me?xse(n.errors,ke,H.name):hn(n.errors,H.name,ke[H.name]):xr(n.errors,H.name))}!Ai(re)&&await k(re,$,B)}}return B.valid},O=()=>{for(const N of c.unMount){const $=Re(r,N);$&&($._f.refs?$._f.refs.every(B=>!GS(B)):!GS($._f.ref))&&ue(N)}c.unMount=new Set},E=(N,$)=>!t.disabled&&(N&&$&&hn(s,N,$),!lc(Q(),i)),R=(N,$,B)=>o3(N,c,{...o.mount?s:tr($)?i:Oo(N)?{[N]:$}:$},B,$),M=N=>H0(Re(o.mount?s:i,N,t.shouldUnregister?Re(i,N,[]):[])),G=(N,$,B={})=>{const K=Re(r,N);let Z=$;if(K){const H=K._f;H&&(!H.disabled&&hn(s,N,h3($,H)),Z=bx(H.ref)&&fi($)?"":$,u3(H.ref)?[...H.ref.options].forEach(re=>re.selected=Z.includes(re.value)):H.refs?bg(H.ref)?H.refs.length>1?H.refs.forEach(re=>(!re.defaultChecked||!re.disabled)&&(re.checked=Array.isArray(Z)?!!Z.find(me=>me===re.value):Z===re.value)):H.refs[0]&&(H.refs[0].checked=!!Z):H.refs.forEach(re=>re.checked=re.value===Z):iT(H.ref)?H.ref.value="":(H.ref.value=Z,H.ref.type||f.values.next({name:N,values:{...s}})))}(B.shouldDirty||B.shouldTouch)&&_(N,Z,B.shouldTouch,B.shouldDirty,!0),B.shouldValidate&&X(N)},L=(N,$,B)=>{for(const K in $){const Z=$[K],H=`${N}.${K}`,re=Re(r,H);(c.array.has(N)||or(Z)||re&&!re._f)&&!Dl(Z)?L(H,Z,B):G(H,Z,B)}},V=(N,$,B={})=>{const K=Re(r,N),Z=c.array.has(N),H=_i($);hn(s,N,H),Z?(f.array.next({name:N,values:{...s}}),(d.isDirty||d.dirtyFields)&&B.shouldDirty&&f.state.next({name:N,dirtyFields:_h(i,s),isDirty:E(N,H)})):K&&!K._f&&!fi(H)?L(N,H,B):G(N,H,B),rR(N,c)&&f.state.next({...n}),f.values.next({name:o.mount?N:void 0,values:{...s}})},I=async N=>{o.mount=!0;const $=N.target;let B=$.name,K=!0;const Z=Re(r,B),H=()=>$.type?KS(Z._f):ZB(N),re=me=>{K=Number.isNaN(me)||Dl(me)&&isNaN(me.getTime())||lc(me,Re(s,B,me))};if(Z){let me,be;const ke=H(),Se=N.type===xx.BLUR||N.type===xx.FOCUS_OUT,qe=!Ase(Z._f)&&!e.resolver&&!Re(n.errors,B)&&!Z._f.deps||jse(Se,Re(n.touchedFields,B),n.isSubmitted,p,h),st=rR(B,c,Se);hn(s,B,ke),Se?(Z._f.onBlur&&Z._f.onBlur(N),l&&l(0)):Z._f.onChange&&Z._f.onChange(N);const Dt=_(B,ke,Se,!1),We=!Ai(Dt)||st;if(!Se&&f.values.next({name:B,type:N.type,values:{...s}}),qe)return d.isValid&&(t.mode==="onBlur"?Se&&y():y()),We&&f.state.next({name:B,...st?{}:Dt});if(!Se&&st&&f.state.next({...n}),e.resolver){const{errors:Je}=await j([B]);if(re(ke),K){const At=uR(n.errors,r,B),Yt=uR(Je,r,At.name||B);me=Yt.error,B=Yt.name,be=Ai(Je)}}else b([B],!0),me=(await cR(Z,s,g,e.shouldUseNativeValidation))[B],b([B]),re(ke),K&&(me?be=!1:d.isValid&&(be=await k(r,!0)));K&&(Z._f.deps&&X(Z._f.deps),A(B,be,me,Dt))}},D=(N,$)=>{if(Re(n.errors,$)&&N.focus)return N.focus(),1},X=async(N,$={})=>{let B,K;const Z=hp(N);if(e.resolver){const H=await P(tr(N)?N:Z);B=Ai(H),K=N?!Z.some(re=>Re(H,re)):B}else N?(K=(await Promise.all(Z.map(async H=>{const re=Re(r,H);return await k(re&&re._f?{[H]:re}:re)}))).every(Boolean),!(!K&&!n.isValid)&&y()):K=B=await k(r);return f.state.next({...!Oo(N)||d.isValid&&B!==n.isValid?{}:{name:N},...e.resolver||!N?{isValid:B}:{},errors:n.errors}),$.shouldFocus&&!K&&pp(r,D,N?Z:c.mount),K},Q=N=>{const $={...o.mount?s:i};return tr(N)?$:Oo(N)?Re($,N):N.map(B=>Re($,B))},J=(N,$)=>({invalid:!!Re(($||n).errors,N),isDirty:!!Re(($||n).dirtyFields,N),error:Re(($||n).errors,N),isValidating:!!Re(n.validatingFields,N),isTouched:!!Re(($||n).touchedFields,N)}),ye=N=>{N&&hp(N).forEach($=>xr(n.errors,$)),f.state.next({errors:N?n.errors:{}})},U=(N,$,B)=>{const K=(Re(r,N,{_f:{}})._f||{}).ref,Z=Re(n.errors,N)||{},{ref:H,message:re,type:me,...be}=Z;hn(n.errors,N,{...be,...$,ref:K}),f.state.next({name:N,errors:n.errors,isValid:!1}),B&&B.shouldFocus&&K&&K.focus&&K.focus()},ne=(N,$)=>xa(N)?f.values.subscribe({next:B=>N(R(void 0,$),B)}):R(N,$,!0),ue=(N,$={})=>{for(const B of N?hp(N):c.mount)c.mount.delete(B),c.array.delete(B),$.keepValue||(xr(r,B),xr(s,B)),!$.keepError&&xr(n.errors,B),!$.keepDirty&&xr(n.dirtyFields,B),!$.keepTouched&&xr(n.touchedFields,B),!$.keepIsValidating&&xr(n.validatingFields,B),!e.shouldUnregister&&!$.keepDefaultValue&&xr(i,B);f.values.next({values:{...s}}),f.state.next({...n,...$.keepDirty?{isDirty:E()}:{}}),!$.keepIsValid&&y()},F=({disabled:N,name:$,field:B,fields:K,value:Z})=>{if(fs(N)&&o.mount||N){const H=N?void 0:tr(Z)?KS(B?B._f:Re(K,$)._f):Z;hn(s,$,H),_($,H,!1,!1,!0)}},ce=(N,$={})=>{let B=Re(r,N);const K=fs($.disabled)||fs(t.disabled);return hn(r,N,{...B||{},_f:{...B&&B._f?B._f:{ref:{name:N}},name:N,mount:!0,...$}}),c.mount.add(N),B?F({field:B,disabled:fs($.disabled)?$.disabled:t.disabled,name:N,value:$.value}):C(N,!0,$.value),{...K?{disabled:$.disabled||t.disabled}:{},...e.progressive?{required:!!$.required,min:Ah($.min),max:Ah($.max),minLength:Ah($.minLength),maxLength:Ah($.maxLength),pattern:Ah($.pattern)}:{},name:N,onChange:I,onBlur:I,ref:Z=>{if(Z){ce(N,$),B=Re(r,N);const H=tr(Z.value)&&Z.querySelectorAll&&Z.querySelectorAll("input,select,textarea")[0]||Z,re=Sse(H),me=B._f.refs||[];if(re?me.find(be=>be===H):H===B._f.ref)return;hn(r,N,{_f:{...B._f,...re?{refs:[...me.filter(GS),H,...Array.isArray(Re(i,N))?[{}]:[]],ref:{type:H.type,name:N}}:{ref:H}}}),C(N,!1,void 0,H)}else B=Re(r,N,{}),B._f&&(B._f.mount=!1),(e.shouldUnregister||$.shouldUnregister)&&!(e3(c.array,N)&&o.action)&&c.unMount.add(N)}}},te=()=>e.shouldFocusError&&pp(r,D,c.mount),pe=N=>{fs(N)&&(f.state.next({disabled:N}),pp(r,($,B)=>{const K=Re(r,B);K&&($.disabled=K._f.disabled||N,Array.isArray(K._f.refs)&&K._f.refs.forEach(Z=>{Z.disabled=K._f.disabled||N}))},0,!1))},we=(N,$)=>async B=>{let K;B&&(B.preventDefault&&B.preventDefault(),B.persist&&B.persist());let Z=_i(s);if(f.state.next({isSubmitting:!0}),e.resolver){const{errors:H,values:re}=await j();n.errors=H,Z=re}else await k(r);if(xr(n.errors,"root"),Ai(n.errors)){f.state.next({errors:{}});try{await N(Z,B)}catch(H){K=H}}else $&&await $({...n.errors},B),te(),setTimeout(te);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ai(n.errors)&&!K,submitCount:n.submitCount+1,errors:n.errors}),K)throw K},Y=(N,$={})=>{Re(r,N)&&(tr($.defaultValue)?V(N,_i(Re(i,N))):(V(N,$.defaultValue),hn(i,N,_i($.defaultValue))),$.keepTouched||xr(n.touchedFields,N),$.keepDirty||(xr(n.dirtyFields,N),n.isDirty=$.defaultValue?E(N,_i(Re(i,N))):E()),$.keepError||(xr(n.errors,N),d.isValid&&y()),f.state.next({...n}))},nt=(N,$={})=>{const B=N?_i(N):i,K=_i(B),Z=Ai(N),H=Z?i:K;if($.keepDefaultValues||(i=B),!$.keepValues){if($.keepDirtyValues){const re=new Set([...c.mount,...Object.keys(_h(i,s))]);for(const me of Array.from(re))Re(n.dirtyFields,me)?hn(H,me,Re(s,me)):V(me,Re(H,me))}else{if(tT&&tr(N))for(const re of c.mount){const me=Re(r,re);if(me&&me._f){const be=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(bx(be)){const ke=be.closest("form");if(ke){ke.reset();break}}}}r={}}s=t.shouldUnregister?$.keepDefaultValues?_i(i):{}:_i(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}c={mount:$.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!$.keepIsValid||!!$.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:$.keepSubmitCount?n.submitCount:0,isDirty:Z?!1:$.keepDirty?n.isDirty:!!($.keepDefaultValues&&!lc(N,i)),isSubmitted:$.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Z?{}:$.keepDirtyValues?$.keepDefaultValues&&s?_h(i,s):n.dirtyFields:$.keepDefaultValues&&N?_h(i,N):$.keepDirty?n.dirtyFields:{},touchedFields:$.keepTouched?n.touchedFields:{},errors:$.keepErrors?n.errors:{},isSubmitSuccessful:$.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ue=(N,$)=>nt(xa(N)?N(s):N,$);return{control:{register:ce,unregister:ue,getFieldState:J,handleSubmit:we,setError:U,_executeSchema:j,_getWatch:R,_getDirty:E,_updateValid:y,_removeUnmounted:O,_updateFieldArray:x,_updateDisabledField:F,_getFieldArray:M,_reset:nt,_resetDefaultValues:()=>xa(e.defaultValues)&&e.defaultValues().then(N=>{Ue(N,e.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:N=>{n={...n,...N}},_disableForm:pe,_subjects:f,_proxyFormState:d,_setErrors:S,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(N){o=N},get _defaultValues(){return i},get _names(){return c},set _names(N){c=N},get _formState(){return n},set _formState(N){n=N},get _options(){return e},set _options(N){e={...e,...N}}},trigger:X,register:ce,handleSubmit:we,watch:ne,setValue:V,getValues:Q,reset:Ue,resetField:Y,clearErrors:ye,unregister:ue,setError:U,setFocus:(N,$={})=>{const B=Re(r,N),K=B&&B._f;if(K){const Z=K.refs?K.refs[0]:K.ref;Z.focus&&(Z.focus(),$.shouldSelect&&Z.select())}},getFieldState:J}}function V0(t={}){const e=T.useRef(),n=T.useRef(),[r,i]=T.useState({isDirty:!1,isValidating:!1,isLoading:xa(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:xa(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...Tse(t),formState:r});const s=e.current.control;return s._options=t,rT({subject:s._subjects.state,next:o=>{i3(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),T.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),T.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),T.useEffect(()=>{t.values&&!lc(t.values,n.current)?(s._reset(t.values,s._options.resetOptions),n.current=t.values,i(o=>({...o}))):s._resetDefaultValues()},[t.values,s]),T.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),T.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),T.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),T.useEffect(()=>{e.current&&(e.current.watch=e.current.watch.bind({}))},[r]),e.current.formState=r3(r,s),e.current}const dR=(t,e,n)=>{if(t&&"reportValidity"in t){const r=Re(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},p3=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?dR(r.ref,n,t):r.refs&&r.refs.forEach(i=>dR(i,n,t))}},Pse=(t,e)=>{e.shouldUseNativeValidation&&p3(t,e);const n={};for(const r in t){const i=Re(e.fields,r),s=Object.assign(t[r]||{},{ref:i&&i.ref});if(kse(e.names||Object.keys(t),r)){const o=Object.assign({},Re(n,r));hn(o,"root",s),hn(n,r,o)}else hn(n,r,s)}return n},kse=(t,e)=>t.some(n=>n.startsWith(e+"."));var Ose=function(t,e){for(var n={};t.length;){var r=t[0],i=r.code,s=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[o]={message:c.message,type:c.code}}else n[o]={message:s,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return t.push(f)})}),e){var l=n[o].types,u=l&&l[r.code];n[o]=a3(o,e,n,i,u?[].concat(u,r.message):r.message)}t.shift()}return n},G0=function(t,e,n){return n===void 0&&(n={}),function(r,i,s){try{return Promise.resolve(function(o,c){try{var l=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(u){return s.shouldUseNativeValidation&&p3({},s),{errors:{},values:n.raw?r:u}})}catch(u){return c(u)}return l&&l.then?l.then(void 0,c):l}(0,function(o){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(o))return{values:{},errors:Pse(Ose(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}},tn;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),o={};for(const c of s)o[c]=i[c];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(tn||(tn={}));var m1;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(m1||(m1={}));const Ke=tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),uc=t=>{switch(typeof t){case"undefined":return Ke.undefined;case"string":return Ke.string;case"number":return isNaN(t)?Ke.nan:Ke.number;case"boolean":return Ke.boolean;case"function":return Ke.function;case"bigint":return Ke.bigint;case"symbol":return Ke.symbol;case"object":return Array.isArray(t)?Ke.array:t===null?Ke.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ke.promise:typeof Map<"u"&&t instanceof Map?Ke.map:typeof Set<"u"&&t instanceof Set?Ke.set:typeof Date<"u"&&t instanceof Date?Ke.date:Ke.object;default:return Ke.unknown}},je=tn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ise=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class ts extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let c=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ts.create=t=>new ts(t);const Jd=(t,e)=>{let n;switch(t.code){case je.invalid_type:t.received===Ke.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case je.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,tn.jsonStringifyReplacer)}`;break;case je.unrecognized_keys:n=`Unrecognized key(s) in object: ${tn.joinValues(t.keys,", ")}`;break;case je.invalid_union:n="Invalid input";break;case je.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${tn.joinValues(t.options)}`;break;case je.invalid_enum_value:n=`Invalid enum value. Expected ${tn.joinValues(t.options)}, received '${t.received}'`;break;case je.invalid_arguments:n="Invalid function arguments";break;case je.invalid_return_type:n="Invalid function return type";break;case je.invalid_date:n="Invalid date";break;case je.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:tn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case je.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case je.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case je.custom:n="Invalid input";break;case je.invalid_intersection_types:n="Intersection results could not be merged";break;case je.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case je.not_finite:n="Number must be finite";break;default:n=e.defaultError,tn.assertNever(t)}return{message:n}};let m3=Jd;function Rse(t){m3=t}function Cx(){return m3}const _x=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let c="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)c=u(o,{data:e,defaultError:c}).message;return{...i,path:s,message:c}},Mse=[];function ze(t,e){const n=Cx(),r=_x({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Jd?void 0:Jd].filter(i=>!!i)});t.common.issues.push(r)}class ii{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return kt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return ii.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return kt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const kt=Object.freeze({status:"aborted"}),cd=t=>({status:"dirty",value:t}),xi=t=>({status:"valid",value:t}),g1=t=>t.status==="aborted",v1=t=>t.status==="dirty",rm=t=>t.status==="valid",im=t=>typeof Promise<"u"&&t instanceof Promise;function Ax(t,e,n,r){if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function g3(t,e,n,r,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var lt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(lt||(lt={}));var Vh,Gh;class Go{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const fR=(t,e)=>{if(rm(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ts(t.common.issues);return this._error=n,this._error}}};function Ut(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,c)=>{var l,u;const{message:d}=t;return o.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:(l=d??r)!==null&&l!==void 0?l:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:c.defaultError}},description:i}}class qt{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return uc(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:uc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ii,ctx:{common:e.parent.common,data:e.data,parsedType:uc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(im(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uc(e)},s=this._parseSync({data:e,path:i.path,parent:i});return fR(i,s)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uc(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(im(i)?i:Promise.resolve(i));return fR(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),c=()=>s.addIssue({code:je.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new fo({schema:this,typeName:Tt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Lo.create(this,this._def)}nullable(){return nl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return eo.create(this,this._def)}promise(){return ef.create(this,this._def)}or(e){return cm.create([this,e],this._def)}and(e){return lm.create(this,e,this._def)}transform(e){return new fo({...Ut(this._def),schema:this,typeName:Tt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new pm({...Ut(this._def),innerType:this,defaultValue:n,typeName:Tt.ZodDefault})}brand(){return new oT({typeName:Tt.ZodBranded,type:this,...Ut(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new mm({...Ut(this._def),innerType:this,catchValue:n,typeName:Tt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return wg.create(this,e)}readonly(){return gm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Dse=/^c[^\s-]{8,}$/i,$se=/^[0-9a-z]+$/,Lse=/^[0-9A-HJKMNP-TV-Z]{26}$/,Fse=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Use=/^[a-z0-9_-]{21}$/i,Bse=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Hse=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zse="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let WS;const Vse=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gse=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Kse=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,v3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Wse=new RegExp(`^${v3}$`);function y3(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function qse(t){return new RegExp(`^${y3(t)}$`)}function x3(t){let e=`${v3}T${y3(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Yse(t,e){return!!((e==="v4"||!e)&&Vse.test(t)||(e==="v6"||!e)&&Gse.test(t))}class qs extends qt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ke.string){const s=this._getOrReturnCtx(e);return ze(s,{code:je.invalid_type,expected:Ke.string,received:s.parsedType}),kt}const r=new ii;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(i=this._getOrReturnCtx(e,i),ze(i,{code:je.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,c=e.data.lengthe.test(i),{validation:n,code:je.invalid_string,...lt.errToObj(r)})}_addCheck(e){return new qs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...lt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...lt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...lt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...lt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...lt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...lt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...lt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...lt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...lt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...lt.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...lt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...lt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...lt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...lt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...lt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...lt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...lt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...lt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...lt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...lt.errToObj(n)})}nonempty(e){return this.min(1,lt.errToObj(e))}trim(){return new qs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value{var e;return new qs({checks:[],typeName:Tt.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ut(t)})};function Qse(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Zc extends qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ke.number){const s=this._getOrReturnCtx(e);return ze(s,{code:je.invalid_type,expected:Ke.number,received:s.parsedType}),kt}let r;const i=new ii;for(const s of this._def.checks)s.kind==="int"?tn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ze(r,{code:je.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ze(r,{code:je.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Qse(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ze(r,{code:je.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ze(r,{code:je.not_finite,message:s.message}),i.dirty()):tn.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,lt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,lt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,lt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,lt.toString(n))}setLimit(e,n,r,i){return new Zc({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:lt.toString(i)}]})}_addCheck(e){return new Zc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:lt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:lt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:lt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:lt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:lt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:lt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:lt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:lt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:lt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&tn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.valuenew Zc({checks:[],typeName:Tt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ut(t)});class el extends qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Ke.bigint){const s=this._getOrReturnCtx(e);return ze(s,{code:je.invalid_type,expected:Ke.bigint,received:s.parsedType}),kt}let r;const i=new ii;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ze(r,{code:je.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ze(r,{code:je.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):tn.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,lt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,lt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,lt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,lt.toString(n))}setLimit(e,n,r,i){return new el({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:lt.toString(i)}]})}_addCheck(e){return new el({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:lt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:lt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:lt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:lt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:lt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value{var e;return new el({checks:[],typeName:Tt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ut(t)})};class sm extends qt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ke.boolean){const r=this._getOrReturnCtx(e);return ze(r,{code:je.invalid_type,expected:Ke.boolean,received:r.parsedType}),kt}return xi(e.data)}}sm.create=t=>new sm({typeName:Tt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ut(t)});class vu extends qt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ke.date){const s=this._getOrReturnCtx(e);return ze(s,{code:je.invalid_type,expected:Ke.date,received:s.parsedType}),kt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ze(s,{code:je.invalid_date}),kt}const r=new ii;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(i=this._getOrReturnCtx(e,i),ze(i,{code:je.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):tn.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new vu({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:lt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:lt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew vu({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Tt.ZodDate,...Ut(t)});class jx extends qt{_parse(e){if(this._getType(e)!==Ke.symbol){const r=this._getOrReturnCtx(e);return ze(r,{code:je.invalid_type,expected:Ke.symbol,received:r.parsedType}),kt}return xi(e.data)}}jx.create=t=>new jx({typeName:Tt.ZodSymbol,...Ut(t)});class om extends qt{_parse(e){if(this._getType(e)!==Ke.undefined){const r=this._getOrReturnCtx(e);return ze(r,{code:je.invalid_type,expected:Ke.undefined,received:r.parsedType}),kt}return xi(e.data)}}om.create=t=>new om({typeName:Tt.ZodUndefined,...Ut(t)});class am extends qt{_parse(e){if(this._getType(e)!==Ke.null){const r=this._getOrReturnCtx(e);return ze(r,{code:je.invalid_type,expected:Ke.null,received:r.parsedType}),kt}return xi(e.data)}}am.create=t=>new am({typeName:Tt.ZodNull,...Ut(t)});class Zd extends qt{constructor(){super(...arguments),this._any=!0}_parse(e){return xi(e.data)}}Zd.create=t=>new Zd({typeName:Tt.ZodAny,...Ut(t)});class Xl extends qt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xi(e.data)}}Xl.create=t=>new Xl({typeName:Tt.ZodUnknown,...Ut(t)});class $a extends qt{_parse(e){const n=this._getOrReturnCtx(e);return ze(n,{code:je.invalid_type,expected:Ke.never,received:n.parsedType}),kt}}$a.create=t=>new $a({typeName:Tt.ZodNever,...Ut(t)});class Ex extends qt{_parse(e){if(this._getType(e)!==Ke.undefined){const r=this._getOrReturnCtx(e);return ze(r,{code:je.invalid_type,expected:Ke.void,received:r.parsedType}),kt}return xi(e.data)}}Ex.create=t=>new Ex({typeName:Tt.ZodVoid,...Ut(t)});class eo extends qt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ke.array)return ze(n,{code:je.invalid_type,expected:Ke.array,received:n.parsedType}),kt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,c=n.data.lengthi.maxLength.value&&(ze(n,{code:je.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>i.type._parseAsync(new Go(n,o,n.path,c)))).then(o=>ii.mergeArray(r,o));const s=[...n.data].map((o,c)=>i.type._parseSync(new Go(n,o,n.path,c)));return ii.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new eo({...this._def,minLength:{value:e,message:lt.toString(n)}})}max(e,n){return new eo({...this._def,maxLength:{value:e,message:lt.toString(n)}})}length(e,n){return new eo({...this._def,exactLength:{value:e,message:lt.toString(n)}})}nonempty(e){return this.min(1,e)}}eo.create=(t,e)=>new eo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Tt.ZodArray,...Ut(e)});function Yu(t){if(t instanceof Kn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Lo.create(Yu(r))}return new Kn({...t._def,shape:()=>e})}else return t instanceof eo?new eo({...t._def,type:Yu(t.element)}):t instanceof Lo?Lo.create(Yu(t.unwrap())):t instanceof nl?nl.create(Yu(t.unwrap())):t instanceof Ko?Ko.create(t.items.map(e=>Yu(e))):t}class Kn extends qt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=tn.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Ke.object){const u=this._getOrReturnCtx(e);return ze(u,{code:je.invalid_type,expected:Ke.object,received:u.parsedType}),kt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof $a&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||c.push(u);const l=[];for(const u of o){const d=s[u],f=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Go(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof $a){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")c.length>0&&(ze(i,{code:je.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of c){const f=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Go(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>ii.mergeObjectSync(r,u)):ii.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return lt.errToObj,new Kn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,c;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=lt.errToObj(e).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}strip(){return new Kn({...this._def,unknownKeys:"strip"})}passthrough(){return new Kn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Kn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Kn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Tt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Kn({...this._def,catchall:e})}pick(e){const n={};return tn.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Kn({...this._def,shape:()=>n})}omit(e){const n={};return tn.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Kn({...this._def,shape:()=>n})}deepPartial(){return Yu(this)}partial(e){const n={};return tn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new Kn({...this._def,shape:()=>n})}required(e){const n={};return tn.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Lo;)s=s._def.innerType;n[r]=s}}),new Kn({...this._def,shape:()=>n})}keyof(){return b3(tn.objectKeys(this.shape))}}Kn.create=(t,e)=>new Kn({shape:()=>t,unknownKeys:"strip",catchall:$a.create(),typeName:Tt.ZodObject,...Ut(e)});Kn.strictCreate=(t,e)=>new Kn({shape:()=>t,unknownKeys:"strict",catchall:$a.create(),typeName:Tt.ZodObject,...Ut(e)});Kn.lazycreate=(t,e)=>new Kn({shape:t,unknownKeys:"strip",catchall:$a.create(),typeName:Tt.ZodObject,...Ut(e)});class cm extends qt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new ts(c.ctx.common.issues));return ze(n,{code:je.invalid_union,unionErrors:o}),kt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(l=>new ts(l));return ze(n,{code:je.invalid_union,unionErrors:c}),kt}}get options(){return this._def.options}}cm.create=(t,e)=>new cm({options:t,typeName:Tt.ZodUnion,...Ut(e)});const aa=t=>t instanceof dm?aa(t.schema):t instanceof fo?aa(t.innerType()):t instanceof fm?[t.value]:t instanceof tl?t.options:t instanceof hm?tn.objectValues(t.enum):t instanceof pm?aa(t._def.innerType):t instanceof om?[void 0]:t instanceof am?[null]:t instanceof Lo?[void 0,...aa(t.unwrap())]:t instanceof nl?[null,...aa(t.unwrap())]:t instanceof oT||t instanceof gm?aa(t.unwrap()):t instanceof mm?aa(t._def.innerType):[];class K0 extends qt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ke.object)return ze(n,{code:je.invalid_type,expected:Ke.object,received:n.parsedType}),kt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ze(n,{code:je.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),kt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=aa(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(i.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);i.set(c,s)}}return new K0({typeName:Tt.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ut(r)})}}function y1(t,e){const n=uc(t),r=uc(e);if(t===e)return{valid:!0,data:t};if(n===Ke.object&&r===Ke.object){const i=tn.objectKeys(e),s=tn.objectKeys(t).filter(c=>i.indexOf(c)!==-1),o={...t,...e};for(const c of s){const l=y1(t[c],e[c]);if(!l.valid)return{valid:!1};o[c]=l.data}return{valid:!0,data:o}}else if(n===Ke.array&&r===Ke.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s{if(g1(s)||g1(o))return kt;const c=y1(s.value,o.value);return c.valid?((v1(s)||v1(o))&&n.dirty(),{status:n.value,value:c.data}):(ze(r,{code:je.invalid_intersection_types}),kt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}lm.create=(t,e,n)=>new lm({left:t,right:e,typeName:Tt.ZodIntersection,...Ut(n)});class Ko extends qt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.array)return ze(r,{code:je.invalid_type,expected:Ke.array,received:r.parsedType}),kt;if(r.data.lengththis._def.items.length&&(ze(r,{code:je.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,c)=>{const l=this._def.items[c]||this._def.rest;return l?l._parse(new Go(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ii.mergeArray(n,o)):ii.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Ko({...this._def,rest:e})}}Ko.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ko({items:t,typeName:Tt.ZodTuple,rest:null,...Ut(e)})};class um extends qt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.object)return ze(r,{code:je.invalid_type,expected:Ke.object,received:r.parsedType}),kt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const c in r.data)i.push({key:s._parse(new Go(r,c,r.path,c)),value:o._parse(new Go(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?ii.mergeObjectAsync(n,i):ii.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof qt?new um({keyType:e,valueType:n,typeName:Tt.ZodRecord,...Ut(r)}):new um({keyType:qs.create(),valueType:e,typeName:Tt.ZodRecord,...Ut(n)})}}class Nx extends qt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.map)return ze(r,{code:je.invalid_type,expected:Ke.map,received:r.parsedType}),kt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([c,l],u)=>({key:i._parse(new Go(r,c,r.path,[u,"key"])),value:s._parse(new Go(r,l,r.path,[u,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return kt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(u.value,d.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return kt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(u.value,d.value)}return{status:n.value,value:c}}}}Nx.create=(t,e,n)=>new Nx({valueType:e,keyType:t,typeName:Tt.ZodMap,...Ut(n)});class yu extends qt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.set)return ze(r,{code:je.invalid_type,expected:Ke.set,received:r.parsedType}),kt;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(ze(r,{code:je.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return kt;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const c=[...r.data.values()].map((l,u)=>s._parse(new Go(r,l,r.path,u)));return r.common.async?Promise.all(c).then(l=>o(l)):o(c)}min(e,n){return new yu({...this._def,minSize:{value:e,message:lt.toString(n)}})}max(e,n){return new yu({...this._def,maxSize:{value:e,message:lt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}yu.create=(t,e)=>new yu({valueType:t,minSize:null,maxSize:null,typeName:Tt.ZodSet,...Ut(e)});class _d extends qt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ke.function)return ze(n,{code:je.invalid_type,expected:Ke.function,received:n.parsedType}),kt;function r(c,l){return _x({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cx(),Jd].filter(u=>!!u),issueData:{code:je.invalid_arguments,argumentsError:l}})}function i(c,l){return _x({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cx(),Jd].filter(u=>!!u),issueData:{code:je.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof ef){const c=this;return xi(async function(...l){const u=new ts([]),d=await c._def.args.parseAsync(l,s).catch(p=>{throw u.addIssue(r(l,p)),u}),f=await Reflect.apply(o,this,d);return await c._def.returns._def.type.parseAsync(f,s).catch(p=>{throw u.addIssue(i(f,p)),u})})}else{const c=this;return xi(function(...l){const u=c._def.args.safeParse(l,s);if(!u.success)throw new ts([r(l,u.error)]);const d=Reflect.apply(o,this,u.data),f=c._def.returns.safeParse(d,s);if(!f.success)throw new ts([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new _d({...this._def,args:Ko.create(e).rest(Xl.create())})}returns(e){return new _d({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new _d({args:e||Ko.create([]).rest(Xl.create()),returns:n||Xl.create(),typeName:Tt.ZodFunction,...Ut(r)})}}class dm extends qt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}dm.create=(t,e)=>new dm({getter:t,typeName:Tt.ZodLazy,...Ut(e)});class fm extends qt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ze(n,{received:n.data,code:je.invalid_literal,expected:this._def.value}),kt}return{status:"valid",value:e.data}}get value(){return this._def.value}}fm.create=(t,e)=>new fm({value:t,typeName:Tt.ZodLiteral,...Ut(e)});function b3(t,e){return new tl({values:t,typeName:Tt.ZodEnum,...Ut(e)})}class tl extends qt{constructor(){super(...arguments),Vh.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ze(n,{expected:tn.joinValues(r),received:n.parsedType,code:je.invalid_type}),kt}if(Ax(this,Vh)||g3(this,Vh,new Set(this._def.values)),!Ax(this,Vh).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return ze(n,{received:n.data,code:je.invalid_enum_value,options:r}),kt}return xi(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return tl.create(e,{...this._def,...n})}exclude(e,n=this._def){return tl.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Vh=new WeakMap;tl.create=b3;class hm extends qt{constructor(){super(...arguments),Gh.set(this,void 0)}_parse(e){const n=tn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ke.string&&r.parsedType!==Ke.number){const i=tn.objectValues(n);return ze(r,{expected:tn.joinValues(i),received:r.parsedType,code:je.invalid_type}),kt}if(Ax(this,Gh)||g3(this,Gh,new Set(tn.getValidEnumValues(this._def.values))),!Ax(this,Gh).has(e.data)){const i=tn.objectValues(n);return ze(r,{received:r.data,code:je.invalid_enum_value,options:i}),kt}return xi(e.data)}get enum(){return this._def.values}}Gh=new WeakMap;hm.create=(t,e)=>new hm({values:t,typeName:Tt.ZodNativeEnum,...Ut(e)});class ef extends qt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ke.promise&&n.common.async===!1)return ze(n,{code:je.invalid_type,expected:Ke.promise,received:n.parsedType}),kt;const r=n.parsedType===Ke.promise?n.data:Promise.resolve(n.data);return xi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ef.create=(t,e)=>new ef({type:t,typeName:Tt.ZodPromise,...Ut(e)});class fo extends qt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Tt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{ze(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return kt;const l=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return l.status==="aborted"?kt:l.status==="dirty"||n.value==="dirty"?cd(l.value):l});{if(n.value==="aborted")return kt;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?kt:c.status==="dirty"||n.value==="dirty"?cd(c.value):c}}if(i.type==="refinement"){const o=c=>{const l=i.refinement(c,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?kt:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?kt:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!rm(o))return o;const c=i.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>rm(o)?Promise.resolve(i.transform(o.value,s)).then(c=>({status:n.value,value:c})):o);tn.assertNever(i)}}fo.create=(t,e,n)=>new fo({schema:t,typeName:Tt.ZodEffects,effect:e,...Ut(n)});fo.createWithPreprocess=(t,e,n)=>new fo({schema:e,effect:{type:"preprocess",transform:t},typeName:Tt.ZodEffects,...Ut(n)});class Lo extends qt{_parse(e){return this._getType(e)===Ke.undefined?xi(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Lo.create=(t,e)=>new Lo({innerType:t,typeName:Tt.ZodOptional,...Ut(e)});class nl extends qt{_parse(e){return this._getType(e)===Ke.null?xi(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nl.create=(t,e)=>new nl({innerType:t,typeName:Tt.ZodNullable,...Ut(e)});class pm extends qt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ke.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pm.create=(t,e)=>new pm({innerType:t,typeName:Tt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ut(e)});class mm extends qt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return im(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ts(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ts(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}mm.create=(t,e)=>new mm({innerType:t,typeName:Tt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ut(e)});class Tx extends qt{_parse(e){if(this._getType(e)!==Ke.nan){const r=this._getOrReturnCtx(e);return ze(r,{code:je.invalid_type,expected:Ke.nan,received:r.parsedType}),kt}return{status:"valid",value:e.data}}}Tx.create=t=>new Tx({typeName:Tt.ZodNaN,...Ut(t)});const Xse=Symbol("zod_brand");class oT extends qt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class wg extends qt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?kt:s.status==="dirty"?(n.dirty(),cd(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?kt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new wg({in:e,out:n,typeName:Tt.ZodPipeline})}}class gm extends qt{_parse(e){const n=this._def.innerType._parse(e),r=i=>(rm(i)&&(i.value=Object.freeze(i.value)),i);return im(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}gm.create=(t,e)=>new gm({innerType:t,typeName:Tt.ZodReadonly,...Ut(e)});function w3(t,e={},n){return t?Zd.create().superRefine((r,i)=>{var s,o;if(!t(r)){const c=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(o=(s=c.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof c=="string"?{message:c}:c;i.addIssue({code:"custom",...u,fatal:l})}}):Zd.create()}const Jse={object:Kn.lazycreate};var Tt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Tt||(Tt={}));const Zse=(t,e={message:`Input not instance of ${t.name}`})=>w3(n=>n instanceof t,e),S3=qs.create,C3=Zc.create,eoe=Tx.create,toe=el.create,_3=sm.create,noe=vu.create,roe=jx.create,ioe=om.create,soe=am.create,ooe=Zd.create,aoe=Xl.create,coe=$a.create,loe=Ex.create,uoe=eo.create,doe=Kn.create,foe=Kn.strictCreate,hoe=cm.create,poe=K0.create,moe=lm.create,goe=Ko.create,voe=um.create,yoe=Nx.create,xoe=yu.create,boe=_d.create,woe=dm.create,Soe=fm.create,Coe=tl.create,_oe=hm.create,Aoe=ef.create,hR=fo.create,joe=Lo.create,Eoe=nl.create,Noe=fo.createWithPreprocess,Toe=wg.create,Poe=()=>S3().optional(),koe=()=>C3().optional(),Ooe=()=>_3().optional(),Ioe={string:t=>qs.create({...t,coerce:!0}),number:t=>Zc.create({...t,coerce:!0}),boolean:t=>sm.create({...t,coerce:!0}),bigint:t=>el.create({...t,coerce:!0}),date:t=>vu.create({...t,coerce:!0})},Roe=kt;var Ie=Object.freeze({__proto__:null,defaultErrorMap:Jd,setErrorMap:Rse,getErrorMap:Cx,makeIssue:_x,EMPTY_PATH:Mse,addIssueToContext:ze,ParseStatus:ii,INVALID:kt,DIRTY:cd,OK:xi,isAborted:g1,isDirty:v1,isValid:rm,isAsync:im,get util(){return tn},get objectUtil(){return m1},ZodParsedType:Ke,getParsedType:uc,ZodType:qt,datetimeRegex:x3,ZodString:qs,ZodNumber:Zc,ZodBigInt:el,ZodBoolean:sm,ZodDate:vu,ZodSymbol:jx,ZodUndefined:om,ZodNull:am,ZodAny:Zd,ZodUnknown:Xl,ZodNever:$a,ZodVoid:Ex,ZodArray:eo,ZodObject:Kn,ZodUnion:cm,ZodDiscriminatedUnion:K0,ZodIntersection:lm,ZodTuple:Ko,ZodRecord:um,ZodMap:Nx,ZodSet:yu,ZodFunction:_d,ZodLazy:dm,ZodLiteral:fm,ZodEnum:tl,ZodNativeEnum:hm,ZodPromise:ef,ZodEffects:fo,ZodTransformer:fo,ZodOptional:Lo,ZodNullable:nl,ZodDefault:pm,ZodCatch:mm,ZodNaN:Tx,BRAND:Xse,ZodBranded:oT,ZodPipeline:wg,ZodReadonly:gm,custom:w3,Schema:qt,ZodSchema:qt,late:Jse,get ZodFirstPartyTypeKind(){return Tt},coerce:Ioe,any:ooe,array:uoe,bigint:toe,boolean:_3,date:noe,discriminatedUnion:poe,effect:hR,enum:Coe,function:boe,instanceof:Zse,intersection:moe,lazy:woe,literal:Soe,map:yoe,nan:eoe,nativeEnum:_oe,never:coe,null:soe,nullable:Eoe,number:C3,object:doe,oboolean:Ooe,onumber:koe,optional:joe,ostring:Poe,pipeline:Toe,preprocess:Noe,promise:Aoe,record:voe,set:xoe,strictObject:foe,string:S3,symbol:roe,transformer:hR,tuple:goe,undefined:ioe,union:hoe,unknown:aoe,void:loe,NEVER:Roe,ZodIssueCode:je,quotelessJson:Ise,ZodError:ts});const ut=v.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));ut.displayName="Card";const ji=v.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",t),...e}));ji.displayName="CardHeader";const qi=v.forwardRef(({className:t,...e},n)=>a.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",t),...e}));qi.displayName="CardTitle";const aT=v.forwardRef(({className:t,...e},n)=>a.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));aT.displayName="CardDescription";const Rt=v.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("p-6 pt-0",t),...e}));Rt.displayName="CardContent";const cT=v.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",t),...e}));cT.displayName="CardFooter";const Wt=v.forwardRef(({className:t,type:e,...n},r)=>a.jsx("input",{type:e,className:Pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Wt.displayName="Input";const Moe=XN("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Hn({className:t,variant:e,...n}){return a.jsx("div",{className:Pe(Moe({variant:e}),t),...n})}function A3({onAssetsChange:t,onUploadComplete:e,onUploadError:n,onFilesChange:r,focusGroupId:i,disabled:s=!1,maxAssets:o=10,allowedTypes:c=["image/*","application/pdf","video/*"],label:l="Upload Assets",description:u="Upload creative assets for testing",maxFileSize:d=10,enableRenaming:f=!0}){const[h,p]=v.useState([]),[g,m]=v.useState([]),[y,b]=v.useState(null),[x,w]=v.useState(""),[S,C]=v.useState(!1),_=v.useRef(null),A=v.useRef(null);v.useEffect(()=>{i&&j()},[i]),v.useEffect(()=>{if(r){const F=h.map(ce=>ce.file);r(F)}},[h,r]);const j=async()=>{if(i)try{const ce=(await pt.getAssets(i)).data.assets||[];m(ce),t&&t(ce)}catch(F){console.error("Error fetching backend assets:",F)}},P=F=>{if(!c.some(pe=>{if(pe.includes("*")){const we=pe.split("/")[0];return F.type.startsWith(we+"/")}return F.type===pe}))return`File "${F.name}" is not a supported file type. Supported types: ${k().join(", ")}.`;const te=d*1024*1024;return F.size>te?`File "${F.name}" is too large. Maximum file size: ${d}MB.`:null},k=()=>{const F={"image/*":"Images","application/pdf":"PDF","video/*":"Videos","text/*":"Text files","application/msword":"Word docs","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"Word docs","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"Excel files"};return c.map(ce=>F[ce]||ce).filter((ce,te,pe)=>pe.indexOf(ce)===te)},O=async F=>{if(!F||F.length===0)return;if(h.length+g.length+F.length>o){se.error(`You can only upload up to ${o} assets`);return}const te=[],pe=[];if(Array.from(F).forEach(Y=>{const nt=P(Y);nt?pe.push(nt):te.push(Y)}),pe.length>0&&(pe.forEach(Y=>se.error(Y)),te.length===0))return;const we=te.map(Y=>{const nt=Y.type.startsWith("image/")?URL.createObjectURL(Y):void 0;return{id:`local-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:Y,previewUrl:nt,status:"uploading",progress:0}});p(Y=>[...Y,...we]);for(const Y of we){if(!i){p(Ue=>Ue.map(at=>at.id===Y.id?{...at,status:"uploaded",progress:100}:at));continue}const nt=Ue=>{p(at=>at.map(Be=>Be.id===Y.id?{...Be,progress:Ue}:Be))};try{nt(10);const Ue=new FormData;if(Ue.append("assets",Y.file),nt(50),(await pt.uploadAssets(i,Ue,!1)).data.uploaded_assets>0)nt(100),setTimeout(()=>{p(Bt=>Bt.filter(N=>N.id!==Y.id))},500),await j(),se.success(`${Y.file.name} uploaded successfully`);else throw new Error("Upload failed")}catch(Ue){console.error(`Upload failed for ${Y.file.name}:`,Ue),p(at=>at.map(Be=>{var Bt,N;return Be.id===Y.id?{...Be,status:"failed",progress:0,error:((N=(Bt=Ue.response)==null?void 0:Bt.data)==null?void 0:N.error)||"Upload failed"}:Be})),n&&n(Ue)}}e&&setTimeout(()=>{e(g)},500)},E=async F=>{if(i)try{await pt.deleteAsset(i,F),await j(),se.info("Asset removed")}catch(ce){console.error("Error removing asset:",ce),se.error("Failed to remove asset")}},R=F=>{const ce=h.find(te=>te.id===F);ce!=null&&ce.previewUrl&&URL.revokeObjectURL(ce.previewUrl),p(te=>te.filter(pe=>pe.id!==F))},M=F=>{F.preventDefault(),F.stopPropagation(),C(!0)},G=F=>{var ce;F.preventDefault(),F.stopPropagation(),(ce=A.current)!=null&&ce.contains(F.relatedTarget)||C(!1)},L=F=>{F.preventDefault(),F.stopPropagation()},V=F=>{if(F.preventDefault(),F.stopPropagation(),C(!1),s)return;const ce=F.dataTransfer.files;ce.length>0&&O(ce)},I=()=>{h.length===0&&g.length===0||(h.forEach(F=>{F.previewUrl&&URL.revokeObjectURL(F.previewUrl)}),p([]),i&&g.length>0?Promise.all(g.map(F=>pt.deleteAsset(i,F.filename).catch(console.error))).then(()=>{m([]),t&&t([]),se.info("All assets cleared")}):(m([]),t&&t([])))},D=async F=>{if(i){p(ce=>ce.map(te=>te.id===F.id?{...te,status:"uploading",error:void 0,progress:0}:te));try{const ce=new FormData;if(ce.append("assets",F.file),p(we=>we.map(Y=>Y.id===F.id?{...Y,progress:50}:Y)),(await pt.uploadAssets(i,ce,!1)).data.uploaded_assets>0)p(we=>we.map(Y=>Y.id===F.id?{...Y,progress:100}:Y)),setTimeout(()=>{p(we=>we.filter(Y=>Y.id!==F.id))},500),await j(),se.success(`${F.file.name} uploaded successfully`);else throw new Error("Upload failed")}catch(ce){p(te=>te.map(pe=>{var we,Y;return pe.id===F.id?{...pe,status:"failed",progress:0,error:((Y=(we=ce.response)==null?void 0:we.data)==null?void 0:Y.error)||"Upload failed"}:pe})),se.error(`Failed to upload ${F.file.name}`)}}},X=F=>{b(F.filename),w(F.user_assigned_name||"")},Q=async F=>{if(!i||!x.trim()){J();return}try{await pt.updateAssetName(i,F,x.trim()),m(ce=>ce.map(te=>te.filename===F?{...te,user_assigned_name:x.trim()}:te)),t&&t(g),b(null),w(""),se.success("Asset name updated")}catch(ce){console.error("Error updating asset name:",ce),se.error("Failed to update asset name")}},J=()=>{b(null),w("")},ye=F=>F.startsWith("image/")?a.jsx(op,{className:"h-8 w-8 text-slate-400"}):F.startsWith("video/")?a.jsx(QJ,{className:"h-8 w-8 text-slate-400"}):F==="application/pdf"?a.jsx(Wp,{className:"h-8 w-8 text-slate-400"}):a.jsx(Wp,{className:"h-8 w-8 text-slate-400"}),U=(F,ce)=>F.user_assigned_name||`Asset ${ce+1}`,ne=h.length+g.length,ue=o-ne;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("h3",{className:"text-lg font-semibold text-foreground",children:l}),a.jsx("p",{className:"text-muted-foreground mt-1",children:u})]}),a.jsx("div",{ref:A,className:`relative border-2 border-dashed rounded-xl p-8 transition-all duration-200 ${s?"border-muted-foreground/20 bg-muted/30 cursor-not-allowed":S?"border-primary bg-primary/5 scale-[1.02]":"border-muted-foreground/30 bg-background hover:border-primary/50 hover:bg-muted/50 cursor-pointer"}`,onDragEnter:M,onDragLeave:G,onDragOver:L,onDrop:V,onClick:()=>{var F;return!s&&((F=_.current)==null?void 0:F.click())},children:a.jsxs("div",{className:"flex flex-col items-center justify-center text-center",children:[a.jsx(qJ,{className:`h-12 w-12 mb-4 ${s?"text-muted-foreground/40":S?"text-primary":"text-muted-foreground"}`}),s?a.jsxs("div",{children:[a.jsx("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:"File Upload Disabled"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete the required details above to enable file uploads"})]}):a.jsxs("div",{children:[a.jsx("p",{className:"text-lg font-medium text-foreground mb-2",children:S?"Drop files here":"Drag and drop files here, or click to browse"}),a.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-4",children:k().map((F,ce)=>a.jsx(Hn,{variant:"secondary",className:"text-xs",children:F},ce))}),a.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Maximum file size: ",d,"MB"]}),a.jsx("input",{ref:_,type:"file",accept:c.join(","),multiple:!0,onChange:F=>O(F.target.files),className:"hidden",disabled:s}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3",children:[a.jsxs(ee,{type:"button",variant:"default",size:"sm",disabled:s||ue<=0,onClick:F=>{var ce;F.stopPropagation(),(ce=_.current)==null||ce.click()},children:[a.jsx(gZ,{className:"mr-2 h-4 w-4"}),"Select Files"]}),(h.length>0||g.length>0)&&a.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),I()},children:[a.jsx(qn,{className:"mr-2 h-4 w-4"}),"Clear All"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:[ue," of ",o," uploads remaining"]})]})]})})]}),(g.length>0||h.length>0)&&a.jsxs(ut,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h4",{className:"text-lg font-semibold text-foreground",children:["Uploaded Files (",h.length+g.length,")"]}),(h.length>0||g.length>0)&&a.jsxs(ee,{type:"button",variant:"ghost",size:"sm",onClick:I,className:"text-muted-foreground hover:text-destructive",children:[a.jsx(qn,{className:"mr-2 h-4 w-4"}),"Clear All"]})]}),a.jsxs("div",{className:"space-y-3",children:[g.map((F,ce)=>{var te;return a.jsxs("div",{className:"flex items-center gap-4 p-4 border rounded-lg bg-card shadow-sm",children:[a.jsx("div",{className:"w-12 h-12 bg-muted/50 rounded-md flex items-center justify-center flex-shrink-0",children:(te=F.mime_type)!=null&&te.startsWith("image/")?a.jsx("img",{src:pt.getAssetUrl(i,F.filename),alt:U(F,ce),className:"max-h-full max-w-full object-contain rounded-md"}):ye(F.mime_type)}),a.jsx("div",{className:"flex-grow min-w-0",children:f&&y===F.filename?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Wt,{value:x,onChange:pe=>w(pe.target.value),placeholder:`Asset ${ce+1}`,className:"flex-1",autoFocus:!0,onKeyDown:pe=>{pe.key==="Enter"?(pe.preventDefault(),Q(F.filename)):pe.key==="Escape"&&J()}}),a.jsx(ee,{size:"sm",variant:"outline",type:"button",onClick:()=>Q(F.filename),children:a.jsx(Es,{className:"h-4 w-4"})}),a.jsx(ee,{size:"sm",variant:"outline",type:"button",onClick:J,children:a.jsx(Ri,{className:"h-4 w-4"})})]}):a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"font-medium text-sm truncate",children:U(F,ce)}),f&&a.jsx(ee,{size:"sm",variant:"ghost",type:"button",onClick:()=>X(F),className:"h-6 w-6 p-0",children:a.jsx(V_,{className:"h-3 w-3"})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["Original: ",F.original_name]}),a.jsx(Hn,{variant:"outline",className:"text-xs text-green-600 bg-green-50 border-green-200",children:"Complete"})]})]})}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f&&a.jsxs("div",{className:"text-right mr-2",children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Will appear as:"}),a.jsxs("div",{className:"text-sm font-medium text-primary",children:['"',U(F,ce),'"']})]}),a.jsx(ee,{size:"sm",variant:"ghost",type:"button",onClick:()=>E(F.filename),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:a.jsx(Ri,{className:"h-4 w-4"})})]})]},F.filename)}),h.map(F=>a.jsxs("div",{className:"flex items-center gap-4 p-4 border rounded-lg bg-muted/30",children:[a.jsx("div",{className:"w-12 h-12 bg-muted/50 rounded-md flex items-center justify-center flex-shrink-0",children:F.previewUrl?a.jsx("img",{src:F.previewUrl,alt:F.file.name,className:"max-h-full max-w-full object-contain rounded-md"}):ye(F.file.type)}),a.jsxs("div",{className:"flex-grow min-w-0",children:[a.jsx("p",{className:"font-medium text-sm truncate",children:F.file.name}),a.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[(F.file.size/1024/1024).toFixed(2)," MB"]}),F.status==="uploading"&&a.jsxs("div",{className:"space-y-1",children:[a.jsx(wc,{value:F.progress||0,className:"h-2"}),a.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground",children:[a.jsx("span",{children:"Uploading..."}),a.jsxs("span",{children:[F.progress||0,"%"]})]})]}),F.error&&a.jsx("p",{className:"text-xs text-destructive truncate mt-1",children:F.error})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[F.status==="uploading"&&a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(Hn,{variant:"outline",className:"text-xs text-blue-600 bg-blue-50 border-blue-200",children:[a.jsx(Js,{className:"h-3 w-3 mr-1 animate-spin"}),"Uploading"]})}),F.status==="uploaded"&&a.jsxs(Hn,{variant:"outline",className:"text-xs text-green-600 bg-green-50 border-green-200",children:[a.jsx(Es,{className:"h-3 w-3 mr-1"}),"Complete"]}),F.status==="failed"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Hn,{variant:"outline",className:"text-xs text-destructive bg-destructive/10 border-destructive/20",children:"Failed"}),a.jsxs(ee,{size:"sm",variant:"outline",type:"button",onClick:()=>D(F),className:"h-7 text-xs",children:[a.jsx(Yl,{className:"h-3 w-3 mr-1"}),"Retry"]})]}),a.jsx(ee,{size:"sm",variant:"ghost",type:"button",onClick:()=>R(F.id),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:a.jsx(Ri,{className:"h-4 w-4"})})]})]},F.id))]}),f&&g.length>0&&a.jsx("div",{className:"mt-6 p-4 bg-primary/5 border border-primary/20 rounded-lg",children:a.jsxs("p",{className:"text-sm text-foreground",children:[a.jsx("strong",{children:"Asset Names:"})," Click the edit icon to customize how assets will be referenced in the discussion guide. Leave blank to use default numbering."]})})]})]})}var Doe="Label",j3=v.forwardRef((t,e)=>a.jsx(it.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));j3.displayName=Doe;var E3=j3;const $oe=XN("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),hs=v.forwardRef(({className:t,...e},n)=>a.jsx(E3,{ref:n,className:Pe($oe(),t),...e}));hs.displayName=E3.displayName;const W0=pse,N3=v.createContext({}),_t=({...t})=>a.jsx(N3.Provider,{value:{name:t.name},children:a.jsx(yse,{...t})}),q0=()=>{const t=v.useContext(N3),e=v.useContext(T3),{getFieldState:n,formState:r}=z0(),i=n(t.name,r);if(!t)throw new Error("useFormField should be used within ");const{id:s}=e;return{id:s,name:t.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},T3=v.createContext({}),gt=v.forwardRef(({className:t,...e},n)=>{const r=v.useId();return a.jsx(T3.Provider,{value:{id:r},children:a.jsx("div",{ref:n,className:Pe("space-y-2",t),...e})})});gt.displayName="FormItem";const vt=v.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:i}=q0();return a.jsx(hs,{ref:n,className:Pe(r&&"text-destructive",t),htmlFor:i,...e})});vt.displayName="FormLabel";const yt=v.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:s}=q0();return a.jsx(Ho,{ref:e,id:r,"aria-describedby":n?`${i} ${s}`:`${i}`,"aria-invalid":!!n,...t})});yt.displayName="FormControl";const Fn=v.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=q0();return a.jsx("p",{ref:n,id:r,className:Pe("text-sm text-muted-foreground",t),...e})});Fn.displayName="FormDescription";const xt=v.forwardRef(({className:t,children:e,...n},r)=>{const{error:i,formMessageId:s}=q0(),o=i?String(i==null?void 0:i.message):e;return o?a.jsx("p",{ref:r,id:s,className:Pe("text-sm font-medium text-destructive",t),...n,children:o}):null});xt.displayName="FormMessage";const ht=v.forwardRef(({className:t,...e},n)=>a.jsx("textarea",{className:Pe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));ht.displayName="Textarea";function vm(t,[e,n]){return Math.min(n,Math.max(e,t))}function Loe(t,e=[]){let n=[];function r(s,o){const c=v.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,y=v.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>v.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,Foe(i,...e)]}function Foe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Y0(t){const e=t+"CollectionProvider",[n,r]=Loe(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:m}=p,y=T.useRef(null),b=T.useRef(new Map).current;return a.jsx(i,{scope:g,itemMap:b,collectionRef:y,children:m})};o.displayName=e;const c=t+"CollectionSlot",l=T.forwardRef((p,g)=>{const{scope:m,children:y}=p,b=s(c,m),x=Ot(g,b.collectionRef);return a.jsx(Ho,{ref:x,children:y})});l.displayName=c;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=T.forwardRef((p,g)=>{const{scope:m,children:y,...b}=p,x=T.useRef(null),w=Ot(g,x),S=s(u,m);return T.useEffect(()=>(S.itemMap.set(x,{ref:x,...b}),()=>void S.itemMap.delete(x))),a.jsx(Ho,{[d]:"",ref:w,children:y})});f.displayName=u;function h(p){const g=s(t+"CollectionConsumer",p);return T.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((S,C)=>b.indexOf(S.ref.current)-b.indexOf(C.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:f},h,r]}var Uoe=v.createContext(void 0);function Pu(t){const e=v.useContext(Uoe);return t||e||"ltr"}var qS=0;function lT(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??pR()),document.body.insertAdjacentElement("beforeend",t[1]??pR()),qS++,()=>{qS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),qS--}},[])}function pR(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var YS="focusScope.autoFocusOnMount",QS="focusScope.autoFocusOnUnmount",mR={bubbles:!1,cancelable:!0},Boe="FocusScope",Q0=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[c,l]=v.useState(null),u=Cr(i),d=Cr(s),f=v.useRef(null),h=Ot(e,m=>l(m)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(p.paused||!c)return;const S=w.target;c.contains(S)?f.current=S:ec(f.current,{select:!0})},y=function(w){if(p.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||ec(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&ec(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(b);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,p.paused]),v.useEffect(()=>{if(c){vR.add(p);const m=document.activeElement;if(!c.contains(m)){const b=new CustomEvent(YS,mR);c.addEventListener(YS,u),c.dispatchEvent(b),b.defaultPrevented||(Hoe(Woe(P3(c)),{select:!0}),document.activeElement===m&&ec(c))}return()=>{c.removeEventListener(YS,u),setTimeout(()=>{const b=new CustomEvent(QS,mR);c.addEventListener(QS,d),c.dispatchEvent(b),b.defaultPrevented||ec(m??document.body,{select:!0}),c.removeEventListener(QS,d),vR.remove(p)},0)}}},[c,u,d,p]);const g=v.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(y&&b){const x=m.currentTarget,[w,S]=zoe(x);w&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&ec(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&ec(S,{select:!0})):b===x&&m.preventDefault()}},[n,r,p.paused]);return a.jsx(it.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});Q0.displayName=Boe;function Hoe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ec(r,{select:e}),document.activeElement!==n)return}function zoe(t){const e=P3(t),n=gR(e,t),r=gR(e.reverse(),t);return[n,r]}function P3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function gR(t,e){for(const n of t)if(!Voe(n,{upTo:e}))return n}function Voe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Goe(t){return t instanceof HTMLInputElement&&"select"in t}function ec(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Goe(t)&&e&&t.select()}}var vR=Koe();function Koe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=yR(t,e),t.unshift(e)},remove(e){var n;t=yR(t,e),(n=t[0])==null||n.resume()}}}function yR(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Woe(t){return t.filter(e=>e.tagName!=="A")}function Sg(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var qoe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Uu=new WeakMap,yv=new WeakMap,xv={},XS=0,k3=function(t){return t&&(t.host||k3(t.parentNode))},Yoe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=k3(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Qoe=function(t,e,n,r){var i=Yoe(e,Array.isArray(t)?t:[t]);xv[n]||(xv[n]=new WeakMap);var s=xv[n],o=[],c=new Set,l=new Set(i),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};i.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(c.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",m=(Uu.get(h)||0)+1,y=(s.get(h)||0)+1;Uu.set(h,m),s.set(h,y),o.push(h),m===1&&g&&yv.set(h,!0),y===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return d(e),c.clear(),XS++,function(){o.forEach(function(f){var h=Uu.get(f)-1,p=s.get(f)-1;Uu.set(f,h),s.set(f,p),h||(yv.has(f)||f.removeAttribute(r),yv.delete(f)),p||f.removeAttribute(n)}),XS--,XS||(Uu=new WeakMap,Uu=new WeakMap,yv=new WeakMap,xv={})}},uT=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=qoe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Qoe(r,i,n,"aria-hidden")):function(){return null}},ko=function(){return ko=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return hae;var e=pae(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},gae=M3(),Ad="data-scroll-locked",vae=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,c=t.gap;return n===void 0&&(n="margin"),` + .`.concat(Joe,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(c,"px ").concat(r,`; + } + body[`).concat(Ad,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(o,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(c,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(oy,` { + right: `).concat(c,"px ").concat(r,`; + } + + .`).concat(ay,` { + margin-right: `).concat(c,"px ").concat(r,`; + } + + .`).concat(oy," .").concat(oy,` { + right: 0 `).concat(r,`; + } + + .`).concat(ay," .").concat(ay,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Ad,`] { + `).concat(Zoe,": ").concat(c,`px; + } +`)},bR=function(){var t=parseInt(document.body.getAttribute(Ad)||"0",10);return isFinite(t)?t:0},yae=function(){v.useEffect(function(){return document.body.setAttribute(Ad,(bR()+1).toString()),function(){var t=bR()-1;t<=0?document.body.removeAttribute(Ad):document.body.setAttribute(Ad,t.toString())}},[])},xae=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;yae();var s=v.useMemo(function(){return mae(i)},[i]);return v.createElement(gae,{styles:vae(s,!e,i,n?"":"!important")})},x1=!1;if(typeof window<"u")try{var bv=Object.defineProperty({},"passive",{get:function(){return x1=!0,!0}});window.addEventListener("test",bv,bv),window.removeEventListener("test",bv,bv)}catch{x1=!1}var Bu=x1?{passive:!1}:!1,bae=function(t){return t.tagName==="TEXTAREA"},D3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!bae(t)&&n[e]==="visible")},wae=function(t){return D3(t,"overflowY")},Sae=function(t){return D3(t,"overflowX")},wR=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=$3(t,r);if(i){var s=L3(t,r),o=s[1],c=s[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cae=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},_ae=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},$3=function(t,e){return t==="v"?wae(e):Sae(e)},L3=function(t,e){return t==="v"?Cae(e):_ae(e)},Aae=function(t,e){return t==="h"&&e==="rtl"?-1:1},jae=function(t,e,n,r,i){var s=Aae(t,window.getComputedStyle(e).direction),o=s*r,c=n.target,l=e.contains(c),u=!1,d=o>0,f=0,h=0;do{var p=L3(t,c),g=p[0],m=p[1],y=p[2],b=m-y-s*g;(g||b)&&$3(t,c)&&(f+=b,h+=g),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!l&&c!==document.body||l&&(e.contains(c)||e===c));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(h)<1||!i))&&(u=!0),u},wv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},SR=function(t){return[t.deltaX,t.deltaY]},CR=function(t){return t&&"current"in t?t.current:t},Eae=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Nae=function(t){return` + .block-interactivity-`.concat(t,` {pointer-events: none;} + .allow-interactivity-`).concat(t,` {pointer-events: all;} +`)},Tae=0,Hu=[];function Pae(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Tae++)[0],s=v.useState(M3)[0],o=v.useRef(t);v.useEffect(function(){o.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=Xoe([t.lockRef.current],(t.shards||[]).map(CR),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var c=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var b=wv(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-b[0],S="deltaY"in m?m.deltaY:x[1]-b[1],C,_=m.target,A=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&A==="h"&&_.type==="range")return!1;var j=wR(A,_);if(!j)return!0;if(j?C=A:(C=A==="v"?"h":"v",j=wR(A,_)),!j)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=C),!C)return!0;var P=r.current||C;return jae(P,y,m,P==="h"?w:S,!0)},[]),l=v.useCallback(function(m){var y=m;if(!(!Hu.length||Hu[Hu.length-1]!==s)){var b="deltaY"in y?SR(y):wv(y),x=e.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&Eae(C.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(CR).filter(Boolean).filter(function(C){return C.contains(y.target)}),S=w.length>0?c(y,w[0]):!o.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=v.useCallback(function(m,y,b,x){var w={name:m,delta:y,target:b,should:x,shadowParent:kae(b)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(m){n.current=wv(m),r.current=void 0},[]),f=v.useCallback(function(m){u(m.type,SR(m),m.target,c(m,t.lockRef.current))},[]),h=v.useCallback(function(m){u(m.type,wv(m),m.target,c(m,t.lockRef.current))},[]);v.useEffect(function(){return Hu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Bu),document.addEventListener("touchmove",l,Bu),document.addEventListener("touchstart",d,Bu),function(){Hu=Hu.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Bu),document.removeEventListener("touchmove",l,Bu),document.removeEventListener("touchstart",d,Bu)}},[]);var p=t.removeScrollBar,g=t.inert;return v.createElement(v.Fragment,null,g?v.createElement(s,{styles:Nae(i)}):null,p?v.createElement(xae,{gapMode:t.gapMode}):null)}function kae(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Oae=oae(R3,Pae);var J0=v.forwardRef(function(t,e){return v.createElement(X0,ko({},t,{ref:e,sideCar:Oae}))});J0.classNames=X0.classNames;var Iae=[" ","Enter","ArrowUp","ArrowDown"],Rae=[" ","Enter"],Cg="Select",[Z0,ew,Mae]=Y0(Cg),[Gf,lFe]=Fi(Cg,[Mae,Mf]),tw=Mf(),[Dae,ul]=Gf(Cg),[$ae,Lae]=Gf(Cg),F3=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:g}=t,m=tw(e),[y,b]=v.useState(null),[x,w]=v.useState(null),[S,C]=v.useState(!1),_=Pu(u),[A=!1,j]=ao({prop:r,defaultProp:i,onChange:s}),[P,k]=ao({prop:o,defaultProp:c,onChange:l}),O=v.useRef(null),E=y?g||!!y.closest("form"):!0,[R,M]=v.useState(new Set),G=Array.from(R).map(L=>L.props.value).join(";");return a.jsx(P4,{...m,children:a.jsxs(Dae,{required:p,scope:e,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Xs(),value:P,onValueChange:k,open:A,onOpenChange:j,dir:_,triggerPointerDownPosRef:O,disabled:h,children:[a.jsx(Z0.Provider,{scope:e,children:a.jsx($ae,{scope:t.__scopeSelect,onNativeOptionAdd:v.useCallback(L=>{M(V=>new Set(V).add(L))},[]),onNativeOptionRemove:v.useCallback(L=>{M(V=>{const I=new Set(V);return I.delete(L),I})},[]),children:n})}),E?a.jsxs(u6,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:P,onChange:L=>k(L.target.value),disabled:h,form:g,children:[P===void 0?a.jsx("option",{value:""}):null,Array.from(R)]},G):null]})})};F3.displayName=Cg;var U3="SelectTrigger",B3=v.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,s=tw(n),o=ul(U3,n),c=o.disabled||r,l=Ot(e,o.onTriggerChange),u=ew(n),d=v.useRef("touch"),[f,h,p]=d6(m=>{const y=u().filter(w=>!w.disabled),b=y.find(w=>w.value===o.value),x=f6(y,m,b);x!==void 0&&o.onValueChange(x.value)}),g=m=>{c||(o.onOpenChange(!0),p()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return a.jsx(bE,{asChild:!0,...s,children:a.jsx(it.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":l6(o.value)?"":void 0,...i,ref:l,onClick:Ne(i.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:Ne(i.onPointerDown,m=>{d.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:Ne(i.onKeyDown,m=>{const y=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(y&&m.key===" ")&&Iae.includes(m.key)&&(g(),m.preventDefault())})})})});B3.displayName=U3;var H3="SelectValue",z3=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:o="",...c}=t,l=ul(H3,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,f=Ot(e,l.onValueNodeChange);return Gr(()=>{u(d)},[u,d]),a.jsx(it.span,{...c,ref:f,style:{pointerEvents:"none"},children:l6(l.value)?a.jsx(a.Fragment,{children:o}):s})});z3.displayName=H3;var Fae="SelectIcon",V3=v.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return a.jsx(it.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});V3.displayName=Fae;var Uae="SelectPortal",G3=t=>a.jsx(f0,{asChild:!0,...t});G3.displayName=Uae;var xu="SelectContent",K3=v.forwardRef((t,e)=>{const n=ul(xu,t.__scopeSelect),[r,i]=v.useState();if(Gr(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?Of.createPortal(a.jsx(W3,{scope:t.__scopeSelect,children:a.jsx(Z0.Slot,{scope:t.__scopeSelect,children:a.jsx("div",{children:t.children})})}),s):null}return a.jsx(q3,{...t,ref:e})});K3.displayName=xu;var Ds=10,[W3,dl]=Gf(xu),Bae="SelectContentImpl",q3=v.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y,...b}=t,x=ul(xu,n),[w,S]=v.useState(null),[C,_]=v.useState(null),A=Ot(e,F=>S(F)),[j,P]=v.useState(null),[k,O]=v.useState(null),E=ew(n),[R,M]=v.useState(!1),G=v.useRef(!1);v.useEffect(()=>{if(w)return uT(w)},[w]),lT();const L=v.useCallback(F=>{const[ce,...te]=E().map(Y=>Y.ref.current),[pe]=te.slice(-1),we=document.activeElement;for(const Y of F)if(Y===we||(Y==null||Y.scrollIntoView({block:"nearest"}),Y===ce&&C&&(C.scrollTop=0),Y===pe&&C&&(C.scrollTop=C.scrollHeight),Y==null||Y.focus(),document.activeElement!==we))return},[E,C]),V=v.useCallback(()=>L([j,w]),[L,j,w]);v.useEffect(()=>{R&&V()},[R,V]);const{onOpenChange:I,triggerPointerDownPosRef:D}=x;v.useEffect(()=>{if(w){let F={x:0,y:0};const ce=pe=>{var we,Y;F={x:Math.abs(Math.round(pe.pageX)-(((we=D.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((Y=D.current)==null?void 0:Y.y)??0))}},te=pe=>{F.x<=10&&F.y<=10?pe.preventDefault():w.contains(pe.target)||I(!1),document.removeEventListener("pointermove",ce),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",te,{capture:!0})}}},[w,I,D]),v.useEffect(()=>{const F=()=>I(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[I]);const[X,Q]=d6(F=>{const ce=E().filter(we=>!we.disabled),te=ce.find(we=>we.ref.current===document.activeElement),pe=f6(ce,F,te);pe&&setTimeout(()=>pe.ref.current.focus())}),J=v.useCallback((F,ce,te)=>{const pe=!G.current&&!te;(x.value!==void 0&&x.value===ce||pe)&&(P(F),pe&&(G.current=!0))},[x.value]),ye=v.useCallback(()=>w==null?void 0:w.focus(),[w]),U=v.useCallback((F,ce,te)=>{const pe=!G.current&&!te;(x.value!==void 0&&x.value===ce||pe)&&O(F)},[x.value]),ne=r==="popper"?b1:Y3,ue=ne===b1?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y}:{};return a.jsx(W3,{scope:n,content:w,viewport:C,onViewportChange:_,itemRefCallback:J,selectedItem:j,onItemLeave:ye,itemTextRefCallback:U,focusSelectedItem:V,selectedItemText:k,position:r,isPositioned:R,searchRef:X,children:a.jsx(J0,{as:Ho,allowPinchZoom:!0,children:a.jsx(Q0,{asChild:!0,trapped:x.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:Ne(i,F=>{var ce;(ce=x.trigger)==null||ce.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(fg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:a.jsx(ne,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:F=>F.preventDefault(),...b,...ue,onPlaced:()=>M(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ne(b.onKeyDown,F=>{const ce=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!ce&&F.key.length===1&&Q(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let pe=E().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(F.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const we=F.target,Y=pe.indexOf(we);pe=pe.slice(Y+1)}setTimeout(()=>L(pe)),F.preventDefault()}})})})})})})});q3.displayName=Bae;var Hae="SelectItemAlignedPosition",Y3=v.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,s=ul(xu,n),o=dl(xu,n),[c,l]=v.useState(null),[u,d]=v.useState(null),f=Ot(e,A=>d(A)),h=ew(n),p=v.useRef(!1),g=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,w=v.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&m&&y&&b){const A=s.trigger.getBoundingClientRect(),j=u.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),k=b.getBoundingClientRect();if(s.dir!=="rtl"){const we=k.left-j.left,Y=P.left-we,nt=A.left-Y,Ue=A.width+nt,at=Math.max(Ue,j.width),Be=window.innerWidth-Ds,Bt=vm(Y,[Ds,Math.max(Ds,Be-at)]);c.style.minWidth=Ue+"px",c.style.left=Bt+"px"}else{const we=j.right-k.right,Y=window.innerWidth-P.right-we,nt=window.innerWidth-A.right-Y,Ue=A.width+nt,at=Math.max(Ue,j.width),Be=window.innerWidth-Ds,Bt=vm(Y,[Ds,Math.max(Ds,Be-at)]);c.style.minWidth=Ue+"px",c.style.right=Bt+"px"}const O=h(),E=window.innerHeight-Ds*2,R=m.scrollHeight,M=window.getComputedStyle(u),G=parseInt(M.borderTopWidth,10),L=parseInt(M.paddingTop,10),V=parseInt(M.borderBottomWidth,10),I=parseInt(M.paddingBottom,10),D=G+L+R+I+V,X=Math.min(y.offsetHeight*5,D),Q=window.getComputedStyle(m),J=parseInt(Q.paddingTop,10),ye=parseInt(Q.paddingBottom,10),U=A.top+A.height/2-Ds,ne=E-U,ue=y.offsetHeight/2,F=y.offsetTop+ue,ce=G+L+F,te=D-ce;if(ce<=U){const we=O.length>0&&y===O[O.length-1].ref.current;c.style.bottom="0px";const Y=u.clientHeight-m.offsetTop-m.offsetHeight,nt=Math.max(ne,ue+(we?ye:0)+Y+V),Ue=ce+nt;c.style.height=Ue+"px"}else{const we=O.length>0&&y===O[0].ref.current;c.style.top="0px";const nt=Math.max(U,G+m.offsetTop+(we?J:0)+ue)+te;c.style.height=nt+"px",m.scrollTop=ce-U+m.offsetTop}c.style.margin=`${Ds}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=E+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,c,u,m,y,b,s.dir,r]);Gr(()=>w(),[w]);const[S,C]=v.useState();Gr(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const _=v.useCallback(A=>{A&&g.current===!0&&(w(),x==null||x(),g.current=!1)},[w,x]);return a.jsx(Vae,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:_,children:a.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:a.jsx(it.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Y3.displayName=Hae;var zae="SelectPopperPosition",b1=v.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ds,...s}=t,o=tw(n);return a.jsx(wE,{...o,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});b1.displayName=zae;var[Vae,dT]=Gf(xu,{}),w1="SelectViewport",Q3=v.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,s=dl(w1,n),o=dT(w1,n),c=Ot(e,s.onViewportChange),l=v.useRef(0);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(Z0.Slot,{scope:n,children:a.jsx(it.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ne(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const p=Math.abs(l.current-d.scrollTop);if(p>0){const g=window.innerHeight-Ds*2,m=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),b=Math.max(m,y);if(b0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Q3.displayName=w1;var X3="SelectGroup",[Gae,Kae]=Gf(X3),Wae=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Xs();return a.jsx(Gae,{scope:n,id:i,children:a.jsx(it.div,{role:"group","aria-labelledby":i,...r,ref:e})})});Wae.displayName=X3;var J3="SelectLabel",Z3=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Kae(J3,n);return a.jsx(it.div,{id:i.id,...r,ref:e})});Z3.displayName=J3;var Px="SelectItem",[qae,e6]=Gf(Px),t6=v.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...o}=t,c=ul(Px,n),l=dl(Px,n),u=c.value===r,[d,f]=v.useState(s??""),[h,p]=v.useState(!1),g=Ot(e,x=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,x,r,i)}),m=Xs(),y=v.useRef("touch"),b=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A 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 a.jsx(qae,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:v.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:a.jsx(Z0.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:a.jsx(it.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:Ne(o.onFocus,()=>p(!0)),onBlur:Ne(o.onBlur,()=>p(!1)),onClick:Ne(o.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:Ne(o.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:Ne(o.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:Ne(o.onPointerMove,x=>{var w;y.current=x.pointerType,i?(w=l.onItemLeave)==null||w.call(l):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ne(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:Ne(o.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(Rae.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});t6.displayName=Px;var Kh="SelectItemText",n6=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...s}=t,o=ul(Kh,n),c=dl(Kh,n),l=e6(Kh,n),u=Lae(Kh,n),[d,f]=v.useState(null),h=Ot(e,b=>f(b),l.onItemTextChange,b=>{var x;return(x=c.itemTextRefCallback)==null?void 0:x.call(c,b,l.value,l.disabled)}),p=d==null?void 0:d.textContent,g=v.useMemo(()=>a.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=u;return Gr(()=>(m(g),()=>y(g)),[m,y,g]),a.jsxs(a.Fragment,{children:[a.jsx(it.span,{id:l.textId,...s,ref:h}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Of.createPortal(s.children,o.valueNode):null]})});n6.displayName=Kh;var r6="SelectItemIndicator",i6=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return e6(r6,n).isSelected?a.jsx(it.span,{"aria-hidden":!0,...r,ref:e}):null});i6.displayName=r6;var S1="SelectScrollUpButton",s6=v.forwardRef((t,e)=>{const n=dl(S1,t.__scopeSelect),r=dT(S1,t.__scopeSelect),[i,s]=v.useState(!1),o=Ot(e,r.onScrollButtonChange);return Gr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?a.jsx(a6,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});s6.displayName=S1;var C1="SelectScrollDownButton",o6=v.forwardRef((t,e)=>{const n=dl(C1,t.__scopeSelect),r=dT(C1,t.__scopeSelect),[i,s]=v.useState(!1),o=Ot(e,r.onScrollButtonChange);return Gr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?a.jsx(a6,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});o6.displayName=C1;var a6=v.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,s=dl("SelectScrollButton",n),o=v.useRef(null),c=ew(n),l=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>l(),[l]),Gr(()=>{var d;const u=c().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),a.jsx(it.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Ne(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ne(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ne(i.onPointerLeave,()=>{l()})})}),Yae="SelectSeparator",c6=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return a.jsx(it.div,{"aria-hidden":!0,...r,ref:e})});c6.displayName=Yae;var _1="SelectArrow",Qae=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=tw(n),s=ul(_1,n),o=dl(_1,n);return s.open&&o.position==="popper"?a.jsx(SE,{...i,...r,ref:e}):null});Qae.displayName=_1;function l6(t){return t===""||t===void 0}var u6=v.forwardRef((t,e)=>{const{value:n,...r}=t,i=v.useRef(null),s=Ot(e,i),o=Sg(n);return v.useEffect(()=>{const c=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==n&&d){const f=new Event("change",{bubbles:!0});d.call(c,n),c.dispatchEvent(f)}},[o,n]),a.jsx(CE,{asChild:!0,children:a.jsx("select",{...r,ref:s,defaultValue:n})})});u6.displayName="BubbleSelect";function d6(t){const e=Cr(t),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(o=>{const c=n.current+o;e(c),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(c)},[e]),s=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function f6(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=Xae(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Xae(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Jae=F3,h6=B3,Zae=z3,ece=V3,tce=G3,p6=K3,nce=Q3,m6=Z3,g6=t6,rce=n6,ice=i6,v6=s6,y6=o6,x6=c6;const Un=Jae,Bn=Zae,Dn=v.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(h6,{ref:r,className:Pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,a.jsx(ece,{asChild:!0,children:a.jsx(Ra,{className:"h-4 w-4 opacity-50"})})]}));Dn.displayName=h6.displayName;const b6=v.forwardRef(({className:t,...e},n)=>a.jsx(v6,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",t),...e,children:a.jsx(uu,{className:"h-4 w-4"})}));b6.displayName=v6.displayName;const w6=v.forwardRef(({className:t,...e},n)=>a.jsx(y6,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",t),...e,children:a.jsx(Ra,{className:"h-4 w-4"})}));w6.displayName=y6.displayName;const $n=v.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>a.jsx(tce,{children:a.jsxs(p6,{ref:i,className:Pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[a.jsx(b6,{}),a.jsx(nce,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),a.jsx(w6,{})]})}));$n.displayName=p6.displayName;const sce=v.forwardRef(({className:t,...e},n)=>a.jsx(m6,{ref:n,className:Pe("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));sce.displayName=m6.displayName;const ae=v.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(g6,{ref:r,className:Pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(ice,{children:a.jsx(Es,{className:"h-4 w-4"})})}),a.jsx(rce,{children:e})]}));ae.displayName=g6.displayName;const oce=v.forwardRef(({className:t,...e},n)=>a.jsx(x6,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",t),...e}));oce.displayName=x6.displayName;const ace=Ie.object({audienceBrief:Ie.string().min(10,{message:"Audience brief must be at least 10 characters."}),researchObjective:Ie.string().optional(),personaCount:Ie.string().min(1,{message:"Number of personas is required."}),dataFile:Ie.instanceof(FileList).optional(),llm_model:Ie.string().optional()});function cce({onSubmit:t,isGenerating:e}){const[n,r]=v.useState(!1),[i,s]=v.useState(!1),[o,c]=v.useState({audience_brief:[],research_objective:[]}),[l,u]=v.useState(!1),[d,f]=v.useState(null),[h,p]=v.useState(null),[g,m]=v.useState([]),y=_=>{const A=new DataTransfer;return _.forEach(j=>A.items.add(j)),A.files},b=V0({resolver:G0(ace),defaultValues:{audienceBrief:"",researchObjective:"",personaCount:"5",llm_model:"gemini-2.5-pro"}}),x=b.watch("audienceBrief"),w=b.watch("researchObjective"),S=async()=>{var j,P,k,O,E,R,M,G,L,V,I;const _=x==null?void 0:x.trim(),A=w==null?void 0:w.trim();if(!_||_.length<10){se.error("Audience brief too short",{description:"Please enter at least 10 characters in the audience brief"});return}if(!A||A.length<10){se.error("Research objective too short",{description:"Please enter at least 10 characters in the research objective"});return}u(!0),f(null);try{const D=await la.enhanceAudienceBrief(_,A);c(D.data.suggestions||{audience_brief:[],research_objective:[]}),r(!0),s(!1);const X=(((P=(j=D.data.suggestions)==null?void 0:j.audience_brief)==null?void 0:P.length)||0)+(((O=(k=D.data.suggestions)==null?void 0:k.research_objective)==null?void 0:O.length)||0);se.success("Enhancement suggestions generated",{description:`Generated ${X} suggestions to improve your research inputs`})}catch(D){console.error("Error enhancing audience brief:",D);let X="Please try again or modify your brief",Q="Failed to generate suggestions";if(D&&typeof D=="object"){const J=D;J.code==="ECONNABORTED"||(E=J.message)!=null&&E.includes("timeout")?(Q="Request timeout",X="The AI took too long to analyze your brief. Please try again."):((R=J.response)==null?void 0:R.status)===500?(Q="Server error",X=((G=(M=J.response)==null?void 0:M.data)==null?void 0:G.message)||"The server encountered an error. Please try again later."):((L=J.response)==null?void 0:L.status)===400?(Q="Invalid brief",X=((I=(V=J.response)==null?void 0:V.data)==null?void 0:I.message)||"Please check your audience brief and try again."):J.message&&(X=J.message)}else D instanceof Error&&(X=D.message);f(X),se.error(Q,{description:X,duration:5e3})}finally{u(!1)}},C=()=>{s(!i)};return a.jsx(W0,{...b,children:a.jsxs("form",{onSubmit:b.handleSubmit(t),className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-6",children:[a.jsx(_t,{control:b.control,name:"audienceBrief",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Audience Brief"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Describe your target audience and research goals...",className:"h-40",..._})}),a.jsx(Fn,{children:"Provide details about the demographics, behaviors, and attitudes you want to explore"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:b.control,name:"researchObjective",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Research Objective"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"What is the main research topic or objective you want to explore?",className:"h-32",..._})}),a.jsx(Fn,{children:"Specify your research focus to generate more targeted persona goals, frustrations, and scenarios"}),a.jsx(xt,{})]})}),a.jsx("div",{className:"space-y-3",children:a.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:S,disabled:!x||x.trim().length<10||!w||w.trim().length<10||l||e,className:"flex items-center gap-2 hover-transition",children:l?a.jsxs(a.Fragment,{children:[a.jsx(Yl,{className:"h-4 w-4 animate-spin"}),"Analyzing Research Inputs..."]}):a.jsxs(a.Fragment,{children:[a.jsx(du,{className:"h-4 w-4"}),"Enhance Brief"]})})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(A3,{focusGroupId:void 0,disabled:e,maxAssets:5,maxFileSize:10,allowedTypes:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/*","image/*"],label:"Customer Data Upload",description:"Upload existing customer data to create more realistic and accurate synthetic personas. This helps the AI understand your target audience better.",enableRenaming:!1,onFilesChange:_=>{m(_),p(_.length>0?y(_):null)}}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports PDF, Word docs, Excel files, text files, and images"})]}),a.jsxs("div",{className:"bg-muted/30 p-4 rounded-lg border border-border",children:[a.jsxs("div",{className:"flex items-center mb-2",children:[a.jsx(Wp,{className:"h-5 w-5 text-muted-foreground mr-2"}),a.jsx("h3",{className:"font-sf font-medium",children:"What's included?"})]}),a.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[a.jsxs("li",{className:"flex items-center",children:[a.jsx(Bh,{className:"h-4 w-4 text-green-500 mr-2"}),"Demographic profiles based on your brief"]}),a.jsxs("li",{className:"flex items-center",children:[a.jsx(Bh,{className:"h-4 w-4 text-green-500 mr-2"}),"Personality traits and behavioral patterns"]}),a.jsxs("li",{className:"flex items-center",children:[a.jsx(Bh,{className:"h-4 w-4 text-green-500 mr-2"}),"Consumer preferences and interests"]}),a.jsxs("li",{className:"flex items-center",children:[a.jsx(Bh,{className:"h-4 w-4 text-green-500 mr-2"}),"Review and refine capabilities"]})]})]})]})]}),n&&a.jsxs("div",{className:"glass-panel rounded-lg p-4 border border-border bg-muted/30",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("h3",{className:"font-sf font-medium text-sm flex items-center gap-2",children:[a.jsx(du,{className:"h-4 w-4 text-primary"}),"Enhancement Suggestions:"]}),a.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:C,className:"h-6 w-6 p-0 hover:bg-slate-200",title:i?"Expand suggestions":"Collapse suggestions",children:i?a.jsx(Ra,{className:"h-4 w-4"}):a.jsx(uu,{className:"h-4 w-4"})})]}),!i&&a.jsx(a.Fragment,{children:d?a.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-md",children:d}):a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{children:o.audience_brief.length>0?a.jsxs("div",{children:[a.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[a.jsx(Dr,{className:"h-4 w-4 text-blue-600"}),"Suggestions for your Audience Brief:"]}),a.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.audience_brief.map((_,A)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-blue-600 mt-1.5 text-xs",children:"•"}),a.jsx("span",{className:"flex-1",children:_})]},A))})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"No audience brief suggestions available"})}),a.jsx("div",{children:o.research_objective.length>0?a.jsxs("div",{children:[a.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[a.jsx(Wp,{className:"h-4 w-4 text-green-600"}),"Suggestions for your Research Objective:"]}),a.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.research_objective.map((_,A)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-green-600 mt-1.5 text-xs",children:"•"}),a.jsx("span",{className:"flex-1",children:_})]},A))})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"No research objective suggestions available"})}),o.audience_brief.length===0&&o.research_objective.length===0&&a.jsx("div",{className:"col-span-full text-sm text-muted-foreground text-center",children:"No suggestions available"})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(_t,{control:b.control,name:"llm_model",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"AI Model"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select AI model"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),a.jsx(ae,{value:"gpt-4.1",children:"GPT-4.1"}),a.jsx(ae,{value:"gpt-5",children:"GPT-5"})]})]}),a.jsx(Fn,{children:"Choose which AI model to use for generating personas"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:b.control,name:"personaCount",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Number of Personas to Generate"}),a.jsx(yt,{children:a.jsx(Wt,{type:"number",min:"1",max:"20",..._})}),a.jsx(Fn,{children:"How many synthetic users do you need for your research?"}),a.jsx(xt,{})]})})]}),a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsx(ee,{type:"button",disabled:e,className:"min-w-36",onClick:()=>{const _=b.getValues();t({..._,dataFile:h})},children:e?a.jsxs(a.Fragment,{children:[a.jsx(Yl,{className:"mr-2 h-4 w-4 animate-spin"}),"AI Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Generate Personas"]})}),e&&a.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:"Generating multiple personas in parallel. This may take 1-2 minutes..."})]})]})})}const lce=t=>{const e=t==null?void 0:t.toLowerCase(),n="/semblance/";switch(e){case"male":return`${n}male_avatar.png`;case"female":return`${n}female_avatar.png`;case"non-binary":case"nonbinary":case"non binary":return`${n}nonbinary_avatar.png`;default:return`${n}male_avatar.png`}},_g=t=>t.avatar||lce(t.gender);function fT({user:t,selected:e=!1,onClick:n,showDetailedDialog:r=!1,onSelectionToggle:i,showAddToFolderButton:s=!1,onAddToFolder:o,onViewDetails:c,folders:l=[]}){const u=ar();v.useState(!1);const[d,f]=v.useState(t),h=t._id||t.id,p=y=>{y.stopPropagation(),u(`/synthetic-users/${h}`)};d.oceanTraits&&(d.oceanTraits.openness,d.oceanTraits.conscientiousness,d.oceanTraits.extraversion,d.oceanTraits.agreeableness,d.oceanTraits.neuroticism);const g=y=>{var w,S;const b=y.target;b.closest("button")&&((S=(w=b.closest("button"))==null?void 0:w.textContent)!=null&&S.includes("View Details"))||(i?i(y):n&&n(y))},m=y=>{y.stopPropagation(),c?c(d):p(y)};return a.jsxs("div",{className:Pe("persona-card glass-card rounded-xl p-4 cursor-pointer hover:shadow-md button-transition",e&&"selected ring-2 ring-primary"),onClick:g,children:[a.jsx("div",{className:"persona-card-overlay"}),a.jsx("div",{className:"persona-card-checkmark",children:a.jsx(Es,{className:"h-4 w-4 text-primary"})}),a.jsx("div",{className:"relative z-10",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center",children:a.jsx("img",{src:_g(d),alt:`${d.name} avatar`,className:"h-12 w-12 rounded-full object-cover"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsx("h3",{className:"text-sm font-medium truncate flex-1",children:d.name})}),a.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[d.age," • ",d.gender]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d.occupation}),a.jsx("p",{className:"text-xs text-muted-foreground",children:d.location}),a.jsx("div",{className:"mt-2",children:d.aiSynthesizedBio?a.jsxs("p",{className:"text-xs text-slate-700 line-clamp-3 leading-relaxed",children:[d.aiSynthesizedBio,d.aiSynthesizedBio.length>150&&"..."]}):a.jsxs("p",{className:"text-xs text-muted-foreground italic line-clamp-3",children:['"',d.personality,'"']})}),d.qualitativeAttributes&&d.qualitativeAttributes.length>0&&a.jsx("div",{className:"mt-3",children:a.jsx("div",{className:"flex flex-wrap gap-1",children:d.qualitativeAttributes.slice(0,3).map((y,b)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded-full",children:[a.jsx(hZ,{className:"h-3 w-3"}),y]},b))})}),d.folder_ids&&d.folder_ids.length>0&&a.jsx("div",{className:"mt-2",children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[d.folder_ids.slice(0,2).map(y=>{const b=l.find(x=>x._id===y);return b?a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 text-xs rounded-full",title:`In folder: ${b.name}`,children:[a.jsx(ds,{className:"h-3 w-3"}),b.name]},y):null}),d.folder_ids.length>2&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 text-xs rounded-full",children:[a.jsx(Br,{className:"h-3 w-3"}),d.folder_ids.length-2," more"]})]})}),d.topPersonalityTraits&&d.topPersonalityTraits.length>0&&a.jsx("div",{className:"mt-2",children:a.jsx("div",{className:"flex flex-wrap gap-1",children:d.topPersonalityTraits.slice(0,3).map((y,b)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-purple-50 text-purple-700 text-xs rounded-full",children:[a.jsx(lu,{className:"h-3 w-3"}),y]},b))})}),a.jsx("div",{className:"mt-3 flex justify-end",children:a.jsx(ee,{variant:"ghost",size:"sm",onClick:m,children:"View Details"})})]})]})})]})}var hT="Collapsible",[uce,uFe]=Fi(hT),[dce,pT]=uce(hT),S6=v.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...c}=t,[l=!1,u]=ao({prop:r,defaultProp:i,onChange:o});return a.jsx(dce,{scope:n,disabled:s,contentId:Xs(),open:l,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:a.jsx(it.div,{"data-state":gT(l),"data-disabled":s?"":void 0,...c,ref:e})})});S6.displayName=hT;var C6="CollapsibleTrigger",_6=v.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=pT(C6,n);return a.jsx(it.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":gT(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Ne(t.onClick,i.onOpenToggle)})});_6.displayName=C6;var mT="CollapsibleContent",A6=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=pT(mT,t.__scopeCollapsible);return a.jsx(Kr,{present:n||i.open,children:({present:s})=>a.jsx(fce,{...r,ref:e,present:s})})});A6.displayName=mT;var fce=v.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=t,o=pT(mT,n),[c,l]=v.useState(r),u=v.useRef(null),d=Ot(e,u),f=v.useRef(0),h=f.current,p=v.useRef(0),g=p.current,m=o.open||c,y=v.useRef(m),b=v.useRef();return v.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),Gr(()=>{const x=u.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,p.current=w.width,y.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),l(r)}},[o.open,r]),a.jsx(it.div,{"data-state":gT(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:m&&i})});function gT(t){return t?"open":"closed"}var hce=S6;const Ag=hce,jg=_6,Eg=A6;function pce({generatedPersonas:t,selectedPersonas:e,isGenerating:n,onPersonaSelection:r,onRefinePersonas:i,onApprovePersonas:s,onBackToGenerator:o}){const c=ar(),[l,u]=v.useState(""),[d,f]=v.useState(!1),h=p=>{c(`/synthetic-users/${p}?fromReview=true`)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Review Generated Personas"}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.length," of ",t.length," selected"]})]}),a.jsx("div",{className:"space-y-4",children:t.map(p=>a.jsx(ut,{className:`border ${e.includes(p.id)?"border-primary/50 bg-primary/5":""} cursor-pointer`,onClick:()=>h(p.id),children:a.jsx(Rt,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("div",{className:"flex-1",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",id:`persona-${p.id}`,checked:e.includes(p.id),onChange:g=>{g.stopPropagation(),r(p.id)},className:"mr-3 h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium",children:p.name}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[p.age," • ",p.gender," • ",p.occupation]})]})]})}),a.jsx(fT,{user:p,showDetailedDialog:!1,onClick:g=>{g.stopPropagation(),h(p.id)}})]})})},p.id))}),a.jsx("div",{className:"space-y-4 pt-4 border-t",children:a.jsxs("div",{children:[a.jsx("div",{className:"flex justify-between items-start mb-4",children:a.jsxs(ee,{variant:"outline",onClick:o,children:[a.jsx(Gp,{className:"mr-2 h-4 w-4"}),"Back to Generator"]})}),a.jsxs(Ag,{open:d,onOpenChange:f,className:"w-full space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx(jg,{asChild:!0,children:a.jsxs(ee,{variant:"outline",className:"flex items-center gap-2",children:[a.jsx(Yl,{className:"h-4 w-4"}),"Refine Personas",a.jsx(Ra,{className:"h-4 w-4 ml-1 transition-transform duration-200",style:{transform:d?"rotate(180deg)":"rotate(0deg)"}})]})}),a.jsxs(ee,{onClick:s,disabled:e.length===0,children:[a.jsx(Bh,{className:"mr-2 h-4 w-4"}),"Approve Selected (",e.length,")"]})]}),a.jsx(Eg,{children:a.jsx(ut,{className:"border shadow-sm w-full mt-4",children:a.jsx(Rt,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"refinement-prompt",className:"text-sm font-medium block mb-2",children:"Refinement Instructions"}),a.jsx(ht,{id:"refinement-prompt",placeholder:"Example: Make all personas 5 years younger, or ensure everyone is from different locations...",value:l,onChange:p=>u(p.target.value),className:"min-h-[100px] w-full resize-y"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Use natural language to describe how you'd like to refine the selected personas."})]}),a.jsxs(ee,{onClick:()=>i(l),disabled:n||l.trim()==="",className:"w-full",children:[n?a.jsx(Yl,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(Yl,{className:"mr-2 h-4 w-4"}),"Apply Refinements"]})]})})})})]})]})})]})}async function mce(t,e,n,r,i,s){console.log(`generateSyntheticPersonas called with targetFolderId: ${i||"none"}`),console.log(`🔄 generateSyntheticPersonas using model: ${s||"gemini-2.5-pro"}`);try{if(console.log(`Generating ${n} synthetic personas using two-stage approach...`),t.trim().length<10)throw new Error("Audience brief is too short. Please provide more context for better persona generation.");let o;if(r&&r.length>0){console.log(`Uploading ${r.length} customer data files...`);try{o=(await la.uploadCustomerData(r)).data.session_id,console.log(`Customer data uploaded with session ID: ${o}`)}catch(l){throw console.error("Failed to upload customer data:",l),new Error("Failed to upload customer data files. Please try again.")}}const c=await la.batchGenerateWithStages(t,e,n,.8,o,s);if(c.data){const l=c.data.partial_success===!0,u=c.data.personas&&c.data.personas.length>0,d=c.data.errors&&c.data.errors.length>0;if(u){if(console.log(`Generated ${c.data.personas.length} personas with two-stage process${d?` (${c.data.errors.length} failed)`:""}`),i){const f=c.data.personas,h=f.map(p=>p._id||p.id).filter(Boolean);console.log(`Adding ${h.length} newly generated personas to folder: ${i}`);try{await Eo.addPersonasBatch(i,h),console.log(`Added ${h.length} newly generated personas to folder: ${i}`)}catch(p){console.error("Error adding personas to folder:",p)}if(o)try{await la.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(p){console.warn("Failed to cleanup customer data:",p)}return l||d?{...c.data,length:f.length}:{...c.data,personas:f}}if(o)try{await la.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}if(l||d)return{...c.data.personas,length:c.data.personas.length,partial_success:l,errors:c.data.errors};if(o)try{await la.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}return c.data.personas}else if(d){if(o)try{await la.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}throw new Error(`Failed to generate personas: ${c.data.errors.length} generation attempts failed.`)}else throw new Error("No personas returned from API")}else throw new Error("Invalid response format from API")}catch(o){if(customerDataSessionId)try{await la.cleanupCustomerData(customerDataSessionId),console.log(`Cleaned up customer data for session: ${customerDataSessionId}`)}catch(c){console.warn("Failed to cleanup customer data:",c)}throw console.error("Error generating AI personas:",o),o}}function j6(){const[t,e]=v.useState([]),n=async s=>{const o=[];for(const c of s){const l={...c};l._id&&typeof l._id=="string"&&l._id.startsWith("local-")&&delete l._id;const u=await Rr.create(l);console.log("Persona saved to database:",u.data),o.push({...c,id:u.data._id||u.data.id,_id:u.data._id||u.data.id,isDbPersona:!0})}e(o)},r=async()=>{const s=await Rr.getAll();return s&&s.data&&Array.isArray(s.data)?(console.log("Personas loaded from database:",s.data.length),s.data.map(o=>({...o,id:o._id||o.id,isDbPersona:!0}))):[]};return v.useEffect(()=>{(async()=>{const o=await r();e(o)})()},[]),{storedPersonas:t,savePersonas:n,loadPersonas:r,clearPersonas:async()=>{const s=await r();for(const o of s)o._id&&await Rr.delete(o._id);e([])}}}function gce({targetFolderId:t,targetFolderName:e}){const n=Ui(),r=ar(),{loadPersonas:i,savePersonas:s}=j6(),[o,c]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState([]),[h,p]=v.useState(!1),[g,m]=v.useState(0);v.useEffect(()=>{const C=new URLSearchParams(n.search),_=C.get("mode"),A=C.get("tab"),j=C.get("step");if(_==="create"&&A==="ai"&&j==="review"){const P=i();P.length>0&&(u(P),f(P.map(k=>k.id)),p(!0))}},[n,i]);async function y(C){var _,A,j,P,k,O,E,R,M,G;try{c(!0),m(0);const L=parseInt(C.personaCount);if(isNaN(L)||L<1||L>10){se.error("Invalid number of personas",{description:"Please enter a number between 1 and 10"}),c(!1);return}m(5);const V=setInterval(()=>{m(Q=>Q<90?Q+Math.random()*5:Q)},500),I=L<=2?"30-60 seconds":L<=4?"1-2 minutes":L<=6?"2-3 minutes":"3-5 minutes";L>4&&se.info("Generation may take longer",{description:`Generating ${L} personas at once may result in some timeouts. If this happens, the successfully created personas will still be saved.`,duration:8e3}),se.info("Generating AI personas in parallel",{description:`Creating ${L} synthetic personas based on your brief. This may take ${I}. Please be patient.`,duration:1e4}),t&&e?(console.log(`Target folder for new personas: ID=${t}, Name=${e}`),se.info(`Creating personas in "${e}" folder`,{duration:3e3})):console.log("No target folder specified for new personas"),console.log(`🤖 Starting persona generation with model: ${C.llm_model||"gemini-2.5-pro"}`);const D=await mce(C.audienceBrief,C.researchObjective,L,C.dataFile,t,C.llm_model),X=D.personas||D;if(clearInterval(V),m(100),X&&X.length>0)console.log(`✅ Successfully generated ${X.length} personas using model: ${C.llm_model||"gemini-2.5-pro"}`),D.partial_success||D.errors&&D.errors.length>0?(se.success("Some personas generated successfully",{description:`${X.length} synthetic personas were created using ${C.llm_model||"Gemini 2.5 Pro"}. ${((_=D.errors)==null?void 0:_.length)||0} failed due to timeout or other errors.`,duration:8e3}),D.errors&&D.errors.length>0&&setTimeout(()=>{se.error("Some personas failed to generate",{description:`${D.errors.length} personas timed out. The server took too long to generate them. The successfully generated personas have been saved${t?" in the selected folder":""}.`,duration:1e4})},1e3)):se.success("Personas generated and saved successfully",{description:`${X.length} synthetic personas have been created using ${C.llm_model||"Gemini 2.5 Pro"} and saved ${t?`to the "${e}" folder`:"to the database"}.`}),r("/synthetic-users?mode=view");else throw new Error("No personas were generated")}catch(L){console.error(`❌ Error generating personas using model: ${C.llm_model||"gemini-2.5-pro"}:`,L);let V="Please try again or adjust your parameters",I="Failed to generate personas";L.code==="ECONNABORTED"||(A=L.message)!=null&&A.includes("timeout")||((j=L.response)==null?void 0:j.status)===504?(I="Generation timeout",V="AI persona generation timed out. This often happens when generating multiple complex personas. Try generating fewer personas (2-3) or try again later."):((P=L.response)==null?void 0:P.status)===500?(I="Server error",(O=(k=L.response)==null?void 0:k.data)!=null&&O.message?V=L.response.data.message:(R=(E=L.response)==null?void 0:E.data)!=null&&R.error?V=L.response.data.error:V="The server encountered an error processing your request. Please try again later."):((M=L.response)==null?void 0:M.status)===401?(I="Authentication required",V="Please log in to generate personas."):(G=L.message)!=null&&G.includes("504 Deadline Exceeded")?(I="Generation timeout",V="The AI model took too long to generate personas. Try generating fewer personas or simplify your brief."):L instanceof Error&&(V=L.message),se.error(I,{description:V,duration:6e3})}finally{setTimeout(()=>{c(!1),m(0)},500)}}const b=C=>{f(_=>_.includes(C)?_.filter(A=>A!==C):[..._,C])},x=(C,_)=>{const A=_.toLowerCase();return C.map(j=>{const P={...j};if(A.includes("younger")){const k=parseInt(P.age);P.age=(k-5).toString()}else if(A.includes("older")){const k=parseInt(P.age);P.age=(k+5).toString()}if(A.includes("different locations")&&(P.location=`${P.location} (Diversified)`),A.includes("more extroverted")?P.personality=`Extroverted, ${P.personality.toLowerCase()}`:A.includes("more introverted")&&(P.personality=`Introverted, ${P.personality.toLowerCase()}`),A.includes("diverse")){const k=["tech-savvy","traditional","innovative","conservative","creative"],O=k[Math.floor(Math.random()*k.length)];P.personality=`${O}, ${P.personality}`}return P})},w=C=>{if(!C.trim()){se.error("Please provide refinement instructions");return}c(!0),setTimeout(()=>{try{const _=l.filter(P=>d.includes(P.id)),A=x(_,C),j=l.map(P=>A.find(O=>O.id===P.id)||P);u(j),c(!1),s(j),se.success("Personas refined based on your instructions",{description:"Review the updated profiles"})}catch(_){console.error("Error refining personas:",_),se.error("Failed to refine personas",{description:"Please try different instructions"}),c(!1)}},1500)},S=()=>{const C=l.filter(_=>d.includes(_.id));se.success(`${C.length} personas approved`,{description:"Added to your synthetic persona library"}),s(C),r("/synthetic-users?mode=view")};return a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Dr,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Persona Recruiter"})]}),o&&a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("span",{className:"text-sm font-medium",children:"Generating personas in parallel..."}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[Math.round(g),"%"]})]}),a.jsx(wc,{value:g,className:"h-2"})]}),h?a.jsx(pce,{generatedPersonas:l,selectedPersonas:d,isGenerating:o,onPersonaSelection:b,onRefinePersonas:w,onApprovePersonas:S,onBackToGenerator:()=>p(!1)}):a.jsx(cce,{onSubmit:y,isGenerating:o})]})}const rl=new Map;function E6(t){const{id:e,title:n,description:r,type:i="default",duration:s}=t;let o;switch(i){case"success":o=se.success(n,{description:r,duration:s});break;case"error":o=se.error(n,{description:r,duration:s});break;case"warning":o=se.warning(n,{description:r,duration:s});break;case"info":o=se.info(n,{description:r,duration:s});break;default:o=se(n,{description:r,duration:s});break}return rl.set(e,o.toString()),e}function vce(t,e){const n=rl.get(t);if(!n)return console.warn(`Toast with ID "${t}" not found. Creating new toast instead.`),E6({id:t,...e,title:e.title||"Updated"}),!1;const{title:r,description:i,type:s="default",duration:o}=e;se.dismiss(n);let c;switch(s){case"success":c=se.success(r,{description:i,duration:o});break;case"error":c=se.error(r,{description:i,duration:o});break;case"warning":c=se.warning(r,{description:i,duration:o});break;case"info":c=se.info(r,{description:i,duration:o});break;default:c=se(r,{description:i,duration:o});break}return rl.set(t,c.toString()),!0}function yce(t){const e=rl.get(t);return e?(se.dismiss(e),rl.delete(t),!0):(console.warn(`Toast with ID "${t}" not found.`),!1)}function xce(t){return rl.has(t)}function bce(){rl.forEach(t=>{se.dismiss(t)}),rl.clear()}const Fe={success:se.success,error:se.error,warning:se.warning,info:se.info,loading:se.loading,dismiss:se.dismiss,createPersistent:E6,updatePersistent:vce,dismissPersistent:yce,hasPersistent:xce,dismissAllPersistent:bce};var N6=["PageUp","PageDown"],T6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],P6={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Kf="Slider",[A1,wce,Sce]=Y0(Kf),[k6,dFe]=Fi(Kf,[Sce]),[Cce,nw]=k6(Kf),O6=v.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:g,...m}=t,y=v.useRef(new Set),b=v.useRef(0),w=o==="horizontal"?_ce:Ace,[S=[],C]=ao({prop:d,defaultProp:u,onChange:O=>{var R;(R=[...y.current][b.current])==null||R.focus(),f(O)}}),_=v.useRef(S);function A(O){const E=Pce(S,O);k(O,E)}function j(O){k(O,b.current)}function P(){const O=_.current[b.current];S[b.current]!==O&&h(S)}function k(O,E,{commit:R}={commit:!1}){const M=Rce(s),G=Mce(Math.round((O-r)/s)*s+r,M),L=vm(G,[r,i]);C((V=[])=>{const I=Nce(V,L,E);if(Ice(I,l*s)){b.current=I.indexOf(L);const D=String(I)!==String(V);return D&&R&&h(I),D?I:V}else return V})}return a.jsx(Cce,{scope:t.__scopeSlider,name:n,disabled:c,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:S,orientation:o,form:g,children:a.jsx(A1.Provider,{scope:t.__scopeSlider,children:a.jsx(A1.Slot,{scope:t.__scopeSlider,children:a.jsx(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...m,ref:e,onPointerDown:Ne(m.onPointerDown,()=>{c||(_.current=S)}),min:r,max:i,inverted:p,onSlideStart:c?void 0:A,onSlideMove:c?void 0:j,onSlideEnd:c?void 0:P,onHomeKeyDown:()=>!c&&k(r,0,{commit:!0}),onEndKeyDown:()=>!c&&k(i,S.length-1,{commit:!0}),onStepKeyDown:({event:O,direction:E})=>{if(!c){const G=N6.includes(O.key)||O.shiftKey&&T6.includes(O.key)?10:1,L=b.current,V=S[L],I=s*G*E;k(V+I,L,{commit:!0})}}})})})})});O6.displayName=Kf;var[I6,R6]=k6(Kf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),_ce=v.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=t,[f,h]=v.useState(null),p=Ot(e,w=>h(w)),g=v.useRef(),m=Pu(i),y=m==="ltr",b=y&&!s||!y&&s;function x(w){const S=g.current||f.getBoundingClientRect(),C=[0,S.width],A=vT(C,b?[n,r]:[r,n]);return g.current=S,A(w-S.left)}return a.jsx(I6,{scope:t.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:a.jsx(M6,{dir:m,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=x(w.clientX);o==null||o(S)},onSlideMove:w=>{const S=x(w.clientX);c==null||c(S)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:w=>{const C=P6[b?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:C?-1:1})}})})}),Ace=v.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:c,onStepKeyDown:l,...u}=t,d=v.useRef(null),f=Ot(e,d),h=v.useRef(),p=!i;function g(m){const y=h.current||d.current.getBoundingClientRect(),b=[0,y.height],w=vT(b,p?[r,n]:[n,r]);return h.current=y,w(m-y.top)}return a.jsx(I6,{scope:t.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:a.jsx(M6,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const y=g(m.clientY);s==null||s(y)},onSlideMove:m=>{const y=g(m.clientY);o==null||o(y)},onSlideEnd:()=>{h.current=void 0,c==null||c()},onStepKeyDown:m=>{const b=P6[p?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:b?-1:1})}})})}),M6=v.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:l,...u}=t,d=nw(Kf,n);return a.jsx(it.span,{...u,ref:e,onKeyDown:Ne(t.onKeyDown,f=>{f.key==="Home"?(o(f),f.preventDefault()):f.key==="End"?(c(f),f.preventDefault()):N6.concat(T6).includes(f.key)&&(l(f),f.preventDefault())}),onPointerDown:Ne(t.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:Ne(t.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:Ne(t.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),D6="SliderTrack",$6=v.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=nw(D6,n);return a.jsx(it.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});$6.displayName=D6;var j1="SliderRange",L6=v.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=nw(j1,n),s=R6(j1,n),o=v.useRef(null),c=Ot(e,o),l=i.values.length,u=i.values.map(h=>U6(h,i.min,i.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return a.jsx(it.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:c,style:{...t.style,[s.startEdge]:d+"%",[s.endEdge]:f+"%"}})});L6.displayName=j1;var E1="SliderThumb",F6=v.forwardRef((t,e)=>{const n=wce(t.__scopeSlider),[r,i]=v.useState(null),s=Ot(e,c=>i(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return a.jsx(jce,{...t,ref:s,index:o})}),jce=v.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=nw(E1,n),c=R6(E1,n),[l,u]=v.useState(null),d=Ot(e,x=>u(x)),f=l?o.form||!!l.closest("form"):!0,h=pg(l),p=o.values[r],g=p===void 0?0:U6(p,o.min,o.max),m=Tce(r,o.values.length),y=h==null?void 0:h[c.size],b=y?kce(y,g,c.direction):0;return v.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${g}% + ${b}px)`},children:[a.jsx(A1.ItemSlot,{scope:t.__scopeSlider,children:a.jsx(it.span,{role:"slider","aria-label":t["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:d,style:p===void 0?{display:"none"}:t.style,onFocus:Ne(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),f&&a.jsx(Ece,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},r)]})});F6.displayName=E1;var Ece=t=>{const{value:e,...n}=t,r=v.useRef(null),i=Sg(e);return v.useEffect(()=>{const s=r.current,o=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(o,"value").set;if(i!==e&&l){const u=new Event("input",{bubbles:!0});l.call(s,e),s.dispatchEvent(u)}},[i,e]),a.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function Nce(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function U6(t,e,n){const s=100/(n-e)*(t-e);return vm(s,[0,100])}function Tce(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Pce(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function kce(t,e,n){const r=t/2,s=vT([0,50],[0,r]);return(r-s(e)*n)*n}function Oce(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Ice(t,e){if(e>0){const n=Oce(t);return Math.min(...n)>=e}return!0}function vT(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Rce(t){return(String(t).split(".")[1]||"").length}function Mce(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var B6=O6,Dce=$6,$ce=L6,Lce=F6;const wr=v.forwardRef(({className:t,...e},n)=>a.jsxs(B6,{ref:n,className:Pe("relative flex w-full touch-none select-none items-center",t),...e,children:[a.jsx(Dce,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx($ce,{className:"absolute h-full bg-primary"})}),a.jsx(Lce,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));wr.displayName=B6.displayName;var yT="Switch",[Fce,fFe]=Fi(yT),[Uce,Bce]=Fce(yT),H6=v.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:o,disabled:c,value:l="on",onCheckedChange:u,form:d,...f}=t,[h,p]=v.useState(null),g=Ot(e,w=>p(w)),m=v.useRef(!1),y=h?d||!!h.closest("form"):!0,[b=!1,x]=ao({prop:i,defaultProp:s,onChange:u});return a.jsxs(Uce,{scope:n,checked:b,disabled:c,children:[a.jsx(it.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":G6(b),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:g,onClick:Ne(t.onClick,w=>{x(S=>!S),y&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),y&&a.jsx(Hce,{control:h,bubbles:!m.current,name:r,value:l,checked:b,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});H6.displayName=yT;var z6="SwitchThumb",V6=v.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Bce(z6,n);return a.jsx(it.span,{"data-state":G6(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});V6.displayName=z6;var Hce=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=v.useRef(null),o=Sg(n),c=pg(e);return v.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[o,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function G6(t){return t?"checked":"unchecked"}var K6=H6,zce=V6;const ym=v.forwardRef(({className:t,...e},n)=>a.jsx(K6,{className:Pe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:a.jsx(zce,{className:Pe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ym.displayName=K6.displayName;function Vce(t,e=[]){let n=[];function r(s,o){const c=v.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[t][l])||c,y=v.useMemo(()=>g,Object.values(g));return a.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[t][l])||c,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>v.createContext(o));return function(c){const l=(c==null?void 0:c[t])||s;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])}};return i.scopeName=t,[r,Gce(i,...e)]}function Gce(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var tC="rovingFocusGroup.onEntryFocus",Kce={bubbles:!1,cancelable:!0},rw="RovingFocusGroup",[N1,W6,Wce]=Y0(rw),[qce,Wf]=Vce(rw,[Wce]),[Yce,Qce]=qce(rw),q6=v.forwardRef((t,e)=>a.jsx(N1.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(N1.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(Xce,{...t,ref:e})})}));q6.displayName=rw;var Xce=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,h=v.useRef(null),p=Ot(e,h),g=Pu(s),[m=null,y]=ao({prop:o,defaultProp:c,onChange:l}),[b,x]=v.useState(!1),w=Cr(u),S=W6(n),C=v.useRef(!1),[_,A]=v.useState(0);return v.useEffect(()=>{const j=h.current;if(j)return j.addEventListener(tC,w),()=>j.removeEventListener(tC,w)},[w]),a.jsx(Yce,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:m,onItemFocus:v.useCallback(j=>y(j),[y]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>A(j=>j+1),[]),onFocusableItemRemove:v.useCallback(()=>A(j=>j-1),[]),children:a.jsx(it.div,{tabIndex:b||_===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...t.style},onMouseDown:Ne(t.onMouseDown,()=>{C.current=!0}),onFocus:Ne(t.onFocus,j=>{const P=!C.current;if(j.target===j.currentTarget&&P&&!b){const k=new CustomEvent(tC,Kce);if(j.currentTarget.dispatchEvent(k),!k.defaultPrevented){const O=S().filter(L=>L.focusable),E=O.find(L=>L.active),R=O.find(L=>L.id===m),G=[E,R,...O].filter(Boolean).map(L=>L.ref.current);X6(G,d)}}C.current=!1}),onBlur:Ne(t.onBlur,()=>x(!1))})})}),Y6="RovingFocusGroupItem",Q6=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=t,c=Xs(),l=s||c,u=Qce(Y6,n),d=u.currentTabStopId===l,f=W6(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=u;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),a.jsx(N1.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:a.jsx(it.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:e,onMouseDown:Ne(t.onMouseDown,g=>{r?u.onItemFocus(l):g.preventDefault()}),onFocus:Ne(t.onFocus,()=>u.onItemFocus(l)),onKeyDown:Ne(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=ele(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(x=>x.focusable).map(x=>x.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const x=b.indexOf(g.currentTarget);b=u.loop?tle(b,x+1):b.slice(x+1)}setTimeout(()=>X6(b))}})})})});Q6.displayName=Y6;var Jce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zce(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function ele(t,e,n){const r=Zce(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Jce[r]}function X6(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function tle(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var xT=q6,bT=Q6,wT="Tabs",[nle,hFe]=Fi(wT,[Wf]),J6=Wf(),[rle,ST]=nle(wT),Z6=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:c,activationMode:l="automatic",...u}=t,d=Pu(c),[f,h]=ao({prop:r,onChange:i,defaultProp:s});return a.jsx(rle,{scope:n,baseId:Xs(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:l,children:a.jsx(it.div,{dir:d,"data-orientation":o,...u,ref:e})})});Z6.displayName=wT;var eH="TabsList",tH=v.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,s=ST(eH,n),o=J6(n);return a.jsx(xT,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:r,children:a.jsx(it.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});tH.displayName=eH;var nH="TabsTrigger",rH=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=t,o=ST(nH,n),c=J6(n),l=oH(o.baseId,r),u=aH(o.baseId,r),d=r===o.value;return a.jsx(bT,{asChild:!0,...c,focusable:!i,active:d,children:a.jsx(it.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:e,onMouseDown:Ne(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:Ne(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:Ne(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!i&&f&&o.onValueChange(r)})})})});rH.displayName=nH;var iH="TabsContent",sH=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...o}=t,c=ST(iH,n),l=oH(c.baseId,r),u=aH(c.baseId,r),d=r===c.value,f=v.useRef(d);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),a.jsx(Kr,{present:i||d,children:({present:h})=>a.jsx(it.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});sH.displayName=iH;function oH(t,e){return`${t}-trigger-${e}`}function aH(t,e){return`${t}-content-${e}`}var ile=Z6,cH=tH,lH=rH,uH=sH;const fl=ile,Va=v.forwardRef(({className:t,...e},n)=>a.jsx(cH,{ref:n,className:Pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));Va.displayName=cH.displayName;const pn=v.forwardRef(({className:t,...e},n)=>a.jsx(lH,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...e}));pn.displayName=lH.displayName;const mn=v.forwardRef(({className:t,...e},n)=>a.jsx(uH,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));mn.displayName=uH.displayName;const sle=Ie.object({name:Ie.string().min(2,{message:"Name must be at least 2 characters."}),age:Ie.string().min(1,{message:"Age is required."}),gender:Ie.string().min(1,{message:"Gender is required."}),occupation:Ie.string().min(2,{message:"Occupation is required."}),education:Ie.string().min(1,{message:"Education is required."}),location:Ie.string().min(2,{message:"Location is required."}),ethnicity:Ie.string().optional(),personality:Ie.string(),interests:Ie.string(),hasPurchasingPower:Ie.boolean().optional(),hasChildren:Ie.boolean().optional(),techSavviness:Ie.number().min(0).max(100),brandLoyalty:Ie.number().min(0).max(100),priceConsciousness:Ie.number().min(0).max(100),environmentalConcern:Ie.number().min(0).max(100),socialGrade:Ie.string().optional(),householdIncome:Ie.string().optional(),householdComposition:Ie.string().optional(),livingSituation:Ie.string().optional(),goals:Ie.array(Ie.string()).optional(),frustrations:Ie.array(Ie.string()).optional(),motivations:Ie.array(Ie.string()).optional(),scenarios:Ie.array(Ie.string()).optional(),scenarioType:Ie.string().optional(),oceanTraits:Ie.object({openness:Ie.number().min(0).max(100),conscientiousness:Ie.number().min(0).max(100),extraversion:Ie.number().min(0).max(100),agreeableness:Ie.number().min(0).max(100),neuroticism:Ie.number().min(0).max(100)}).optional(),thinkFeelDo:Ie.object({thinks:Ie.array(Ie.string()),feels:Ie.array(Ie.string()),does:Ie.array(Ie.string())}).optional(),mediaConsumption:Ie.string().optional(),deviceUsage:Ie.string().optional(),shoppingHabits:Ie.string().optional(),brandPreferences:Ie.string().optional(),communicationPreferences:Ie.string().optional(),paymentMethods:Ie.string().optional(),purchaseBehaviour:Ie.string().optional(),coreValues:Ie.string().optional(),lifestyleChoices:Ie.string().optional(),socialActivities:Ie.string().optional(),categoryKnowledge:Ie.string().optional(),decisionInfluences:Ie.string().optional(),painPoints:Ie.string().optional(),journeyContext:Ie.string().optional(),keyTouchpoints:Ie.string().optional(),selfDeterminationNeeds:Ie.object({autonomy:Ie.string(),competence:Ie.string(),relatedness:Ie.string()}).optional(),fears:Ie.array(Ie.string()).optional(),narrative:Ie.string().optional(),additionalInformation:Ie.string().optional()});function ole({targetFolderId:t,targetFolderName:e}){const[n,r]=v.useState(1),[i,s]=v.useState(!1),[o,c]=v.useState(!1),[l,u]=v.useState(0),d=ar(),{isAuthenticated:f,login:h}=Qo();v.useEffect(()=>{u(0)},[]),v.useEffect(()=>{(async()=>{if(!f&&!o){c(!0);try{console.log("Attempting auto login with default credentials"),await h("user","pass"),console.log("Auto login successful");const A=localStorage.getItem("auth_token");A?(console.log("Token successfully stored:",A.substring(0,10)+"..."),Fe.success("Logged in automatically with default account")):(console.error("Token not stored after successful login"),Fe.error("Authentication problem, token not stored"))}catch(A){console.error("Auto login failed:",A)}finally{c(!1)}}})()},[]);const p=V0({resolver:G0(sle),defaultValues:{name:"",age:"",gender:"",occupation:"",education:"",location:"",ethnicity:"",personality:"",interests:"",hasPurchasingPower:!1,hasChildren:!1,techSavviness:50,brandLoyalty:50,priceConsciousness:50,environmentalConcern:50,socialGrade:"",householdIncome:"",householdComposition:"",livingSituation:"",goals:[],frustrations:[],motivations:[],scenarios:[],scenarioType:"",oceanTraits:{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:{thinks:[],feels:[],does:[]},mediaConsumption:"",deviceUsage:"",shoppingHabits:"",brandPreferences:"",communicationPreferences:"",paymentMethods:"",purchaseBehaviour:"",coreValues:"",lifestyleChoices:"",socialActivities:"",categoryKnowledge:"",decisionInfluences:"",painPoints:"",journeyContext:"",keyTouchpoints:"",selfDeterminationNeeds:{autonomy:"",competence:"",relatedness:""},fears:[],narrative:"",additionalInformation:""}}),g=_=>{const A=p.getValues(_)||[];p.setValue(_,[...A,""])},m=(_,A,j)=>{const k=[...p.getValues(_)||[]];k[A]=j,p.setValue(_,k)},y=(_,A)=>{const P=[...p.getValues(_)||[]];P.splice(A,1),p.setValue(_,P)},b=_=>{const A=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},j={...A,[_]:[...A[_]||[],""]};p.setValue("thinkFeelDo",j)},x=(_,A,j)=>{const P=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},k=[...P[_]||[]];k[A]=j;const O={...P,[_]:k};p.setValue("thinkFeelDo",O)},w=(_,A)=>{const j=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},P=[...j[_]||[]];P.splice(A,1);const k={...j,[_]:P};p.setValue("thinkFeelDo",k)},S=(_,A)=>{const P={...p.getValues("oceanTraits")||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},[_]:A};p.setValue("oceanTraits",P)};async function C(_,A=!1){var j,P,k,O,E;if(A&&l>=1){console.log("Max retry attempts reached, stopping retry loop"),Fe.error("Authentication failed after multiple attempts",{description:"Please try logging in manually (user/pass)"}),d("/login",{state:{from:"/synthetic-users"}}),s(!1);return}A?(u(R=>R+1),console.log(`Retry attempt ${l+1}`)):u(0),s(!0);try{if(!f)try{console.log("Not authenticated, attempting login with default credentials before submission"),await h("user","pass"),console.log("Login successful before persona creation")}catch(D){console.error("Login failed before persona creation:",D),Fe.error("Authentication required",{description:"Please log in before creating personas. Default: user/pass"}),d("/login",{state:{from:"/synthetic-users"}}),s(!1);return}const R=`persona-generation-${Date.now()}`,M=t&&e?` in "${e}" folder`:"",G=n>1?`${n} personas`:"persona";console.log(`UserCreator - Creating ${G}${M}`),Fe.createPersistent({id:R,title:`Generating ${G}...`,description:`Creating synthetic user profile${n>1?"s":""}${M}`,type:"info"});const L={..._,oceanTraits:_.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:_.thinkFeelDo||{thinks:[],feels:[],does:[]},folderId:t||void 0},V={id:`temp-${Date.now()}`,...L},I=JSON.parse(localStorage.getItem("tempPersonas")||"[]");if(I.push(V),localStorage.setItem("tempPersonas",JSON.stringify(I)),n===1)try{if(!localStorage.getItem("auth_token")){console.error("No authentication token found"),Fe.error("Authentication required",{description:"No valid token found. Please log in again."});try{console.log("No token found, attempting new login"),await h("user","pass"),console.log("Login successful, token:",((j=localStorage.getItem("auth_token"))==null?void 0:j.substring(0,10))+"...")}catch(Q){throw console.error("Login retry failed:",Q),new Error("Authentication failed after retry")}}console.log("Sending persona creation request to API with auth token");const X=await Rr.create(L);console.log("Persona created successfully:",X),Fe.updatePersistent(R,{title:"Synthetic user created successfully",description:`Created profile for ${_.name}`,type:"success"})}catch(D){throw console.error("Error creating persona via API:",D),D.response&&D.response.status===401&&Fe.error("Authentication error",{description:"Failed to authenticate with server. Please try again."}),D}else{const D=[];D.push(L);for(let X=1;X{d("/synthetic-users?mode=view")},300)}catch(R){if(console.error("Error creating personas:",R),R.response&&R.response.status===401||R.message&&R.message.includes("Authentication failed")&&l<1)try{console.log("Got auth error, attempting login retry with default credentials"),localStorage.removeItem("auth_token");const M=await ty.login("user","pass");if((k=M==null?void 0:M.data)!=null&&k.access_token){localStorage.setItem("auth_token",M.data.access_token),localStorage.setItem("user",JSON.stringify(M.data.user)),console.log("Manual login successful, got new token:",M.data.access_token.substring(0,10)+"..."),Fe.info("Logged in with default account, retrying submission..."),setTimeout(()=>{C(_,!0)},500);return}else throw new Error("No access token received")}catch(M){console.error("Login retry failed:",M),Fe.error("Authentication error",{description:"Cannot authenticate with server. Please contact support."})}else Fe.updatePersistent(generationToastId,{title:"Failed to create synthetic users",description:((E=(O=R.response)==null?void 0:O.data)==null?void 0:E.message)||R.message||"An unexpected error occurred",type:"error"})}finally{s(!1)}}return a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h2",{className:"text-2xl font-sf font-semibold",children:"Create Synthetic Users"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ee,{variant:"outline",size:"sm",onClick:()=>r(Math.max(1,n-1)),children:"-"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Dr,{size:16,className:"text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:n})]}),a.jsx(ee,{variant:"outline",size:"sm",onClick:()=>r(n+1),children:"+"})]})]}),a.jsx(W0,{...p,children:a.jsxs("form",{onSubmit:p.handleSubmit(C),className:"space-y-6",children:[a.jsxs(fl,{defaultValue:"basic",children:[a.jsxs(Va,{className:"grid w-full grid-cols-6",children:[a.jsx(pn,{value:"basic",children:"Basic"}),a.jsx(pn,{value:"cooper",children:"Cooper"}),a.jsx(pn,{value:"personality",children:"Personality"}),a.jsx(pn,{value:"demographics",children:"Demographics"}),a.jsx(pn,{value:"lifestyle",children:"Lifestyle"}),a.jsx(pn,{value:"extended",children:"Extended"})]}),a.jsx(mn,{value:"basic",className:"mt-6",children:a.jsx(ut,{children:a.jsx(Rt,{className:"p-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"name",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Name"}),a.jsx(yt,{children:a.jsx(Wt,{placeholder:"Jane Smith",..._})}),a.jsx(xt,{})]})}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(_t,{control:p.control,name:"age",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Age Range"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select age range"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"18-24",children:"18-24"}),a.jsx(ae,{value:"25-34",children:"25-34"}),a.jsx(ae,{value:"35-44",children:"35-44"}),a.jsx(ae,{value:"45-54",children:"45-54"}),a.jsx(ae,{value:"55-64",children:"55-64"}),a.jsx(ae,{value:"65+",children:"65+"})]})]}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"gender",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Gender"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select gender"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Male",children:"Male"}),a.jsx(ae,{value:"Female",children:"Female"}),a.jsx(ae,{value:"Non-binary",children:"Non-binary"}),a.jsx(ae,{value:"Other",children:"Other"})]})]}),a.jsx(xt,{})]})})]}),a.jsx(_t,{control:p.control,name:"occupation",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Occupation"}),a.jsx(yt,{children:a.jsx(Wt,{placeholder:"Software Engineer",..._})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"education",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Education"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select education level"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"High School",children:"High School"}),a.jsx(ae,{value:"Some College",children:"Some College"}),a.jsx(ae,{value:"Associate's Degree",children:"Associate's Degree"}),a.jsx(ae,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),a.jsx(ae,{value:"Master's Degree",children:"Master's Degree"}),a.jsx(ae,{value:"PhD",children:"PhD"})]})]}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"location",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Location"}),a.jsx(yt,{children:a.jsx(Wt,{placeholder:"New York, USA",..._})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"ethnicity",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Ethnicity (Optional)"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select ethnicity"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"white",children:"White"}),a.jsx(ae,{value:"black",children:"Black"}),a.jsx(ae,{value:"asian",children:"Asian"}),a.jsx(ae,{value:"hispanic",children:"Hispanic/Latino"}),a.jsx(ae,{value:"native-american",children:"Native American"}),a.jsx(ae,{value:"middle-eastern",children:"Middle Eastern"}),a.jsx(ae,{value:"mixed",children:"Mixed"}),a.jsx(ae,{value:"other",children:"Other"}),a.jsx(ae,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]}),a.jsx(xt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"personality",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Personality Traits"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Curious, analytical, detail-oriented",..._,rows:3})}),a.jsx(Fn,{children:"Describe key personality traits that define this user"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"interests",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Interests"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Technology, fitness, cooking, travel",..._,rows:3})}),a.jsx(Fn,{children:"List interests, hobbies and activities this user enjoys"}),a.jsx(xt,{})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-medium text-sm",children:"Behavioral Attributes"}),a.jsx(_t,{control:p.control,name:"techSavviness",render:({field:_})=>a.jsxs(gt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(vt,{children:"Tech Savviness"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(yt,{children:a.jsx(wr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"brandLoyalty",render:({field:_})=>a.jsxs(gt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(vt,{children:"Brand Loyalty"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(yt,{children:a.jsx(wr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"priceConsciousness",render:({field:_})=>a.jsxs(gt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(vt,{children:"Price Consciousness"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(yt,{children:a.jsx(wr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"environmentalConcern",render:({field:_})=>a.jsxs(gt,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(vt,{children:"Environmental Concern"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.value,"%"]})]}),a.jsx(yt,{children:a.jsx(wr,{min:0,max:100,step:1,value:[_.value],onValueChange:A=>_.onChange(A[0])})}),a.jsx(xt,{})]})}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[a.jsx(_t,{control:p.control,name:"hasPurchasingPower",render:({field:_})=>a.jsxs(gt,{className:"flex items-center justify-between",children:[a.jsx(vt,{children:"Purchasing Power"}),a.jsx(yt,{children:a.jsx(ym,{checked:_.value,onCheckedChange:_.onChange})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"hasChildren",render:({field:_})=>a.jsxs(gt,{className:"flex items-center justify-between",children:[a.jsx(vt,{children:"Has Children"}),a.jsx(yt,{children:a.jsx(ym,{checked:_.value,onCheckedChange:_.onChange})}),a.jsx(xt,{})]})})]})]})]})]})})})}),a.jsxs(mn,{value:"cooper",className:"mt-6 space-y-6",children:[a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(p.watch("goals")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:_,onChange:j=>m("goals",A,j.target.value),placeholder:"Enter a goal"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("goals",A),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>g("goals"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(p.watch("frustrations")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:_,onChange:j=>m("frustrations",A,j.target.value),placeholder:"Enter a frustration"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("frustrations",A),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>g("frustrations"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(p.watch("motivations")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:_,onChange:j=>m("motivations",A,j.target.value),placeholder:"Enter a motivation"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("motivations",A),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>g("motivations"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).thinks||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:_,onChange:j=>x("thinks",A,j.target.value),placeholder:"What they think"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("thinks",A),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>b("thinks"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).feels||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:_,onChange:j=>x("feels",A,j.target.value),placeholder:"What they feel"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("feels",A),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>b("feels"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).does||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:_,onChange:j=>x("does",A,j.target.value),placeholder:"What they do"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("does",A),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>b("does"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),a.jsx(ut,{children:a.jsx(Rt,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"scenarioType",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Scenario Section Title"}),a.jsx(yt,{children:a.jsx(Wt,{placeholder:"Life Scenarios",..._})}),a.jsx(Fn,{children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'}),a.jsx(xt,{})]})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(p.watch("scenarios")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[a.jsx(ht,{value:_,onChange:j=>m("scenarios",A,j.target.value),rows:2,placeholder:"Describe a usage scenario"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("scenarios",A),className:"mt-2",children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>g("scenarios"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})]})})})]}),a.jsx(mn,{value:"personality",className:"mt-6",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{openness:50}).openness||50,"%"]})]}),a.jsx(wr,{value:[(p.watch("oceanTraits")||{openness:50}).openness||50],onValueChange:_=>S("openness",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50,"%"]})]}),a.jsx(wr,{value:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50],onValueChange:_=>S("conscientiousness",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50,"%"]})]}),a.jsx(wr,{value:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50],onValueChange:_=>S("extraversion",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50,"%"]})]}),a.jsx(wr,{value:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50],onValueChange:_=>S("agreeableness",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),a.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50,"%"]})]}),a.jsx(wr,{value:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50],onValueChange:_=>S("neuroticism",_[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),a.jsx(mn,{value:"demographics",className:"mt-6",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"socialGrade",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Social Grade"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select social grade"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"A",children:"A - Higher managerial"}),a.jsx(ae,{value:"B",children:"B - Intermediate managerial"}),a.jsx(ae,{value:"C1",children:"C1 - Supervisory or clerical"}),a.jsx(ae,{value:"C2",children:"C2 - Skilled manual workers"}),a.jsx(ae,{value:"D",children:"D - Semi and unskilled manual workers"}),a.jsx(ae,{value:"E",children:"E - State pensioners, unemployed"})]})]}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"householdIncome",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Household Income"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select income range"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Under $25k",children:"Under $25,000"}),a.jsx(ae,{value:"$25k-$50k",children:"$25,000 - $50,000"}),a.jsx(ae,{value:"$50k-$75k",children:"$50,000 - $75,000"}),a.jsx(ae,{value:"$75k-$100k",children:"$75,000 - $100,000"}),a.jsx(ae,{value:"$100k-$150k",children:"$100,000 - $150,000"}),a.jsx(ae,{value:"$150k-$250k",children:"$150,000 - $250,000"}),a.jsx(ae,{value:"Over $250k",children:"Over $250,000"}),a.jsx(ae,{value:"Prefer not to say",children:"Prefer not to say"})]})]}),a.jsx(xt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"householdComposition",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Household Composition"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select household type"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Single person",children:"Single person"}),a.jsx(ae,{value:"Couple without children",children:"Couple without children"}),a.jsx(ae,{value:"Couple with children",children:"Couple with children"}),a.jsx(ae,{value:"Single parent",children:"Single parent"}),a.jsx(ae,{value:"Multi-generational",children:"Multi-generational"}),a.jsx(ae,{value:"Shared housing",children:"Shared housing"}),a.jsx(ae,{value:"Other",children:"Other"})]})]}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"livingSituation",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Living Situation"}),a.jsxs(Un,{onValueChange:_.onChange,defaultValue:_.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select living situation"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Own home",children:"Own home"}),a.jsx(ae,{value:"Rent apartment",children:"Rent apartment"}),a.jsx(ae,{value:"Rent house",children:"Rent house"}),a.jsx(ae,{value:"Live with family",children:"Live with family"}),a.jsx(ae,{value:"Student housing",children:"Student housing"}),a.jsx(ae,{value:"Assisted living",children:"Assisted living"}),a.jsx(ae,{value:"Other",children:"Other"})]})]}),a.jsx(xt,{})]})})]})]})]})})}),a.jsx(mn,{value:"lifestyle",className:"mt-6",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"mediaConsumption",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Media Consumption"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"TV shows, podcasts, news sources, social media platforms",..._,rows:3})}),a.jsx(Fn,{children:"Describe media consumption habits and preferences"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"deviceUsage",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Device Usage"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Smartphone, laptop, tablet, smart TV, gaming console",..._,rows:3})}),a.jsx(Fn,{children:"Primary devices and usage patterns"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"shoppingHabits",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Shopping Habits"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Online vs in-store, frequency, preferred retailers",..._,rows:3})}),a.jsx(Fn,{children:"Shopping behavior and preferences"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"brandPreferences",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Brand Preferences"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Favorite brands, brand values alignment",..._,rows:3})}),a.jsx(Fn,{children:"Preferred brands and reasoning"}),a.jsx(xt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"communicationPreferences",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Communication Preferences"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Email, phone, text, video calls, in-person",..._,rows:3})}),a.jsx(Fn,{children:"Preferred communication methods and channels"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"paymentMethods",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Payment Methods"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Credit cards, digital wallets, cash, BNPL",..._,rows:3})}),a.jsx(Fn,{children:"Preferred payment methods and financial tools"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"purchaseBehaviour",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Purchase Behavior"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Research habits, decision factors, impulse vs planned buying",..._,rows:3})}),a.jsx(Fn,{children:"How they approach making purchase decisions"}),a.jsx(xt,{})]})})]})]})]})})}),a.jsxs(mn,{value:"extended",className:"mt-6 space-y-6",children:[a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"coreValues",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Core Values"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Key principles and values that guide decisions",..._,rows:3})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"lifestyleChoices",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Lifestyle Choices"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Health, fitness, diet, work-life balance preferences",..._,rows:3})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"socialActivities",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Social Activities"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Social hobbies, community involvement, networking",..._,rows:3})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"categoryKnowledge",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Category Knowledge"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Expertise in specific product/service categories",..._,rows:3})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"decisionInfluences",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Decision Influences"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"What factors most influence their decisions",..._,rows:3})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"painPoints",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Pain Points"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Common challenges and friction points",..._,rows:3})}),a.jsx(xt,{})]})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(_t,{control:p.control,name:"journeyContext",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Journey Context"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Current life stage and contextual factors",..._,rows:3})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"keyTouchpoints",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Key Touchpoints"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Important interaction points and channels",..._,rows:3})}),a.jsx(xt,{})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),a.jsx(_t,{control:p.control,name:"selfDeterminationNeeds.autonomy",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Autonomy"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Need for independence and self-direction",..._,rows:2})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"selfDeterminationNeeds.competence",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Competence"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Need to feel capable and effective",..._,rows:2})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"selfDeterminationNeeds.relatedness",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Relatedness"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Need for connection and belonging",..._,rows:2})}),a.jsx(xt,{})]})})]})]})]})]})}),a.jsx(ut,{children:a.jsx(Rt,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(p.watch("fears")||[]).map((_,A)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:_,onChange:j=>m("fears",A,j.target.value),placeholder:"Enter a fear or concern"}),a.jsx(ee,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("fears",A),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},A)),a.jsxs(ee,{variant:"outline",size:"sm",type:"button",onClick:()=>g("fears"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),a.jsx(_t,{control:p.control,name:"narrative",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Personal Narrative"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Personal story, background, key life experiences",..._,rows:4})}),a.jsx(Fn,{children:"A brief narrative that captures their personal story"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:p.control,name:"additionalInformation",render:({field:_})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Additional Information"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Any other relevant details or context",..._,rows:4})}),a.jsx(Fn,{children:"Additional context or details not covered elsewhere"}),a.jsx(xt,{})]})})]})})})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(ee,{variant:"outline",type:"button",onClick:()=>p.reset(),children:"Reset"}),a.jsxs(ee,{type:"submit",disabled:i,children:[i?a.jsx(tZ,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(DE,{className:"mr-2 h-4 w-4"}),i?"Creating...":`Create ${n>1?`${n} Users`:"User"}`]})]})]})})]})}var T1=["Enter"," "],ale=["ArrowDown","PageUp","Home"],dH=["ArrowUp","PageDown","End"],cle=[...ale,...dH],lle={ltr:[...T1,"ArrowRight"],rtl:[...T1,"ArrowLeft"]},ule={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ng="Menu",[xm,dle,fle]=Y0(Ng),[ku,fH]=Fi(Ng,[fle,Mf,Wf]),iw=Mf(),hH=Wf(),[hle,Ou]=ku(Ng),[ple,Tg]=ku(Ng),pH=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,c=iw(e),[l,u]=v.useState(null),d=v.useRef(!1),f=Cr(s),h=Pu(i);return v.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),a.jsx(P4,{...c,children:a.jsx(hle,{scope:e,open:n,onOpenChange:f,content:l,onContentChange:u,children:a.jsx(ple,{scope:e,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};pH.displayName=Ng;var mle="MenuAnchor",CT=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=iw(n);return a.jsx(bE,{...i,...r,ref:e})});CT.displayName=mle;var _T="MenuPortal",[gle,mH]=ku(_T,{forceMount:void 0}),gH=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Ou(_T,e);return a.jsx(gle,{scope:e,forceMount:n,children:a.jsx(Kr,{present:n||s.open,children:a.jsx(f0,{asChild:!0,container:i,children:r})})})};gH.displayName=_T;var Cs="MenuContent",[vle,AT]=ku(Cs),vH=v.forwardRef((t,e)=>{const n=mH(Cs,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ou(Cs,t.__scopeMenu),o=Tg(Cs,t.__scopeMenu);return a.jsx(xm.Provider,{scope:t.__scopeMenu,children:a.jsx(Kr,{present:r||s.open,children:a.jsx(xm.Slot,{scope:t.__scopeMenu,children:o.modal?a.jsx(yle,{...i,ref:e}):a.jsx(xle,{...i,ref:e})})})})}),yle=v.forwardRef((t,e)=>{const n=Ou(Cs,t.__scopeMenu),r=v.useRef(null),i=Ot(e,r);return v.useEffect(()=>{const s=r.current;if(s)return uT(s)},[]),a.jsx(jT,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ne(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),xle=v.forwardRef((t,e)=>{const n=Ou(Cs,t.__scopeMenu);return a.jsx(jT,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),jT=v.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...m}=t,y=Ou(Cs,n),b=Tg(Cs,n),x=iw(n),w=hH(n),S=dle(n),[C,_]=v.useState(null),A=v.useRef(null),j=Ot(e,A,y.onContentChange),P=v.useRef(0),k=v.useRef(""),O=v.useRef(0),E=v.useRef(null),R=v.useRef("right"),M=v.useRef(0),G=g?J0:v.Fragment,L=g?{as:Ho,allowPinchZoom:!0}:void 0,V=D=>{var F,ce;const X=k.current+D,Q=S().filter(te=>!te.disabled),J=document.activeElement,ye=(F=Q.find(te=>te.ref.current===J))==null?void 0:F.textValue,U=Q.map(te=>te.textValue),ne=kle(U,X,ye),ue=(ce=Q.find(te=>te.textValue===ne))==null?void 0:ce.ref.current;(function te(pe){k.current=pe,window.clearTimeout(P.current),pe!==""&&(P.current=window.setTimeout(()=>te(""),1e3))})(X),ue&&setTimeout(()=>ue.focus())};v.useEffect(()=>()=>window.clearTimeout(P.current),[]),lT();const I=v.useCallback(D=>{var Q,J;return R.current===((Q=E.current)==null?void 0:Q.side)&&Ile(D,(J=E.current)==null?void 0:J.area)},[]);return a.jsx(vle,{scope:n,searchRef:k,onItemEnter:v.useCallback(D=>{I(D)&&D.preventDefault()},[I]),onItemLeave:v.useCallback(D=>{var X;I(D)||((X=A.current)==null||X.focus(),_(null))},[I]),onTriggerLeave:v.useCallback(D=>{I(D)&&D.preventDefault()},[I]),pointerGraceTimerRef:O,onPointerGraceIntentChange:v.useCallback(D=>{E.current=D},[]),children:a.jsx(G,{...L,children:a.jsx(Q0,{asChild:!0,trapped:i,onMountAutoFocus:Ne(s,D=>{var X;D.preventDefault(),(X=A.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:a.jsx(fg,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:a.jsx(xT,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:Ne(l,D=>{b.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(wE,{role:"menu","aria-orientation":"vertical","data-state":IH(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:j,style:{outline:"none",...m.style},onKeyDown:Ne(m.onKeyDown,D=>{const Q=D.target.closest("[data-radix-menu-content]")===D.currentTarget,J=D.ctrlKey||D.altKey||D.metaKey,ye=D.key.length===1;Q&&(D.key==="Tab"&&D.preventDefault(),!J&&ye&&V(D.key));const U=A.current;if(D.target!==U||!cle.includes(D.key))return;D.preventDefault();const ue=S().filter(F=>!F.disabled).map(F=>F.ref.current);dH.includes(D.key)&&ue.reverse(),Tle(ue)}),onBlur:Ne(t.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(P.current),k.current="")}),onPointerMove:Ne(t.onPointerMove,bm(D=>{const X=D.target,Q=M.current!==D.clientX;if(D.currentTarget.contains(X)&&Q){const J=D.clientX>M.current?"right":"left";R.current=J,M.current=D.clientX}}))})})})})})})});vH.displayName=Cs;var ble="MenuGroup",ET=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(it.div,{role:"group",...r,ref:e})});ET.displayName=ble;var wle="MenuLabel",yH=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(it.div,{...r,ref:e})});yH.displayName=wle;var kx="MenuItem",_R="menu.itemSelect",sw=v.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=v.useRef(null),o=Tg(kx,t.__scopeMenu),c=AT(kx,t.__scopeMenu),l=Ot(e,s),u=v.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(_R,{bubbles:!0,cancelable:!0});f.addEventListener(_R,p=>r==null?void 0:r(p),{once:!0}),l4(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return a.jsx(xH,{...i,ref:l,disabled:n,onClick:Ne(t.onClick,d),onPointerDown:f=>{var h;(h=t.onPointerDown)==null||h.call(t,f),u.current=!0},onPointerUp:Ne(t.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:Ne(t.onKeyDown,f=>{const h=c.searchRef.current!=="";n||h&&f.key===" "||T1.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});sw.displayName=kx;var xH=v.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=AT(kx,n),c=hH(n),l=v.useRef(null),u=Ot(e,l),[d,f]=v.useState(!1),[h,p]=v.useState("");return v.useEffect(()=>{const g=l.current;g&&p((g.textContent??"").trim())},[s.children]),a.jsx(xm.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:a.jsx(bT,{asChild:!0,...c,focusable:!r,children:a.jsx(it.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:Ne(t.onPointerMove,bm(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(t.onPointerLeave,bm(g=>o.onItemLeave(g))),onFocus:Ne(t.onFocus,()=>f(!0)),onBlur:Ne(t.onBlur,()=>f(!1))})})})}),Sle="MenuCheckboxItem",bH=v.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return a.jsx(AH,{scope:t.__scopeMenu,checked:n,children:a.jsx(sw,{role:"menuitemcheckbox","aria-checked":Ox(n)?"mixed":n,...i,ref:e,"data-state":TT(n),onSelect:Ne(i.onSelect,()=>r==null?void 0:r(Ox(n)?!0:!n),{checkForDefaultPrevented:!1})})})});bH.displayName=Sle;var wH="MenuRadioGroup",[Cle,_le]=ku(wH,{value:void 0,onValueChange:()=>{}}),SH=v.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Cr(r);return a.jsx(Cle,{scope:t.__scopeMenu,value:n,onValueChange:s,children:a.jsx(ET,{...i,ref:e})})});SH.displayName=wH;var CH="MenuRadioItem",_H=v.forwardRef((t,e)=>{const{value:n,...r}=t,i=_le(CH,t.__scopeMenu),s=n===i.value;return a.jsx(AH,{scope:t.__scopeMenu,checked:s,children:a.jsx(sw,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":TT(s),onSelect:Ne(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});_H.displayName=CH;var NT="MenuItemIndicator",[AH,Ale]=ku(NT,{checked:!1}),jH=v.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=Ale(NT,n);return a.jsx(Kr,{present:r||Ox(s.checked)||s.checked===!0,children:a.jsx(it.span,{...i,ref:e,"data-state":TT(s.checked)})})});jH.displayName=NT;var jle="MenuSeparator",EH=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(it.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});EH.displayName=jle;var Ele="MenuArrow",NH=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=iw(n);return a.jsx(SE,{...i,...r,ref:e})});NH.displayName=Ele;var Nle="MenuSub",[pFe,TH]=ku(Nle),Wh="MenuSubTrigger",PH=v.forwardRef((t,e)=>{const n=Ou(Wh,t.__scopeMenu),r=Tg(Wh,t.__scopeMenu),i=TH(Wh,t.__scopeMenu),s=AT(Wh,t.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,u={__scopeMenu:t.__scopeMenu},d=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),l(null)}},[c,l]),a.jsx(CT,{asChild:!0,...u,children:a.jsx(xH,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":IH(n.open),...t,ref:c0(e,i.onTriggerChange),onClick:f=>{var h;(h=t.onClick)==null||h.call(t,f),!(t.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ne(t.onPointerMove,bm(f=>{s.onItemEnter(f),!f.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ne(t.onPointerLeave,bm(f=>{var p,g;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const m=(g=n.content)==null?void 0:g.dataset.side,y=m==="right",b=y?-5:5,x=h[y?"left":"right"],w=h[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x,y:h.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ne(t.onKeyDown,f=>{var p;const h=s.searchRef.current!=="";t.disabled||h&&f.key===" "||lle[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});PH.displayName=Wh;var kH="MenuSubContent",OH=v.forwardRef((t,e)=>{const n=mH(Cs,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ou(Cs,t.__scopeMenu),o=Tg(Cs,t.__scopeMenu),c=TH(kH,t.__scopeMenu),l=v.useRef(null),u=Ot(e,l);return a.jsx(xm.Provider,{scope:t.__scopeMenu,children:a.jsx(Kr,{present:r||s.open,children:a.jsx(xm.Slot,{scope:t.__scopeMenu,children:a.jsx(jT,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ne(t.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ne(t.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:Ne(t.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=ule[o.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(p=c.trigger)==null||p.focus(),d.preventDefault())})})})})})});OH.displayName=kH;function IH(t){return t?"open":"closed"}function Ox(t){return t==="indeterminate"}function TT(t){return Ox(t)?"indeterminate":t?"checked":"unchecked"}function Tle(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Ple(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function kle(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=Ple(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Ole(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ile(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Ole(n,e)}function bm(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Rle=pH,Mle=CT,Dle=gH,$le=vH,Lle=ET,Fle=yH,Ule=sw,Ble=bH,Hle=SH,zle=_H,Vle=jH,Gle=EH,Kle=NH,Wle=PH,qle=OH,PT="DropdownMenu",[Yle,mFe]=Fi(PT,[fH]),Si=fH(),[Qle,RH]=Yle(PT),MH=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:c=!0}=t,l=Si(e),u=v.useRef(null),[d=!1,f]=ao({prop:i,defaultProp:s,onChange:o});return a.jsx(Qle,{scope:e,triggerId:Xs(),triggerRef:u,contentId:Xs(),open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),modal:c,children:a.jsx(Rle,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};MH.displayName=PT;var DH="DropdownMenuTrigger",$H=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=RH(DH,n),o=Si(n);return a.jsx(Mle,{asChild:!0,...o,children:a.jsx(it.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:c0(e,s.triggerRef),onPointerDown:Ne(t.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:Ne(t.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});$H.displayName=DH;var Xle="DropdownMenuPortal",LH=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Si(e);return a.jsx(Dle,{...r,...n})};LH.displayName=Xle;var FH="DropdownMenuContent",UH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=RH(FH,n),s=Si(n),o=v.useRef(!1);return a.jsx($le,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:Ne(t.onCloseAutoFocus,c=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Ne(t.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!i.modal||d)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});UH.displayName=FH;var Jle="DropdownMenuGroup",Zle=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Lle,{...i,...r,ref:e})});Zle.displayName=Jle;var eue="DropdownMenuLabel",BH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Fle,{...i,...r,ref:e})});BH.displayName=eue;var tue="DropdownMenuItem",HH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Ule,{...i,...r,ref:e})});HH.displayName=tue;var nue="DropdownMenuCheckboxItem",zH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Ble,{...i,...r,ref:e})});zH.displayName=nue;var rue="DropdownMenuRadioGroup",iue=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Hle,{...i,...r,ref:e})});iue.displayName=rue;var sue="DropdownMenuRadioItem",VH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(zle,{...i,...r,ref:e})});VH.displayName=sue;var oue="DropdownMenuItemIndicator",GH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Vle,{...i,...r,ref:e})});GH.displayName=oue;var aue="DropdownMenuSeparator",KH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Gle,{...i,...r,ref:e})});KH.displayName=aue;var cue="DropdownMenuArrow",lue=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Kle,{...i,...r,ref:e})});lue.displayName=cue;var uue="DropdownMenuSubTrigger",WH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(Wle,{...i,...r,ref:e})});WH.displayName=uue;var due="DropdownMenuSubContent",qH=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Si(n);return a.jsx(qle,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qH.displayName=due;var fue=MH,hue=$H,pue=LH,YH=UH,QH=BH,XH=HH,JH=zH,ZH=VH,ez=GH,tz=KH,nz=WH,rz=qH;const P1=fue,k1=hue,mue=v.forwardRef(({className:t,inset:e,children:n,...r},i)=>a.jsxs(nz,{ref:i,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,a.jsx(us,{className:"ml-auto h-4 w-4"})]}));mue.displayName=nz.displayName;const gue=v.forwardRef(({className:t,...e},n)=>a.jsx(rz,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));gue.displayName=rz.displayName;const Ix=v.forwardRef(({className:t,sideOffset:e=4,...n},r)=>a.jsx(pue,{children:a.jsx(YH,{ref:r,sideOffset:e,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Ix.displayName=YH.displayName;const ic=v.forwardRef(({className:t,inset:e,...n},r)=>a.jsx(XH,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));ic.displayName=XH.displayName;const vue=v.forwardRef(({className:t,children:e,checked:n,...r},i)=>a.jsxs(JH,{ref:i,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(ez,{children:a.jsx(Es,{className:"h-4 w-4"})})}),e]}));vue.displayName=JH.displayName;const yue=v.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(ZH,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(ez,{children:a.jsx(RE,{className:"h-2 w-2 fill-current"})})}),e]}));yue.displayName=ZH.displayName;const xue=v.forwardRef(({className:t,inset:e,...n},r)=>a.jsx(QH,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));xue.displayName=QH.displayName;const bue=v.forwardRef(({className:t,...e},n)=>a.jsx(tz,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",t),...e}));bue.displayName=tz.displayName;var kT="Dialog",[iz,sz]=Fi(kT),[wue,mo]=iz(kT),oz=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,c=v.useRef(null),l=v.useRef(null),[u=!1,d]=ao({prop:r,defaultProp:i,onChange:s});return a.jsx(wue,{scope:e,triggerRef:c,contentRef:l,contentId:Xs(),titleId:Xs(),descriptionId:Xs(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};oz.displayName=kT;var az="DialogTrigger",cz=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mo(az,n),s=Ot(e,i.triggerRef);return a.jsx(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":RT(i.open),...r,ref:s,onClick:Ne(t.onClick,i.onOpenToggle)})});cz.displayName=az;var OT="DialogPortal",[Sue,lz]=iz(OT,{forceMount:void 0}),uz=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=mo(OT,e);return a.jsx(Sue,{scope:e,forceMount:n,children:v.Children.map(r,o=>a.jsx(Kr,{present:n||s.open,children:a.jsx(f0,{asChild:!0,container:i,children:o})}))})};uz.displayName=OT;var Rx="DialogOverlay",dz=v.forwardRef((t,e)=>{const n=lz(Rx,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=mo(Rx,t.__scopeDialog);return s.modal?a.jsx(Kr,{present:r||s.open,children:a.jsx(Cue,{...i,ref:e})}):null});dz.displayName=Rx;var Cue=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mo(Rx,n);return a.jsx(J0,{as:Ho,allowPinchZoom:!0,shards:[i.contentRef],children:a.jsx(it.div,{"data-state":RT(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),bu="DialogContent",fz=v.forwardRef((t,e)=>{const n=lz(bu,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=mo(bu,t.__scopeDialog);return a.jsx(Kr,{present:r||s.open,children:s.modal?a.jsx(_ue,{...i,ref:e}):a.jsx(Aue,{...i,ref:e})})});fz.displayName=bu;var _ue=v.forwardRef((t,e)=>{const n=mo(bu,t.__scopeDialog),r=v.useRef(null),i=Ot(e,n.contentRef,r);return v.useEffect(()=>{const s=r.current;if(s)return uT(s)},[]),a.jsx(hz,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ne(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&s.preventDefault()}),onFocusOutside:Ne(t.onFocusOutside,s=>s.preventDefault())})}),Aue=v.forwardRef((t,e)=>{const n=mo(bu,t.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return a.jsx(hz,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,c;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),hz=v.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,c=mo(bu,n),l=v.useRef(null),u=Ot(e,l);return lT(),a.jsxs(a.Fragment,{children:[a.jsx(Q0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:a.jsx(fg,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":RT(c.open),...o,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Eue,{titleId:c.titleId}),a.jsx(Tue,{contentRef:l,descriptionId:c.descriptionId})]})]})}),IT="DialogTitle",pz=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mo(IT,n);return a.jsx(it.h2,{id:i.titleId,...r,ref:e})});pz.displayName=IT;var mz="DialogDescription",gz=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mo(mz,n);return a.jsx(it.p,{id:i.descriptionId,...r,ref:e})});gz.displayName=mz;var vz="DialogClose",yz=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mo(vz,n);return a.jsx(it.button,{type:"button",...r,ref:e,onClick:Ne(t.onClick,()=>i.onOpenChange(!1))})});yz.displayName=vz;function RT(t){return t?"open":"closed"}var xz="DialogTitleWarning",[jue,bz]=H9(xz,{contentName:bu,titleName:IT,docsSlug:"dialog"}),Eue=({titleId:t})=>{const e=bz(xz),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Nue="DialogDescriptionWarning",Tue=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bz(Nue).contentName}}.`;return v.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},wz=oz,Pue=cz,Sz=uz,MT=dz,DT=fz,$T=pz,LT=gz,FT=yz,Cz="AlertDialog",[kue,gFe]=Fi(Cz,[sz]),Ga=sz(),_z=t=>{const{__scopeAlertDialog:e,...n}=t,r=Ga(e);return a.jsx(wz,{...r,...n,modal:!0})};_z.displayName=Cz;var Oue="AlertDialogTrigger",Iue=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Ga(n);return a.jsx(Pue,{...i,...r,ref:e})});Iue.displayName=Oue;var Rue="AlertDialogPortal",Az=t=>{const{__scopeAlertDialog:e,...n}=t,r=Ga(e);return a.jsx(Sz,{...r,...n})};Az.displayName=Rue;var Mue="AlertDialogOverlay",jz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Ga(n);return a.jsx(MT,{...i,...r,ref:e})});jz.displayName=Mue;var jd="AlertDialogContent",[Due,$ue]=kue(jd),Ez=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,s=Ga(n),o=v.useRef(null),c=Ot(e,o),l=v.useRef(null);return a.jsx(jue,{contentName:jd,titleName:Nz,docsSlug:"alert-dialog",children:a.jsx(Due,{scope:n,cancelRef:l,children:a.jsxs(DT,{role:"alertdialog",...s,...i,ref:c,onOpenAutoFocus:Ne(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(dE,{children:r}),a.jsx(Fue,{contentRef:o})]})})})});Ez.displayName=jd;var Nz="AlertDialogTitle",Tz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Ga(n);return a.jsx($T,{...i,...r,ref:e})});Tz.displayName=Nz;var Pz="AlertDialogDescription",kz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Ga(n);return a.jsx(LT,{...i,...r,ref:e})});kz.displayName=Pz;var Lue="AlertDialogAction",Oz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Ga(n);return a.jsx(FT,{...i,...r,ref:e})});Oz.displayName=Lue;var Iz="AlertDialogCancel",Rz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=$ue(Iz,n),s=Ga(n),o=Ot(e,i);return a.jsx(FT,{...s,...r,ref:o})});Rz.displayName=Iz;var Fue=({contentRef:t})=>{const e=`\`${jd}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${jd}\` by passing a \`${Pz}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +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 \`${jd}\`. 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. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Uue=_z,Bue=Az,Mz=jz,Dz=Ez,$z=Oz,Lz=Rz,Fz=Tz,Uz=kz;const O1=Uue,Hue=Bue,Bz=v.forwardRef(({className:t,...e},n)=>a.jsx(Mz,{className:Pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Bz.displayName=Mz.displayName;const Mx=v.forwardRef(({className:t,...e},n)=>a.jsxs(Hue,{children:[a.jsx(Bz,{}),a.jsx(Dz,{ref:n,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Mx.displayName=Dz.displayName;const Dx=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col space-y-2 text-center sm:text-left",t),...e});Dx.displayName="AlertDialogHeader";const $x=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});$x.displayName="AlertDialogFooter";const Lx=v.forwardRef(({className:t,...e},n)=>a.jsx(Fz,{ref:n,className:Pe("text-lg font-semibold",t),...e}));Lx.displayName=Fz.displayName;const Fx=v.forwardRef(({className:t,...e},n)=>a.jsx(Uz,{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));Fx.displayName=Uz.displayName;const Ux=v.forwardRef(({className:t,...e},n)=>a.jsx($z,{ref:n,className:Pe(JN(),t),...e}));Ux.displayName=$z.displayName;const Bx=v.forwardRef(({className:t,...e},n)=>a.jsx(Lz,{ref:n,className:Pe(JN({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Bx.displayName=Lz.displayName;const Jl=wz,zue=Sz,Hz=v.forwardRef(({className:t,...e},n)=>a.jsx(MT,{ref:n,className:Pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));Hz.displayName=MT.displayName;const $c=v.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(zue,{children:[a.jsx(Hz,{}),a.jsxs(DT,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,a.jsxs(FT,{className:"absolute right-4 top-4 z-[100] rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Ri,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$c.displayName=DT.displayName;const Lc=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Lc.displayName="DialogHeader";const Fc=({className:t,...e})=>a.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Fc.displayName="DialogFooter";const Uc=v.forwardRef(({className:t,...e},n)=>a.jsx($T,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",t),...e}));Uc.displayName=$T.displayName;const Zl=v.forwardRef(({className:t,...e},n)=>a.jsx(LT,{ref:n,className:Pe("text-sm text-muted-foreground",t),...e}));Zl.displayName=LT.displayName;var UT="Radio",[Vue,zz]=Fi(UT),[Gue,Kue]=Vue(UT),Vz=v.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:o,value:c="on",onCheck:l,form:u,...d}=t,[f,h]=v.useState(null),p=Ot(e,y=>h(y)),g=v.useRef(!1),m=f?u||!!f.closest("form"):!0;return a.jsxs(Gue,{scope:n,checked:i,disabled:o,children:[a.jsx(it.button,{type:"button",role:"radio","aria-checked":i,"data-state":Wz(i),"data-disabled":o?"":void 0,disabled:o,value:c,...d,ref:p,onClick:Ne(t.onClick,y=>{i||l==null||l(),m&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})}),m&&a.jsx(Wue,{control:f,bubbles:!g.current,name:r,value:c,checked:i,required:s,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});Vz.displayName=UT;var Gz="RadioIndicator",Kz=v.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,s=Kue(Gz,n);return a.jsx(Kr,{present:r||s.checked,children:a.jsx(it.span,{"data-state":Wz(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});Kz.displayName=Gz;var Wue=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=v.useRef(null),o=Sg(n),c=pg(e);return v.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[o,n,r]),a.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Wz(t){return t?"checked":"unchecked"}var que=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],BT="RadioGroup",[Yue,vFe]=Fi(BT,[Wf,zz]),qz=Wf(),Yz=zz(),[Que,Xue]=Yue(BT),Qz=v.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:o=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...h}=t,p=qz(n),g=Pu(u),[m,y]=ao({prop:s,defaultProp:i,onChange:f});return a.jsx(Que,{scope:n,name:r,required:o,disabled:c,value:m,onValueChange:y,children:a.jsx(xT,{asChild:!0,...p,orientation:l,dir:g,loop:d,children:a.jsx(it.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:g,...h,ref:e})})})});Qz.displayName=BT;var Xz="RadioGroupItem",Jz=v.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,s=Xue(Xz,n),o=s.disabled||r,c=qz(n),l=Yz(n),u=v.useRef(null),d=Ot(e,u),f=s.value===i.value,h=v.useRef(!1);return v.useEffect(()=>{const p=m=>{que.includes(m.key)&&(h.current=!0)},g=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),a.jsx(bT,{asChild:!0,...c,focusable:!o,active:f,children:a.jsx(Vz,{disabled:o,required:s.required,checked:f,...l,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:Ne(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ne(i.onFocus,()=>{var p;h.current&&((p=u.current)==null||p.click())})})})});Jz.displayName=Xz;var Jue="RadioGroupIndicator",Zz=v.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=Yz(n);return a.jsx(Kz,{...i,...r,ref:e})});Zz.displayName=Jue;var eV=Qz,tV=Jz,Zue=Zz;const I1=v.forwardRef(({className:t,...e},n)=>a.jsx(eV,{className:Pe("grid gap-2",t),...e,ref:n}));I1.displayName=eV.displayName;const qh=v.forwardRef(({className:t,...e},n)=>a.jsx(tV,{ref:n,className:Pe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:a.jsx(Zue,{className:"flex items-center justify-center",children:a.jsx(RE,{className:"h-2.5 w-2.5 fill-current text-current"})})}));qh.displayName=tV.displayName;var HT="Checkbox",[ede,yFe]=Fi(HT),[tde,nde]=ede(HT),nV=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:o,disabled:c,value:l="on",onCheckedChange:u,form:d,...f}=t,[h,p]=v.useState(null),g=Ot(e,S=>p(S)),m=v.useRef(!1),y=h?d||!!h.closest("form"):!0,[b=!1,x]=ao({prop:i,defaultProp:s,onChange:u}),w=v.useRef(b);return v.useEffect(()=>{const S=h==null?void 0:h.form;if(S){const C=()=>x(w.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[h,x]),a.jsxs(tde,{scope:n,state:b,disabled:c,children:[a.jsx(it.button,{type:"button",role:"checkbox","aria-checked":Bc(b)?"mixed":b,"aria-required":o,"data-state":sV(b),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:g,onKeyDown:Ne(t.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ne(t.onClick,S=>{x(C=>Bc(C)?!0:!C),y&&(m.current=S.isPropagationStopped(),m.current||S.stopPropagation())})}),y&&a.jsx(rde,{control:h,bubbles:!m.current,name:r,value:l,checked:b,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"},defaultChecked:Bc(s)?!1:s})]})});nV.displayName=HT;var rV="CheckboxIndicator",iV=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,s=nde(rV,n);return a.jsx(Kr,{present:r||Bc(s.state)||s.state===!0,children:a.jsx(it.span,{"data-state":sV(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});iV.displayName=rV;var rde=t=>{const{control:e,checked:n,bubbles:r=!0,defaultChecked:i,...s}=t,o=v.useRef(null),c=Sg(n),l=pg(e);v.useEffect(()=>{const d=o.current,f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});d.indeterminate=Bc(n),p.call(d,Bc(n)?!1:n),d.dispatchEvent(g)}},[c,n,r]);const u=v.useRef(Bc(n)?!1:n);return a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??u.current,...s,tabIndex:-1,ref:o,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Bc(t){return t==="indeterminate"}function sV(t){return Bc(t)?"indeterminate":t?"checked":"unchecked"}var oV=nV,ide=iV;const $l=v.forwardRef(({className:t,...e},n)=>a.jsx(oV,{ref:n,className:Pe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:a.jsx(ide,{className:Pe("flex items-center justify-center text-current"),children:a.jsx(Es,{className:"h-4 w-4"})})}));$l.displayName=oV.displayName;const zT=({isActive:t,isComplete:e,hasError:n,label:r,onComplete:i,className:s})=>{const[o,c]=v.useState(0),[l,u]=v.useState("progressing"),[d,f]=v.useState(!1),h=v.useRef(null),p=v.useRef(null),g=()=>{h.current&&(clearInterval(h.current),h.current=null),p.current&&(clearTimeout(p.current),p.current=null)},m=()=>{g(),c(0),u("progressing"),f(!1)},y=S=>{g(),u("completing");const C=100-S,_=50,A=500/_,j=C/A;let P=0;h.current=setInterval(()=>{P++;const k=S+j*P;k>=100||P>=A?(c(100),u("completed"),g(),p.current=setTimeout(()=>{u("hiding"),setTimeout(()=>{m(),i==null||i()},300)},2e3)):c(k)},_)},b=()=>{l==="progressing"&&y(o)},x=()=>{l==="waiting"&&y(90)},w=()=>{g()};return v.useEffect(()=>{if(t&&!d){f(!0),c(0),u("progressing");const S=90/540;let C=0;h.current=setInterval(()=>{C+=S,C>=90?(c(90),u("waiting"),g()):c(C)},100)}return e&&l==="progressing"&&b(),e&&l==="waiting"&&x(),n&&(l==="progressing"||l==="waiting")&&w(),!t&&d&&m(),()=>{t||g()}},[t,e,n,l,d]),v.useEffect(()=>()=>{g()},[]),d?a.jsxs("div",{className:Pe("w-full space-y-2",s),children:[r&&a.jsxs("div",{className:"flex justify-between items-center text-sm text-muted-foreground",children:[a.jsx("span",{children:l==="waiting"?`${r} - finalizing...`:r}),a.jsxs("span",{children:[Math.round(o),"%"]})]}),a.jsx(wc,{value:o,className:Pe("w-full transition-all duration-200",n&&"opacity-75",l==="completed"&&"bg-green-100")}),n&&a.jsx("div",{className:"text-sm text-red-600",children:"Generation failed. Please try again."}),l==="completed"&&!n&&a.jsx("div",{className:"text-sm text-green-600",children:"Generation completed successfully!"})]}):null},Gn="all",sde=()=>{var Os,ea,ta,yl;const t=v.useCallback(()=>{document.body.style.pointerEvents==="none"&&(console.log("ensureBodyInteractive: Fixing body pointer-events..."),document.body.style.pointerEvents="auto")},[]),e=ar(),[n]=$J(),{loadPersonas:r}=j6(),{clearNavigationState:i}=xg(),[s,o]=v.useState("view"),[c,l]=v.useState("ai"),[u,d]=v.useState("");v.useState(null);const[f,h]=v.useState(Gn),[p,g]=v.useState(!1),[m,y]=v.useState("");v.useEffect(()=>{const q=n.get("mode");(q==="view"||q==="create")&&o(q)},[n]);const[b,x]=v.useState([]),[w,S]=v.useState([]),[C,_]=v.useState(!0);v.useState(null);const[A,j]=v.useState(new Set),[P,k]=v.useState(!1),[O,E]=v.useState(null),[R,M]=v.useState(""),[G,L]=v.useState(!1),[V,I]=v.useState(null),[D,X]=v.useState(!1),[Q,J]=v.useState(null),[ye,U]=v.useState(!1),[ne,ue]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[F,ce]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[te,pe]=v.useState(!1),[we,Y]=v.useState(!1),[nt,Ue]=v.useState(!1),[at,Be]=v.useState(!1),[Bt,N]=v.useState("gemini-2.5-pro"),$=()=>{pe(!1),Y(!1),Ue(!1)},B=q=>{i(),e(`/synthetic-users/${q._id||q.id}`)},K=q=>{const Oe={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return q.forEach(Ge=>{if(Ge.age&&Oe.age.add(Ge.age),Ge.gender&&Oe.gender.add(Ge.gender),Ge.occupation&&Oe.occupation.add(Ge.occupation),Ge.location&&Oe.location.add(Ge.location),Ge.techSavviness!==void 0){const mt=Ge.techSavviness<30?"Low (0-30)":Ge.techSavviness<70?"Medium (31-70)":"High (71-100)";Oe.techSavviness.add(mt)}Ge.ethnicity&&Oe.ethnicity.add(Ge.ethnicity)}),{age:Array.from(Oe.age).sort(),gender:Array.from(Oe.gender).sort(),occupation:Array.from(Oe.occupation).sort(),location:Array.from(Oe.location).sort(),techSavviness:Array.from(Oe.techSavviness).sort((Ge,mt)=>{const tt=["Low (0-30)","Medium (31-70)","High (71-100)"];return tt.indexOf(Ge)-tt.indexOf(mt)}),ethnicity:Array.from(Oe.ethnicity).sort()}},Z=()=>{U(!1),setTimeout(()=>{ue({...F})},0)},H=()=>{ce({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]})},re=(q,Oe)=>{ce(Ge=>{const mt={...Ge};return mt[q].includes(Oe)?mt[q]=mt[q].filter(tt=>tt!==Oe):mt[q]=[...mt[q],Oe],mt})},me=async()=>{try{const Ge=(await Eo.getAll()).data.map(mt=>({...mt,id:mt._id}));return S(Ge),Ge}catch(q){return console.error("Error fetching folders:",q),Fe.error("Failed to load folders"),S([]),[]}},be=async()=>{_(!0);try{const Ge=(await Rr.getAll()).data;{const tt=[...Ge.map(wt=>({...wt,id:wt.id||wt._id}))];try{(async()=>{const dn=await r();console.log("Loaded stored personas (for debugging only):",dn?dn.length:0)})()}catch(wt){console.warn("Error loading stored personas:",wt)}x(tt)}}catch(Oe){console.error("Error fetching personas:",Oe),Fe.error("Failed to load personas"),x([])}finally{_(!1)}};v.useEffect(()=>((async()=>{try{const[,]=await Promise.all([me(),be()])}catch(Oe){console.error("Error loading data:",Oe)}})(),()=>{}),[t]),v.useEffect(()=>{var q;if(s==="view")be();else if(s==="create"&&(console.log(`Switching to create mode with folder: ${f}, ${f!==Gn?"NOT default":"IS default"}`),f!==Gn)){const Oe=(q=w.find(Ge=>Ge.id===f))==null?void 0:q.name;console.log(`Selected folder for creation: ${f} (${Oe})`)}},[s]),v.useEffect(()=>{be();const q=()=>{window.location.pathname.includes("/synthetic-users")&&!window.location.pathname.includes("/synthetic-users/")&&(console.log("Navigation to synthetic users page detected, refreshing data"),be())},Oe=()=>{console.log("Synthetic users navigation event detected, refreshing data"),be()};console.log("Setting up MutationObserver for body style");const Ge=new MutationObserver(mt=>{mt.forEach(tt=>{tt.type==="attributes"&&tt.attributeName==="style"&&document.body.style.pointerEvents==="none"&&(console.log("MutationObserver detected pointer-events: none, fixing..."),t())})});return Ge.observe(document.body,{attributes:!0,attributeFilter:["style"]}),t(),window.addEventListener("popstate",q),window.addEventListener("syntheticUsersNavigation",Oe),()=>{window.removeEventListener("popstate",q),window.removeEventListener("syntheticUsersNavigation",Oe),console.log("Disconnecting MutationObserver"),Ge.disconnect()}},[]);const ke=async()=>{if(!m.trim()){Fe.error("Please enter a folder name");return}try{const q=await Eo.create({name:m.trim(),persona_ids:[]});await me(),y(""),g(!1),Fe.success(`Folder "${m}" created`)}catch(q){console.error("Error creating folder:",q),Fe.error("Failed to create folder")}},Se=()=>{y(""),g(!1)},qe=q=>{E(q),M(q.name)},st=async()=>{if(!O||!R.trim()){E(null);return}try{await Eo.update(O._id,{name:R.trim()}),await me(),E(null),Fe.success(`Folder renamed to "${R}"`)}catch(q){console.error("Error renaming folder:",q),Fe.error("Failed to rename folder"),E(null)}},Dt=()=>{E(null),M("")},We=q=>{I(q),L(!0)},Je=async()=>{if(V)try{await Eo.delete(V._id),await me(),(f===V._id||f===V.id)&&h(Gn),L(!1),I(null),Fe.success(`Folder "${V.name}" deleted`)}catch(q){console.error("Error deleting folder:",q),Fe.error("Failed to delete folder")}},At=async(q,Oe)=>{var dn;const Ge=q||A,mt=Oe||Q;if(!mt||Ge.size===0)return;const tt=Array.from(Ge),wt=tt.map(dt=>{const _n=b.find(on=>on.id===dt);return(_n==null?void 0:_n._id)||(_n==null?void 0:_n.id)||dt}).filter(Boolean);try{const dt=[],_n=[];if(mt!==Gn)try{await Eo.addPersonasBatch(mt,wt),dt.push(...tt)}catch(nn){console.error("Error adding personas to folder:",nn),_n.push(...tt)}else dt.push(...tt);await Promise.all([me(),be()]);const on=mt===Gn?"All Personas":((dn=w.find(nn=>nn._id===mt||nn.id===mt))==null?void 0:dn.name)||"folder";return dt.length>0&&Fe.success(`Added ${dt.length} persona${dt.length!==1?"s":""} to ${on}`),_n.length>0&&Fe.error(`Failed to add ${_n.length} persona${_n.length!==1?"s":""} to ${on}.`),q||j(new Set),{success:dt.length>0,successCount:dt.length,failureCount:_n.length}}catch(dt){return console.error("Error moving personas to folder:",dt),Fe.error("An unexpected error occurred while adding personas to folder."),{success:!1,error:dt}}},Yt=async()=>{var Ge,mt,tt;if(A.size===0||f===Gn)return;const q=Array.from(A),Oe=q.map(wt=>{const dn=b.find(dt=>dt.id===wt);return(dn==null?void 0:dn._id)||(dn==null?void 0:dn.id)||wt}).filter(Boolean);console.log("Removing personas from folder:",{selectedFolder:f,selectedIds:q,mongoIds:Oe,folderName:(Ge=w.find(wt=>wt._id===f))==null?void 0:Ge.name});try{await Eo.removePersonasBatch(f,Oe),await Promise.all([me(),be()]);const wt=((mt=w.find(dn=>dn._id===f))==null?void 0:mt.name)||"folder";Fe.success(`Removed ${q.length} persona${q.length!==1?"s":""} from ${wt}`),j(new Set)}catch(wt){console.error("Error removing personas from folder:",wt),console.error("Error details:",((tt=wt.response)==null?void 0:tt.data)||wt.message),Fe.error("Failed to remove personas from folder")}},Xn=q=>{j(Oe=>{const Ge=new Set(Oe);return Ge.has(q)?Ge.delete(q):Ge.add(q),Ge})},cr=()=>{A.size===jt.length?j(new Set):j(new Set(jt.map(q=>q.id)))},ct=async()=>{if(A.size===0)return;const q=Array.from(A);j(new Set),k(!1),_(!0);const Oe=[],Ge=[];for(const mt of q)try{const tt=b.find(dn=>dn.id===mt);if(!tt){console.error(`Could not find persona with id: ${mt}`),Ge.push(mt);continue}let wt=mt;tt._id&&(wt=tt._id.toString()),console.log(`Attempting to delete persona: ${wt}`),await Rr.delete(wt),Oe.push(mt)}catch(tt){console.error(`Failed to delete persona ${mt}:`,tt),Ge.push(mt)}x(mt=>mt.filter(tt=>!Oe.includes(tt.id))),await me(),_(!1),setTimeout(()=>{Oe.length>0&&Fe.success(`Successfully deleted ${Oe.length} persona${Oe.length!==1?"s":""}`),Ge.length>0&&Fe.error(`Failed to delete ${Ge.length} persona${Ge.length!==1?"s":""}`),(Oe.length>0||Ge.length>0)&&be()},50)},jt=b.filter(q=>{const Oe=q.name.toLowerCase().includes(u.toLowerCase())||q.occupation.toLowerCase().includes(u.toLowerCase())||q.location.toLowerCase().includes(u.toLowerCase()),Ge=(ne.age.length===0||ne.age.includes(q.age))&&(ne.gender.length===0||ne.gender.includes(q.gender))&&(ne.occupation.length===0||ne.occupation.includes(q.occupation))&&(ne.location.length===0||ne.location.includes(q.location))&&(ne.ethnicity.length===0||q.ethnicity&&ne.ethnicity.includes(q.ethnicity))&&(ne.techSavviness.length===0||q.techSavviness!==void 0&&ne.techSavviness.includes(q.techSavviness<30?"Low (0-30)":q.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&(ne.folderStatus.length===0||ne.folderStatus.includes("hasFolder")&&ne.folderStatus.includes("noFolder")||ne.folderStatus.includes("hasFolder")&&!ne.folderStatus.includes("noFolder")&&(q.folder_ids&&q.folder_ids.length>0||q.folder_id&&q.folder_id!==Gn||q.folderId&&q.folderId!==Gn)||ne.folderStatus.includes("noFolder")&&!ne.folderStatus.includes("hasFolder")&&(!q.folder_ids||q.folder_ids.length===0)&&(!q.folder_id||q.folder_id===Gn)&&(!q.folderId||q.folderId===Gn));return f===Gn||q.folder_ids&&Array.isArray(q.folder_ids)&&q.folder_ids.includes(f)||q.folder_id===f||q.folderId===f?Oe&&Ge:!1}),ot=(q,Oe)=>{const Ge=new Date().toISOString().split("T")[0],mt=q.length;let tt=`# Persona Summary Report + +`;return tt+=`**Folder:** ${Oe} +`,tt+=`**Date:** ${Ge} +`,tt+=`**Total Personas:** ${mt} + +`,mt===0?(tt+=`No personas found in this folder. +`,tt):(q.forEach((wt,dn)=>{tt+=`## ${wt.name} + +`,tt+=`### Demographics +`,tt+=`- **Age:** ${wt.age} +`,tt+=`- **Gender:** ${wt.gender} +`,tt+=`- **Occupation:** ${wt.occupation} +`,tt+=`- **Location:** ${wt.location} + +`,wt.aiSynthesizedBio&&(tt+=`### AI-Synthesized Bio +`,tt+=`${wt.aiSynthesizedBio} + +`),wt.qualitativeAttributes&&wt.qualitativeAttributes.length>0&&(tt+=`### Key Attributes +`,wt.qualitativeAttributes.forEach(dt=>{tt+=`- 🏷️ ${dt} +`}),tt+=` +`),wt.topPersonalityTraits&&wt.topPersonalityTraits.length>0&&(tt+=`### Top Personality Traits +`,wt.topPersonalityTraits.forEach(dt=>{tt+=`- 🧠 ${dt} +`}),tt+=` +`),dn{if(jt.length===0){Fe.error("No personas to download");return}Be(!0)},gn=async()=>{var Ge,mt,tt,wt,dn;const q=f===Gn?"All Personas":((Ge=w.find(dt=>dt.id===f))==null?void 0:Ge.name)||"Unknown Folder",Oe=jt.map(dt=>dt._id||dt.id);console.log(`🤖 Frontend: User selected ${Bt} for persona summary download`),Be(!1),pe(!0),Y(!1),Ue(!1),_(!0);try{Fe.info("Generating persona summaries...",{description:`Processing ${jt.length} persona${jt.length!==1?"s":""} with AI`});const dt=await la.batchGenerateSummaries(Oe,.7,Bt),{summaries:_n,summary_stats:on,errors:nn}=dt.data,lr=new Date().toISOString().split("T")[0],z=`persona-summary-${q.toLowerCase().replace(/\s+/g,"-")}-${lr}.md`;let he=`# Persona Summary Report + +`;he+=`**Folder:** ${q} +`,he+=`**Date:** ${lr} +`,he+=`**Total Personas:** ${on.total_requested} +`,he+=`**Successfully Processed:** ${on.total_successful} +`,on.total_failed>0&&(he+=`**Failed to Process:** ${on.total_failed} +`),he+=` +--- + +`,_n.length===0?he+=`No persona summaries could be generated. +`:_n.forEach((an,Ci)=>{he+=`# ${an.persona_name} + +`,he+=`${an.summary} + +`,Ci<_n.length-1&&(he+=`--- + +`)}),nn&&(((mt=nn.failed_summaries)==null?void 0:mt.length)>0||((tt=nn.missing_personas)==null?void 0:tt.length)>0)&&(he+=` +--- + +## Processing Errors + +`,((wt=nn.failed_summaries)==null?void 0:wt.length)>0&&(he+=`### Failed to Generate Summaries +`,nn.failed_summaries.forEach(an=>{he+=`- **${an.persona_name}** (ID: ${an.persona_id}): ${an.error} +`}),he+=` +`),((dn=nn.missing_personas)==null?void 0:dn.length)>0&&(he+=`### Missing Personas +`,nn.missing_personas.forEach(an=>{he+=`- ID: ${an} +`})));const fe=document.createElement("a"),De=new Blob([he],{type:"text/markdown"});fe.href=URL.createObjectURL(De),fe.download=z,document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),Y(!0);const Nt=Bt==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro";on.total_successful===on.total_requested?Fe.success("Persona summary downloaded",{description:`Successfully processed all ${on.total_successful} persona${on.total_successful!==1?"s":""} from "${q}" using ${Nt}`}):Fe.success("Persona summary downloaded with warnings",{description:`Processed ${on.total_successful} of ${on.total_requested} personas from "${q}" using ${Nt}`})}catch(dt){console.error("Error generating persona summaries:",dt),dt.response?(console.error("Error response data:",dt.response.data),console.error("Error response status:",dt.response.status),console.error("Error response headers:",dt.response.headers)):dt.request?console.error("Error request:",dt.request):console.error("Error message:",dt.message),Ue(!0),Fe.error("AI summary generation failed, creating basic summary",{description:"Using simplified format due to processing error"});try{const _n=new Date().toISOString().split("T")[0],on=`persona-summary-basic-${q.toLowerCase().replace(/\s+/g,"-")}-${_n}.md`,nn=ot(jt,q),lr=document.createElement("a"),z=new Blob([nn],{type:"text/markdown"});lr.href=URL.createObjectURL(z),lr.download=on,document.body.appendChild(lr),lr.click(),document.body.removeChild(lr)}catch{Fe.error("Failed to create persona summary",{description:"Unable to generate summary in any format"})}}finally{_(!1)}};return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(_a,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Synthetic Personas"}),a.jsx("p",{className:"text-slate-600 mt-1",children:"Create and manage AI-generated research participants"})]}),a.jsx("div",{className:"mt-4 sm:mt-0 flex flex-col items-end gap-3",children:a.jsxs("div",{className:"flex items-center gap-3",children:[s==="view"&&jt.length>0&&a.jsxs(ee,{variant:"outline",onClick:Ze,disabled:te,className:"flex items-center gap-2 hover-transition",children:[a.jsx(Xc,{className:"h-4 w-4"}),te?"Generating Summary...":"Download Persona Summary"]}),a.jsx(ee,{onClick:()=>o(s==="view"?"create":"view"),className:"hover-transition",children:s==="view"?"Create New Personas":"View All Personas"})]})})]}),s==="view"&&jt.length>0&&te&&a.jsx("div",{className:"mb-6",children:a.jsx(zT,{isActive:te,isComplete:we,hasError:nt,label:"Generating comprehensive persona summaries",onComplete:$,className:"max-w-4xl mx-auto"})}),s==="view"?a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex flex-col md:flex-row gap-6 mb-6",children:[a.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),a.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>g(!0),className:"h-7 w-7 p-0",children:a.jsx(u5,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("button",{onClick:()=>h(Gn),className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${f===Gn?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx("span",{children:"All Personas"})]}),w.map(q=>a.jsx("div",{className:"flex items-center justify-between group",children:O&&O._id===q._id?a.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx(Wt,{value:R,onChange:Oe=>M(Oe.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:Oe=>{Oe.key==="Enter"?st():Oe.key==="Escape"&&Dt()}}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:st,className:"h-7 w-7 p-0",children:a.jsx(Es,{className:"h-4 w-4"})}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:Dt,className:"h-7 w-7 p-0",children:a.jsx(Ri,{className:"h-4 w-4"})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>h(q._id),className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${f===q._id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx("span",{children:q.name}),a.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:b.filter(Oe=>Oe.folder_ids&&Oe.folder_ids.includes(q._id)).length})]}),a.jsxs(P1,{children:[a.jsx(k1,{asChild:!0,children:a.jsx(ee,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:a.jsx(B_,{className:"h-4 w-4"})})}),a.jsxs(Ix,{align:"end",children:[a.jsx(ic,{onClick:()=>qe(q),children:"Rename"}),a.jsx(ic,{className:"text-red-600",onClick:()=>We(q),children:"Delete"})]})]})]})},q._id)),p&&a.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[a.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx(Wt,{value:m,onChange:q=>y(q.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:q=>{q.key==="Enter"?ke():q.key==="Escape"&&Se()}})]}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:ke,className:"h-7 w-7 p-0",children:a.jsx(Es,{className:"h-4 w-4"})}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:Se,className:"h-7 w-7 p-0",children:a.jsx(Ri,{className:"h-4 w-4"})})]})]})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx($E,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),a.jsx(Wt,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:u,onChange:q=>d(q.target.value)})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[A.size>0&&a.jsxs(P1,{children:[a.jsx(k1,{asChild:!0,children:a.jsxs(ee,{variant:"outline",size:"sm",className:"flex items-center gap-2",onClick:q=>{q.stopPropagation()},children:[a.jsxs("span",{children:["Actions (",A.size,")"]}),a.jsx(B_,{className:"h-4 w-4"})]})}),a.jsxs(Ix,{align:"end",onCloseAutoFocus:q=>{q.preventDefault()},children:[a.jsxs(ic,{className:"flex items-center gap-2 cursor-pointer",onClick:q=>{q.preventDefault(),q.stopPropagation();const Oe=Array.from(A);e("/focus-groups",{state:{mode:"create",preSelectedParticipants:Oe}})},children:[a.jsx(Vo,{className:"h-4 w-4"}),"Create Focus Group with selected Personas"]}),a.jsxs(ic,{className:"flex items-center gap-2 cursor-pointer",onClick:q=>{q.preventDefault(),q.stopPropagation(),k(!0)},children:[a.jsx(qn,{className:"h-4 w-4"}),"Delete"]}),a.jsxs(ic,{className:"flex items-center gap-2 cursor-pointer",onClick:q=>{q.preventDefault(),q.stopPropagation(),X(!0)},children:[a.jsx(ds,{className:"h-4 w-4"}),"Move to folder"]}),f!==Gn&&a.jsxs(ic,{className:"flex items-center gap-2 cursor-pointer",onClick:q=>{q.preventDefault(),q.stopPropagation(),Yt()},children:[a.jsx(Ri,{className:"h-4 w-4"}),"Remove from ",((Os=w.find(q=>q._id===f))==null?void 0:Os.name)||"folder"]})]})]}),a.jsxs(ee,{variant:"outline",className:"flex items-center gap-2",onClick:()=>U(!0),children:[a.jsx(ME,{className:"h-4 w-4"}),a.jsxs("span",{children:["Filter",Object.values(ne).some(q=>q.length>0)?` (${Object.values(ne).reduce((q,Oe)=>q+Oe.length,0)})`:""]})]})]})]}),a.jsxs("div",{className:"glass-panel rounded-xl p-6 mb-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Dr,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:f===Gn?"Your Synthetic Persona Library":((ea=w.find(q=>q._id===f))==null?void 0:ea.name)||"Personas"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",jt.length,")"]})]}),jt.length>0&&a.jsxs("div",{className:"flex items-center",children:[a.jsx($l,{id:"select-all",checked:jt.length>0&&A.size===jt.length,onCheckedChange:cr,className:"mr-2"}),a.jsx("label",{htmlFor:"select-all",className:"text-sm cursor-pointer",children:"Select All"})]})]}),jt.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-2 xl:grid-cols-2 gap-4",children:jt.map(q=>a.jsx("div",{className:"relative group",children:a.jsx(fT,{user:q,selected:A.has(q.id),onClick:()=>B(q),onSelectionToggle:Oe=>{Oe.stopPropagation(),Xn(q.id)},showAddToFolderButton:!1,folders:w})},q.id))}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-muted-foreground",children:"No personas found matching your criteria."})})]}),a.jsx(O1,{open:P,onOpenChange:q=>{k(q||!1)},children:a.jsxs(Mx,{onInteractOutside:q=>{q.preventDefault()},children:[a.jsxs(Dx,{children:[a.jsx(Lx,{children:"Delete Personas"}),a.jsxs(Fx,{children:["Are you sure you want to delete ",A.size," selected persona",A.size!==1?"s":"","? This action cannot be undone."]})]}),a.jsxs($x,{children:[a.jsx(Bx,{onClick:()=>{setTimeout(()=>j(new Set),50)},children:"Cancel"}),a.jsx(Ux,{onClick:ct,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),a.jsx(O1,{open:G,onOpenChange:q=>{L(q||!1)},children:a.jsxs(Mx,{children:[a.jsxs(Dx,{children:[a.jsx(Lx,{children:"Delete Folder"}),a.jsxs(Fx,{children:['Are you sure you want to delete the folder "',V==null?void 0:V.name,'"?',a.jsx("br",{}),a.jsx("br",{}),a.jsx("strong",{children:"Note:"})," Any personas in this folder will not be deleted - they will still be available under 'All Personas' after folder deletion."]})]}),a.jsxs($x,{children:[a.jsx(Bx,{children:"Cancel"}),a.jsx(Ux,{onClick:Je,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),a.jsx(Jl,{open:D,onOpenChange:q=>{X(q||!1)},children:a.jsxs($c,{className:"z-50",children:[a.jsxs(Lc,{children:[a.jsx(Uc,{children:"Move to Folder"}),a.jsxs(Zl,{children:["Choose a folder to move ",A.size," selected persona",A.size!==1?"s":""," to."]})]}),a.jsx("div",{className:"py-4",children:a.jsxs(I1,{value:Q||"",onValueChange:J,className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(qh,{value:Gn,id:"folder-all"}),a.jsxs(hs,{htmlFor:"folder-all",className:"flex items-center gap-2",children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx("span",{children:"All Personas (Remove from folders)"})]})]}),w.map(q=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(qh,{value:q._id,id:`folder-${q._id}`}),a.jsxs(hs,{htmlFor:`folder-${q._id}`,className:"flex items-center gap-2",children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx("span",{children:q.name})]})]},q._id))]})}),a.jsxs(Fc,{children:[a.jsx(ee,{variant:"outline",onClick:q=>{q.preventDefault(),q.stopPropagation(),X(!1),J(null)},children:"Cancel"}),a.jsx(ee,{onClick:async q=>{if(q.preventDefault(),q.stopPropagation(),!Q)return;const Oe=new Set(A),Ge=Q;if(X(!1),J(null),Ge&&Oe.size>0){_(!0);try{await At(Oe,Ge)}finally{_(!1),j(new Set)}}},disabled:!Q,children:"Move"})]})]})}),a.jsx(Jl,{open:ye,onOpenChange:q=>{q?(U(q),ce({...ne})):(A.size>0&&j(new Set),U(!1))},children:a.jsxs($c,{className:"max-w-4xl max-h-[80vh] flex flex-col",onInteractOutside:q=>{q.preventDefault()},children:[a.jsx("div",{className:"sticky top-0 bg-background border-b shadow-sm pb-4 z-10",children:a.jsxs(Lc,{children:[a.jsx(Uc,{children:"Filter Personas"}),a.jsx(Zl,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic. Filter options dynamically update to show only relevant values."})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-1 py-4 space-y-6",children:[Object.values(F).some(q=>q.length>0)&&a.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(F).reduce((q,Oe)=>q+Oe.length,0)," active filters"]})}),a.jsx("div",{className:"space-y-4",children:(()=>{const q=tt=>{const wt={...F};wt[tt]=[];const dn=b.filter(dt=>Object.entries(wt).every(([_n,on])=>{if(on.length===0)return!0;const nn=_n;if(nn==="techSavviness"&&dt.techSavviness!==void 0){const lr=dt.techSavviness<30?"Low (0-30)":dt.techSavviness<70?"Medium (31-70)":"High (71-100)";return on.includes(lr)}else{if(nn==="age"&&dt.age)return on.includes(dt.age);if(nn==="gender"&&dt.gender)return on.includes(dt.gender);if(nn==="occupation"&&dt.occupation)return on.includes(dt.occupation);if(nn==="location"&&dt.location)return on.includes(dt.location);if(nn==="ethnicity"&&dt.ethnicity)return on.includes(dt.ethnicity)}return!0}));return K(dn)},Oe=Object.values(F).every(tt=>tt.length===0),Ge=K(b),mt=(tt,wt,dn,dt=1)=>{const _n=F[wt],on=[...new Set([...dn,..._n])].sort();return on.length===0?null:a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:tt}),a.jsx("div",{className:`grid grid-cols-1 ${dt===2?"sm:grid-cols-2":dt===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:on.map(nn=>{const lr=F[wt].includes(nn),z=dn.includes(nn);return a.jsxs("div",{className:`flex items-center space-x-2 ${!z&&!lr?"opacity-50":""}`,children:[a.jsx($l,{id:`${wt}-${nn}`,checked:lr,onCheckedChange:()=>re(wt,nn),disabled:!z&&!lr}),a.jsxs(hs,{htmlFor:`${wt}-${nn}`,className:"truncate overflow-hidden",children:[nn,lr&&!z&&a.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},nn)})})]})};return a.jsxs(a.Fragment,{children:[mt("Gender","gender",Oe?Ge.gender:q("gender").gender,3),mt("Age","age",Oe?Ge.age:q("age").age,3),mt("Ethnicity","ethnicity",Oe?Ge.ethnicity:q("ethnicity").ethnicity,2),mt("Location","location",Oe?Ge.location:q("location").location,2),mt("Occupation","occupation",Oe?Ge.occupation:q("occupation").occupation,2),mt("Tech Savviness","techSavviness",Oe?Ge.techSavviness:q("techSavviness").techSavviness,3),a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Folder Assignment"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx($l,{id:"folderStatus-hasFolder",checked:F.folderStatus.includes("hasFolder"),onCheckedChange:()=>re("folderStatus","hasFolder")}),a.jsx(hs,{htmlFor:"folderStatus-hasFolder",className:"truncate overflow-hidden",children:"Has folder assignment"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx($l,{id:"folderStatus-noFolder",checked:F.folderStatus.includes("noFolder"),onCheckedChange:()=>re("folderStatus","noFolder")}),a.jsx(hs,{htmlFor:"folderStatus-noFolder",className:"truncate overflow-hidden",children:"No folder assignment"})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()})]}),a.jsx("div",{className:"sticky bottom-0 bg-background border-t shadow-[0_-2px_4px_rgba(0,0,0,0.05)] pt-4 z-10",children:a.jsxs(Fc,{children:[a.jsx(ee,{variant:"outline",onClick:H,children:"Reset"}),a.jsx(ee,{onClick:Z,children:"Apply Filters"})]})})]})}),a.jsx(Jl,{open:at,onOpenChange:Be,children:a.jsxs($c,{children:[a.jsxs(Lc,{children:[a.jsx(Uc,{children:"Select AI Model for Summary Generation"}),a.jsx(Zl,{children:"Choose which AI model to use for generating persona summaries"})]}),a.jsx("div",{className:"py-4",children:a.jsxs(I1,{value:Bt,onValueChange:N,className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(qh,{value:"gemini-2.5-pro",id:"download-gemini"}),a.jsx(hs,{htmlFor:"download-gemini",className:"text-sm font-medium",children:"Gemini 2.5 Pro"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(qh,{value:"gpt-4.1",id:"download-gpt"}),a.jsx(hs,{htmlFor:"download-gpt",className:"text-sm font-medium",children:"GPT-4.1"})]})]})}),a.jsxs(Fc,{children:[a.jsx(ee,{variant:"outline",onClick:()=>Be(!1),children:"Cancel"}),a.jsx(ee,{onClick:gn,children:"Generate Summary"})]})]})})]})]})}):a.jsxs(fl,{defaultValue:"ai",onValueChange:q=>l(q),children:[a.jsxs(Va,{className:"grid w-full grid-cols-2 mb-6",children:[a.jsx(pn,{value:"ai",children:"AI Recruiter"}),a.jsx(pn,{value:"manual",children:"Manual Creation"})]}),a.jsxs(mn,{value:"ai",children:[console.log(`Rendering AIRecruiter with targetFolderId: ${f!==Gn?f:"null"}`),console.log("Current folders:",w.map(q=>({id:q.id,name:q.name}))),a.jsx(gce,{targetFolderId:f!==Gn?f:null,targetFolderName:f!==Gn?(ta=w.find(q=>q.id===f))==null?void 0:ta.name:null})]}),a.jsx(mn,{value:"manual",children:a.jsx(ole,{targetFolderId:f!==Gn?f:null,targetFolderName:f!==Gn?(yl=w.find(q=>q.id===f))==null?void 0:yl.name:null})})]})]})]})},VT=T.memo(t=>{const{discussionGuide:e,moderatorStatus:n,onSectionSelect:r,onSetPosition:i,onSave:s,showProgress:o=!0,collapsible:c=!0,defaultExpanded:l=!1,className:u,onDownload:d,isDownloading:f=!1,focusGroupId:h,onEditingChange:p}=t,g=typeof e=="string",m=v.useMemo(()=>g?null:e,[e,g]),[y,b]=v.useState(new Set),[x,w]=v.useState(null),[S,C]=v.useState(null),[_,A]=v.useState(!1),[j,P]=v.useState(null),[k,O]=v.useState("");v.useEffect(()=>{p&&p(!!x)},[x,p]),v.useEffect(()=>{if(x&&m){const N=m.sections.find($=>$.id===x);N&&!S&&C({...N})}},[m,x,S]);const E=N=>{w(N.id),C({...N}),b($=>new Set($).add(N.id))},R=()=>{w(null),C(null)},M=v.useCallback(N=>{C($=>$&&{...$,...N})},[]),G=v.useCallback((N,$,B)=>{C(K=>{if(!K)return K;const Z={...K};if(B==="question"&&Z.questions){if(Z.questions.findIndex(re=>re.id===N)!==-1)return Z.questions=Z.questions.map(re=>re.id===N?{...re,...$}:re),Z}else if(B==="activity"&&Z.activities&&Z.activities.findIndex(re=>re.id===N)!==-1)return Z.activities=Z.activities.map(re=>re.id===N?{...re,...$}:re),Z;return Z.subsections&&(Z.subsections=Z.subsections.map(H=>{const re={...H};return B==="question"&&re.questions?re.questions.findIndex(be=>be.id===N)!==-1&&(re.questions=re.questions.map(be=>be.id===N?{...be,...$}:be)):B==="activity"&&re.activities&&re.activities.findIndex(be=>be.id===N)!==-1&&(re.activities=re.activities.map(be=>be.id===N?{...be,...$}:be)),re})),Z})},[]),L=N=>{if(!S)return;const $={id:`${N}-${Date.now()}`,content:`New ${N}`,type:N==="question"?"open_ended":"discussion",time_limit:void 0},B={...S};N==="question"?B.questions=[...B.questions||[],$]:B.activities=[...B.activities||[],$],C(B)},V=(N,$)=>{if(!S||!S.subsections)return;const B={id:`${$}-${Date.now()}`,content:`New ${$}`,type:$==="question"?"open_ended":"discussion",time_limit:void 0},K=[...S.subsections],Z={...K[N]};$==="question"?Z.questions=[...Z.questions||[],B]:Z.activities=[...Z.activities||[],B],K[N]=Z,C(H=>H&&{...H,subsections:K})},I=()=>{if(!S)return;const N={id:`subsection-${Date.now()}`,title:"New Subsection",questions:[],activities:[]},$=[...S.subsections||[],N];C(B=>B&&{...B,subsections:$})},D=N=>{if(!S||!S.subsections)return;const $=S.subsections.filter((B,K)=>K!==N);C(B=>B&&{...B,subsections:$})},X=(N,$)=>{var K,Z;if(!S)return;const B={...S};$==="question"?B.questions=(K=B.questions)==null?void 0:K.filter(H=>H.id!==N):B.activities=(Z=B.activities)==null?void 0:Z.filter(H=>H.id!==N),C(B)},Q=async()=>{if(!(!S||!m||!s)){A(!0);try{const N={...m,sections:m.sections.map($=>$.id===x?S:$)};await s(N),R(),se.success("Section updated successfully")}catch(N){console.error("Error saving section:",N),se.error("Failed to save section")}finally{A(!1)}}},J=N=>{b($=>{const B=new Set($);return B.has(N)?B.delete(N):B.add(N),B})};v.useEffect(()=>{m&&m.sections.length>0&&b(l?new Set(m.sections.map(N=>N.id)):new Set)},[l,m]);const ye=(N,$,B,K)=>{if(!n||n.legacy_format)return null;const Z=n.moderator_position;if(Z.section_index!==N)return Z.section_index>N?"completed":null;if(K!==void 0){if(Z.subsection_index===void 0)return null;if(Z.subsection_index!==K)return Z.subsection_index>K?"completed":null}else if(Z.subsection_index!==void 0)return"completed";return Z.item_type!==B?B==="activity"&&Z.item_type==="question"?"completed":null:Z.item_index===$?"current":Z.item_index>$?"completed":null},U=(N,$)=>N===`New ${$}`,ne=v.useCallback((N,$,B)=>{if($<0||$>=N.length||B<0||B>=N.length)return N;const K=[...N],[Z]=K.splice($,1);return K.splice(B,0,Z),K},[]),ue=v.useCallback((N,$)=>$>0,[]),F=v.useCallback((N,$)=>${if(!S||!S.subsections)return;const $=S.subsections;if(ue($,N)){const B=ne($,N,N-1);C(K=>K&&{...K,subsections:B})}},[S,ue,ne]),te=v.useCallback(N=>{if(!S||!S.subsections)return;const $=S.subsections;if(F($,N)){const B=ne($,N,N+1);C(K=>K&&{...K,subsections:B})}},[S,F,ne]),pe=v.useCallback((N,$)=>{P(N),O($)},[]),we=v.useCallback(()=>{P(null),O("")},[]),Y=v.useCallback(()=>{if(!j||!S||!S.subsections)return;const N=S.subsections.map($=>$.id===j?{...$,title:k.trim()}:$);C($=>$&&{...$,subsections:N}),we()},[j,S,k,we]),nt=v.useCallback((N,$,B,K)=>{if(!S)return;const Z=$==="question"?"questions":"activities";if(K!==void 0){const H=S.subsections||[];if(K>=0&&KSe&&{...Se,subsections:ke})}}}else{const H=S[Z]||[];if(ue(H,B)){const re=ne(H,B,B-1);C(me=>me&&{...me,[Z]:re})}}},[S,ue,ne]),Ue=v.useCallback((N,$,B,K)=>{if(!S)return;const Z=$==="question"?"questions":"activities";if(K!==void 0){const H=S.subsections||[];if(K>=0&&KSe&&{...Se,subsections:ke})}}}else{const H=S[Z]||[];if(F(H,B)){const re=ne(H,B,B+1);C(me=>me&&{...me,[Z]:re})}}},[S,F,ne]),at=(N,$,B,K,Z)=>{var Dt,We,Je,At,Yt,Xn,cr,ct,jt;const H=m==null?void 0:m.sections[$],re=x===(H==null?void 0:H.id),me=ye($,B,K,Z),be=me==="current",ke=me==="completed",qe=(ot=>{var Ze,gn;return((gn=(Ze=ot.metadata)==null?void 0:Ze.visual_asset)==null?void 0:gn.filename)||null})(N),st=U(N.content,K);return re?a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-white border-blue-200",children:[a.jsxs("div",{className:"flex-shrink-0 flex flex-col gap-1",children:[a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>nt(N.id,K,B,Z),disabled:(()=>{if(Z!==void 0){const Ze=((S==null?void 0:S.subsections)||[])[Z],gn=(Ze==null?void 0:Ze[K==="question"?"questions":"activities"])||[];return!ue(gn,B)}else{const ot=(S==null?void 0:S[K==="question"?"questions":"activities"])||[];return!ue(ot,B)}})(),className:"h-6 w-6 p-0",title:"Move item up",children:a.jsx(uu,{className:"h-3 w-3"})}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>Ue(N.id,K,B,Z),disabled:(()=>{if(Z!==void 0){const Ze=((S==null?void 0:S.subsections)||[])[Z],gn=(Ze==null?void 0:Ze[K==="question"?"questions":"activities"])||[];return!F(gn,B)}else{const ot=(S==null?void 0:S[K==="question"?"questions":"activities"])||[];return!F(ot,B)}})(),className:"h-6 w-6 p-0",title:"Move item down",children:a.jsx(Ra,{className:"h-3 w-3"})})]}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Hn,{variant:"outline",className:"text-xs",children:K==="activity"?a.jsxs(a.Fragment,{children:[a.jsx(ha,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]}):a.jsxs(a.Fragment,{children:[a.jsx(jo,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]})}),N.time_limit&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500",children:[a.jsx(Kp,{className:"h-3 w-3"}),a.jsx(Wt,{type:"number",value:N.time_limit,onChange:ot=>G(N.id,{time_limit:parseInt(ot.target.value)||void 0},K),className:"w-16 h-6 text-xs",placeholder:"min"}),"min"]})]}),a.jsx(ht,{value:st?"":N.content,onChange:ot=>G(N.id,{content:ot.target.value},K),placeholder:st?N.content:"Enter content...",className:"min-h-[60px]"}),K==="question"&&a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium text-slate-700 mb-1 block",children:"Probe Questions (one per line)"}),a.jsx(ht,{value:((Dt=N.probes)==null?void 0:Dt.join(` +`))||"",onChange:ot=>{const Ze=ot.target.value.trim()?ot.target.value.split(` +`).filter(gn=>gn.trim()):[];G(N.id,{probes:Ze},K)},placeholder:"Enter probe questions, one per line...",className:"min-h-[40px]"})]}),(((We=N.metadata)==null?void 0:We.image_url)||((Je=N.metadata)==null?void 0:Je.image_id)||qe)&&a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(op,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(At=N.metadata)!=null&&At.image_url?a.jsx("img",{src:N.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(Yt=N.metadata)!=null&&Yt.image_id&&h?a.jsx("img",{src:pt.getAssetUrl(h,N.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):qe&&h?a.jsx("img",{src:pt.getAssetUrl(h,qe),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]}),a.jsx("div",{className:"flex-shrink-0",children:a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>X(N.id,K),className:"h-8 w-8 p-0 text-red-600 hover:text-red-700",children:a.jsx(qn,{className:"h-3 w-3"})})})]},`edit-item-${N.id}`):a.jsxs("div",{className:Pe("flex items-start gap-3 p-3 rounded-lg border transition-colors",be&&"bg-blue-50 border-blue-200",ke&&"bg-green-50 border-green-200",!be&&!ke&&"bg-slate-50 border-slate-200",r&&"cursor-pointer hover:bg-slate-100"),onClick:()=>r==null?void 0:r(m.sections[$].id,N.id),children:[a.jsx("div",{className:"flex-shrink-0 mt-1",children:ke?a.jsx(IE,{className:"h-4 w-4 text-green-600"}):be?a.jsx(l5,{className:"h-4 w-4 text-blue-600"}):a.jsx(RE,{className:"h-4 w-4 text-slate-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[a.jsx(Hn,{variant:"outline",className:"text-xs whitespace-nowrap",children:K==="activity"?a.jsxs(a.Fragment,{children:[a.jsx(ha,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]}):a.jsxs(a.Fragment,{children:[a.jsx(jo,{className:"h-3 w-3 mr-1"}),typeof N.type=="string"?N.type.replace("_"," "):String(N.type||"unknown")]})}),N.time_limit&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500 whitespace-nowrap",children:[a.jsx(Kp,{className:"h-3 w-3"}),N.time_limit," min"]}),i&&a.jsxs(ee,{size:"sm",variant:"ghost",onClick:ot=>{ot.stopPropagation();const Ze=m.sections[$],gn=K==="activity"?`Activity ${B+1}`:`Question ${B+1}`;i(Ze.id,N.id,N.content,Ze.title,gn,K,N.metadata)},className:"h-6 px-2 ml-auto",children:[a.jsx(Xv,{className:"h-3 w-3 mr-1"}),"Set Position"]})]}),a.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:N.content}),N.probes&&N.probes.length>0&&a.jsxs("div",{className:"mt-2 pl-4 border-l-2 border-slate-200",children:[a.jsx("p",{className:"text-xs font-medium text-slate-600 mb-1",children:"Probe Questions:"}),a.jsx("ul",{className:"space-y-1",children:N.probes.map((ot,Ze)=>a.jsxs("li",{className:"text-xs text-slate-600",children:["• ",ot]},Ze))})]}),(((Xn=N.metadata)==null?void 0:Xn.image_url)||((cr=N.metadata)==null?void 0:cr.image_id)||qe)&&a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(op,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(ct=N.metadata)!=null&&ct.image_url?a.jsx("img",{src:N.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(jt=N.metadata)!=null&&jt.image_id&&h?a.jsx("img",{src:pt.getAssetUrl(h,N.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):qe&&h?a.jsx("img",{src:pt.getAssetUrl(h,qe),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},N.id)},Be=(N,$)=>{var re,me,be,ke;const B=y.has(N.id),K=x===N.id,Z=K?S:N,H=(n==null?void 0:n.moderator_position.section_index)===$;return a.jsxs("div",{className:Pe("border rounded-lg overflow-hidden transition-colors",H&&"border-blue-500 shadow-md",!H&&"border-slate-200"),children:[a.jsxs("div",{className:Pe("px-4 py-3 flex items-center justify-between cursor-pointer hover:bg-slate-50 transition-colors",H&&"bg-blue-50"),onClick:()=>!K&&J(N.id),children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"transition-transform",style:{transform:B?"rotate(90deg)":"rotate(0deg)"},children:a.jsx(us,{className:"h-5 w-5 text-slate-500"})}),a.jsx("h3",{className:"font-semibold text-slate-800",children:K?a.jsx(Wt,{value:Z.title,onChange:Se=>M({title:Se.target.value}),onClick:Se=>Se.stopPropagation(),className:"font-semibold"}):Z.title}),H&&a.jsx(Hn,{variant:"default",className:"text-xs",children:"Current"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[s&&!K&&a.jsx(ee,{size:"sm",variant:"ghost",onClick:Se=>{Se.stopPropagation(),E(N)},className:"h-8 px-2",children:a.jsx(V_,{className:"h-3 w-3"})}),K&&a.jsxs("div",{className:"flex items-center gap-2",onClick:Se=>Se.stopPropagation(),children:[a.jsxs(ee,{size:"sm",variant:"default",onClick:Q,disabled:_,className:"h-8",children:[_?a.jsx(Js,{className:"h-3 w-3 animate-spin"}):a.jsx(DE,{className:"h-3 w-3"}),a.jsx("span",{className:"ml-1",children:"Save"})]}),a.jsxs(ee,{size:"sm",variant:"ghost",onClick:R,disabled:_,className:"h-8",children:[a.jsx(Ri,{className:"h-3 w-3"}),a.jsx("span",{className:"ml-1",children:"Cancel"})]})]})]})]}),B&&a.jsxs("div",{className:"px-4 py-3 border-t border-slate-200 space-y-4",children:[Z.content&&a.jsx("div",{className:"prose prose-sm max-w-none",children:K?a.jsx(ht,{value:Z.content,onChange:Se=>M({content:Se.target.value}),placeholder:"Section introduction or context...",className:"min-h-[80px] w-full"}):a.jsx("p",{className:"text-slate-700",children:Z.content})}),Z.activities&&Z.activities.length>0||K?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[a.jsx(ha,{className:"h-4 w-4"}),"Activities"]}),K&&a.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>L("activity"),className:"h-7",children:[a.jsx(ha,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),a.jsx("div",{className:"space-y-2",children:(re=Z.activities)==null?void 0:re.map((Se,qe)=>at(Se,$,qe,"activity"))})]}):null,Z.questions&&Z.questions.length>0||K?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[a.jsx(jo,{className:"h-4 w-4"}),"Questions"]}),K&&a.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>L("question"),className:"h-7",children:[a.jsx(jo,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),a.jsx("div",{className:"space-y-2",children:(me=Z.questions)==null?void 0:me.map((Se,qe)=>at(Se,$,qe,"question"))})]}):null,K&&a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[a.jsx(Xv,{className:"h-4 w-4"}),"Subsections"]}),a.jsxs(ee,{size:"sm",variant:"outline",onClick:I,className:"h-7",children:[a.jsx(Xv,{className:"h-3 w-3 mr-1"}),"Add Subsection"]})]})}),Z.subsections&&Z.subsections.length>0&&a.jsx("div",{className:"space-y-3 ml-4",children:Z.subsections.map((Se,qe)=>{var st,Dt;return a.jsxs("div",{className:"border-l-2 border-slate-200 pl-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[K&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>ce(qe),disabled:!ue(Z.subsections||[],qe),className:"h-7 w-7 p-0",title:"Move subsection up",children:a.jsx(uu,{className:"h-4 w-4"})}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>te(qe),disabled:!F(Z.subsections||[],qe),className:"h-7 w-7 p-0",title:"Move subsection down",children:a.jsx(Ra,{className:"h-4 w-4"})})]}),K&&j===Se.id?a.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[a.jsx(Wt,{value:k,onChange:We=>O(We.target.value),className:"flex-1",onKeyDown:We=>{We.key==="Enter"?Y():We.key==="Escape"&&we()},autoFocus:!0}),a.jsx(ee,{size:"sm",onClick:Y,children:a.jsx(Es,{className:"h-3 w-3"})}),a.jsx(ee,{size:"sm",variant:"outline",onClick:we,children:a.jsx(Ri,{className:"h-3 w-3"})})]}):a.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[a.jsx("h5",{className:Pe("font-medium text-slate-700",K&&"cursor-pointer hover:text-blue-600"),onClick:()=>K&&pe(Se.id,Se.title),children:Se.title}),K&&a.jsxs(a.Fragment,{children:[a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>pe(Se.id,Se.title),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100",children:a.jsx(V_,{className:"h-3 w-3"})}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>D(qe),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100 text-red-600 hover:text-red-700",title:"Delete subsection",children:a.jsx(qn,{className:"h-3 w-3"})})]})]})]}),Se.questions&&Se.questions.length>0||K?a.jsxs("div",{className:"space-y-2 mb-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[a.jsx(jo,{className:"h-3 w-3"}),"Questions"]}),K&&a.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>V(qe,"question"),className:"h-6",children:[a.jsx(jo,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),a.jsx("div",{className:"space-y-2",children:(st=Se.questions)==null?void 0:st.map((We,Je)=>at(We,$,Je,"question",qe))})]}):null,Se.activities&&Se.activities.length>0||K?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[a.jsx(ha,{className:"h-3 w-3"}),"Activities"]}),K&&a.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>V(qe,"activity"),className:"h-6",children:[a.jsx(ha,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),a.jsx("div",{className:"space-y-2",children:(Dt=Se.activities)==null?void 0:Dt.map((We,Je)=>at(We,$,Je,"activity",qe))})]}):null]},Se.id)})}),(((be=N.metadata)==null?void 0:be.image_url)||((ke=N.metadata)==null?void 0:ke.image_id))&&a.jsxs("div",{className:"mt-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(op,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),N.metadata.image_url?a.jsx("img",{src:N.metadata.image_url,alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):N.metadata.image_id&&h?a.jsx("img",{src:pt.getAssetUrl(h,N.metadata.image_id),alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},N.id)};if(g)return a.jsxs("div",{className:Pe("space-y-4",u),children:[o&&n&&a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[a.jsx("span",{children:"Progress"}),a.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),a.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:a.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h2",{className:"text-xl font-semibold text-slate-800",children:"Discussion Guide"}),d&&a.jsxs(ee,{size:"sm",variant:"outline",onClick:d,disabled:f,children:[f?a.jsx(Js,{className:"h-4 w-4 animate-spin mr-2"}):a.jsx(Xc,{className:"h-4 w-4 mr-2"}),"Download"]})]}),a.jsx("div",{className:"prose prose-sm max-w-none",children:a.jsx("pre",{className:"whitespace-pre-wrap text-sm text-slate-700 font-sans",children:e})}),n&&a.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[a.jsx("h3",{className:"font-medium text-blue-900 mb-2",children:"Current Position"}),a.jsx("p",{className:"text-sm text-blue-800",children:n.current_section}),n.current_item&&a.jsx("p",{className:"text-sm text-blue-700 mt-1",children:n.current_item})]})]})]});if(!m)return a.jsx("div",{className:Pe("bg-slate-50 rounded-lg p-8 text-center",u),children:a.jsx("p",{className:"text-slate-600",children:"No discussion guide available"})});const Bt=a.jsxs("div",{className:"space-y-4",children:[o&&n&&a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[a.jsx("span",{children:"Overall Progress"}),a.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),a.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:a.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})}),a.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 mt-2",children:[a.jsxs("span",{children:["Section ",n.moderator_position.section_index+1," of ",n.total_sections]}),a.jsxs("span",{children:[Math.round(n.section_progress),"% of current section"]})]})]}),a.jsx("div",{className:"space-y-3",children:m.sections.map((N,$)=>Be(N,$))})]});return c?a.jsxs(Ag,{defaultOpen:l,className:u,children:[a.jsx(jg,{asChild:!0,children:a.jsxs("div",{className:"flex items-center justify-between p-4 bg-white rounded-lg border border-slate-200 cursor-pointer hover:bg-slate-50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(us,{className:"h-5 w-5 text-slate-500 transition-transform data-[state=open]:rotate-90"}),a.jsx("h2",{className:"text-lg font-semibold text-slate-800",children:m.title||"Discussion Guide"}),a.jsxs(Hn,{variant:"outline",className:"text-xs",children:[m.total_duration," min"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[n&&a.jsxs(Hn,{variant:n.progress===100?"success":"default",className:"text-xs",children:[Math.round(n.progress),"% Complete"]}),d&&a.jsx(ee,{size:"sm",variant:"outline",onClick:N=>{N.stopPropagation(),d()},disabled:f,children:f?a.jsx(Js,{className:"h-4 w-4 animate-spin"}):a.jsx(Xc,{className:"h-4 w-4"})})]})]})}),a.jsx(Eg,{className:"mt-4",children:Bt})]}):a.jsx("div",{className:u,children:Bt})});VT.displayName="DiscussionGuideViewer";const xl="all",ode=Ie.object({researchBrief:Ie.string().min(10,{message:"Research brief must be at least 10 characters."}),focusGroupName:Ie.string().min(3,{message:"Focus group name must be at least 3 characters."}),discussionTopics:Ie.string().min(10,{message:"Discussion topics are required."}),duration:Ie.string().min(1,{message:"Duration is required."}),llm_model:Ie.string().optional(),reasoning_effort:Ie.string().optional(),verbosity:Ie.string().optional()});function ade({draftToEdit:t,onDraftSaved:e,preSelectedParticipants:n=[]}={}){console.log("FocusGroupModerator component rendering, draftToEdit:",t);const r=ar();Ui();const{setPreviousRoute:i,navigationState:s,clearNavigationState:o}=xg(),[c,l]=v.useState("setup"),[u,d]=v.useState(!1),[f,h]=v.useState(!1),[p,g]=v.useState(!1),[m,y]=v.useState(null),[b,x]=v.useState(null),[w,S]=v.useState(!1),C=v.useRef(m);C.current=m;const _=v.useRef(!1),A=z=>z&&typeof z=="object"&&z.title&&z.sections,[j,P]=v.useState([]),[k,O]=v.useState([]),[E,R]=v.useState(!1),[M,G]=v.useState([]),[L,V]=v.useState(!1),[I,D]=v.useState(!1),[X,Q]=v.useState([]),[J,ye]=v.useState(xl),[U,ne]=v.useState(!1),[ue,F]=v.useState(""),[ce,te]=v.useState(null),[pe,we]=v.useState(""),[Y,nt]=v.useState(""),[Ue,at]=v.useState(!1),[Be,Bt]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[N,$]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[B,K]=v.useState("idle"),[Z,H]=v.useState(null),[re,me]=v.useState(0),be=v.useRef(null),ke=v.useRef(!1),Se=v.useRef(!1),qe=z=>{i("/focus-groups",{focusGroupId:b,focusGroupTab:"participants",isNewFocusGroup:!t,focusGroupData:{name:Ze.getValues("name"),description:Ze.getValues("description"),selectedParticipants:j,discussionGuide:m}}),r(`/synthetic-users/${z.id}`)},st=z=>{const he={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return z.forEach(fe=>{if(fe.age&&he.age.add(fe.age),fe.gender&&he.gender.add(fe.gender),fe.occupation&&he.occupation.add(fe.occupation),fe.location&&he.location.add(fe.location),fe.techSavviness!==void 0){const De=fe.techSavviness<30?"Low (0-30)":fe.techSavviness<70?"Medium (31-70)":"High (71-100)";he.techSavviness.add(De)}fe.ethnicity&&he.ethnicity.add(fe.ethnicity)}),{age:Array.from(he.age).sort(),gender:Array.from(he.gender).sort(),occupation:Array.from(he.occupation).sort(),location:Array.from(he.location).sort(),techSavviness:Array.from(he.techSavviness).sort((fe,De)=>{const Nt=["Low (0-30)","Medium (31-70)","High (71-100)"];return Nt.indexOf(fe)-Nt.indexOf(De)}),ethnicity:Array.from(he.ethnicity).sort()}},Dt=z=>{const he={...N};he[z]=[];const fe=M.filter(De=>{let Nt=!0;return J!==xl&&(Nt=!1,De.folder_ids&&Array.isArray(De.folder_ids)&&(Nt=De.folder_ids.includes(J)),!Nt&&(De.folder_id===J||De.folderId===J)&&(Nt=!0)),Nt?Object.entries(he).every(([an,Ci])=>{if(Ci.length===0)return!0;const ie=an;if(ie==="techSavviness"&&De.techSavviness!==void 0){const le=De.techSavviness<30?"Low (0-30)":De.techSavviness<70?"Medium (31-70)":"High (71-100)";return Ci.includes(le)}else{if(ie==="age"&&De.age)return Ci.includes(De.age);if(ie==="gender"&&De.gender)return Ci.includes(De.gender);if(ie==="occupation"&&De.occupation)return Ci.includes(De.occupation);if(ie==="location"&&De.location)return Ci.includes(De.location);if(ie==="ethnicity"&&De.ethnicity)return Ci.includes(De.ethnicity)}return!0}):!1});return st(fe)},We=()=>{at(!1),setTimeout(()=>{Bt({...N})},0)},Je=()=>{$({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]})},At=(z,he)=>{$(fe=>{const De={...fe};return De[z].includes(he)?De[z]=De[z].filter(Nt=>Nt!==he):De[z]=[...De[z],he],De})},Yt=async()=>{try{const fe=(await Eo.getAll()).data.map(De=>({...De,id:De._id}));return Q(fe),fe}catch(z){return console.error("Error fetching folders:",z),se.error("Failed to load folders"),Q([]),[]}},Xn=async()=>{if(!ue.trim()){se.error("Please enter a folder name");return}try{const z=await Eo.create({name:ue.trim()});await Yt(),F(""),ne(!1),se.success(`Folder "${ue}" created`)}catch(z){console.error("Error creating folder:",z),se.error("Failed to create folder")}},cr=()=>{F(""),ne(!1)},ct=z=>{te(z),we(z.name)},jt=async()=>{if(!ce||!pe.trim()){te(null);return}try{await Eo.update(ce._id,{name:pe.trim()}),await Yt(),te(null),se.success(`Folder renamed to "${pe}"`)}catch(z){console.error("Error renaming folder:",z),se.error("Failed to rename folder"),te(null)}},ot=()=>{te(null),we("")};v.useEffect(()=>{const z=async()=>{V(!0);try{const fe=await Rr.getAll();console.log("Fetched personas for FocusGroupModerator:",fe.data),Array.isArray(fe.data)&&fe.data.length>0?G(fe.data):(console.warn("No personas returned from API or invalid format",fe.data),se.warning("No participants available"))}catch(fe){console.error("Error fetching personas:",fe),se.error("Failed to load participants")}finally{V(!1)}};(async()=>{await Promise.all([Yt(),z()])})()},[]),console.log("About to initialize form with useForm hook");const Ze=V0({resolver:G0(ode),defaultValues:{researchBrief:"",focusGroupName:"",discussionTopics:"",duration:"60",llm_model:"gemini-2.5-pro",reasoning_effort:"medium",verbosity:"medium"}});console.log("Form initialized successfully");const gn=()=>{c!=="setup"||Se.current||(be.current&&clearTimeout(be.current),be.current=setTimeout(async()=>{if(ke.current)return;const z=Ze.getValues(),he={name:z.focusGroupName||"",description:z.researchBrief||"",objective:z.researchBrief||"",topic:z.discussionTopics||"",duration:z.duration?parseInt(z.duration):60,llm_model:z.llm_model||"gemini-2.5-pro",reasoning_effort:z.reasoning_effort||"medium",verbosity:z.verbosity||"medium",participants:j,participants_count:j.length,status:"draft",date:new Date().toISOString(),uploadedAssets:k.map(fe=>fe.filename||fe.original_name||"unknown")};if(!(Z&&JSON.stringify(he)===JSON.stringify(Z))&&!(!he.name&&!he.description&&!he.topic)){ke.current=!0,K("saving");try{let fe=b||(t==null?void 0:t.id)||(t==null?void 0:t._id);if(console.log("Auto-save: draftFocusGroupId =",b),console.log("Auto-save: draftToEdit ID =",(t==null?void 0:t.id)||(t==null?void 0:t._id)),console.log("Auto-save: using focusGroupId =",fe),console.log("Auto-save: llm_model in currentData =",he.llm_model),console.log("Auto-save: duration in currentData =",he.duration),fe)console.log("Auto-save: Updating existing focus group:",fe),await pt.update(fe,he),console.log("Auto-save: Updated existing draft:",fe);else{console.log("Auto-save: Creating NEW focus group (no existing ID)");const De=await pt.create(he);fe=De.data.focus_group_id||De.data.id||De.data._id,x(fe),console.log("Auto-save: Created new draft with ID:",fe)}H(he),K("saved"),me(0),setTimeout(()=>{K("idle")},2e3)}catch(fe){if(console.error("Auto-save failed:",fe),K("error"),me(De=>De+1),re<3){const De=Math.pow(2,re)*2e3;setTimeout(()=>{gn()},De)}else se.error("Auto-save failed",{description:"Your changes may not be saved. Please check your connection."})}finally{ke.current=!1}}},2e3))},Os=async z=>{try{R(!0);const he=await pt.getAssets(z);O(he.data.assets||[])}catch(he){console.error("Error fetching backend assets:",he),se.error("Failed to load asset information")}finally{R(!1)}},ea=Ze.watch(),ta=v.useRef(""),yl=v.useRef("");v.useEffect(()=>{const z=JSON.stringify(ea);c==="setup"&&z!==ta.current&&(ta.current=z,gn())},[ea,c]),v.useEffect(()=>{const z=JSON.stringify(j);c==="setup"&&z!==yl.current&&(yl.current=z,gn())},[j,c]),v.useEffect(()=>(c!=="setup"&&be.current&&clearTimeout(be.current),()=>{be.current&&clearTimeout(be.current)}),[c]),v.useEffect(()=>{if(console.log("Draft loading effect - draftToEdit:",t,"draftLoadedRef.current:",_.current),!t){_.current=!1;return}if(t&&!_.current){console.log("Loading draft focus group:",t),Se.current=!0,_.current=!0;const z=t.id||t._id;x(z),console.log("Setting draft ID from draftToEdit:",z),z&&Os(z),t.name&&Ze.setValue("focusGroupName",t.name),(t.description||t.objective)&&Ze.setValue("researchBrief",t.description||t.objective||""),t.topic&&Ze.setValue("discussionTopics",t.topic),t.duration&&Ze.setValue("duration",t.duration.toString()),t.llm_model&&Ze.setValue("llm_model",t.llm_model),t.reasoning_effort&&Ze.setValue("reasoning_effort",t.reasoning_effort),t.verbosity&&Ze.setValue("verbosity",t.verbosity),t.discussionGuide&&(y(t.discussionGuide),(!s.focusGroupTab||s.previousRoute!=="/focus-groups")&&l("review")),t.participants&&Array.isArray(t.participants)&&P(t.participants);const he={name:t.name||"",description:t.description||t.objective||"",objective:t.description||t.objective||"",topic:t.topic||"",duration:t.duration||60,llm_model:t.llm_model||"gemini-2.5-pro",reasoning_effort:t.reasoning_effort||"medium",verbosity:t.verbosity||"medium",participants:t.participants||[],participants_count:(t.participants||[]).length,status:"draft",date:t.date||new Date().toISOString(),uploadedAssets:k.map(fe=>fe.filename||fe.original_name||"unknown")};H(he),console.log("Set lastSavedData to current draft:",he),se.success("Draft focus group loaded",{description:"Continue editing your focus group setup"}),setTimeout(()=>{Se.current=!1;const fe=JSON.stringify(Ze.getValues());ta.current=fe},1e3)}},[t,Ze]),v.useEffect(()=>{n.length>0&&(console.log("Pre-selected participants received:",n),P(n),l("participants"))},[n]),v.useEffect(()=>{s.focusGroupTab&&s.previousRoute==="/focus-groups"&&setTimeout(()=>{l(s.focusGroupTab),o()},0)},[s.focusGroupTab,t,o]),v.useEffect(()=>{t||setTimeout(()=>{Se.current=!1;const z=JSON.stringify(Ze.getValues());ta.current=z},500)},[t,Ze]);const q=()=>{if(B==="idle")return null;const he={saving:{text:"Saving...",className:"text-blue-600 bg-blue-50"},saved:{text:"All changes saved",className:"text-green-600 bg-green-50"},error:{text:"Save failed - retrying...",className:"text-red-600 bg-red-50"}}[B];return a.jsx("div",{className:`fixed top-16 left-1/2 transform -translate-x-1/2 z-50 px-3 py-1 rounded-md text-sm font-medium border shadow-sm ${he.className}`,children:he.text})},Oe=async(z,he)=>{var fe,De;d(!0),h(!1),g(!1);try{const Nt={name:z.focusGroupName,description:z.researchBrief,objective:z.researchBrief,topic:z.discussionTopics,duration:parseInt(z.duration),llm_model:z.llm_model,reasoning_effort:z.reasoning_effort,verbosity:z.verbosity},an=he?await pt.generateDiscussionGuideForGroup(he,Nt):await pt.generateDiscussionGuide(Nt);if(an.data&&an.data.discussionGuide)return h(!0),an.data.discussionGuide;throw new Error("Failed to generate discussion guide")}catch(Nt){console.error("Error generating discussion guide:",Nt),g(!0);let an="Unknown error occurred";throw(De=(fe=Nt==null?void 0:Nt.response)==null?void 0:fe.data)!=null&&De.error?an=Nt.response.data.error:Nt!=null&&Nt.message&&(an=Nt.message),an.includes("500")||an.includes("internal error")||an.includes("Internal Server Error")?se.error("AI service temporarily unavailable",{description:"The discussion guide generator is experiencing issues. Please try again in a few minutes.",action:{label:"Retry",onClick:()=>Oe(z)}}):se.error("Failed to generate discussion guide",{description:an,action:{label:"Retry",onClick:()=>Oe(z)}}),Nt}},Ge=()=>{d(!1),h(!1),g(!1)};async function mt(z){try{let he=b;if(!he){const fe={name:z.focusGroupName,status:"draft",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(z.duration),topic:z.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:z.researchBrief,objective:z.researchBrief,llm_model:z.llm_model,reasoning_effort:z.reasoning_effort,verbosity:z.verbosity},De=await pt.create(fe);he=De.data.focus_group_id||De.data.id||De.data._id,x(he),console.log("Draft focus group created for discussion guide generation:",De,"with ID:",he)}if(he)try{const fe={name:z.focusGroupName,participants:j,participants_count:j.length,duration:parseInt(z.duration),topic:z.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:z.researchBrief,objective:z.researchBrief,llm_model:z.llm_model,reasoning_effort:z.reasoning_effort,verbosity:z.verbosity};await pt.update(he,fe),console.log("Focus group updated with latest form values before guide generation"),console.log(`🔄 Updated focus group ${he} with model: ${z.llm_model}`)}catch(fe){console.error("Failed to update focus group before guide generation:",fe)}try{const fe=await Oe(z,he);y(fe);try{const De={name:z.focusGroupName,status:"draft",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(z.duration),topic:z.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:z.researchBrief,objective:z.researchBrief,llm_model:z.llm_model,reasoning_effort:z.reasoning_effort,verbosity:z.verbosity,discussionGuide:fe};await pt.update(he,De),console.log("Focus group updated with discussion guide"),se.success("Progress saved as draft",{description:"Your focus group setup has been automatically saved"})}catch(De){console.error("Failed to update focus group with discussion guide:",De),se.error("Failed to save draft",{description:"Discussion guide generated, but draft save failed"})}l("review"),se.success("Discussion guide generated",{description:"Review and edit before proceeding"})}catch(fe){console.error("Discussion guide generation failed:",fe),se.error("Discussion guide generation failed",{description:"Please go back to the setup tab and try generating again. Check your inputs and try a different AI model if the issue persists.",duration:8e3});return}}catch(he){console.error("Error in focus group creation flow:",he),se.error("Focus group creation failed",{description:he.message||"An unexpected error occurred"})}}const tt=(()=>{var he;const z=M.filter(fe=>{const De=fe.name.toLowerCase().includes(Y.toLowerCase())||fe.occupation&&fe.occupation.toLowerCase().includes(Y.toLowerCase())||fe.location&&fe.location.toLowerCase().includes(Y.toLowerCase()),Nt=(Be.age.length===0||Be.age.includes(fe.age))&&(Be.gender.length===0||Be.gender.includes(fe.gender))&&(Be.occupation.length===0||Be.occupation.includes(fe.occupation))&&(Be.location.length===0||Be.location.includes(fe.location))&&(Be.ethnicity.length===0||fe.ethnicity&&Be.ethnicity.includes(fe.ethnicity))&&(Be.techSavviness.length===0||fe.techSavviness!==void 0&&Be.techSavviness.includes(fe.techSavviness<30?"Low (0-30)":fe.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&!0;let an=!0;return J!==xl&&(an=!1,fe.folder_ids&&Array.isArray(fe.folder_ids)&&(an=fe.folder_ids.includes(J)),an||(fe.folder_id===J||fe.folderId===J)&&(an=!0)),De&&Nt&&an});if(console.log(`Filtered personas: ${z.length}/${M.length}`),console.log(`Selected folder: ${J===xl?"All Personas":((he=X.find(fe=>fe._id===J||fe.id===J))==null?void 0:he.name)||J}`),J!==xl){const fe=X.find(De=>De._id===J||De.id===J);if(fe){const De=M.filter(Nt=>Nt.folder_ids&&Array.isArray(Nt.folder_ids)?Nt.folder_ids.includes(J):Nt.folder_id===J||Nt.folderId===J);console.log(`Folder details: ${fe.name}, ID: ${fe._id}, Contains: ${De.length} personas`),console.log("Personas in this folder:",De.map(Nt=>Nt.name))}}return z})(),wt=z=>{console.log("Toggling selection for participant ID:",z),P(he=>{const fe=he.includes(z);console.log("Current selection:",{id:z,isCurrentlySelected:fe,currentSelections:[...he]});const De=fe?he.filter(Nt=>Nt!==z):[...he,z];return console.log("New selection:",De),De})},dn=async()=>{try{const z=Ze.getValues(),he={name:z.focusGroupName,status:"in-progress",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(z.duration),topic:z.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),discussionGuide:m},De=(await pt.create(he)).data;return console.log("Focus group created successfully:",De),De.focus_group_id}catch(z){throw console.error("Error saving focus group:",z),z}},dt=v.useCallback(async()=>{if(!C.current){se.error("No discussion guide available",{description:"Please generate a discussion guide first"});return}D(!0);try{const{downloadDiscussionGuideAsMarkdown:z}=await Vie(async()=>{const{downloadDiscussionGuideAsMarkdown:fe}=await import("./discussionGuideMarkdown-eMXneipz.js");return{downloadDiscussionGuideAsMarkdown:fe}},[]),he=Ze.getValues();z(C.current,he.focusGroupName),se.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(z){console.error("Error downloading discussion guide:",z),se.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{D(!1)}},[Ze]),_n=v.useCallback(async z=>{console.log("📝 handleSaveDiscussionGuide called with:",z),w?(C.current=z,console.log("📝 Skipping discussionGuide state update during editing to preserve focus")):(y(z),se.success("Discussion guide updated",{description:"Your changes have been saved."}))},[w]),on=v.useCallback(z=>{console.log("📝 Discussion guide editing state changed:",z),S(z),!z&&C.current&&(console.log("📝 Updating discussionGuide state after editing ended"),y(C.current))},[]),nn=v.useCallback(()=>{},[]),lr=async()=>{if(!Ze.getValues().focusGroupName){se.error("Missing focus group name",{description:"Please provide a name for the focus group"});return}if(!m){se.error("Missing discussion guide",{description:"Please generate a discussion guide first"});return}if(j.length<1){se.error("Not enough participants",{description:"Please select at least one participant for the focus group"});return}console.log("Starting focus group with participants:",j);try{se.loading("Creating focus group...");let z;if(b){const he=Ze.getValues(),fe={name:he.focusGroupName,status:"in-progress",participants:j,participants_count:j.length,date:new Date().toISOString(),duration:parseInt(he.duration),topic:he.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:he.researchBrief,objective:he.researchBrief,discussionGuide:m},De=await pt.update(b,fe);z=b,console.log("Draft focus group updated to in-progress:",De),e&&e()}else z=await dn();se.dismiss(),se.success("Focus group created successfully",{description:"The AI moderator is now running the session"}),r(`/focus-groups/${z}`)}catch(z){se.dismiss(),z!=null&&z.message,console.error("Failed to start focus group:",z),se.error("Failed to create focus group",{description:"Please try again or check your connection"})}};return a.jsxs(a.Fragment,{children:[a.jsx(q,{}),a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Vo,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Focus Group Moderator"})]}),u&&a.jsx("div",{className:"mb-6",children:a.jsx(zT,{isActive:u,isComplete:f,hasError:p,label:"Generating discussion guide",onComplete:Ge})}),a.jsxs(fl,{value:c,onValueChange:l,children:[a.jsxs(Va,{className:"grid w-full grid-cols-3 mb-6",children:[a.jsx(pn,{value:"setup",children:"Setup"}),a.jsx(pn,{value:"review",children:"Review & Edit"}),a.jsx(pn,{value:"participants",children:"Participants"})]}),a.jsx(mn,{value:"setup",children:a.jsx(W0,{...Ze,children:a.jsxs("form",{onSubmit:Ze.handleSubmit(mt),className:"space-y-6",children:[a.jsx(_t,{control:Ze.control,name:"focusGroupName",render:({field:z})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Focus Group Name"}),a.jsx(yt,{children:a.jsx(Wt,{placeholder:"e.g., Mobile App UX Evaluation",...z})}),a.jsx(Fn,{children:"Give your focus group a descriptive name"}),a.jsx(xt,{})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(_t,{control:Ze.control,name:"researchBrief",render:({field:z})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Research Brief"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"Describe your research objectives...",className:"h-36",...z})}),a.jsx(Fn,{children:"Provide context about what you want to learn"}),a.jsx(xt,{})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(_t,{control:Ze.control,name:"discussionTopics",render:({field:z})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Discussion Topics"}),a.jsx(yt,{children:a.jsx(ht,{placeholder:"List main topics to cover, separated by commas",className:"h-24",...z})}),a.jsx(Fn,{children:"E.g., User experience, feature preferences, pain points"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:Ze.control,name:"duration",render:({field:z})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Duration (minutes)"}),a.jsxs(Un,{onValueChange:z.onChange,value:z.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select duration"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"30",children:"30 minutes"}),a.jsx(ae,{value:"45",children:"45 minutes"}),a.jsx(ae,{value:"60",children:"60 minutes"}),a.jsx(ae,{value:"90",children:"90 minutes"}),a.jsx(ae,{value:"120",children:"120 minutes"})]})]}),a.jsx(Fn,{children:"How long should the focus group session last?"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:Ze.control,name:"llm_model",render:({field:z})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"AI Model"}),a.jsxs(Un,{onValueChange:z.onChange,value:z.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select AI model"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),a.jsx(ae,{value:"gpt-4.1",children:"GPT-4.1"}),a.jsx(ae,{value:"gpt-5",children:"GPT-5"})]})]}),a.jsx(Fn,{children:"Choose which AI model to use for generating responses and discussion guides"}),a.jsx(xt,{})]})}),Ze.watch("llm_model")==="gpt-5"&&a.jsxs(a.Fragment,{children:[a.jsx(_t,{control:Ze.control,name:"reasoning_effort",render:({field:z})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Reasoning Effort"}),a.jsxs(Un,{onValueChange:z.onChange,value:z.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select reasoning effort"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"minimal",children:"Minimal - Fast responses"}),a.jsx(ae,{value:"low",children:"Low - Quick thinking"}),a.jsx(ae,{value:"medium",children:"Medium - Balanced (default)"}),a.jsx(ae,{value:"high",children:"High - Deep reasoning"})]})]}),a.jsx(Fn,{children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx("div",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx(xt,{})]})}),a.jsx(_t,{control:Ze.control,name:"verbosity",render:({field:z})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Response Verbosity"}),a.jsxs(Un,{onValueChange:z.onChange,value:z.value,children:[a.jsx(yt,{children:a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select verbosity level"})})}),a.jsxs($n,{children:[a.jsx(ae,{value:"low",children:"Low - Concise responses"}),a.jsx(ae,{value:"medium",children:"Medium - Balanced length (default)"}),a.jsx(ae,{value:"high",children:"High - Detailed responses"})]})]}),a.jsx(Fn,{children:"Controls how detailed and lengthy GPT-5's responses will be"}),a.jsx("div",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx(xt,{})]})})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-2 block",children:"Creative Assets (Optional)"}),a.jsx(A3,{focusGroupId:b,disabled:!b,onUploadComplete:z=>{O(z)},onUploadError:z=>{console.error("Asset upload error:",z)},onAssetsChange:z=>{O(z)},maxAssets:10,maxFileSize:10,allowedTypes:["image/*","application/pdf","video/*","text/*","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],label:"Asset Upload",description:"Provide any files you wish the moderator to use in the focus group session. This could include mockups, designs, documents, or other materials for discussion.",enableRenaming:!0}),a.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Upload visuals that you want feedback on during the session"})]}),a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex justify-end",children:a.jsxs(ee,{type:"submit",disabled:u,className:"min-w-32",children:[a.jsx(Vo,{className:"mr-2 h-4 w-4"}),u?"Generating...":"Generate Discussion Guide"]})})})]})})}),a.jsx(mn,{value:"review",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h3",{className:"font-sf text-lg font-medium",children:"AI-Generated Discussion Guide"}),m&&a.jsx(Hn,{variant:"outline",className:"text-xs",children:A(m)?"Structured JSON":"Legacy Text"})]})}),a.jsx("div",{className:"prose max-w-none",children:m?a.jsx(VT,{discussionGuide:m,showProgress:!1,collapsible:!0,defaultExpanded:!0,className:"border-0",onSave:_n,onDownload:dt,onSectionSelect:nn,isDownloading:I,focusGroupId:b,onEditingChange:on}):a.jsx("div",{className:"bg-slate-50 p-4 rounded border text-center text-slate-600",children:p?a.jsxs("div",{children:[a.jsx("p",{className:"mb-2",children:"Discussion guide generation failed."}),a.jsxs("p",{className:"text-sm",children:["Go back to the ",a.jsx("strong",{children:"Setup"})," tab and try generating again. Check your inputs and try a different AI model if the issue persists."]})]}):a.jsx("p",{children:'No discussion guide generated yet. Complete the setup and click "Generate Discussion Guide" to create one.'})})})]})}),k.length>0&&a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Creative Assets"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-slate-600",children:"Assets that will be referenced in the discussion guide:"}),a.jsx("div",{className:"space-y-2",children:k.map((z,he)=>{var De;const fe=z.user_assigned_name||`Asset ${he+1}`;return a.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-lg bg-slate-50",children:[a.jsx("div",{className:"w-10 h-10 bg-slate-200 rounded flex items-center justify-center flex-shrink-0",children:(De=z.mime_type)!=null&&De.startsWith("image/")?a.jsx("img",{src:pt.getAssetUrl(b,z.filename),alt:fe,className:"max-h-full max-w-full object-contain rounded"}):a.jsx(Wp,{className:"h-6 w-6 text-slate-600"})}),a.jsxs("div",{className:"flex-grow",children:[a.jsxs("p",{className:"font-medium text-sm",children:['"',fe,'"']}),a.jsx("p",{className:"text-xs text-slate-500",children:"Will appear in discussion guide"})]})]},z.filename)})}),a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:a.jsxs("p",{className:"text-sm text-blue-700",children:[a.jsx("strong",{children:"Note:"})," To rename assets, go back to the Setup tab and click the edit icon next to each asset."]})})]})]})}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx(ee,{variant:"outline",onClick:()=>l("setup"),children:"Back to Setup"}),a.jsxs(ee,{onClick:()=>l("participants"),children:["Select Participants",a.jsx(Dr,{className:"ml-2 h-4 w-4"})]})]})]})}),a.jsxs(mn,{value:"participants",children:[a.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[a.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),a.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>{console.log("Clicked 'Create new folder' button"),ne(!0)},className:"h-7 w-7 p-0",children:a.jsx(u5,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("button",{onClick:()=>{console.log("Clicked 'All Personas' folder"),console.log("All personas count:",M.length),ye(xl),setTimeout(()=>{console.log(`Will show all ${M.length} personas`)},0)},className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${J===xl?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx("span",{children:"All Personas"})]}),X.map(z=>a.jsx("div",{className:"flex items-center justify-between group",children:ce&&ce._id===z._id?a.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx(Wt,{value:pe,onChange:he=>we(he.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:he=>{he.key==="Enter"?jt():he.key==="Escape"&&ot()}}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming folder rename: "${ce==null?void 0:ce.name}" to "${pe}"`),jt()},className:"h-7 w-7 p-0",children:a.jsx(Es,{className:"h-4 w-4"})}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Cancelling rename of folder: "${ce==null?void 0:ce.name}"`),ot()},className:"h-7 w-7 p-0",children:a.jsx(Ri,{className:"h-4 w-4"})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>{console.log(`Clicked folder: ${z.name} (ID: ${z._id})`);const he=M.filter(fe=>fe.folder_ids&&Array.isArray(fe.folder_ids)?fe.folder_ids.includes(z._id):fe.folder_id===z._id||fe.folderId===z._id);console.log(`Current persona count in folder: ${he.length}`),console.log("All personas count:",M.length),ye(z._id),setTimeout(()=>{console.log(`Will show ${he.length} personas after filtering`),console.log("Filtered personas:",he.map(fe=>fe.name))},0)},className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${J===z._id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx("span",{children:z.name}),a.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:M.filter(he=>he.folder_ids&&Array.isArray(he.folder_ids)?he.folder_ids.includes(z._id):he.folder_id===z._id||he.folderId===z._id).length})]}),a.jsxs(P1,{children:[a.jsx(k1,{asChild:!0,children:a.jsx(ee,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:a.jsx(B_,{className:"h-4 w-4"})})}),a.jsx(Ix,{align:"end",children:a.jsx(ic,{onClick:()=>{console.log(`Initiating rename for folder: ${z.name} (ID: ${z.id})`),ct(z)},children:"Rename"})})]})]})},z._id)),U&&a.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[a.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[a.jsx(ds,{className:"h-4 w-4"}),a.jsx(Wt,{value:ue,onChange:z=>F(z.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:z=>{z.key==="Enter"?Xn():z.key==="Escape"&&cr()}})]}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming creation of new folder: "${ue}"`),Xn()},className:"h-7 w-7 p-0",children:a.jsx(Es,{className:"h-4 w-4"})}),a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>{console.log("Cancelling folder creation"),cr()},className:"h-7 w-7 p-0",children:a.jsx(Ri,{className:"h-4 w-4"})})]})]})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx(ut,{className:"mb-4",children:a.jsx(Rt,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Select Participants"}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Dr,{className:"h-5 w-5 mr-2 text-muted-foreground"}),a.jsxs("span",{className:"text-sm font-medium",children:[j.length," of ",tt.length," selected"]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx($E,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),a.jsx(Wt,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:Y,onChange:z=>nt(z.target.value)})]}),a.jsxs(ee,{variant:"outline",className:"flex items-center gap-2",onClick:()=>at(!0),children:[a.jsx(ME,{className:"h-4 w-4"}),a.jsxs("span",{children:["Filter",Object.values(Be).some(z=>z.length>0)?` (${Object.values(Be).reduce((z,he)=>z+he.length,0)})`:""]})]})]}),L?a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx(Js,{className:"h-8 w-8 animate-spin text-primary"})}):tt.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:tt.map(z=>{const he=z._id||z.id;return a.jsx(fT,{user:{id:he,_id:z._id,name:z.name,age:z.age,gender:z.gender,occupation:z.occupation,location:z.location||"Unknown",techSavviness:z.techSavviness||50,personality:z.personality||"No description available",oceanTraits:z.oceanTraits,qualitativeAttributes:z.qualitativeAttributes,topPersonalityTraits:z.topPersonalityTraits,aiSynthesizedBio:z.aiSynthesizedBio},selected:j.includes(he),onSelectionToggle:()=>wt(he),onViewDetails:qe},he)})}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-muted-foreground",children:"No personas available matching your criteria."})})]})})}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx(ee,{variant:"outline",onClick:()=>l("review"),children:"Back to Review"}),a.jsxs(ee,{onClick:lr,disabled:j.length<1||!m,children:[a.jsx(oZ,{className:"mr-2 h-4 w-4"}),"Start Focus Group Session"]})]})]})]}),a.jsx(Jl,{open:Ue,onOpenChange:z=>{z?(at(z),$({...Be})):at(!1)},children:a.jsxs($c,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Lc,{children:[a.jsx(Uc,{children:"Filter Personas"}),a.jsx(Zl,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic."})]}),a.jsxs("div",{className:"py-4 space-y-6",children:[Object.values(N).some(z=>z.length>0)&&a.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(N).reduce((z,he)=>z+he.length,0)," active filters"]})}),(()=>{const z=st(M),he=Object.values(N).every(De=>De.length===0),fe=(De,Nt,an=1)=>{const Ci=he?z[Nt]:Dt(Nt)[Nt],ie=N[Nt],le=[...new Set([...Ci,...ie])].sort();return le.length===0?null:a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:De}),a.jsx("div",{className:`grid grid-cols-1 ${an===2?"sm:grid-cols-2":an===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:le.map(Te=>{const $e=N[Nt].includes(Te),He=Ci.includes(Te);return a.jsxs("div",{className:`flex items-center space-x-2 ${!He&&!$e?"opacity-50":""}`,children:[a.jsx($l,{id:`${Nt}-${Te}`,checked:$e,onCheckedChange:()=>At(Nt,Te),disabled:!He&&!$e}),a.jsxs(hs,{htmlFor:`${Nt}-${Te}`,className:"truncate overflow-hidden",children:[Te,$e&&!He&&a.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},Te)})})]})};return a.jsxs(a.Fragment,{children:[fe("Gender","gender",3),fe("Age","age",3),fe("Ethnicity","ethnicity",2),fe("Location","location",2),fe("Occupation","occupation",2),fe("Tech Savviness","techSavviness",3),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()]}),a.jsxs(Fc,{children:[a.jsx(ee,{variant:"outline",onClick:Je,children:"Reset"}),a.jsx(ee,{onClick:We,children:"Apply Filters"})]})]})})]})]})]})]})}const cde=[{id:"1",name:"Mobile App UX Evaluation",status:"completed",participants:6,date:"2023-06-10T14:00:00Z",duration:60,topic:"user-experience"},{id:"2",name:"Product Feature Feedback",status:"scheduled",participants:8,date:"2023-06-15T10:00:00Z",duration:90,topic:"product-feedback"},{id:"3",name:"Marketing Campaign Testing",status:"in-progress",participants:5,date:"2023-06-12T15:30:00Z",duration:45,topic:"creative-testing"},{id:"4",name:"Website Navigation Study",status:"scheduled",participants:7,date:"2023-06-18T13:00:00Z",duration:60,topic:"user-experience"}],lde={completed:"bg-green-100 text-green-800 border-green-200",scheduled:"bg-blue-100 text-blue-800 border-blue-200","in-progress":"bg-amber-100 text-amber-800 border-amber-200",active:"bg-amber-100 text-amber-800 border-amber-200",paused:"bg-purple-100 text-purple-800 border-purple-200",new:"bg-slate-100 text-slate-800 border-slate-200",ai_mode:"bg-amber-100 text-amber-800 border-amber-200",draft:"bg-gray-100 text-gray-800 border-gray-200"},ude=()=>{console.log("FocusGroups component rendering");const[t,e]=v.useState("view"),[n,r]=v.useState(""),[i,s]=v.useState([]),[o,c]=v.useState(!0),[l,u]=v.useState([]),[d,f]=v.useState(!1),[h,p]=v.useState(!1),[g,m]=v.useState(null),y=ar(),b=Ui(),[x,w]=v.useState([]),S=v.useRef(!0),C=async(E=!0)=>{if(console.log("fetchFocusGroups called with isMountedCheck:",E),console.log("isMounted.current:",S.current),E&&!S.current){console.log("Exiting early: component not mounted");return}console.log("Setting loading to true and making API call"),c(!0);try{console.log("Calling focusGroupsApi.getAll()");const R=await pt.getAll();if(console.log("API response received:",R),!E||S.current){const M=R.data.map(G=>({...G,id:G.id||G._id,participants_count:Array.isArray(G.participants)?G.participants.length:typeof G.participants=="number"?G.participants:0}));s(M)}}catch(R){console.error("Error fetching focus groups:",R),(!E||S.current)&&(Fe.error("Failed to load focus groups"),s(cde))}finally{(!E||S.current)&&c(!1)}},_=async E=>{try{const R=await pt.getById(E);R&&R.data&&(m(R.data),e("create"))}catch(R){console.error("Error fetching focus group for edit:",R),Fe.error("Failed to load focus group for editing")}};v.useEffect(()=>(console.log("useEffect running - about to fetch focus groups"),C(),()=>{console.log("useEffect cleanup - setting isMounted to false"),S.current=!1}),[]),v.useEffect(()=>{console.log("Mode change useEffect running, mode:",t),t==="view"&&(console.log("Mode is view, calling fetchFocusGroups"),C())},[t]),v.useEffect(()=>{const E=b.state;(E==null?void 0:E.mode)==="create"&&(E!=null&&E.preSelectedParticipants)&&(w(E.preSelectedParticipants),e("create"),y(b.pathname,{replace:!0,state:null}))},[b.state,b.pathname,y]),v.useEffect(()=>{const E=new URLSearchParams(b.search),R=E.get("mode"),M=E.get("id"),G=E.get("tab");if(R==="create")e("create"),m(null);else if(R==="edit"&&M){const L=i.find(V=>(V._id||V.id)===M);L?(m(L),e("create")):_(M)}if(R||M||G){const L=b.pathname;y(L,{replace:!0})}},[b.search,i,y,b.pathname]);const A=i.filter(E=>E.name.toLowerCase().includes(n.toLowerCase())||E.topic.toLowerCase().includes(n.toLowerCase())),j=E=>new Date(E).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),P=E=>new Date(E).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),k=E=>{u(R=>R.includes(E)?R.filter(M=>M!==E):[...R,E])},O=async()=>{if(l.length!==0){p(!0);try{const E=l.map(R=>pt.delete(R));await Promise.all(E),s(R=>R.filter(M=>!l.includes(M.id||M._id||""))),u([]),Fe.success(`${l.length} focus group${l.length>1?"s":""} deleted successfully`)}catch(E){console.error("Error deleting focus groups:",E),Fe.error("Failed to delete focus groups")}finally{p(!1),f(!1)}}};return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(_a,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Focus Groups"}),a.jsx("p",{className:"text-slate-600 mt-1",children:"Set up and manage AI-moderated research sessions"})]}),a.jsx("div",{className:"mt-4 sm:mt-0",children:a.jsx(ee,{onClick:()=>{console.log("Create New Focus Group button clicked, current mode:",t);try{t==="view"?(console.log("Setting draft to null and switching to create mode"),m(null),e("create")):(console.log("Switching back to view mode"),e("view"))}catch(E){console.error("Error in Create New Focus Group onClick:",E)}},className:"hover-transition",children:t==="view"?"Create New Focus Group":"View All Focus Groups"})})]}),t==="view"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx($E,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),a.jsx(Wt,{placeholder:"Search focus groups by name or topic...",className:"pl-10 bg-white",value:n,onChange:E=>r(E.target.value)})]}),a.jsxs(ee,{variant:"outline",className:"flex items-center gap-2",children:[a.jsx(ME,{className:"h-4 w-4"}),a.jsx("span",{children:"Filter"})]})]}),a.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vo,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Your Focus Groups"})]}),l.length>0&&a.jsxs(ee,{variant:"destructive",size:"sm",onClick:()=>f(!0),disabled:h,className:"flex items-center gap-2",children:[a.jsx(qn,{className:"h-4 w-4"}),"Delete Selected (",l.length,")"]})]}),o?a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx(Js,{className:"h-8 w-8 animate-spin text-primary"})}):A.length>0?a.jsx("div",{className:"space-y-4",children:A.map(E=>a.jsx("div",{className:"glass-card rounded-xl overflow-hidden hover:shadow-md button-transition",children:a.jsxs("div",{className:"flex flex-col md:flex-row",children:[a.jsxs("div",{className:"flex-1 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx($l,{id:`select-${E.id||E._id}`,checked:l.includes(E.id||E._id||""),onCheckedChange:()=>k(E.id||E._id||""),className:"mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:E.name}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(BJ,{className:"h-4 w-4 mr-1"}),j(E.date)]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Kp,{className:"h-4 w-4 mr-1"}),P(E.date)]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Dr,{className:"h-4 w-4 mr-1"}),E.participants_count||(Array.isArray(E.participants)?E.participants.length:0)," participant",E.participants_count>1||Array.isArray(E.participants)&&E.participants.length>1?"s":""]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Kp,{className:"h-4 w-4 mr-1"}),E.duration," min"]})]})]})]}),a.jsxs("div",{className:Pe("px-3 py-1 rounded-full text-xs font-medium border",lde[E.status]||"bg-gray-100 text-gray-800 border-gray-200"),children:[E.status==="completed"&&"Completed",E.status==="scheduled"&&"Scheduled",E.status==="in-progress"&&"In Progress",E.status==="active"&&"In Progress",E.status==="ai_mode"&&"In Progress",E.status==="paused"&&"Paused",E.status==="new"&&"Not Started",E.status==="draft"&&"Draft",!["completed","scheduled","in-progress","active","ai_mode","paused","new","draft"].includes(E.status)&&E.status]})]}),a.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[a.jsxs("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:[E.topic==="user-experience"&&"User Experience",E.topic==="product-feedback"&&"Product Feedback",E.topic==="creative-testing"&&"Creative Testing",E.topic==="messaging-evaluation"&&"Messaging Evaluation",E.topic&&!["user-experience","product-feedback","creative-testing","messaging-evaluation"].includes(E.topic)&&E.topic.charAt(0).toUpperCase()+E.topic.slice(1).replace(/-/g," ")]}),a.jsx("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:"AI Moderated"})]})]}),a.jsx("div",{className:"bg-slate-50 p-6 flex flex-col justify-center items-center md:border-l border-slate-100",children:a.jsx(ee,{variant:E.status==="in-progress"||E.status==="active"||E.status==="ai_mode"?"default":E.status==="new"||E.status==="draft"?"outline":"default",className:Pe("w-full hover-transition",E.status==="new"?"bg-slate-200 text-slate-700 hover:bg-slate-300 border-slate-300":"",E.status==="draft"?"bg-gray-200 text-gray-700 hover:bg-gray-300 border-gray-300":""),onClick:()=>{if(E.status==="draft")m(E),e("create");else{const R=E.id||E._id;console.log("Navigating to focus group:",R),y(`/focus-groups/${R}`)}},children:E.status==="completed"?a.jsxs(a.Fragment,{children:["View Session",a.jsx(us,{className:"ml-2 h-4 w-4"})]}):E.status==="in-progress"||E.status==="active"||E.status==="ai_mode"?a.jsxs(a.Fragment,{children:["Join Session",a.jsx(us,{className:"ml-2 h-4 w-4"})]}):E.status==="paused"?a.jsxs(a.Fragment,{children:["Session Details",a.jsx(us,{className:"ml-2 h-4 w-4"})]}):E.status==="scheduled"?a.jsxs(a.Fragment,{children:["View Details",a.jsx(us,{className:"ml-2 h-4 w-4"})]}):E.status==="new"?a.jsxs(a.Fragment,{children:["View Session",a.jsx(us,{className:"ml-2 h-4 w-4"})]}):E.status==="draft"?a.jsxs(a.Fragment,{children:["Edit",a.jsx(us,{className:"ml-2 h-4 w-4"})]}):a.jsxs(a.Fragment,{children:["View Session",a.jsx(us,{className:"ml-2 h-4 w-4"})]})})})]})},E.id))}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-muted-foreground",children:"No focus groups found matching your search criteria."})})]})]}):a.jsx(ade,{draftToEdit:g,preSelectedParticipants:x,onDraftSaved:()=>{m(null),e("view"),w([]),C()}})]}),a.jsx(O1,{open:d,onOpenChange:f,children:a.jsxs(Mx,{children:[a.jsxs(Dx,{children:[a.jsxs(Lx,{children:["Delete ",l.length," Focus Group",l.length!==1?"s":"","?"]}),a.jsxs(Fx,{children:["This action cannot be undone. This will permanently delete the selected focus group",l.length!==1?"s":""," and remove all data associated with ",l.length!==1?"them":"it","."]})]}),a.jsxs($x,{children:[a.jsx(Bx,{disabled:h,children:"Cancel"}),a.jsx(Ux,{onClick:E=>{E.preventDefault(),O()},disabled:h,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:h?a.jsxs(a.Fragment,{children:[a.jsx(Js,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):a.jsx(a.Fragment,{children:"Delete"})})]})]})})]})},dde=({participants:t,selectedParticipantIds:e,onToggleParticipantFilter:n})=>{const r=ar(),{id:i}=OE(),{setPreviousRoute:s}=xg(),o=l=>{const u=l.id||l._id;u&&i&&(s(`/focus-groups/${i}`,{focusGroupId:i}),r(`/personas/${u}`))},c=l=>{const u=l.id||l._id;u&&n(u)};return a.jsx("div",{className:"w-full lg:w-64 shrink-0",children:a.jsxs("div",{className:"glass-panel rounded-xl p-4",children:[a.jsxs("h2",{className:"font-sf text-lg font-semibold flex items-center mb-3",children:[a.jsx(Dr,{className:"h-5 w-5 text-primary mr-2"})," Participants"]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center p-2 bg-primary/5 rounded-lg",children:[a.jsx(va,{className:"h-8 w-8 text-primary mr-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-primary",children:"AI Moderator"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Session facilitator"})]})]}),t.map(l=>{const u=l.id||l._id,d=e.includes(u);return a.jsxs("div",{className:`flex items-center p-2 rounded-lg transition-colors ${d?"bg-blue-50 border border-blue-200":"hover:bg-slate-100"}`,children:[a.jsx("div",{className:"cursor-pointer mr-3",onClick:()=>o(l),title:`View ${l.name}'s profile`,children:a.jsx("img",{src:_g(l),alt:l.name,className:"h-8 w-8 rounded-full object-cover"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("p",{className:"font-medium cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>c(l),title:`Filter to show only ${l.name}'s messages`,children:l.name}),d&&a.jsx(Es,{className:"h-4 w-4 text-blue-600 ml-2"})]}),a.jsx("p",{className:"text-xs text-slate-500",children:l.occupation})]})]},l.id)})]})]})})};function fde(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}var GT="ScrollArea",[aV,xFe]=Fi(GT),[hde,Ts]=aV(GT),cV=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...o}=t,[c,l]=v.useState(null),[u,d]=v.useState(null),[f,h]=v.useState(null),[p,g]=v.useState(null),[m,y]=v.useState(null),[b,x]=v.useState(0),[w,S]=v.useState(0),[C,_]=v.useState(!1),[A,j]=v.useState(!1),P=Ot(e,O=>l(O)),k=Pu(i);return a.jsx(hde,{scope:n,type:r,dir:k,scrollHideDelay:s,scrollArea:c,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:_,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:A,onScrollbarYEnabledChange:j,onCornerWidthChange:x,onCornerHeightChange:S,children:a.jsx(it.div,{dir:k,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});cV.displayName=GT;var lV="ScrollAreaViewport",uV=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,asChild:i,nonce:s,...o}=t,c=Ts(lV,n),l=v.useRef(null),u=Ot(e,l,c.onViewportChange);return a.jsxs(a.Fragment,{children:[a.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; +} +:where([data-radix-scroll-area-viewport]) { + display: flex; + flex-direction: column; + align-items: stretch; +} +:where([data-radix-scroll-area-content]) { + flex-grow: 1; +} +`},nonce:s}),a.jsx(it.div,{"data-radix-scroll-area-viewport":"",...o,asChild:i,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:Cde({asChild:i,children:r},d=>a.jsx("div",{"data-radix-scroll-area-content":"",ref:c.onContentChange,style:{minWidth:c.scrollbarXEnabled?"fit-content":void 0},children:d}))})]})});uV.displayName=lV;var Xo="ScrollAreaScrollbar",KT=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ts(Xo,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,c=t.orientation==="horizontal";return v.useEffect(()=>(c?s(!0):o(!0),()=>{c?s(!1):o(!1)}),[c,s,o]),i.type==="hover"?a.jsx(pde,{...r,ref:e,forceMount:n}):i.type==="scroll"?a.jsx(mde,{...r,ref:e,forceMount:n}):i.type==="auto"?a.jsx(dV,{...r,ref:e,forceMount:n}):i.type==="always"?a.jsx(WT,{...r,ref:e}):null});KT.displayName=Xo;var pde=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ts(Xo,t.__scopeScrollArea),[s,o]=v.useState(!1);return v.useEffect(()=>{const c=i.scrollArea;let l=0;if(c){const u=()=>{window.clearTimeout(l),o(!0)},d=()=>{l=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),a.jsx(Kr,{present:n||s,children:a.jsx(dV,{"data-state":s?"visible":"hidden",...r,ref:e})})}),mde=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ts(Xo,t.__scopeScrollArea),s=t.orientation==="horizontal",o=aw(()=>l("SCROLL_END"),100),[c,l]=fde("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 v.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,i.scrollHideDelay,l]),v.useEffect(()=>{const u=i.viewport,d=s?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(l("SCROLL"),o()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[i.viewport,s,l,o]),a.jsx(Kr,{present:n||c!=="hidden",children:a.jsx(WT,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Ne(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ne(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),dV=v.forwardRef((t,e)=>{const n=Ts(Xo,t.__scopeScrollArea),{forceMount:r,...i}=t,[s,o]=v.useState(!1),c=t.orientation==="horizontal",l=aw(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,i=Ts(Xo,t.__scopeScrollArea),s=v.useRef(null),o=v.useRef(0),[c,l]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=gV(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,p){return wde(h,o.current,c,p)}return n==="horizontal"?a.jsx(gde,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollLeft,p=AR(h,c,i.dir);s.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?a.jsx(vde,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollTop,p=AR(h,c);s.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),gde=v.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,s=Ts(Xo,t.__scopeScrollArea),[o,c]=v.useState(),l=v.useRef(null),u=Ot(e,l,s.onScrollbarXChange);return v.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),a.jsx(hV,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ow(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(h),yV(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:zx(o.paddingLeft),paddingEnd:zx(o.paddingRight)}})}})}),vde=v.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,s=Ts(Xo,t.__scopeScrollArea),[o,c]=v.useState(),l=v.useRef(null),u=Ot(e,l,s.onScrollbarYChange);return v.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),a.jsx(hV,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ow(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(h),yV(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:zx(o.paddingTop),paddingEnd:zx(o.paddingBottom)}})}})}),[yde,fV]=aV(Xo),hV=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=t,p=Ts(Xo,n),[g,m]=v.useState(null),y=Ot(e,P=>m(P)),b=v.useRef(null),x=v.useRef(""),w=p.viewport,S=r.content-r.viewport,C=Cr(d),_=Cr(l),A=aw(f,10);function j(P){if(b.current){const k=P.clientX-b.current.left,O=P.clientY-b.current.top;u({x:k,y:O})}}return v.useEffect(()=>{const P=k=>{const O=k.target;(g==null?void 0:g.contains(O))&&C(k,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[w,g,S,C]),v.useEffect(_,[r,_]),tf(g,A),tf(p.content,A),a.jsx(yde,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Cr(s),onThumbPointerUp:Cr(o),onThumbPositionChange:_,onThumbPointerDown:Cr(c),children:a.jsx(it.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:Ne(t.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),b.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),j(P))}),onPointerMove:Ne(t.onPointerMove,j),onPointerUp:Ne(t.onPointerUp,P=>{const k=P.target;k.hasPointerCapture(P.pointerId)&&k.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),Hx="ScrollAreaThumb",pV=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=fV(Hx,t.__scopeScrollArea);return a.jsx(Kr,{present:n||i.hasThumb,children:a.jsx(xde,{ref:e,...r})})}),xde=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,s=Ts(Hx,n),o=fV(Hx,n),{onThumbPositionChange:c}=o,l=Ot(e,f=>o.onThumbChange(f)),u=v.useRef(),d=aw(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const f=s.viewport;if(f){const h=()=>{if(d(),!u.current){const p=Sde(f,c);u.current=p,c()}};return c(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[s.viewport,d,c]),a.jsx(it.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ne(t.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),g=f.clientX-p.left,m=f.clientY-p.top;o.onThumbPointerDown({x:g,y:m})}),onPointerUp:Ne(t.onPointerUp,o.onThumbPointerUp)})});pV.displayName=Hx;var qT="ScrollAreaCorner",mV=v.forwardRef((t,e)=>{const n=Ts(qT,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(bde,{...t,ref:e}):null});mV.displayName=qT;var bde=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=Ts(qT,n),[s,o]=v.useState(0),[c,l]=v.useState(0),u=!!(s&&c);return tf(i.scrollbarX,()=>{var f;const d=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(d),l(d)}),tf(i.scrollbarY,()=>{var f;const d=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(d),o(d)}),u?a.jsx(it.div,{...r,ref:e,style:{width:s,height:c,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function zx(t){return t?parseInt(t,10):0}function gV(t,e){const n=t/e;return isNaN(n)?0:n}function ow(t){const e=gV(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function wde(t,e,n,r="ltr"){const i=ow(n),s=i/2,o=e||s,c=i-o,l=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return vV([l,u],f)(t)}function AR(t,e,n="ltr"){const r=ow(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,c=s-r,l=n==="ltr"?[0,o]:[o*-1,0],u=vm(t,l);return vV([0,o],[0,c])(u)}function vV(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function yV(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const s={left:t.scrollLeft,top:t.scrollTop},o=n.left!==s.left,c=n.top!==s.top;(o||c)&&e(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function aw(t,e){const n=Cr(t),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function tf(t,e){const n=Cr(e);Gr(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}function Cde(t,e){const{asChild:n,children:r}=t;if(!n)return typeof e=="function"?e(r):e;const i=v.Children.only(r);return v.cloneElement(i,{children:typeof e=="function"?e(i.props.children):e})}var xV=cV,_de=uV,Ade=mV;const cw=v.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(xV,{ref:r,className:Pe("relative overflow-hidden",t),...n,children:[a.jsx(_de,{className:"h-full w-full rounded-[inherit]",children:e}),a.jsx(bV,{}),a.jsx(Ade,{})]}));cw.displayName=xV.displayName;const bV=v.forwardRef(({className:t,orientation:e="vertical",...n},r)=>a.jsx(KT,{ref:r,orientation:e,className:Pe("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:a.jsx(pV,{className:"relative flex-1 rounded-full bg-border"})}));bV.displayName=KT.displayName;const jde=({participants:t,isVisible:e,selectedIndex:n,onSelect:r,onClose:i,position:s})=>{const o=v.useRef(null);return v.useEffect(()=>{const c=l=>{o.current&&!o.current.contains(l.target)&&i()};if(e)return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[e,i]),v.useEffect(()=>{if(e&&n>=0&&o.current){const c=o.current.children[n];c&&c.scrollIntoView({block:"nearest",behavior:"smooth"})}},[n,e]),!e||t.length===0?null:a.jsxs("div",{ref:o,className:"absolute z-50 w-64 max-h-48 overflow-y-auto bg-white border border-slate-200 rounded-lg shadow-lg",style:{top:s.top,left:s.left},children:[t.map((c,l)=>{const u=c.id||c._id,d=l===n;return a.jsxs("div",{className:`flex items-center p-3 cursor-pointer transition-colors ${d?"bg-blue-50 border-l-4 border-blue-500":"hover:bg-slate-50"}`,onClick:()=>r(c),children:[a.jsx("img",{src:_g(c),alt:c.name,className:"h-8 w-8 rounded-full object-cover mr-3 flex-shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:`font-medium truncate ${d?"text-blue-900":"text-slate-900"}`,children:c.name}),a.jsx("p",{className:`text-sm truncate ${d?"text-blue-600":"text-slate-500"}`,children:c.occupation})]})]},u)}),t.length===0&&a.jsx("div",{className:"p-3 text-center text-slate-500 text-sm",children:"No participants found"})]})};function R1(t,e){const n=[],r=[],i=/@(\w+(?:\s+\w+)*?)(?=\s+and\s|\s+or\s|\s*[^\w\s]|\s*$)/g;let s;for(;(s=i.exec(t))!==null;){const o=s[1],c=s.index,l=s.index+s[0].length,u=e.find(d=>d.name.toLowerCase()===o.toLowerCase());if(u){const d=u.id||u._id;d&&(n.push({id:d,name:u.name,startIndex:c,endIndex:l}),r.includes(d)||r.push(d))}}return{text:t,mentions:n,mentionedParticipantIds:r}}function Ede(t,e){if(e.length===0)return[t];const n=[];let r=0;return[...e].sort((s,o)=>s.startIndex-o.startIndex).forEach((s,o)=>{s.startIndex>r&&n.push(t.slice(r,s.startIndex)),n.push(T.createElement("span",{key:`mention-${o}`,className:"text-blue-600 bg-blue-50 px-1 rounded font-medium"},`@${s.name}`)),r=s.endIndex}),r=0;n--){const r=t[n];if(r==="@"){if(n===0||/\s/.test(t[n-1]))return n}else if(/\s/.test(r))break}return null}function Pde(t,e,n){return t.slice(e+1,n).toLowerCase()}function kde(t,e){return e?t.filter(n=>n.name.toLowerCase().includes(e)):t}const wV=v.forwardRef(({value:t,onChange:e,participants:n,placeholder:r="Ask a question or provide guidance...",className:i="",disabled:s=!1},o)=>{const[c,l]=v.useState(!1),[u,d]=v.useState(0),[f,h]=v.useState({top:0,left:0}),[p,g]=v.useState(null),[m,y]=v.useState([]),b=v.useRef(null),x=v.useRef(null);v.useEffect(()=>{o&&b.current&&(typeof o=="function"?o(b.current):o.current=b.current)},[o]);const w=()=>{if(b.current&&x.current&&p!==null){const j=b.current,P=x.current,k=document.createElement("div");k.style.position="absolute",k.style.visibility="hidden",k.style.whiteSpace="pre",k.style.font=window.getComputedStyle(j).font,k.textContent=t.slice(0,p),document.body.appendChild(k);const O=k.offsetWidth;document.body.removeChild(k);const E=P.getBoundingClientRect(),R=j.getBoundingClientRect();h({top:R.height+4,left:Math.min(O,E.width-280)})}},S=j=>{const P=j.target.value,k=j.target.selectionStart||0,O=Tde(P,k);if(O!==null&&n.length>0){const R=Pde(P,O,k),M=kde(n,R);g(O),y(M),d(0),l(!0)}else l(!1),g(null);const E=R1(P,n);e(P,E)},C=j=>{if(c&&m.length>0)switch(j.key){case"ArrowDown":j.preventDefault(),d(P=>PP>0?P-1:m.length-1);break;case"Enter":case"Tab":j.preventDefault(),m[u]&&_(m[u]);break;case"Escape":j.preventDefault(),l(!1);break}},_=j=>{if(p!==null&&b.current){const P=b.current.selectionStart||0,{newText:k,newCursorPosition:O}=Nde(t,P,j,p),E=R1(k,n);e(k,E),setTimeout(()=>{b.current&&(b.current.focus(),b.current.setSelectionRange(O,O))},0),l(!1),g(null)}},A=()=>{l(!1),g(null)};return v.useEffect(()=>{c&&p!==null&&w()},[c,p,t]),a.jsxs("div",{ref:x,className:`relative ${i}`,children:[a.jsx("input",{ref:b,type:"text",value:t,onChange:S,onKeyDown:C,placeholder:r,disabled:s,className:"flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),a.jsx(jde,{participants:m,isVisible:c,selectedIndex:u,onSelect:_,onClose:A,position:f})]})});wV.displayName="MentionInput";const Ode=({message:t,persona:e,toggleHighlight:n,participants:r=[],focusGroupId:i})=>{const[s,o]=v.useState(!1),c=t.senderId==="moderator",l=t.senderId==="facilitator",u=R1(t.text,r),d=Ede(t.text,u.mentions),f=(c||l)&&(t.visualAsset||g(t.text))&&i,p=(()=>{if(t.visualAsset)return{filename:t.visualAsset.filename,displayReference:t.visualAsset.displayReference};{const y=g(t.text);return y?{filename:y,displayReference:y}:null}})();function g(y){const b=[/titled\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/asset\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/(fg-[a-f0-9]+-[a-f0-9]{32}\.(jpg|jpeg|png))/i];for(const x of b){const w=y.match(x);if(w)return w[1]}return null}const m=()=>{n()};return a.jsxs("div",{id:`message-${t.id}`,className:Pe("flex items-start p-3 rounded-lg transition-colors",t.highlighted?"bg-amber-50 border border-amber-200":"hover:bg-slate-50",c?"border-l-4 border-l-primary pl-4":"",l?"border-l-4 border-l-green-500 pl-4":""),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-highlighted":t.highlighted?"true":"false",children:[a.jsx("div",{className:"flex-shrink-0 mr-3",children:c?a.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:a.jsx(va,{className:"h-6 w-6 text-primary"})}):l?a.jsx("div",{className:"bg-green-100 p-2 rounded-full",children:a.jsx(qp,{className:"h-6 w-6 text-green-600"})}):e?a.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:a.jsx("img",{src:_g(e),alt:`${e.name} avatar`,className:"h-6 w-6 rounded-full object-cover"})}):a.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:a.jsx(GJ,{className:"h-6 w-6 text-slate-600"})})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center mb-1",children:[a.jsx("span",{className:"font-medium mr-2",children:c?"AI Moderator":l?"Human Facilitator":(e==null?void 0:e.name)||"Unknown"}),!c&&!l&&e&&a.jsx(Hn,{variant:"outline",className:"text-xs font-normal",children:e.occupation}),a.jsx("span",{className:"text-xs text-slate-500 ml-auto",children:t.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),a.jsx("p",{className:"text-slate-700",children:!t.text||t.text.trim()===""||t.text==="..."?a.jsx("span",{className:"text-red-500 italic",children:"[No response content - AI generation may have failed]"}):d}),f&&p&&a.jsxs("div",{className:"mt-3 p-3 border rounded-lg bg-slate-50",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(op,{className:"h-4 w-4 text-slate-600"}),a.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Creative Asset"}),p.displayReference!==p.filename&&a.jsxs("span",{className:"text-xs text-slate-500",children:["(",p.displayReference,")"]})]}),a.jsx("img",{src:pt.getAssetUrl(i,p.filename),alt:"Creative asset for review",className:"max-w-full h-auto rounded border shadow-sm",style:{maxHeight:"300px"},onError:y=>{var x;console.error("Failed to load creative asset:",pt.getAssetUrl(i,p.filename)),y.currentTarget.style.display="none";const b=document.createElement("div");b.className="text-xs text-slate-500 italic p-2 border rounded bg-slate-100",b.textContent=`Creative asset not found: ${p.displayReference}`,(x=y.currentTarget.parentNode)==null||x.appendChild(b)}})]}),a.jsx("div",{className:Pe("flex mt-2 space-x-2",!s&&!t.highlighted&&"hidden"),children:a.jsxs(ee,{variant:"ghost",size:"sm",onClick:m,className:"h-8 px-2 text-xs",children:[a.jsx(fZ,{className:Pe("h-3 w-3 mr-1",t.highlighted?"fill-amber-400 text-amber-400":"text-slate-400")}),t.highlighted?"Highlighted":"Highlight"]})})]})]})},Ide=({action:t})=>{switch(t){case"moderator_speak":return a.jsx(Vo,{className:"h-4 w-4 text-blue-500"});case"participant_respond":return a.jsx(Dr,{className:"h-4 w-4 text-green-500"});case"participant_interaction":return a.jsx(Dr,{className:"h-4 w-4 text-purple-500"});case"probe_trigger":return a.jsx(d5,{className:"h-4 w-4 text-orange-500"});case"end_session":return a.jsx(mZ,{className:"h-4 w-4 text-red-500"});default:return a.jsx(lu,{className:"h-4 w-4 text-gray-500"})}},Rde=({status:t})=>{switch(t){case"success":return a.jsx(IE,{className:"h-3 w-3 text-green-500"});case"error":return a.jsx(KJ,{className:"h-3 w-3 text-red-500"});case"pending":return a.jsx(Kp,{className:"h-3 w-3 text-yellow-500 animate-pulse"});default:return null}},Mde=({action:t})=>({moderator_speak:"Moderator",participant_respond:"Participant Response",participant_interaction:"Participant Interaction",probe_trigger:"Probe Question",end_session:"End Session"})[t]||t,Dde=t=>{try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return t}},$de=({entry:t,isLatest:e})=>{const[n,r]=v.useState(e);return a.jsx(ut,{className:`mb-2 ${e?"ring-2 ring-blue-200 bg-blue-50/50":""}`,children:a.jsxs(Ag,{open:n,onOpenChange:r,children:[a.jsx(jg,{asChild:!0,children:a.jsx(ji,{className:"pb-2 cursor-pointer hover:bg-gray-50/50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ide,{action:t.action}),a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-sm",children:a.jsx(Mde,{action:t.action})}),a.jsx(Rde,{status:t.execution_status})]}),a.jsx("span",{className:"text-xs text-gray-500",children:Dde(t.timestamp)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsx(Hn,{variant:"secondary",className:"text-xs",children:"Latest"}),n?a.jsx(uu,{className:"h-4 w-4 text-gray-400"}):a.jsx(Ra,{className:"h-4 w-4 text-gray-400"})]})]})})}),a.jsx(Eg,{children:a.jsx(Rt,{className:"pt-0",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"AI Reasoning:"}),a.jsxs("p",{className:"text-sm text-gray-600 bg-gray-50 p-2 rounded italic",children:['"',t.reasoning,'"']})]}),t.details&&Object.keys(t.details).length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Details:"}),a.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded font-mono",children:JSON.stringify(t.details,null,2)})]}),t.execution_result&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Execution Result:"}),a.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded",children:t.execution_result.error?a.jsxs("span",{className:"text-red-600",children:["Error: ",t.execution_result.error]}):a.jsx("span",{className:"text-green-600",children:t.execution_result.message||"Success"})})]})]})})})]})})},Lde=({reasoningHistory:t,isVisible:e,onToggle:n,isAiMode:r=!1})=>{const[i,s]=v.useState(!0);return v.useEffect(()=>{if(i&&t.length>0){const o=document.getElementById("reasoning-panel-content");o&&(o.scrollTop=0)}},[t.length,i]),a.jsx("div",{className:"border-t border-gray-200 bg-white",children:a.jsxs(Ag,{open:e,onOpenChange:n,children:[a.jsx(jg,{asChild:!0,children:a.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-gray-50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(lu,{className:"h-4 w-4 text-purple-600"}),a.jsx("span",{className:"font-medium text-sm",children:r?"AI Decision Reasoning":"AI Moderator Logic"}),r&&t.length>0&&a.jsx(Hn,{variant:"outline",className:"text-xs",children:t.length}),!r&&a.jsx(Hn,{variant:"secondary",className:"text-xs",children:"Manual Mode"})]}),e?a.jsx(uu,{className:"h-4 w-4 text-gray-400"}):a.jsx(Ra,{className:"h-4 w-4 text-gray-400"})]})}),a.jsx(Eg,{children:a.jsx("div",{className:"border-t border-gray-100",children:r?t.length===0?a.jsxs("div",{className:"p-4 text-center text-gray-500",children:[a.jsx(lu,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),a.jsx("p",{className:"text-sm",children:"No AI decisions yet"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Reasoning will appear here when the AI makes decisions"})]}):a.jsx(cw,{id:"reasoning-panel-content",className:"h-[25vh] p-3",children:a.jsx("div",{className:"space-y-2",children:t.map((o,c)=>a.jsx($de,{entry:o,isLatest:c===0},`${o.timestamp}-${c}`))})}):a.jsxs("div",{className:"p-4 text-center text-gray-500",children:[a.jsx(LE,{className:"h-8 w-8 mx-auto mb-2 text-gray-400"}),a.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Manual Moderation Mode"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"You are currently moderating the discussion manually."}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Switch to AI Mode to see automated reasoning and decisions."})]})})})]})})},Fde=({modeEvent:t})=>{const e=i=>i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=i=>{switch(i){case"ai_mode_started":return"AI Mode Started";case"manual_mode_started":return"Manual Moderation Enabled";case"ai_session_concluded":return"AI Discussion Concluded";default:return"Mode Changed"}},r=i=>{switch(i){case"ai_mode_started":return"text-blue-600";case"manual_mode_started":return"text-slate-600";case"ai_session_concluded":return"text-green-600";default:return"text-gray-600"}};return a.jsxs("div",{className:"flex items-center my-6 px-4",children:[a.jsx("div",{className:"flex-1 border-t border-gray-200"}),a.jsx("div",{className:`mx-4 px-3 py-1 bg-white border border-gray-200 rounded-full ${r(t.event_type)}`,children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-medium",children:[a.jsx("span",{children:n(t.event_type)}),a.jsx("span",{className:"text-gray-400",children:"at"}),a.jsx("span",{children:e(t.timestamp)})]})}),a.jsx("div",{className:"flex-1 border-t border-gray-200"})]})},Ude=({messages:t,modeEvents:e,personas:n,isSpeaking:r,focusGroupId:i,isAiModeActive:s=!1,selectedParticipantIds:o,onToggleHighlight:c,onAdvanceDiscussion:l,onNewMessage:u,onStatusChange:d,isEditingDiscussionGuide:f=!1})=>{const[h,p]=v.useState(""),[g,m]=v.useState(null),[y,b]=v.useState(!1),[x,w]=v.useState(null),S=v.useRef(null),[C,_]=v.useState(-1),[A,j]=v.useState(!1),P=v.useRef(0),k=v.useRef(null),O=v.useRef(1e4),E=v.useRef(null),[R,M]=v.useState(!1),[G,L]=v.useState(!1),[V,I]=v.useState(!1),[D,X]=v.useState(null),Q=D!==null?D:s,[J,ye]=v.useState([]),[U,ne]=v.useState(!1),ue=U;v.useEffect(()=>{s&&i&&F()},[s,i]);const F=async()=>{if(i)try{s&&ce()}catch(H){console.error("Error checking autonomous status:",H)}},ce=async()=>{if(i)try{const H=await er.getReasoningHistory(i);ye(H.data.reasoning_history||[])}catch(H){console.error("Error fetching reasoning history:",H)}};v.useEffect(()=>{R&&Y()},[t,R]),v.useEffect(()=>{let H;return s&&i&&(H=setInterval(()=>{ce(),F()},5e3)),()=>{H&&clearInterval(H)}},[s,i]),v.useEffect(()=>{P.current=t.length},[]),v.useEffect(()=>{const H=t.length,re=P.current;if(A&&H>re){const me=Date.now(),be=k.current;if(be&&me-be>=O.current)b(!1),j(!1),k.current=null;else if(be){const ke=O.current-(me-be);setTimeout(()=>{b(!1),j(!1),k.current=null},Math.max(0,ke))}else b(!1),j(!1)}P.current=H},[t.length,A]);const te=H=>n.find(re=>re.id===H||re._id===H),pe=o.length===0?t:t.filter(H=>H.senderId==="moderator"||H.senderId==="facilitator"||o.includes(H.senderId)),we=()=>{const H=[];return pe.forEach(re=>{H.push({type:"message",data:re,timestamp:re.timestamp})}),e.forEach(re=>{H.push({type:"mode_event",data:re,timestamp:re.timestamp})}),H.sort((re,me)=>re.timestamp.getTime()-me.timestamp.getTime())},Y=()=>{if(!f&&E.current){const H=E.current.closest("[data-radix-scroll-area-viewport]");if(H){const re=E.current.offsetTop-H.clientHeight+50,me=H.scrollTop,be=re-me,ke=300;let Se=null;const qe=st=>{Se||(Se=st);const Dt=st-Se,We=Math.min(Dt/ke,1),Je=1-Math.pow(1-We,3);H.scrollTop=me+be*Je,We<1&&window.requestAnimationFrame(qe)};window.requestAnimationFrame(qe)}else E.current.scrollIntoView({behavior:"smooth",block:"end"})}},nt=async H=>{var Se,qe;if(H.preventDefault(),!h.trim())return;let re=h,me=null,be=null;const ke=g;p(""),m(null),b(!0),j(!0),k.current=Date.now();try{if(x){try{se.info("Uploading creative asset...",{description:"Please wait while we upload your image."});const We=new FormData;We.append("assets",x);const Je=await pt.uploadAssets(i,We);console.log("Upload response:",Je==null?void 0:Je.data);const At=Je==null?void 0:Je.data;if(At&&At.assets&&At.assets.length>0?(me=At.assets[0].filename,console.log("Successfully got filename from upload response:",me)):console.error("Invalid upload response structure:",At),me){try{const Yt=await pt.getAssets(i),Xn=((Se=Yt==null?void 0:Yt.data)==null?void 0:Se.assets)||[],cr=Xn.find(jt=>jt.filename===me);let ct="the uploaded asset";cr&&(cr.user_assigned_name?ct=cr.user_assigned_name:ct=`Asset ${Xn.findIndex(ot=>ot.filename===me)+1}`),be={filename:me,displayReference:ct},re=`Please review ${ct}. ${h}`,console.log("Using display reference in message:",ct)}catch(Yt){console.error("Error fetching asset metadata:",Yt),re=`Please review the uploaded asset. ${h}`,be={filename:me,displayReference:"the uploaded asset"}}se.success("Creative asset uploaded successfully",{description:"The image has been attached to your message."})}}catch(We){console.error("Error uploading file:",We),console.error("Upload error details:",(qe=We.response)==null?void 0:qe.data),se.error("Failed to upload creative asset",{description:"Your message will be sent without the attachment."})}B()}const st={text:re,type:"question",senderId:"facilitator"};me&&(st.attached_assets=[me],st.activates_visual_context=!0,be&&(st.visualAsset=be));const Dt=await pt.sendMessage(i,st);console.log("Message sent to API:",Dt),setTimeout(()=>{Y()},100),ke&&ke.mentionedParticipantIds.length>0?setTimeout(()=>{K(ke.mentionedParticipantIds,re)},500):(b(!1),j(!1),k.current=null)}catch(st){console.error("Error sending message:",st),b(!1),j(!1),k.current=null;const Dt={id:`msg-${Date.now()}`,senderId:"facilitator",text:h,timestamp:new Date,type:"question"};u(Dt),setTimeout(()=>{Y()},100),se.error("Failed to send message to server",{description:"Message will be shown locally but not saved."})}},Ue=()=>{for(let H=t.length-1;H>=0;H--)if(t[H].senderId==="moderator"&&t[H].type==="question")return t[H].text;for(let H=t.length-1;H>=0;H--)if(t[H].senderId==="moderator")return t[H].text;return"What are your thoughts on this topic?"},at=(H,re)=>{if(!H||!H.sections||!re)return null;const{section_index:me,subsection_index:be,item_index:ke,item_type:Se}=re,qe=H.sections,st=We=>{const Je=[];return We.questions&&We.questions.forEach((At,Yt)=>{Je.push({...At,type:"question",index:Yt})}),We.activities&&We.activities.forEach((At,Yt)=>{Je.push({...At,type:"activity",index:Yt})}),Je.sort((At,Yt)=>At.type!==Yt.type?At.type==="question"?-1:1:At.index-Yt.index)};if(me>=qe.length)return{completed:!0};const Dt=qe[me];if(be!==void 0&&Dt.subsections){if(be>=Dt.subsections.length)return at(H,{section_index:me+1,subsection_index:void 0,item_index:0,item_type:"question"});const We=Dt.subsections[be],Je=st(We),At=Je.findIndex(Yt=>Yt.type===Se&&Yt.index===ke);if(At0){const Je=We.findIndex(At=>At.type===Se&&At.index===ke);if(Je0?at(H,{section_index:me,subsection_index:0,item_index:0,item_type:"question"}):at(H,{section_index:me+1,subsection_index:void 0,item_index:0,item_type:"question"})}},Be=async()=>{var H,re,me;if(i)try{b(!0),j(!0),k.current=Date.now(),se.info("Advancing discussion...",{description:"Moving to the next question in the discussion guide."});const[be,ke]=await Promise.all([er.getModeratorStatus(i),pt.getById(i)]);if(!((H=be==null?void 0:be.data)!=null&&H.status)||!((re=ke==null?void 0:ke.data)!=null&&re.discussionGuide))throw new Error("Could not fetch moderator status or discussion guide");const Se=be.data.status,qe=ke.data.discussionGuide;if(!qe.sections)throw new Error("Discussion guide does not have a structured format");const st=at(qe,Se.moderator_position);if(!st)throw new Error("Could not determine next discussion item");if(st.completed){se.success("Discussion guide completed",{description:"All sections of the discussion guide have been covered."});const We={id:`msg-${Date.now()}`,senderId:"moderator",text:"We have covered all the questions in our discussion guide. Thank you all for your valuable insights and participation in this focus group session.",timestamp:new Date,type:"system"};u(We),b(!1),j(!1),k.current=null;return}await er.setModeratorPosition(i,st.sectionId,st.itemId);const Dt={id:`msg-${Date.now()}`,senderId:"moderator",text:st.content,timestamp:new Date,type:"question"};try{const We=await pt.sendMessage(i,{senderId:"moderator",text:Dt.text,type:"question"});(me=We==null?void 0:We.data)!=null&&me.message_id&&(Dt.id=We.data.message_id)}catch(We){console.warn("Failed to save message to API, showing locally:",We)}u(Dt),b(!1),j(!1),k.current=null,setTimeout(()=>{Y()},100),se.success("Discussion advanced",{description:`Moved to: ${st.section.title}${st.subsection?` > ${st.subsection.title}`:""}`}),d&&setTimeout(()=>d(),500)}catch(be){console.error("Error advancing discussion:",be),se.error("Failed to advance discussion",{description:be.message||"There was a problem advancing to the next question."}),b(!1),j(!1),k.current=null}},Bt=async()=>{var H,re,me,be;if(i){console.log("Starting AI Mode: setting autonomousLoading to true"),I(!0);try{console.log("Starting AI Mode: calling API...");const Se=await Promise.race([er.startAutonomousConversation(i),new Promise((qe,st)=>setTimeout(()=>st(new Error("API call timeout after 30 seconds")),3e4))]);if(console.log("Starting AI Mode: API response received:",Se),Se.data.error){se.error("Failed to start autonomous conversation",{description:Se.data.error}),I(!1);return}se.success("Autonomous conversation started",{description:"The AI is now managing the focus group conversation"}),X(!0);try{console.log("Starting AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Starting AI Mode: onStatusChange completed successfully"))}catch(qe){console.error("Starting AI Mode: onStatusChange failed:",qe)}console.log("Starting AI Mode: resetting autonomousLoading to false"),I(!1),ce()}catch(ke){console.error("Error starting autonomous conversation:",ke),ke.response&&ke.response.data&&console.error("Backend error details:",ke.response.data);const Se=((re=(H=ke.response)==null?void 0:H.data)==null?void 0:re.message)||((be=(me=ke.response)==null?void 0:me.data)==null?void 0:be.error)||"Please check your connection and try again";se.error("Failed to start autonomous conversation",{description:Se}),I(!1)}}},N=async()=>{if(i){console.log("Stopping AI Mode: setting autonomousLoading to true"),I(!0);try{const H=await er.stopAutonomousConversation(i,"manual_stop");if(H.data.error){se.error("Failed to stop autonomous conversation",{description:H.data.error}),I(!1);return}ye([]),se.success("Autonomous conversation stopped",{description:"You can now moderate the discussion manually"}),X(!1);try{console.log("Stopping AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Stopping AI Mode: onStatusChange completed successfully"))}catch(re){console.error("Stopping AI Mode: onStatusChange failed:",re)}console.log("Stopping AI Mode: resetting autonomousLoading to false"),I(!1)}catch(H){console.error("Error stopping autonomous conversation:",H),se.error("Failed to stop autonomous conversation"),I(!1)}}},$=H=>{var me;const re=(me=H.target.files)==null?void 0:me[0];if(re){if(!re.type.startsWith("image/")){se.error("Please select an image file",{description:"Only image files (JPG, PNG, etc.) are supported for creative review."});return}if(re.size>10*1024*1024){se.error("File too large",{description:"Please select an image smaller than 10MB."});return}w(re),se.success(`Image selected: ${re.name}`,{description:"The image will be attached to your next message."})}},B=()=>{w(null),S.current&&(S.current.value="")},K=async(H,re)=>{var me;if(!(!i||H.length===0))try{b(!0),j(!0),k.current=Date.now(),se.info("Generating responses from mentioned participants...",{description:`Generating responses from ${H.length} mentioned participant(s).`});for(const be of H){const ke=n.find(Se=>(Se._id||Se.id)===be);if(!ke){console.warn(`Mentioned participant ${be} not found in focus group`);continue}try{const Se=await er.generateResponse(i,be,re||"Continue the conversation based on the latest moderator message.");if((me=Se==null?void 0:Se.data)!=null&&me.response){console.log("Generated response from mentioned participant:",Se.data);const qe={id:Se.data.message_id||`msg-${Date.now()}-${be}`,senderId:be,text:Se.data.response,timestamp:new Date(Se.data.timestamp||Se.data.created_at||new Date),type:"response"};u(qe),se.success(`Response generated from ${ke.name}`,{description:Se.data.response.substring(0,100)+"..."})}}catch(Se){console.error(`Error generating response from ${ke.name}:`,Se),se.error(`Failed to generate response from ${ke.name}`)}}b(!1),j(!1),k.current=null}catch(be){console.error("Error generating mentioned responses:",be),se.error("Failed to generate responses from mentioned participants"),b(!1),j(!1),k.current=null}},Z=async()=>{var H,re,me,be;if(i){if(n.length===0){se.error("No participants available",{description:"Add participants to the focus group before generating responses."});return}try{b(!0),j(!0),k.current=Date.now(),se.info("AI is selecting participant...",{description:"Analyzing the conversation to choose the best respondent."});const ke=await er.makeConversationDecision(i,.7,"manual");if(!ke||!ke.data||!ke.data.decision)throw new Error("Empty decision response from AI");const Se=ke.data.decision;if(Se.action==="participant_respond"){const qe=Se.details.participant_id,st=Se.details.topic_context,Dt=Se.reasoning,We=n.find(At=>(At._id||At.id)===qe);if(!We)throw new Error(`Selected participant ${qe} not found in focus group`);se.info("Generating response...",{description:`AI selected ${We.name}: ${Dt.substring(0,100)}${Dt.length>100?"...":""}`});const Je=await er.generateResponse(i,qe,st);if(!Je||!Je.data)throw new Error("Empty response from API");if((H=Je==null?void 0:Je.data)!=null&&H.message_id&&((re=Je==null?void 0:Je.data)!=null&&re.response)){const At={id:Je.data.message_id,senderId:qe,text:Je.data.response,timestamp:new Date(Je.data.timestamp||Je.data.created_at||new Date),type:"response",highlighted:!1};u(At),b(!1),j(!1),k.current=null,setTimeout(()=>{Y()},100)}else throw new Error("Failed to generate or save AI response")}else{if(console.log("AI suggested different action:",Se.action),Se.action==="moderator_speak"){se.info("AI suggests moderator intervention",{description:`AI reasoning: ${Se.reasoning.substring(0,100)}${Se.reasoning.length>100?"...":""}`}),b(!1),j(!1),k.current=null;return}se.warning("Using fallback participant selection",{description:`AI suggested "${Se.action}" but generating participant response anyway.`});const qe=(C+1)%n.length,st=n[qe],Dt=Ue(),We=st._id||st.id,Je=await er.generateResponse(i,We,Dt);if((me=Je==null?void 0:Je.data)!=null&&me.message_id&&((be=Je==null?void 0:Je.data)!=null&&be.response)){const At={id:Je.data.message_id,senderId:We,text:Je.data.response,timestamp:new Date(Je.data.timestamp||Je.data.created_at||new Date),type:"response",highlighted:!1};u(At),b(!1),j(!1),k.current=null,setTimeout(()=>{Y()},100),_(qe)}}}catch(ke){console.error("Error generating AI response:",ke),se.error("Failed to generate AI response",{description:"There was a problem connecting to the server."}),b(!1),j(!1),k.current=null}}};return a.jsxs("div",{className:"glass-panel rounded-xl p-4 flex flex-col h-full",children:[a.jsx("div",{className:"flex-1 min-h-0 mb-4",children:a.jsxs(cw,{className:"h-full pr-4",children:[a.jsxs("div",{className:"space-y-4",children:[we().map(H=>H.type==="message"?a.jsx(Ode,{message:H.data,persona:H.data.senderId!=="moderator"&&H.data.senderId!=="facilitator"?te(H.data.senderId):null,toggleHighlight:()=>c(H.data.id),participants:n,focusGroupId:i},H.data.id):a.jsx(Fde,{modeEvent:H.data},H.data.id)),(y||s)&&a.jsxs("div",{className:"flex items-center space-x-2 text-sm text-slate-500 animate-pulse",children:[a.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:s?a.jsx(va,{className:"h-4 w-4 text-primary animate-spin"}):a.jsx(jo,{className:"h-4 w-4 text-primary"})}),a.jsx("span",{children:s?"AI is generating next response...":"Generating AI response..."})]}),a.jsx("div",{className:"h-8"}),a.jsx("div",{ref:E,className:"h-1"})]}),!R&&pe.length>6&&a.jsx("div",{className:"sticky bottom-5 ml-auto mr-5 z-10 w-fit",children:a.jsx(ee,{size:"sm",className:"rounded-full shadow-md h-10 w-10 p-0",onClick:Y,title:"Scroll to bottom",children:a.jsx(qO,{className:"h-4 w-4"})})})]})}),a.jsx(Lde,{reasoningHistory:J,isVisible:ue,onToggle:()=>ne(!U),isAiMode:s}),a.jsxs("div",{className:"pt-4 border-t border-slate-200 w-full",children:[x&&a.jsxs("div",{className:"mb-2 p-2 bg-blue-50 border border-blue-200 rounded-md flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ZO,{className:"h-4 w-4 text-blue-600"}),a.jsx("span",{className:"text-sm text-blue-700",children:x.name}),a.jsxs("span",{className:"text-xs text-blue-500",children:["(",(x.size/1024/1024).toFixed(1)," MB)"]})]}),a.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:B,className:"h-6 w-6 p-0 text-blue-600 hover:text-blue-800",children:"×"})]}),a.jsxs("form",{onSubmit:nt,className:"flex items-center gap-2 w-full",children:[a.jsx("input",{ref:S,type:"file",accept:"image/*",onChange:$,className:"hidden"}),a.jsx(wV,{value:h,onChange:(H,re)=>{p(H),m(re||null)},participants:n,placeholder:"Ask a question or provide guidance...",className:"flex-1 min-w-0",disabled:!1}),a.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:()=>{var H;return(H=S.current)==null?void 0:H.click()},className:"hover-transition shrink-0 px-3",disabled:!1,title:"Attach image for creative review",children:a.jsx(ZO,{className:"h-4 w-4"})}),a.jsxs(ee,{type:"submit",variant:"default",className:"hover-transition shrink-0",disabled:!1,children:[a.jsx(Vo,{className:"mr-2 h-4 w-4"}),"Send"]})]}),a.jsxs("div",{className:"flex justify-between items-center mt-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("p",{className:"text-sm text-slate-500",children:r?"Speaking...":s?"AI mode active":"Manual moderation mode"}),a.jsx(ee,{variant:"outline",size:"sm",onClick:Q?N:Bt,disabled:V,className:`hover-transition ${Q?"bg-red-50 text-red-600 hover:bg-red-100":"bg-blue-50 text-blue-600 hover:bg-blue-100"}`,title:Q?"Stop AI mode and return to manual":"Start autonomous AI conversation",children:V?a.jsxs(a.Fragment,{children:[a.jsx(va,{className:"mr-1 h-3 w-3 animate-spin"}),s?"Stopping...":"Starting..."]}):Q?a.jsxs(a.Fragment,{children:[a.jsx(va,{className:"mr-1 h-3 w-3"}),"Stop AI Mode"]}):a.jsxs(a.Fragment,{children:[a.jsx(va,{className:"mr-1 h-3 w-3"}),"Start AI Mode"]})}),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{M(!R),R||Y()},className:`hover-transition ${R?"bg-blue-50 text-blue-600 hover:bg-blue-100":""}`,title:R?"Disable auto-scroll":"Enable auto-scroll",children:[a.jsx(qO,{className:"h-3 w-3 mr-1"}),"Auto-scroll"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!s&&a.jsxs(a.Fragment,{children:[a.jsxs(ee,{variant:"outline",onClick:Be,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:y,title:n.length===0?"Add participants to the focus group first":"Advance to the next part of the discussion guide",children:[a.jsx(Vo,{className:"mr-2 h-4 w-4"}),n.length===0?"No Participants":"Advance Discussion"]}),a.jsxs(ee,{variant:"ghost",size:"sm",onClick:Z,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:y||n.length===0,title:"Generate a participant response to the current topic",children:[a.jsx(jo,{className:"mr-1 h-3 w-3"}),"Get Response"]})]}),s&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1 text-sm text-slate-600",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{children:"AI Active"})]}),a.jsx(ee,{variant:"outline",size:"sm",onClick:()=>L(!G),className:"hover-transition",title:"Show autonomous conversation controls",children:a.jsx(LE,{className:"h-3 w-3"})})]})]})]})]})]})},Bde=({themes:t,messages:e,personas:n=[],onThemeDelete:r,onQuoteClick:i})=>{const s=(d,f)=>{d.stopPropagation(),r&&(r(f),se.success("Theme deleted successfully"))},o=d=>n.find(f=>f.id===d||f._id===d),c=d=>{let f=d;const h=d.match(/^\[MSG_ID:[^\]]+\]\s*(.*)$/);h&&(f=h[1]);const p=f.match(/^\[([^\]]+)\]:\s*(.*)$/);if(p)return{persona:p[1],text:p[2]};const g=f.match(/^([^:]+):\s*(.*)$/);return g&&g[1].trim()!==f.trim()?{persona:g[1].trim(),text:g[2]}:{persona:null,text:f}},l=t.filter(d=>"source"in d?d.source==="highlight":!0),u=t.filter(d=>"source"in d&&d.source==="generated");return a.jsxs("div",{className:"glass-panel rounded-xl p-6 h-[70vh] flex flex-col overflow-hidden",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(du,{className:"h-5 w-5 text-primary mr-2"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Key Themes"})]}),a.jsxs("div",{className:"overflow-auto",children:[u.length>0&&a.jsxs("div",{className:"mb-8",children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(lu,{className:"h-4 w-4 text-primary mr-2"}),a.jsx("h3",{className:"font-medium",children:"AI-Generated Themes"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:u.map(d=>a.jsxs(ut,{className:"hover:shadow-md transition-shadow relative group",children:[r&&a.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity",onClick:f=>s(f,d.id),children:a.jsx(Ri,{className:"h-3 w-3 text-slate-700"})}),a.jsx(ji,{className:"pb-2",children:a.jsx(qi,{className:"text-base",children:d.title})}),a.jsxs(Rt,{children:[a.jsx("p",{className:"text-sm text-slate-600 mb-2",children:d.description}),d.quotes&&d.quotes.length>0&&a.jsxs("div",{className:"mt-3",children:[a.jsx("h4",{className:"text-xs font-medium text-slate-700 mb-2",children:"Supporting Quotes:"}),a.jsx("div",{className:"space-y-2",children:d.quotes.map((f,h)=>{const p=typeof f=="object"&&f!==null,g=p?f.text:f,m=p?f.speaker:c(f).persona,y=p?f.message_id:void 0,b=p?f.original:f;return a.jsxs("div",{className:"bg-slate-50 p-2 rounded text-xs text-slate-600 border-l-2 border-slate-200 cursor-pointer hover:bg-slate-100 transition-colors",onClick:x=>{x.stopPropagation(),i&&i(p?f:b,y)},title:y?`Message ID: ${y}`:"Click to find original message",children:[m&&a.jsxs("span",{className:"font-semibold text-slate-700 mr-1",children:[m,":"]}),'"',g,'"',y&&a.jsx("span",{className:"ml-2 text-xs text-green-600 opacity-70",children:"✓"})]},h)})})]})]})]},d.id))})]}),l.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(sZ,{className:"h-4 w-4 text-primary mr-2"}),a.jsx("h3",{className:"font-medium",children:"Highlighted Comments"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:l.map(d=>{const f=d.messages.length>0?e.find(y=>y.id===d.messages[0]):null,h=(f==null?void 0:f.text)||d.text,p=h.length>200?h.substring(0,200)+"...":h,g=f==null?void 0:f.senderId;let m="";if(g==="moderator")m="AI Moderator";else if(g==="facilitator")m="Human Facilitator";else if(g){const y=o(g);m=(y==null?void 0:y.name)||"Unknown Participant"}return a.jsxs(ut,{className:"hover:shadow-md hover:bg-slate-50 transition-all cursor-pointer relative group",onClick:y=>{y.stopPropagation(),i&&f&&i(f.text,f.id)},title:"Click to view in discussion",children:[r&&a.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity z-10",onClick:y=>s(y,d.id),children:a.jsx(Ri,{className:"h-3 w-3 text-slate-700"})}),a.jsx(ji,{className:"pb-2",children:a.jsx(qi,{className:"text-sm font-medium text-slate-800 line-clamp-2",children:m&&a.jsx("span",{className:"text-primary font-semibold",children:m})})}),a.jsxs(Rt,{className:"pt-0",children:[a.jsxs("p",{className:"text-sm text-slate-600 leading-relaxed",children:['"',p,'"']}),a.jsxs("div",{className:"mt-2 flex items-center text-xs text-slate-400",children:[a.jsx(jo,{className:"h-3 w-3 mr-1"}),"Click to view in discussion"]})]})]},d.id)})})]}),t.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[a.jsx(du,{className:"h-8 w-8 text-slate-400 mb-3"}),a.jsx("p",{className:"text-slate-600",children:"No themes have been identified yet."}),a.jsx("p",{className:"text-sm text-slate-500 mt-2",children:"Highlight important messages in the discussion or generate themes automatically."})]})]})]})},Hde=({themes:t,messages:e,personas:n,focusGroupId:r,onThemesGenerated:i,onThemeDelete:s,onQuoteClick:o,onGenerateKeyThemes:c})=>{const l=()=>{if(!t||t.length===0){se.warning("No themes to export",{description:"Generate some themes first before exporting."});return}let u=`# Key Themes Analysis + +`;const d=t.filter(g=>"source"in g&&g.source==="generated");if(d.length===0){se.warning("No AI-generated themes to export",{description:"Only AI-generated themes are included in the export."});return}d.forEach((g,m)=>{u+=`## ${m+1}. ${g.title} + +`,u+=`${g.description} + +`,g.quotes&&g.quotes.length>0&&(u+=`**Supporting Quotes:** + +`,g.quotes.forEach(y=>{if(typeof y=="string")u+=`> ${y} + +`;else{let b="";y.speaker&&(b+=`**${y.speaker}:** `),b+=y.text,u+=`> ${b} + +`}})),u+=`--- + +`});const f=new Blob([u],{type:"text/markdown"}),h=URL.createObjectURL(f),p=document.createElement("a");p.href=h,p.download=`key-themes-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(h),se.success("Themes exported successfully",{description:`Downloaded ${d.length} themes as markdown file.`})};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsxs(ee,{onClick:c,className:"w-full",children:[a.jsx(vZ,{className:"mr-2 h-4 w-4"}),"Analyze Discussion for Key Themes"]}),a.jsxs(ee,{onClick:l,disabled:!t||t.length===0,variant:"outline",className:"w-full",children:[a.jsx(Xc,{className:"mr-2 h-4 w-4"}),"Export Themes"]})]}),a.jsx("div",{className:"flex-grow overflow-hidden",children:a.jsx(Bde,{themes:t,messages:e,personas:n,onThemeDelete:s,focusGroupId:r,onQuoteClick:o})})]})};var zde=Array.isArray,Bi=zde,Vde=typeof Hg=="object"&&Hg&&Hg.Object===Object&&Hg,SV=Vde,Gde=SV,Kde=typeof self=="object"&&self&&self.Object===Object&&self,Wde=Gde||Kde||Function("return this")(),Jo=Wde,qde=Jo,Yde=qde.Symbol,Pg=Yde,jR=Pg,CV=Object.prototype,Qde=CV.hasOwnProperty,Xde=CV.toString,jh=jR?jR.toStringTag:void 0;function Jde(t){var e=Qde.call(t,jh),n=t[jh];try{t[jh]=void 0;var r=!0}catch{}var i=Xde.call(t);return r&&(e?t[jh]=n:delete t[jh]),i}var Zde=Jde,efe=Object.prototype,tfe=efe.toString;function nfe(t){return tfe.call(t)}var rfe=nfe,ER=Pg,ife=Zde,sfe=rfe,ofe="[object Null]",afe="[object Undefined]",NR=ER?ER.toStringTag:void 0;function cfe(t){return t==null?t===void 0?afe:ofe:NR&&NR in Object(t)?ife(t):sfe(t)}var Ka=cfe;function lfe(t){return t!=null&&typeof t=="object"}var Wa=lfe,ufe=Ka,dfe=Wa,ffe="[object Symbol]";function hfe(t){return typeof t=="symbol"||dfe(t)&&ufe(t)==ffe}var qf=hfe,pfe=Bi,mfe=qf,gfe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vfe=/^\w*$/;function yfe(t,e){if(pfe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||mfe(t)?!0:vfe.test(t)||!gfe.test(t)||e!=null&&t in Object(e)}var YT=yfe;function xfe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var hl=xfe;const Yf=un(hl);var bfe=Ka,wfe=hl,Sfe="[object AsyncFunction]",Cfe="[object Function]",_fe="[object GeneratorFunction]",Afe="[object Proxy]";function jfe(t){if(!wfe(t))return!1;var e=bfe(t);return e==Cfe||e==_fe||e==Sfe||e==Afe}var QT=jfe;const Et=un(QT);var Efe=Jo,Nfe=Efe["__core-js_shared__"],Tfe=Nfe,nC=Tfe,TR=function(){var t=/[^.]+$/.exec(nC&&nC.keys&&nC.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Pfe(t){return!!TR&&TR in t}var kfe=Pfe,Ofe=Function.prototype,Ife=Ofe.toString;function Rfe(t){if(t!=null){try{return Ife.call(t)}catch{}try{return t+""}catch{}}return""}var _V=Rfe,Mfe=QT,Dfe=kfe,$fe=hl,Lfe=_V,Ffe=/[\\^$.*+?()[\]{}|]/g,Ufe=/^\[object .+?Constructor\]$/,Bfe=Function.prototype,Hfe=Object.prototype,zfe=Bfe.toString,Vfe=Hfe.hasOwnProperty,Gfe=RegExp("^"+zfe.call(Vfe).replace(Ffe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kfe(t){if(!$fe(t)||Dfe(t))return!1;var e=Mfe(t)?Gfe:Ufe;return e.test(Lfe(t))}var Wfe=Kfe;function qfe(t,e){return t==null?void 0:t[e]}var Yfe=qfe,Qfe=Wfe,Xfe=Yfe;function Jfe(t,e){var n=Xfe(t,e);return Qfe(n)?n:void 0}var Iu=Jfe,Zfe=Iu,ehe=Zfe(Object,"create"),lw=ehe,PR=lw;function the(){this.__data__=PR?PR(null):{},this.size=0}var nhe=the;function rhe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ihe=rhe,she=lw,ohe="__lodash_hash_undefined__",ahe=Object.prototype,che=ahe.hasOwnProperty;function lhe(t){var e=this.__data__;if(she){var n=e[t];return n===ohe?void 0:n}return che.call(e,t)?e[t]:void 0}var uhe=lhe,dhe=lw,fhe=Object.prototype,hhe=fhe.hasOwnProperty;function phe(t){var e=this.__data__;return dhe?e[t]!==void 0:hhe.call(e,t)}var mhe=phe,ghe=lw,vhe="__lodash_hash_undefined__";function yhe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ghe&&e===void 0?vhe:e,this}var xhe=yhe,bhe=nhe,whe=ihe,She=uhe,Che=mhe,_he=xhe;function Qf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Bhe=Uhe,Hhe=uw;function zhe(t,e){var n=this.__data__,r=Hhe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Vhe=zhe,Ghe=Ehe,Khe=Mhe,Whe=Lhe,qhe=Bhe,Yhe=Vhe;function Xf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},Ll=function(e){return kg(e)&&e.indexOf("%")===e.length-1},Ee=function(e){return gme(e)&&!Zf(e)},Er=function(e){return Ee(e)||kg(e)},bme=0,eh=function(e){var n=++bme;return"".concat(e||"").concat(n)},gi=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ee(e)&&!kg(e))return r;var s;if(Ll(e)){var o=e.indexOf("%");s=n*parseFloat(e.slice(0,o))/100}else s=+e;return Zf(s)&&(s=r),i&&s>n&&(s=n),s},dc=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},wme=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Eme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function D1(t){"@babel/helpers - typeof";return D1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D1(t)}var $R={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Aa=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},LR=null,iC=null,oP=function t(e){if(e===LR&&Array.isArray(iC))return iC;var n=[];return v.Children.forEach(e,function(r){$t(r)||(IV.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),iC=n,LR=e,n};function _s(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Aa(i)}):r=[Aa(e)],oP(t).forEach(function(i){var s=ns(i,"type.displayName")||ns(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function Wi(t,e){var n=_s(t,e);return n&&n[0]}var FR=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!Ee(r)||r<=0||!Ee(i)||i<=0)},Nme=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Tme=function(e){return e&&e.type&&kg(e.type)&&Nme.indexOf(e.type)>=0},Pme=function(e){return e&&D1(e)==="object"&&"clipDot"in e},kme=function(e,n,r,i){var s,o=(s=rC==null?void 0:rC[i])!==null&&s!==void 0?s:[];return!Et(e)&&(i&&o.includes(n)||Cme.includes(n))||r&&sP.includes(n)},rt=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(v.isValidElement(e)&&(i=e.props),!Yf(i))return null;var s={};return Object.keys(i).forEach(function(o){var c;kme((c=i)===null||c===void 0?void 0:c[o],o,n,r)&&(s[o]=i[o])}),s},$1=function t(e,n){if(e===n)return!0;var r=v.Children.count(e);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return UR(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Dme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function F1(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,s=t.className,o=t.style,c=t.title,l=t.desc,u=Mme(t,Rme),d=i||{width:n,height:r,x:0,y:0},f=Mt("recharts-surface",s);return T.createElement("svg",L1({},rt(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),T.createElement("title",null,c),T.createElement("desc",null,l),e)}var $me=["children","className"];function U1(){return U1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Fme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var Xt=T.forwardRef(function(t,e){var n=t.children,r=t.className,i=Lme(t,$me),s=Mt("recharts-layer",r);return T.createElement("g",U1({className:s},rt(i,!0),{ref:e}),n)}),to=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;si?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r=r?t:Hme(t,e,n)}var Vme=zme,Gme="\\ud800-\\udfff",Kme="\\u0300-\\u036f",Wme="\\ufe20-\\ufe2f",qme="\\u20d0-\\u20ff",Yme=Kme+Wme+qme,Qme="\\ufe0e\\ufe0f",Xme="\\u200d",Jme=RegExp("["+Xme+Gme+Yme+Qme+"]");function Zme(t){return Jme.test(t)}var MV=Zme;function ege(t){return t.split("")}var tge=ege,DV="\\ud800-\\udfff",nge="\\u0300-\\u036f",rge="\\ufe20-\\ufe2f",ige="\\u20d0-\\u20ff",sge=nge+rge+ige,oge="\\ufe0e\\ufe0f",age="["+DV+"]",B1="["+sge+"]",H1="\\ud83c[\\udffb-\\udfff]",cge="(?:"+B1+"|"+H1+")",$V="[^"+DV+"]",LV="(?:\\ud83c[\\udde6-\\uddff]){2}",FV="[\\ud800-\\udbff][\\udc00-\\udfff]",lge="\\u200d",UV=cge+"?",BV="["+oge+"]?",uge="(?:"+lge+"(?:"+[$V,LV,FV].join("|")+")"+BV+UV+")*",dge=BV+UV+uge,fge="(?:"+[$V+B1+"?",B1,LV,FV,age].join("|")+")",hge=RegExp(H1+"(?="+H1+")|"+fge+dge,"g");function pge(t){return t.match(hge)||[]}var mge=pge,gge=tge,vge=MV,yge=mge;function xge(t){return vge(t)?yge(t):gge(t)}var bge=xge,wge=Vme,Sge=MV,Cge=bge,_ge=NV;function Age(t){return function(e){e=_ge(e);var n=Sge(e)?Cge(e):void 0,r=n?n[0]:e.charAt(0),i=n?wge(n,1).join(""):e.slice(1);return r[t]()+i}}var jge=Age,Ege=jge,Nge=Ege("toUpperCase"),Tge=Nge;const _w=un(Tge);function Tn(t){return function(){return t}}const HV=Math.cos,Kx=Math.sin,go=Math.sqrt,Wx=Math.PI,Aw=2*Wx,z1=Math.PI,V1=2*z1,jl=1e-6,Pge=V1-jl;function zV(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return zV;const n=10**e;return function(r){this._+=r[0];for(let i=1,s=r.length;ijl)if(!(Math.abs(f*l-u*d)>jl)||!s)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-o,g=i-c,m=l*l+u*u,y=p*p+g*g,b=Math.sqrt(m),x=Math.sqrt(h),w=s*Math.tan((z1-Math.acos((m+h-y)/(2*b*x)))/2),S=w/x,C=w/b;Math.abs(S-1)>jl&&this._append`L${e+S*d},${n+S*f}`,this._append`A${s},${s},0,0,${+(f*p>d*g)},${this._x1=e+C*l},${this._y1=n+C*u}`}}arc(e,n,r,i,s,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),l=r*Math.sin(i),u=e+c,d=n+l,f=1^o,h=o?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>jl||Math.abs(this._y1-d)>jl)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%V1+V1),h>Pge?this._append`A${r},${r},0,1,${f},${e-c},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>jl&&this._append`A${r},${r},0,${+(h>=z1)},${f},${this._x1=e+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function aP(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Oge(e)}function cP(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function VV(t){this._context=t}VV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function jw(t){return new VV(t)}function GV(t){return t[0]}function KV(t){return t[1]}function WV(t,e){var n=Tn(!0),r=null,i=jw,s=null,o=aP(c);t=typeof t=="function"?t:t===void 0?GV:Tn(t),e=typeof e=="function"?e:e===void 0?KV:Tn(e);function c(l){var u,d=(l=cP(l)).length,f,h=!1,p;for(r==null&&(s=i(p=o())),u=0;u<=d;++u)!(u=p;--g)c.point(w[g],S[g]);c.lineEnd(),c.areaEnd()}b&&(w[h]=+t(y,h,f),S[h]=+e(y,h,f),c.point(r?+r(y,h,f):w[h],n?+n(y,h,f):S[h]))}if(x)return c=null,x+""||null}function d(){return WV().defined(i).curve(o).context(s)}return u.x=function(f){return arguments.length?(t=typeof f=="function"?f:Tn(+f),r=null,u):t},u.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Tn(+f),u):t},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Tn(+f),u):r},u.y=function(f){return arguments.length?(e=typeof f=="function"?f:Tn(+f),n=null,u):e},u.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Tn(+f),u):e},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Tn(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(n)},u.lineX1=function(){return d().x(r).y(e)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Tn(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,s!=null&&(c=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=c=null:c=o(s=f),u):s},u}class qV{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Ige(t){return new qV(t,!0)}function Rge(t){return new qV(t,!1)}const lP={draw(t,e){const n=go(e/Wx);t.moveTo(n,0),t.arc(0,0,n,0,Aw)}},Mge={draw(t,e){const n=go(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},YV=go(1/3),Dge=YV*2,$ge={draw(t,e){const n=go(e/Dge),r=n*YV;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Lge={draw(t,e){const n=go(e),r=-n/2;t.rect(r,r,n,n)}},Fge=.8908130915292852,QV=Kx(Wx/10)/Kx(7*Wx/10),Uge=Kx(Aw/10)*QV,Bge=-HV(Aw/10)*QV,Hge={draw(t,e){const n=go(e*Fge),r=Uge*n,i=Bge*n;t.moveTo(0,-n),t.lineTo(r,i);for(let s=1;s<5;++s){const o=Aw*s/5,c=HV(o),l=Kx(o);t.lineTo(l*n,-c*n),t.lineTo(c*r-l*i,l*r+c*i)}t.closePath()}},sC=go(3),zge={draw(t,e){const n=-go(e/(sC*3));t.moveTo(0,n*2),t.lineTo(-sC*n,-n),t.lineTo(sC*n,-n),t.closePath()}},os=-.5,as=go(3)/2,G1=1/go(12),Vge=(G1/2+1)*3,Gge={draw(t,e){const n=go(e/Vge),r=n/2,i=n*G1,s=r,o=n*G1+n,c=-s,l=o;t.moveTo(r,i),t.lineTo(s,o),t.lineTo(c,l),t.lineTo(os*r-as*i,as*r+os*i),t.lineTo(os*s-as*o,as*s+os*o),t.lineTo(os*c-as*l,as*c+os*l),t.lineTo(os*r+as*i,os*i-as*r),t.lineTo(os*s+as*o,os*o-as*s),t.lineTo(os*c+as*l,os*l-as*c),t.closePath()}};function Kge(t,e){let n=null,r=aP(i);t=typeof t=="function"?t:Tn(t||lP),e=typeof e=="function"?e:Tn(e===void 0?64:+e);function i(){let s;if(n||(n=s=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Tn(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Tn(+s),i):e},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function qx(){}function Yx(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function XV(t){this._context=t}XV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Yx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Wge(t){return new XV(t)}function JV(t){this._context=t}JV.prototype={areaStart:qx,areaEnd:qx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function qge(t){return new JV(t)}function ZV(t){this._context=t}ZV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Yge(t){return new ZV(t)}function eG(t){this._context=t}eG.prototype={areaStart:qx,areaEnd:qx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Qge(t){return new eG(t)}function HR(t){return t<0?-1:1}function zR(t,e,n){var r=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),c=(s*i+o*r)/(r+i);return(HR(s)+HR(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(c))||0}function VR(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function oC(t,e,n){var r=t._x0,i=t._y0,s=t._x1,o=t._y1,c=(s-r)/3;t._context.bezierCurveTo(r+c,i+c*e,s-c,o-c*n,s,o)}function Qx(t){this._context=t}Qx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:oC(this,this._t0,VR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,oC(this,VR(this,n=zR(this,t,e)),n);break;default:oC(this,this._t0,n=zR(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function tG(t){this._context=new nG(t)}(tG.prototype=Object.create(Qx.prototype)).point=function(t,e){Qx.prototype.point.call(this,e,t)};function nG(t){this._context=t}nG.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,s){this._context.bezierCurveTo(e,t,r,n,s,i)}};function Xge(t){return new Qx(t)}function Jge(t){return new tG(t)}function rG(t){this._context=t}rG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=GR(t),i=GR(e),s=0,o=1;o=0;--e)i[e]=(o[e]-i[e+1])/s[e];for(s[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function eve(t){return new Ew(t,.5)}function tve(t){return new Ew(t,0)}function nve(t){return new Ew(t,1)}function nf(t,e){if((o=t.length)>1)for(var n=1,r,i,s=t[e[0]],o,c=s.length;n=0;)n[e]=e;return n}function rve(t,e){return t[e]}function ive(t){const e=[];return e.key=t,e}function sve(){var t=Tn([]),e=K1,n=nf,r=rve;function i(s){var o=Array.from(t.apply(this,arguments),ive),c,l=o.length,u=-1,d;for(const f of s)for(c=0,++u;c0){for(var n,r,i=0,s=t[0].length,o;i0){for(var n=0,r=t[e[0]],i,s=r.length;n0)||!((s=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,s,o;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pve(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var iG={symbolCircle:lP,symbolCross:Mge,symbolDiamond:$ge,symbolSquare:Lge,symbolStar:Hge,symbolTriangle:zge,symbolWye:Gge},mve=Math.PI/180,gve=function(e){var n="symbol".concat(_w(e));return iG[n]||lP},vve=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*mve;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},yve=function(e,n){iG["symbol".concat(_w(e))]=n},uP=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,s=i===void 0?64:i,o=e.sizeType,c=o===void 0?"area":o,l=hve(e,lve),u=WR(WR({},l),{},{type:r,size:s,sizeType:c}),d=function(){var y=gve(r),b=Kge().type(y).size(vve(s,c,r));return b()},f=u.className,h=u.cx,p=u.cy,g=rt(u,!0);return h===+h&&p===+p&&s===+s?T.createElement("path",W1({},g,{className:Mt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};uP.registerSymbol=yve;function rf(t){"@babel/helpers - typeof";return rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rf(t)}function q1(){return q1=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var x=p.inactive?u:p.color;return T.createElement("li",q1({className:y,style:f,key:"legend-item-".concat(g)},wu(r.props,p,g)),T.createElement(F1,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),T.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},m?m(b,p,g):b))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,o=r.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return T.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])}(v.PureComponent);Sm(dP,"displayName","Legend");Sm(dP,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Nve=dw;function Tve(){this.__data__=new Nve,this.size=0}var Pve=Tve;function kve(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Ove=kve;function Ive(t){return this.__data__.get(t)}var Rve=Ive;function Mve(t){return this.__data__.has(t)}var Dve=Mve,$ve=dw,Lve=JT,Fve=ZT,Uve=200;function Bve(t,e){var n=this.__data__;if(n instanceof $ve){var r=n.__data__;if(!Lve||r.lengthc))return!1;var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,p=n&lye?new sye:void 0;for(s.set(t,e),s.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=hxe}var mP=pxe,mxe=Ka,gxe=mP,vxe=Wa,yxe="[object Arguments]",xxe="[object Array]",bxe="[object Boolean]",wxe="[object Date]",Sxe="[object Error]",Cxe="[object Function]",_xe="[object Map]",Axe="[object Number]",jxe="[object Object]",Exe="[object RegExp]",Nxe="[object Set]",Txe="[object String]",Pxe="[object WeakMap]",kxe="[object ArrayBuffer]",Oxe="[object DataView]",Ixe="[object Float32Array]",Rxe="[object Float64Array]",Mxe="[object Int8Array]",Dxe="[object Int16Array]",$xe="[object Int32Array]",Lxe="[object Uint8Array]",Fxe="[object Uint8ClampedArray]",Uxe="[object Uint16Array]",Bxe="[object Uint32Array]",In={};In[Ixe]=In[Rxe]=In[Mxe]=In[Dxe]=In[$xe]=In[Lxe]=In[Fxe]=In[Uxe]=In[Bxe]=!0;In[yxe]=In[xxe]=In[kxe]=In[bxe]=In[Oxe]=In[wxe]=In[Sxe]=In[Cxe]=In[_xe]=In[Axe]=In[jxe]=In[Exe]=In[Nxe]=In[Txe]=In[Pxe]=!1;function Hxe(t){return vxe(t)&&gxe(t.length)&&!!In[mxe(t)]}var zxe=Hxe;function Vxe(t){return function(e){return t(e)}}var mG=Vxe,eb={exports:{}};eb.exports;(function(t,e){var n=SV,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s&&n.process,c=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=c})(eb,eb.exports);var Gxe=eb.exports,Kxe=zxe,Wxe=mG,e2=Gxe,t2=e2&&e2.isTypedArray,qxe=t2?Wxe(t2):Kxe,gG=qxe,Yxe=Jye,Qxe=hP,Xxe=Bi,Jxe=pG,Zxe=pP,ebe=gG,tbe=Object.prototype,nbe=tbe.hasOwnProperty;function rbe(t,e){var n=Xxe(t),r=!n&&Qxe(t),i=!n&&!r&&Jxe(t),s=!n&&!r&&!i&&ebe(t),o=n||r||i||s,c=o?Yxe(t.length,String):[],l=c.length;for(var u in t)(e||nbe.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Zxe(u,l)))&&c.push(u);return c}var ibe=rbe,sbe=Object.prototype;function obe(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||sbe;return t===n}var abe=obe;function cbe(t,e){return function(n){return t(e(n))}}var vG=cbe,lbe=vG,ube=lbe(Object.keys,Object),dbe=ube,fbe=abe,hbe=dbe,pbe=Object.prototype,mbe=pbe.hasOwnProperty;function gbe(t){if(!fbe(t))return hbe(t);var e=[];for(var n in Object(t))mbe.call(t,n)&&n!="constructor"&&e.push(n);return e}var vbe=gbe,ybe=QT,xbe=mP;function bbe(t){return t!=null&&xbe(t.length)&&!ybe(t)}var Og=bbe,wbe=ibe,Sbe=vbe,Cbe=Og;function _be(t){return Cbe(t)?wbe(t):Sbe(t)}var Nw=_be,Abe=Uye,jbe=Qye,Ebe=Nw;function Nbe(t){return Abe(t,Ebe,jbe)}var Tbe=Nbe,n2=Tbe,Pbe=1,kbe=Object.prototype,Obe=kbe.hasOwnProperty;function Ibe(t,e,n,r,i,s){var o=n&Pbe,c=n2(t),l=c.length,u=n2(e),d=u.length;if(l!=d&&!o)return!1;for(var f=l;f--;){var h=c[f];if(!(o?h in e:Obe.call(e,h)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=o;++f-1}var kwe=Pwe;function Owe(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Wwe){var u=e?null:Gwe(t);if(u)return Kwe(u);o=!1,i=Vwe,l=new Bwe}else l=e?[]:c;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function uSe(t){return t.value}function dSe(t,e){if(T.isValidElement(t))return T.cloneElement(t,e);if(typeof t=="function")return T.createElement(t,e);e.ref;var n=cSe(e,eSe);return T.createElement(dP,n)}var y2=1,ja=function(t){function e(){var n;tSe(this,e);for(var r=arguments.length,i=new Array(r),s=0;sy2||Math.abs(i.height-this.lastBoundingBox.height)>y2)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?sa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,o=i.align,c=i.verticalAlign,l=i.margin,u=i.chartWidth,d=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&s==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=c==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return sa(sa({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,o=i.width,c=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=sa(sa({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(l)),l);return T.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},dSe(s,sa(sa({},this.props),{},{payload:_G(d,u,uSe)})))}}],[{key:"getWithHeight",value:function(r,i){var s=sa(sa({},this.defaultProps),r.props),o=s.layout;return o==="vertical"&&Ee(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(v.PureComponent);Tw(ja,"displayName","Legend");Tw(ja,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var x2=Pg,fSe=hP,hSe=Bi,b2=x2?x2.isConcatSpreadable:void 0;function pSe(t){return hSe(t)||fSe(t)||!!(b2&&t&&t[b2])}var mSe=pSe,gSe=fG,vSe=mSe;function EG(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=vSe),i||(i=[]);++s0&&n(c)?e>1?EG(c,e-1,n,r,i):gSe(i,c):r||(i[i.length]=c)}return i}var NG=EG;function ySe(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),c=o.length;c--;){var l=o[t?c:++i];if(n(s[l],l,s)===!1)break}return e}}var xSe=ySe,bSe=xSe,wSe=bSe(),SSe=wSe,CSe=SSe,_Se=Nw;function ASe(t,e){return t&&CSe(t,e,_Se)}var TG=ASe,jSe=Og;function ESe(t,e){return function(n,r){if(n==null)return n;if(!jSe(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=Object(n);(e?s--:++se||s&&o&&l&&!c&&!u||r&&o&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&t=c)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}var BSe=USe,uC=tP,HSe=nP,zSe=Zo,VSe=PG,GSe=DSe,KSe=mG,WSe=BSe,qSe=rh,YSe=Bi;function QSe(t,e,n){e.length?e=uC(e,function(s){return YSe(s)?function(o){return HSe(o,s.length===1?s[0]:s)}:s}):e=[qSe];var r=-1;e=uC(e,KSe(zSe));var i=VSe(t,function(s,o,c){var l=uC(e,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return GSe(i,function(s,o){return WSe(s,o,n)})}var XSe=QSe;function JSe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var ZSe=JSe,eCe=ZSe,S2=Math.max;function tCe(t,e,n){return e=S2(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=S2(r.length-e,0),o=Array(s);++i0){if(++e>=dCe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var mCe=pCe,gCe=uCe,vCe=mCe,yCe=vCe(gCe),xCe=yCe,bCe=rh,wCe=nCe,SCe=xCe;function CCe(t,e){return SCe(wCe(t,e,bCe),t+"")}var _Ce=CCe,ACe=XT,jCe=Og,ECe=pP,NCe=hl;function TCe(t,e,n){if(!NCe(n))return!1;var r=typeof e;return(r=="number"?jCe(n)&&ECe(e,n.length):r=="string"&&e in n)?ACe(n[e],t):!1}var Pw=TCe,PCe=NG,kCe=XSe,OCe=_Ce,_2=Pw,ICe=OCe(function(t,e){if(t==null)return[];var n=e.length;return n>1&&_2(t,e[0],e[1])?e=[]:n>2&&_2(e[0],e[1],e[2])&&(e=[e[0]]),kCe(t,PCe(e,1),[])}),RCe=ICe;const yP=un(RCe);function Cm(t){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cm(t)}function nA(){return nA=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(Eh,"-left"),Ee(n)&&e&&Ee(e.x)&&n=e.y),"".concat(Eh,"-top"),Ee(r)&&e&&Ee(e.y)&&rm?Math.max(d,l[r]):Math.max(f,l[r])}function YCe(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function QCe(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,s=t.reverseDirection,o=t.tooltipBox,c=t.useTranslate3d,l=t.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=E2({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=E2({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=YCe({translateX:d,translateY:f,useTranslate3d:c})):u=WCe,{cssProperties:u,cssClasses:qCe({translateX:d,translateY:f,coordinate:n})}}function of(t){"@babel/helpers - typeof";return of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},of(t)}function N2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function T2(t){for(var e=1;eP2||Math.abs(r.height-this.state.lastBoundingBox.height)>P2)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,c=i.animationDuration,l=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,p=i.offset,g=i.position,m=i.reverseDirection,y=i.useTranslate3d,b=i.viewBox,x=i.wrapperStyle,w=QCe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),S=w.cssClasses,C=w.cssProperties,_=T2(T2({transition:h&&s?"transform ".concat(c,"ms ").concat(l):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return T.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(j){r.wrapperNode=j}},u)}}])}(v.PureComponent),o_e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},no={isSsr:o_e(),get:function(e){return no[e]},set:function(e,n){if(typeof e=="string")no[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){no[i]=e[i]})}}};function af(t){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(t)}function k2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function O2(t){for(var e=1;e0;return T.createElement(s_e,{allowEscapeViewBox:o,animationDuration:c,animationEasing:l,isAnimationActive:h,active:s,coordinate:d,hasPayload:_,offset:p,position:y,reverseDirection:b,useTranslate3d:x,viewBox:w,wrapperStyle:S},g_e(u,O2(O2({},this.props),{},{payload:C})))}}])}(v.PureComponent);xP(Zr,"displayName","Tooltip");xP(Zr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!no.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var v_e=Jo,y_e=function(){return v_e.Date.now()},x_e=y_e,b_e=/\s/;function w_e(t){for(var e=t.length;e--&&b_e.test(t.charAt(e)););return e}var S_e=w_e,C_e=S_e,__e=/^\s+/;function A_e(t){return t&&t.slice(0,C_e(t)+1).replace(__e,"")}var j_e=A_e,E_e=j_e,I2=hl,N_e=qf,R2=NaN,T_e=/^[-+]0x[0-9a-f]+$/i,P_e=/^0b[01]+$/i,k_e=/^0o[0-7]+$/i,O_e=parseInt;function I_e(t){if(typeof t=="number")return t;if(N_e(t))return R2;if(I2(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=I2(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=E_e(t);var n=P_e.test(t);return n||k_e.test(t)?O_e(t.slice(2),n?2:8):T_e.test(t)?R2:+t}var DG=I_e,R_e=hl,fC=x_e,M2=DG,M_e="Expected a function",D_e=Math.max,$_e=Math.min;function L_e(t,e,n){var r,i,s,o,c,l,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(M_e);e=M2(e)||0,R_e(n)&&(d=!!n.leading,f="maxWait"in n,s=f?D_e(M2(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function p(_){var A=r,j=i;return r=i=void 0,u=_,o=t.apply(j,A),o}function g(_){return u=_,c=setTimeout(b,e),d?p(_):o}function m(_){var A=_-l,j=_-u,P=e-A;return f?$_e(P,s-j):P}function y(_){var A=_-l,j=_-u;return l===void 0||A>=e||A<0||f&&j>=s}function b(){var _=fC();if(y(_))return x(_);c=setTimeout(b,m(_))}function x(_){return c=void 0,h&&r?p(_):(r=i=void 0,o)}function w(){c!==void 0&&clearTimeout(c),u=0,r=l=i=c=void 0}function S(){return c===void 0?o:x(fC())}function C(){var _=fC(),A=y(_);if(r=arguments,i=this,l=_,A){if(c===void 0)return g(l);if(f)return clearTimeout(c),c=setTimeout(b,e),p(l)}return c===void 0&&(c=setTimeout(b,e)),o}return C.cancel=w,C.flush=S,C}var F_e=L_e,U_e=F_e,B_e=hl,H_e="Expected a function";function z_e(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(H_e);return B_e(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),U_e(t,e,{leading:r,maxWait:e,trailing:i})}var V_e=z_e;const $G=un(V_e);function Am(t){"@babel/helpers - typeof";return Am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Am(t)}function D2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Av(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(R=$G(R,m,{trailing:!0,leading:!1}));var M=new ResizeObserver(R),G=C.current.getBoundingClientRect(),L=G.width,V=G.height;return O(L,V),M.observe(C.current),function(){M.disconnect()}},[O,m]);var E=v.useMemo(function(){var R=P.containerWidth,M=P.containerHeight;if(R<0||M<0)return null;to(Ll(o)||Ll(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),to(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=Ll(o)?R:o,L=Ll(l)?M:l;n&&n>0&&(G?L=G/n:L&&(G=L*n),h&&L>h&&(L=h)),to(G>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,G,L,o,l,d,f,n);var V=!Array.isArray(p)&&Aa(p.type).endsWith("Chart");return T.Children.map(p,function(I){return IV.isElement(I)?v.cloneElement(I,Av({width:G,height:L},V?{style:Av({height:"100%",width:"100%",maxHeight:L,maxWidth:G},I.props.style)}:{})):I})},[n,p,l,h,f,d,P,o]);return T.createElement("div",{id:y?"".concat(y):void 0,className:Mt("recharts-responsive-container",b),style:Av(Av({},S),{},{width:o,height:l,minWidth:d,minHeight:f,maxHeight:h}),ref:C},E)}),Ig=function(e){return null};Ig.displayName="Cell";function jm(t){"@babel/helpers - typeof";return jm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jm(t)}function L2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function oA(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||no.isSsr)return{width:0,height:0};var r=i1e(n),i=JSON.stringify({text:e,copyStyle:r});if(zu.widthCache[i])return zu.widthCache[i];try{var s=document.getElementById(F2);s||(s=document.createElement("span"),s.setAttribute("id",F2),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=oA(oA({},r1e),r);Object.assign(s.style,o),s.textContent="".concat(e);var c=s.getBoundingClientRect(),l={width:c.width,height:c.height};return zu.widthCache[i]=l,++zu.cacheCount>n1e&&(zu.cacheCount=0,zu.widthCache={}),l}catch{return{width:0,height:0}}},s1e=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Em(t){"@babel/helpers - typeof";return Em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Em(t)}function ib(t,e){return l1e(t)||c1e(t,e)||a1e(t,e)||o1e()}function o1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a1e(t,e){if(t){if(typeof t=="string")return U2(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U2(t,e)}}function U2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function C1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function K2(t,e){return E1e(t)||j1e(t,e)||A1e(t,e)||_1e()}function _1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A1e(t,e){if(t){if(typeof t=="string")return W2(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W2(t,e)}}function W2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(L,V){var I=V.word,D=V.width,X=L[L.length-1];if(X&&(i==null||s||X.width+D+rV.width?L:V})};if(!d)return p;for(var m="…",y=function(G){var L=f.slice(0,G),V=BG({breakAll:u,style:l,children:L+m}).wordsWithComputedWidth,I=h(V),D=I.length>o||g(I).width>Number(i);return[D,I]},b=0,x=f.length-1,w=0,S;b<=x&&w<=f.length-1;){var C=Math.floor((b+x)/2),_=C-1,A=y(_),j=K2(A,2),P=j[0],k=j[1],O=y(C),E=K2(O,1),R=E[0];if(!P&&!R&&(b=C+1),P&&R&&(x=C-1),!P&&R){S=k;break}w++}return S||p},q2=function(e){var n=$t(e)?[]:e.toString().split(UG);return[{words:n}]},T1e=function(e){var n=e.width,r=e.scaleToFit,i=e.children,s=e.style,o=e.breakAll,c=e.maxLines;if((n||r)&&!no.isSsr){var l,u,d=BG({breakAll:o,children:i,style:s});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;l=f,u=h}else return q2(i);return N1e({breakAll:o,children:i,maxLines:c,style:s},l,u,n,r)}return q2(i)},Y2="#808080",Su=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,s=i===void 0?0:i,o=e.lineHeight,c=o===void 0?"1em":o,l=e.capHeight,u=l===void 0?"0.71em":l,d=e.scaleToFit,f=d===void 0?!1:d,h=e.textAnchor,p=h===void 0?"start":h,g=e.verticalAnchor,m=g===void 0?"end":g,y=e.fill,b=y===void 0?Y2:y,x=G2(e,w1e),w=v.useMemo(function(){return T1e({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),S=x.dx,C=x.dy,_=x.angle,A=x.className,j=x.breakAll,P=G2(x,S1e);if(!Er(r)||!Er(s))return null;var k=r+(Ee(S)?S:0),O=s+(Ee(C)?C:0),E;switch(m){case"start":E=hC("calc(".concat(u,")"));break;case"middle":E=hC("calc(".concat((w.length-1)/2," * -").concat(c," + (").concat(u," / 2))"));break;default:E=hC("calc(".concat(w.length-1," * -").concat(c,")"));break}var R=[];if(f){var M=w[0].width,G=x.width;R.push("scale(".concat((Ee(G)?G/M:1)/M,")"))}return _&&R.push("rotate(".concat(_,", ").concat(k,", ").concat(O,")")),R.length&&(P.transform=R.join(" ")),T.createElement("text",aA({},rt(P,!0),{x:k,y:O,className:Mt("recharts-text",A),textAnchor:p,fill:b.includes("url")?Y2:b}),w.map(function(L,V){var I=L.words.join(j?"":" ");return T.createElement("tspan",{x:k,dy:V===0?E:c,key:"".concat(I,"-").concat(V)},I)}))};function zc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function P1e(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function bP(t){let e,n,r;t.length!==2?(e=zc,n=(c,l)=>zc(t(c),l),r=(c,l)=>t(c)-l):(e=t===zc||t===P1e?t:k1e,n=t,r=t);function i(c,l,u=0,d=c.length){if(u>>1;n(c[f],l)<0?u=f+1:d=f}while(u>>1;n(c[f],l)<=0?u=f+1:d=f}while(uu&&r(c[f-1],l)>-r(c[f],l)?f-1:f}return{left:i,center:o,right:s}}function k1e(){return 0}function HG(t){return t===null?NaN:+t}function*O1e(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const I1e=bP(zc),Rg=I1e.right;bP(HG).center;class Q2 extends Map{constructor(e,n=D1e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(X2(this,e))}has(e){return super.has(X2(this,e))}set(e,n){return super.set(R1e(this,e),n)}delete(e){return super.delete(M1e(this,e))}}function X2({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function R1e({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function M1e({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function D1e(t){return t!==null&&typeof t=="object"?t.valueOf():t}function $1e(t=zc){if(t===zc)return zG;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function zG(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const L1e=Math.sqrt(50),F1e=Math.sqrt(10),U1e=Math.sqrt(2);function sb(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),o=s>=L1e?10:s>=F1e?5:s>=U1e?2:1;let c,l,u;return i<0?(u=Math.pow(10,-i)/o,c=Math.round(t*u),l=Math.round(e*u),c/ue&&--l,u=-u):(u=Math.pow(10,i)*o,c=Math.round(t/u),l=Math.round(e/u),c*ue&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const c=s-i+1,l=new Array(c);if(r)if(o<0)for(let u=0;u=r)&&(n=r);return n}function Z2(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function VG(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?zG:$1e(i);r>n;){if(r-n>600){const l=r-n+1,u=e-n+1,d=Math.log(l),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(l-f)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(e-u*f/l+h)),g=Math.min(r,Math.floor(e+(l-u)*f/l+h));VG(t,e,p,g,i)}const s=t[e];let o=n,c=r;for(Nh(t,n,e),i(t[r],s)>0&&Nh(t,n,r);o0;)--c}i(t[n],s)===0?Nh(t,n,c):(++c,Nh(t,c,r)),c<=e&&(n=c+1),e<=c&&(r=c-1)}return t}function Nh(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function B1e(t,e,n){if(t=Float64Array.from(O1e(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Z2(t);if(e>=1)return J2(t);var r,i=(r-1)*e,s=Math.floor(i),o=J2(VG(t,s).subarray(0,s+1)),c=Z2(t.subarray(s+1));return o+(c-o)*(i-s)}}function H1e(t,e,n=HG){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,s=Math.floor(i),o=+n(t[s],s,t),c=+n(t[s+1],s+1,t);return o+(c-o)*(i-s)}}function z1e(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,s=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Ev(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Ev(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=G1e.exec(t))?new Pi(e[1],e[2],e[3],1):(e=K1e.exec(t))?new Pi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=W1e.exec(t))?Ev(e[1],e[2],e[3],e[4]):(e=q1e.exec(t))?Ev(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Y1e.exec(t))?oM(e[1],e[2]/100,e[3]/100,1):(e=Q1e.exec(t))?oM(e[1],e[2]/100,e[3]/100,e[4]):eM.hasOwnProperty(t)?rM(eM[t]):t==="transparent"?new Pi(NaN,NaN,NaN,0):null}function rM(t){return new Pi(t>>16&255,t>>8&255,t&255,1)}function Ev(t,e,n,r){return r<=0&&(t=e=n=NaN),new Pi(t,e,n,r)}function Z1e(t){return t instanceof Mg||(t=km(t)),t?(t=t.rgb(),new Pi(t.r,t.g,t.b,t.opacity)):new Pi}function fA(t,e,n,r){return arguments.length===1?Z1e(t):new Pi(t,e,n,r??1)}function Pi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}SP(Pi,fA,KG(Mg,{brighter(t){return t=t==null?ob:Math.pow(ob,t),new Pi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Tm:Math.pow(Tm,t),new Pi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Pi(eu(this.r),eu(this.g),eu(this.b),ab(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:iM,formatHex:iM,formatHex8:eAe,formatRgb:sM,toString:sM}));function iM(){return`#${Fl(this.r)}${Fl(this.g)}${Fl(this.b)}`}function eAe(){return`#${Fl(this.r)}${Fl(this.g)}${Fl(this.b)}${Fl((isNaN(this.opacity)?1:this.opacity)*255)}`}function sM(){const t=ab(this.opacity);return`${t===1?"rgb(":"rgba("}${eu(this.r)}, ${eu(this.g)}, ${eu(this.b)}${t===1?")":`, ${t})`}`}function ab(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function eu(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Fl(t){return t=eu(t),(t<16?"0":"")+t.toString(16)}function oM(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ks(t,e,n,r)}function WG(t){if(t instanceof Ks)return new Ks(t.h,t.s,t.l,t.opacity);if(t instanceof Mg||(t=km(t)),!t)return new Ks;if(t instanceof Ks)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=NaN,c=s-i,l=(s+i)/2;return c?(e===s?o=(n-r)/c+(n0&&l<1?0:o,new Ks(o,c,l,t.opacity)}function tAe(t,e,n,r){return arguments.length===1?WG(t):new Ks(t,e,n,r??1)}function Ks(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}SP(Ks,tAe,KG(Mg,{brighter(t){return t=t==null?ob:Math.pow(ob,t),new Ks(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Tm:Math.pow(Tm,t),new Ks(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Pi(pC(t>=240?t-240:t+120,i,r),pC(t,i,r),pC(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ks(aM(this.h),Nv(this.s),Nv(this.l),ab(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ab(this.opacity);return`${t===1?"hsl(":"hsla("}${aM(this.h)}, ${Nv(this.s)*100}%, ${Nv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function aM(t){return t=(t||0)%360,t<0?t+360:t}function Nv(t){return Math.max(0,Math.min(1,t||0))}function pC(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const CP=t=>()=>t;function nAe(t,e){return function(n){return t+n*e}}function rAe(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function iAe(t){return(t=+t)==1?qG:function(e,n){return n-e?rAe(e,n,t):CP(isNaN(e)?n:e)}}function qG(t,e){var n=e-t;return n?nAe(t,n):CP(isNaN(t)?e:t)}const cM=function t(e){var n=iAe(e);function r(i,s){var o=n((i=fA(i)).r,(s=fA(s)).r),c=n(i.g,s.g),l=n(i.b,s.b),u=qG(i.opacity,s.opacity);return function(d){return i.r=o(d),i.g=c(d),i.b=l(d),i.opacity=u(d),i+""}}return r.gamma=t,r}(1);function sAe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(s){for(i=0;in&&(s=e.slice(n,s),c[o]?c[o]+=s:c[++o]=s),(r=r[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,l.push({i:o,x:cb(r,i)})),n=mC.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function gAe(t,e,n){var r=t[0],i=t[1],s=e[0],o=e[1];return i2?vAe:gAe,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?s:(l||(l=c(t.map(r),e,n)))(r(o(h)))}return f.invert=function(h){return o(i((u||(u=c(e,t.map(r),cb)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,lb),d()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),d()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=_P,d()},f.clamp=function(h){return arguments.length?(o=h?!0:vi,d()):o!==vi},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,p){return r=h,i=p,d()}}function AP(){return kw()(vi,vi)}function yAe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ub(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function cf(t){return t=ub(Math.abs(t)),t?t[1]:NaN}function xAe(t,e){return function(n,r){for(var i=n.length,s=[],o=0,c=t[0],l=0;i>0&&c>0&&(l+c+1>r&&(c=Math.max(1,r-l)),s.push(n.substring(i-=c,i+c)),!((l+=c+1)>r));)c=t[o=(o+1)%t.length];return s.reverse().join(e)}}function bAe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var wAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Om(t){if(!(e=wAe.exec(t)))throw new Error("invalid format: "+t);var e;return new jP({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Om.prototype=jP.prototype;function jP(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}jP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function SAe(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var YG;function CAe(t,e){var n=ub(t,e);if(!n)return t+"";var r=n[0],i=n[1],s=i-(YG=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ub(t,Math.max(0,e+s-1))[0]}function uM(t,e){var n=ub(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const dM={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:yAe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>uM(t*100,e),r:uM,s:CAe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fM(t){return t}var hM=Array.prototype.map,pM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _Ae(t){var e=t.grouping===void 0||t.thousands===void 0?fM:xAe(hM.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?fM:bAe(hM.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(f){f=Om(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,y=f.zero,b=f.width,x=f.comma,w=f.precision,S=f.trim,C=f.type;C==="n"?(x=!0,C="g"):dM[C]||(w===void 0&&(w=12),S=!0,C="g"),(y||h==="0"&&p==="=")&&(y=!0,h="0",p="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",A=m==="$"?r:/[%p]/.test(C)?o:"",j=dM[C],P=/[defgprs%]/.test(C);w=w===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function k(O){var E=_,R=A,M,G,L;if(C==="c")R=j(O)+R,O="";else{O=+O;var V=O<0||1/O<0;if(O=isNaN(O)?l:j(Math.abs(O),w),S&&(O=SAe(O)),V&&+O==0&&g!=="+"&&(V=!1),E=(V?g==="("?g:c:g==="-"||g==="("?"":g)+E,R=(C==="s"?pM[8+YG/3]:"")+R+(V&&g==="("?")":""),P){for(M=-1,G=O.length;++ML||L>57){R=(L===46?i+O.slice(M+1):O.slice(M))+R,O=O.slice(0,M);break}}}x&&!y&&(O=e(O,1/0));var I=E.length+O.length+R.length,D=I>1)+E+O+R+D.slice(I);break;default:O=D+E+O+R;break}return s(O)}return k.toString=function(){return f+""},k}function d(f,h){var p=u((f=Om(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(cf(h)/3)))*3,m=Math.pow(10,-g),y=pM[8+g/3];return function(b){return p(m*b)+y}}return{format:u,formatPrefix:d}}var Tv,EP,QG;AAe({thousands:",",grouping:[3],currency:["$",""]});function AAe(t){return Tv=_Ae(t),EP=Tv.format,QG=Tv.formatPrefix,Tv}function jAe(t){return Math.max(0,-cf(Math.abs(t)))}function EAe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(cf(e)/3)))*3-cf(Math.abs(t)))}function NAe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,cf(e)-cf(t))+1}function XG(t,e,n,r){var i=uA(t,e,n),s;switch(r=Om(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(s=EAe(i,o))&&(r.precision=s),QG(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=NAe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=jAe(i))&&(r.precision=s-(r.type==="%")*2);break}}return EP(r)}function pl(t){var e=t.domain;return t.ticks=function(n){var r=e();return cA(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return XG(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,s=r.length-1,o=r[i],c=r[s],l,u,d=10;for(c0;){if(u=lA(o,c,n),u===l)return r[i]=o,r[s]=c,e(r);if(u>0)o=Math.floor(o/u)*u,c=Math.ceil(c/u)*u;else if(u<0)o=Math.ceil(o*u)/u,c=Math.floor(c*u)/u;else break;l=u}return t},t}function db(){var t=AP();return t.copy=function(){return Dg(t,db())},ks.apply(t,arguments),pl(t)}function JG(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,lb),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return JG(t).unknown(e)},t=arguments.length?Array.from(t,lb):[0,1],pl(n)}function ZG(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],o;return sMath.pow(t,e)}function IAe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function vM(t){return(e,n)=>-t(-e,n)}function NP(t){const e=t(mM,gM),n=e.domain;let r=10,i,s;function o(){return i=IAe(r),s=OAe(r),n()[0]<0?(i=vM(i),s=vM(s),t(TAe,PAe)):t(mM,gM),e}return e.base=function(c){return arguments.length?(r=+c,o()):r},e.domain=function(c){return arguments.length?(n(c),o()):n()},e.ticks=c=>{const l=n();let u=l[0],d=l[l.length-1];const f=d0){for(;h<=p;++h)for(g=1;gd)break;b.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/s(-h):g*s(h),!(md)break;b.push(m)}b.length*2{if(c==null&&(c=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Om(l)).precision==null&&(l.trim=!0),l=EP(l)),c===1/0)return l;const u=Math.max(1,r*c/e.ticks().length);return d=>{let f=d/s(Math.round(i(d)));return f*rn(ZG(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),e}function e8(){const t=NP(kw()).domain([1,10]);return t.copy=()=>Dg(t,e8()).base(t.base()),ks.apply(t,arguments),t}function yM(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function xM(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function TP(t){var e=1,n=t(yM(e),xM(e));return n.constant=function(r){return arguments.length?t(yM(e=+r),xM(e)):e},pl(n)}function t8(){var t=TP(kw());return t.copy=function(){return Dg(t,t8()).constant(t.constant())},ks.apply(t,arguments)}function bM(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function RAe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function MAe(t){return t<0?-t*t:t*t}function PP(t){var e=t(vi,vi),n=1;function r(){return n===1?t(vi,vi):n===.5?t(RAe,MAe):t(bM(n),bM(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},pl(e)}function kP(){var t=PP(kw());return t.copy=function(){return Dg(t,kP()).exponent(t.exponent())},ks.apply(t,arguments),t}function DAe(){return kP.apply(null,arguments).exponent(.5)}function wM(t){return Math.sign(t)*t*t}function $Ae(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function n8(){var t=AP(),e=[0,1],n=!1,r;function i(s){var o=$Ae(t(s));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(s){return t.invert(wM(s))},i.domain=function(s){return arguments.length?(t.domain(s),i):t.domain()},i.range=function(s){return arguments.length?(t.range((e=Array.from(s,lb)).map(wM)),i):e.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(t.clamp(s),i):t.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return n8(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},ks.apply(i,arguments),pl(i)}function r8(){var t=[],e=[],n=[],r;function i(){var o=0,c=Math.max(1,e.length);for(n=new Array(c-1);++o0?n[c-1]:t[0],c=n?[r[n-1],e]:[r[u-1],r[u]]},o.unknown=function(l){return arguments.length&&(s=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return i8().domain([t,e]).range(i).unknown(s)},ks.apply(pl(o),arguments)}function s8(){var t=[.5],e=[0,1],n,r=1;function i(s){return s!=null&&s<=s?e[Rg(t,s,0,r)]:n}return i.domain=function(s){return arguments.length?(t=Array.from(s),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(s){return arguments.length?(e=Array.from(s),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(s){var o=e.indexOf(s);return[t[o-1],t[o]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return s8().domain(t).range(e).unknown(n)},ks.apply(i,arguments)}const gC=new Date,vC=new Date;function Nr(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const o=i(s),c=i.ceil(s);return s-o(e(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,c)=>{const l=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s0))return l;let u;do l.push(u=new Date(+s)),e(s,c),t(s);while(uNr(o=>{if(o>=o)for(;t(o),!s(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;e(o,-1),!s(o););else for(;--c>=0;)for(;e(o,1),!s(o););}),n&&(i.count=(s,o)=>(gC.setTime(+s),vC.setTime(+o),t(gC),t(vC),Math.floor(n(gC,vC))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?o=>r(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const fb=Nr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);fb.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Nr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):fb);fb.range;const ba=1e3,ws=ba*60,wa=ws*60,La=wa*24,OP=La*7,SM=La*30,yC=La*365,Ul=Nr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*ba)},(t,e)=>(e-t)/ba,t=>t.getUTCSeconds());Ul.range;const IP=Nr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ba)},(t,e)=>{t.setTime(+t+e*ws)},(t,e)=>(e-t)/ws,t=>t.getMinutes());IP.range;const RP=Nr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ws)},(t,e)=>(e-t)/ws,t=>t.getUTCMinutes());RP.range;const MP=Nr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ba-t.getMinutes()*ws)},(t,e)=>{t.setTime(+t+e*wa)},(t,e)=>(e-t)/wa,t=>t.getHours());MP.range;const DP=Nr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*wa)},(t,e)=>(e-t)/wa,t=>t.getUTCHours());DP.range;const $g=Nr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ws)/La,t=>t.getDate()-1);$g.range;const Ow=Nr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/La,t=>t.getUTCDate()-1);Ow.range;const o8=Nr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/La,t=>Math.floor(t/La));o8.range;function Ru(t){return Nr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ws)/OP)}const Iw=Ru(0),hb=Ru(1),LAe=Ru(2),FAe=Ru(3),lf=Ru(4),UAe=Ru(5),BAe=Ru(6);Iw.range;hb.range;LAe.range;FAe.range;lf.range;UAe.range;BAe.range;function Mu(t){return Nr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/OP)}const Rw=Mu(0),pb=Mu(1),HAe=Mu(2),zAe=Mu(3),uf=Mu(4),VAe=Mu(5),GAe=Mu(6);Rw.range;pb.range;HAe.range;zAe.range;uf.range;VAe.range;GAe.range;const $P=Nr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());$P.range;const LP=Nr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());LP.range;const Fa=Nr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Fa.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Nr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Fa.range;const Ua=Nr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Ua.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Nr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Ua.range;function a8(t,e,n,r,i,s){const o=[[Ul,1,ba],[Ul,5,5*ba],[Ul,15,15*ba],[Ul,30,30*ba],[s,1,ws],[s,5,5*ws],[s,15,15*ws],[s,30,30*ws],[i,1,wa],[i,3,3*wa],[i,6,6*wa],[i,12,12*wa],[r,1,La],[r,2,2*La],[n,1,OP],[e,1,SM],[e,3,3*SM],[t,1,yC]];function c(u,d,f){const h=dy).right(o,h);if(p===o.length)return t.every(uA(u/yC,d/yC,f));if(p===0)return fb.every(Math.max(uA(u,d,f),1));const[g,m]=o[h/o[p-1][2]53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Ue=bC(Th(Y.y,0,1)),at=Ue.getUTCDay(),Ue=at>4||at===0?pb.ceil(Ue):pb(Ue),Ue=Ow.offset(Ue,(Y.V-1)*7),Y.y=Ue.getUTCFullYear(),Y.m=Ue.getUTCMonth(),Y.d=Ue.getUTCDate()+(Y.w+6)%7):(Ue=xC(Th(Y.y,0,1)),at=Ue.getDay(),Ue=at>4||at===0?hb.ceil(Ue):hb(Ue),Ue=$g.offset(Ue,(Y.V-1)*7),Y.y=Ue.getFullYear(),Y.m=Ue.getMonth(),Y.d=Ue.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),at="Z"in Y?bC(Th(Y.y,0,1)).getUTCDay():xC(Th(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(at+5)%7:Y.w+Y.U*7-(at+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,bC(Y)):xC(Y)}}function j(te,pe,we,Y){for(var nt=0,Ue=pe.length,at=we.length,Be,Bt;nt=at)return-1;if(Be=pe.charCodeAt(nt++),Be===37){if(Be=pe.charAt(nt++),Bt=C[Be in CM?pe.charAt(nt++):Be],!Bt||(Y=Bt(te,we,Y))<0)return-1}else if(Be!=we.charCodeAt(Y++))return-1}return Y}function P(te,pe,we){var Y=u.exec(pe.slice(we));return Y?(te.p=d.get(Y[0].toLowerCase()),we+Y[0].length):-1}function k(te,pe,we){var Y=p.exec(pe.slice(we));return Y?(te.w=g.get(Y[0].toLowerCase()),we+Y[0].length):-1}function O(te,pe,we){var Y=f.exec(pe.slice(we));return Y?(te.w=h.get(Y[0].toLowerCase()),we+Y[0].length):-1}function E(te,pe,we){var Y=b.exec(pe.slice(we));return Y?(te.m=x.get(Y[0].toLowerCase()),we+Y[0].length):-1}function R(te,pe,we){var Y=m.exec(pe.slice(we));return Y?(te.m=y.get(Y[0].toLowerCase()),we+Y[0].length):-1}function M(te,pe,we){return j(te,e,pe,we)}function G(te,pe,we){return j(te,n,pe,we)}function L(te,pe,we){return j(te,r,pe,we)}function V(te){return o[te.getDay()]}function I(te){return s[te.getDay()]}function D(te){return l[te.getMonth()]}function X(te){return c[te.getMonth()]}function Q(te){return i[+(te.getHours()>=12)]}function J(te){return 1+~~(te.getMonth()/3)}function ye(te){return o[te.getUTCDay()]}function U(te){return s[te.getUTCDay()]}function ne(te){return l[te.getUTCMonth()]}function ue(te){return c[te.getUTCMonth()]}function F(te){return i[+(te.getUTCHours()>=12)]}function ce(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var pe=_(te+="",w);return pe.toString=function(){return te},pe},parse:function(te){var pe=A(te+="",!1);return pe.toString=function(){return te},pe},utcFormat:function(te){var pe=_(te+="",S);return pe.toString=function(){return te},pe},utcParse:function(te){var pe=A(te+="",!0);return pe.toString=function(){return te},pe}}}var CM={"-":"",_:" ",0:"0"},$r=/^\s*\d+/,XAe=/^%/,JAe=/[\\^$*+?|[\]().{}]/g;function cn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function eje(t,e,n){var r=$r.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function tje(t,e,n){var r=$r.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function nje(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function rje(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ije(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function _M(t,e,n){var r=$r.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function AM(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function sje(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function oje(t,e,n){var r=$r.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function aje(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function jM(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function cje(t,e,n){var r=$r.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function EM(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function lje(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function uje(t,e,n){var r=$r.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function dje(t,e,n){var r=$r.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function fje(t,e,n){var r=$r.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function hje(t,e,n){var r=XAe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function pje(t,e,n){var r=$r.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function mje(t,e,n){var r=$r.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function NM(t,e){return cn(t.getDate(),e,2)}function gje(t,e){return cn(t.getHours(),e,2)}function vje(t,e){return cn(t.getHours()%12||12,e,2)}function yje(t,e){return cn(1+$g.count(Fa(t),t),e,3)}function c8(t,e){return cn(t.getMilliseconds(),e,3)}function xje(t,e){return c8(t,e)+"000"}function bje(t,e){return cn(t.getMonth()+1,e,2)}function wje(t,e){return cn(t.getMinutes(),e,2)}function Sje(t,e){return cn(t.getSeconds(),e,2)}function Cje(t){var e=t.getDay();return e===0?7:e}function _je(t,e){return cn(Iw.count(Fa(t)-1,t),e,2)}function l8(t){var e=t.getDay();return e>=4||e===0?lf(t):lf.ceil(t)}function Aje(t,e){return t=l8(t),cn(lf.count(Fa(t),t)+(Fa(t).getDay()===4),e,2)}function jje(t){return t.getDay()}function Eje(t,e){return cn(hb.count(Fa(t)-1,t),e,2)}function Nje(t,e){return cn(t.getFullYear()%100,e,2)}function Tje(t,e){return t=l8(t),cn(t.getFullYear()%100,e,2)}function Pje(t,e){return cn(t.getFullYear()%1e4,e,4)}function kje(t,e){var n=t.getDay();return t=n>=4||n===0?lf(t):lf.ceil(t),cn(t.getFullYear()%1e4,e,4)}function Oje(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+cn(e/60|0,"0",2)+cn(e%60,"0",2)}function TM(t,e){return cn(t.getUTCDate(),e,2)}function Ije(t,e){return cn(t.getUTCHours(),e,2)}function Rje(t,e){return cn(t.getUTCHours()%12||12,e,2)}function Mje(t,e){return cn(1+Ow.count(Ua(t),t),e,3)}function u8(t,e){return cn(t.getUTCMilliseconds(),e,3)}function Dje(t,e){return u8(t,e)+"000"}function $je(t,e){return cn(t.getUTCMonth()+1,e,2)}function Lje(t,e){return cn(t.getUTCMinutes(),e,2)}function Fje(t,e){return cn(t.getUTCSeconds(),e,2)}function Uje(t){var e=t.getUTCDay();return e===0?7:e}function Bje(t,e){return cn(Rw.count(Ua(t)-1,t),e,2)}function d8(t){var e=t.getUTCDay();return e>=4||e===0?uf(t):uf.ceil(t)}function Hje(t,e){return t=d8(t),cn(uf.count(Ua(t),t)+(Ua(t).getUTCDay()===4),e,2)}function zje(t){return t.getUTCDay()}function Vje(t,e){return cn(pb.count(Ua(t)-1,t),e,2)}function Gje(t,e){return cn(t.getUTCFullYear()%100,e,2)}function Kje(t,e){return t=d8(t),cn(t.getUTCFullYear()%100,e,2)}function Wje(t,e){return cn(t.getUTCFullYear()%1e4,e,4)}function qje(t,e){var n=t.getUTCDay();return t=n>=4||n===0?uf(t):uf.ceil(t),cn(t.getUTCFullYear()%1e4,e,4)}function Yje(){return"+0000"}function PM(){return"%"}function kM(t){return+t}function OM(t){return Math.floor(+t/1e3)}var Vu,f8,h8;Qje({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Qje(t){return Vu=QAe(t),f8=Vu.format,Vu.parse,h8=Vu.utcFormat,Vu.utcParse,Vu}function Xje(t){return new Date(t)}function Jje(t){return t instanceof Date?+t:+new Date(+t)}function FP(t,e,n,r,i,s,o,c,l,u){var d=AP(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),x=u("%b %d"),w=u("%B"),S=u("%Y");function C(_){return(l(_)<_?p:c(_)<_?g:o(_)<_?m:s(_)<_?y:r(_)<_?i(_)<_?b:x:n(_)<_?w:S)(_)}return d.invert=function(_){return new Date(f(_))},d.domain=function(_){return arguments.length?h(Array.from(_,Jje)):h().map(Xje)},d.ticks=function(_){var A=h();return t(A[0],A[A.length-1],_??10)},d.tickFormat=function(_,A){return A==null?C:u(A)},d.nice=function(_){var A=h();return(!_||typeof _.range!="function")&&(_=e(A[0],A[A.length-1],_??10)),_?h(ZG(A,_)):d},d.copy=function(){return Dg(d,FP(t,e,n,r,i,s,o,c,l,u))},d}function Zje(){return ks.apply(FP(qAe,YAe,Fa,$P,Iw,$g,MP,IP,Ul,f8).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function eEe(){return ks.apply(FP(KAe,WAe,Ua,LP,Rw,Ow,DP,RP,Ul,h8).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Mw(){var t=0,e=1,n,r,i,s,o=vi,c=!1,l;function u(f){return f==null||isNaN(f=+f)?l:o(i===0?.5:(f=(s(f)-n)*i,c?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([t,e]=f,n=s(t=+t),r=s(e=+e),i=n===r?0:1/(r-n),u):[t,e]},u.clamp=function(f){return arguments.length?(c=!!f,u):c},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,o=f(p,g),u):[o(0),o(1)]}}return u.range=d(ih),u.rangeRound=d(_P),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return s=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),u}}function ml(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function p8(){var t=pl(Mw()(vi));return t.copy=function(){return ml(t,p8())},qa.apply(t,arguments)}function m8(){var t=NP(Mw()).domain([1,10]);return t.copy=function(){return ml(t,m8()).base(t.base())},qa.apply(t,arguments)}function g8(){var t=TP(Mw());return t.copy=function(){return ml(t,g8()).constant(t.constant())},qa.apply(t,arguments)}function UP(){var t=PP(Mw());return t.copy=function(){return ml(t,UP()).exponent(t.exponent())},qa.apply(t,arguments)}function tEe(){return UP.apply(null,arguments).exponent(.5)}function v8(){var t=[],e=vi;function n(r){if(r!=null&&!isNaN(r=+r))return e((Rg(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(zc),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>B1e(t,s/r))},n.copy=function(){return v8(e).domain(t)},qa.apply(n,arguments)}function Dw(){var t=0,e=.5,n=1,r=1,i,s,o,c,l,u=vi,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-s)*(r*me}var w8=sEe,oEe=$w,aEe=w8,cEe=rh;function lEe(t){return t&&t.length?oEe(t,cEe,aEe):void 0}var uEe=lEe;const Sc=un(uEe);function dEe(t,e){return tt.e^s.s<0?1:-1;for(r=s.d.length,i=t.d.length,e=0,n=rt.d[e]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};Xe.decimalPlaces=Xe.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Mn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Xe.dividedBy=Xe.div=function(t){return Ea(this,new this.constructor(t))};Xe.dividedToIntegerBy=Xe.idiv=function(t){var e=this,n=e.constructor;return En(Ea(e,new n(t),0,1),n.precision)};Xe.equals=Xe.eq=function(t){return!this.cmp(t)};Xe.exponent=function(){return gr(this)};Xe.greaterThan=Xe.gt=function(t){return this.cmp(t)>0};Xe.greaterThanOrEqualTo=Xe.gte=function(t){return this.cmp(t)>=0};Xe.isInteger=Xe.isint=function(){return this.e>this.d.length-2};Xe.isNegative=Xe.isneg=function(){return this.s<0};Xe.isPositive=Xe.ispos=function(){return this.s>0};Xe.isZero=function(){return this.s===0};Xe.lessThan=Xe.lt=function(t){return this.cmp(t)<0};Xe.lessThanOrEqualTo=Xe.lte=function(t){return this.cmp(t)<1};Xe.logarithm=Xe.log=function(t){var e,n=this,r=n.constructor,i=r.precision,s=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Qi))throw Error(Ns+"NaN");if(n.s<1)throw Error(Ns+(n.s?"NaN":"-Infinity"));return n.eq(Qi)?new r(0):(Vn=!1,e=Ea(Im(n,s),Im(t,s),s),Vn=!0,En(e,i))};Xe.minus=Xe.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?j8(e,t):_8(e,(t.s=-t.s,t))};Xe.modulo=Xe.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Ns+"NaN");return n.s?(Vn=!1,e=Ea(n,t,0,1).times(t),Vn=!0,n.minus(e)):En(new r(n),i)};Xe.naturalExponential=Xe.exp=function(){return A8(this)};Xe.naturalLogarithm=Xe.ln=function(){return Im(this)};Xe.negated=Xe.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Xe.plus=Xe.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?_8(e,t):j8(e,(t.s=-t.s,t))};Xe.precision=Xe.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(tu+t);if(e=gr(i)+1,r=i.d.length-1,n=r*Mn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Xe.squareRoot=Xe.sqrt=function(){var t,e,n,r,i,s,o,c=this,l=c.constructor;if(c.s<1){if(!c.s)return new l(0);throw Error(Ns+"NaN")}for(t=gr(c),Vn=!1,i=Math.sqrt(+c),i==0||i==1/0?(e=Io(c.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=oh((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=o=n+3;;)if(s=r,r=s.plus(Ea(c,s,o+2)).times(.5),Io(s.d).slice(0,o)===(e=Io(r.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(En(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(e!="9999")break;o+=4}return Vn=!0,En(r,n)};Xe.times=Xe.mul=function(t){var e,n,r,i,s,o,c,l,u,d=this,f=d.constructor,h=d.d,p=(t=new f(t)).d;if(!d.s||!t.s)return new f(0);for(t.s*=d.s,n=d.e+t.e,l=h.length,u=p.length,l=0;){for(e=0,i=l+r;i>r;)c=s[i]+p[r]*h[i-r-1]+e,s[i--]=c%Pr|0,e=c/Pr|0;s[i]=(s[i]+e)%Pr|0}for(;!s[--o];)s.pop();return e?++n:s.shift(),t.d=s,t.e=n,Vn?En(t,f.precision):t};Xe.toDecimalPlaces=Xe.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Wo(t,0,sh),e===void 0?e=r.rounding:Wo(e,0,8),En(n,t+gr(n)+1,e))};Xe.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=_u(r,!0):(Wo(t,0,sh),e===void 0?e=i.rounding:Wo(e,0,8),r=En(new i(r),t+1,e),n=_u(r,!0,t+1)),n};Xe.toFixed=function(t,e){var n,r,i=this,s=i.constructor;return t===void 0?_u(i):(Wo(t,0,sh),e===void 0?e=s.rounding:Wo(e,0,8),r=En(new s(i),t+gr(i)+1,e),n=_u(r.abs(),!1,t+gr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Xe.toInteger=Xe.toint=function(){var t=this,e=t.constructor;return En(new e(t),gr(t)+1,e.rounding)};Xe.toNumber=function(){return+this};Xe.toPower=Xe.pow=function(t){var e,n,r,i,s,o,c=this,l=c.constructor,u=12,d=+(t=new l(t));if(!t.s)return new l(Qi);if(c=new l(c),!c.s){if(t.s<1)throw Error(Ns+"Infinity");return c}if(c.eq(Qi))return c;if(r=l.precision,t.eq(Qi))return En(c,r);if(e=t.e,n=t.d.length-1,o=e>=n,s=c.s,o){if((n=d<0?-d:d)<=C8){for(i=new l(Qi),e=Math.ceil(r/Mn+4),Vn=!1;n%2&&(i=i.times(c),MM(i.d,e)),n=oh(n/2),n!==0;)c=c.times(c),MM(c.d,e);return Vn=!0,t.s<0?new l(Qi).div(i):En(i,r)}}else if(s<0)throw Error(Ns+"NaN");return s=s<0&&t.d[Math.max(e,n)]&1?-1:1,c.s=1,Vn=!1,i=t.times(Im(c,r+u)),Vn=!0,i=A8(i),i.s=s,i};Xe.toPrecision=function(t,e){var n,r,i=this,s=i.constructor;return t===void 0?(n=gr(i),r=_u(i,n<=s.toExpNeg||n>=s.toExpPos)):(Wo(t,1,sh),e===void 0?e=s.rounding:Wo(e,0,8),i=En(new s(i),t,e),n=gr(i),r=_u(i,t<=n||n<=s.toExpNeg,t)),r};Xe.toSignificantDigits=Xe.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Wo(t,1,sh),e===void 0?e=r.rounding:Wo(e,0,8)),En(new r(n),t,e)};Xe.toString=Xe.valueOf=Xe.val=Xe.toJSON=Xe[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=gr(t),n=t.constructor;return _u(t,e<=n.toExpNeg||e>=n.toExpPos)};function _8(t,e){var n,r,i,s,o,c,l,u,d=t.constructor,f=d.precision;if(!t.s||!e.s)return e.s||(e=new d(t)),Vn?En(e,f):e;if(l=t.d,u=e.d,o=t.e,i=e.e,l=l.slice(),s=o-i,s){for(s<0?(r=l,s=-s,c=u.length):(r=u,i=o,c=l.length),o=Math.ceil(f/Mn),c=o>c?o+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=l.length,s=u.length,c-s<0&&(s=c,r=u,u=l,l=r),n=0;s;)n=(l[--s]=l[s]+u[s]+n)/Pr|0,l[s]%=Pr;for(n&&(l.unshift(n),++i),c=l.length;l[--c]==0;)l.pop();return e.d=l,e.e=i,Vn?En(e,f):e}function Wo(t,e,n){if(t!==~~t||tn)throw Error(tu+t)}function Io(t){var e,n,r,i=t.length-1,s="",o=t[0];if(i>0){for(s+=o,e=1;eo?1:-1;else for(c=l=0;ci[c]?1:-1;break}return l}function n(r,i,s){for(var o=0;s--;)r[s]-=o,o=r[s]1;)r.shift()}return function(r,i,s,o){var c,l,u,d,f,h,p,g,m,y,b,x,w,S,C,_,A,j,P=r.constructor,k=r.s==i.s?1:-1,O=r.d,E=i.d;if(!r.s)return new P(r);if(!i.s)throw Error(Ns+"Division by zero");for(l=r.e-i.e,A=E.length,C=O.length,p=new P(k),g=p.d=[],u=0;E[u]==(O[u]||0);)++u;if(E[u]>(O[u]||0)&&--l,s==null?x=s=P.precision:o?x=s+(gr(r)-gr(i))+1:x=s,x<0)return new P(0);if(x=x/Mn+2|0,u=0,A==1)for(d=0,E=E[0],x++;(u1&&(E=t(E,d),O=t(O,d),A=E.length,C=O.length),S=A,m=O.slice(0,A),y=m.length;y=Pr/2&&++_;do d=0,c=e(E,m,A,y),c<0?(b=m[0],A!=y&&(b=b*Pr+(m[1]||0)),d=b/_|0,d>1?(d>=Pr&&(d=Pr-1),f=t(E,d),h=f.length,y=m.length,c=e(f,m,h,y),c==1&&(d--,n(f,A16)throw Error(HP+gr(t));if(!t.s)return new d(Qi);for(e==null?(Vn=!1,c=f):c=e,o=new d(.03125);t.abs().gte(.1);)t=t.times(o),u+=5;for(r=Math.log(Nl(2,u))/Math.LN10*2+5|0,c+=r,n=i=s=new d(Qi),d.precision=c;;){if(i=En(i.times(t),c),n=n.times(++l),o=s.plus(Ea(i,n,c)),Io(o.d).slice(0,c)===Io(s.d).slice(0,c)){for(;u--;)s=En(s.times(s),c);return d.precision=f,e==null?(Vn=!0,En(s,f)):s}s=o}}function gr(t){for(var e=t.e*Mn,n=t.d[0];n>=10;n/=10)e++;return e}function wC(t,e,n){if(e>t.LN10.sd())throw Vn=!0,n&&(t.precision=n),Error(Ns+"LN10 precision limit exceeded");return En(new t(t.LN10),e)}function sc(t){for(var e="";t--;)e+="0";return e}function Im(t,e){var n,r,i,s,o,c,l,u,d,f=1,h=10,p=t,g=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Ns+(p.s?"NaN":"-Infinity"));if(p.eq(Qi))return new m(0);if(e==null?(Vn=!1,u=y):u=e,p.eq(10))return e==null&&(Vn=!0),wC(m,u);if(u+=h,m.precision=u,n=Io(g),r=n.charAt(0),s=gr(p),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=Io(p.d),r=n.charAt(0),f++;s=gr(p),r>1?(p=new m("0."+n),s++):p=new m(r+"."+n.slice(1))}else return l=wC(m,u+2,y).times(s+""),p=Im(new m(r+"."+n.slice(1)),u-h).plus(l),m.precision=y,e==null?(Vn=!0,En(p,y)):p;for(c=o=p=Ea(p.minus(Qi),p.plus(Qi),u),d=En(p.times(p),u),i=3;;){if(o=En(o.times(d),u),l=c.plus(Ea(o,new m(i),u)),Io(l.d).slice(0,u)===Io(c.d).slice(0,u))return c=c.times(2),s!==0&&(c=c.plus(wC(m,u+2,y).times(s+""))),c=Ea(c,new m(f),u),m.precision=y,e==null?(Vn=!0,En(c,y)):c;c=l,i+=2}}function RM(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=oh(n/Mn),t.d=[],r=(n+1)%Mn,n<0&&(r+=Mn),rmb||t.e<-mb))throw Error(HP+n)}else t.s=0,t.e=0,t.d=[0];return t}function En(t,e,n){var r,i,s,o,c,l,u,d,f=t.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(r=e-o,r<0)r+=Mn,i=e,u=f[d=0];else{if(d=Math.ceil((r+1)/Mn),s=f.length,d>=s)return t;for(u=s=f[d],o=1;s>=10;s/=10)o++;r%=Mn,i=r-Mn+o}if(n!==void 0&&(s=Nl(10,o-i-1),c=u/s%10|0,l=e<0||f[d+1]!==void 0||u%s,l=n<4?(c||l)&&(n==0||n==(t.s<0?3:2)):c>5||c==5&&(n==4||l||n==6&&(r>0?i>0?u/Nl(10,o-i):0:f[d-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(s=gr(t),f.length=1,e=e-s-1,f[0]=Nl(10,(Mn-e%Mn)%Mn),t.e=oh(-e/Mn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=d,s=1,d--):(f.length=d+1,s=Nl(10,Mn-r),f[d]=i>0?(u/Nl(10,o-i)%Nl(10,i)|0)*s:0),l)for(;;)if(d==0){(f[0]+=s)==Pr&&(f[0]=1,++t.e);break}else{if(f[d]+=s,f[d]!=Pr)break;f[d--]=0,s=1}for(r=f.length;f[--r]===0;)f.pop();if(Vn&&(t.e>mb||t.e<-mb))throw Error(HP+gr(t));return t}function j8(t,e){var n,r,i,s,o,c,l,u,d,f,h=t.constructor,p=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),Vn?En(e,p):e;if(l=t.d,f=e.d,r=e.e,u=t.e,l=l.slice(),o=u-r,o){for(d=o<0,d?(n=l,o=-o,c=f.length):(n=f,r=u,c=l.length),i=Math.max(Math.ceil(p/Mn),c)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=l.length,c=f.length,d=i0;--i)l[c++]=0;for(i=f.length;i>o;){if(l[--i]0?s=s.charAt(0)+"."+s.slice(1)+sc(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+sc(-i-1)+s,n&&(r=n-o)>0&&(s+=sc(r))):i>=o?(s+=sc(i+1-o),n&&(r=n-i-1)>0&&(s=s+"."+sc(r))):((r=i+1)0&&(i+1===o&&(s+="."),s+=sc(r))),t.s<0?"-"+s:s}function MM(t,e){if(t.length>e)return t.length=e,!0}function E8(t){var e,n,r;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(tu+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return RM(o,s.toString())}else if(typeof s!="string")throw Error(tu+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,OEe.test(s))RM(o,s);else throw Error(tu+s)}if(i.prototype=Xe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=E8,i.config=i.set=IEe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(tu+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(tu+n+": "+r);return this}var zP=E8(kEe);Qi=new zP(1);const wn=zP;function REe(t){return LEe(t)||$Ee(t)||DEe(t)||MEe()}function MEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DEe(t,e){if(t){if(typeof t=="string")return mA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mA(t,e)}}function $Ee(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function LEe(t){if(Array.isArray(t))return mA(t)}function mA(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-o,DM(function(){for(var c=arguments.length,l=new Array(c),u=0;ut.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,s=void 0;try{for(var o=t[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,s=l}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw s}}return n}}function ZEe(t){if(Array.isArray(t))return t}function O8(t){var e=Rm(t,2),n=e[0],r=e[1],i=n,s=r;return n>r&&(i=r,s=n),[i,s]}function I8(t,e,n){if(t.lte(0))return new wn(0);var r=Uw.getDigitCount(t.toNumber()),i=new wn(10).pow(r),s=t.div(i),o=r!==1?.05:.1,c=new wn(Math.ceil(s.div(o).toNumber())).add(n).mul(o),l=c.mul(i);return e?l:new wn(Math.ceil(l))}function eNe(t,e,n){var r=1,i=new wn(t);if(!i.isint()&&n){var s=Math.abs(t);s<1?(r=new wn(10).pow(Uw.getDigitCount(t)-1),i=new wn(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new wn(Math.floor(t)))}else t===0?i=new wn(Math.floor((e-1)/2)):n||(i=new wn(Math.floor(t)));var o=Math.floor((e-1)/2),c=HEe(BEe(function(l){return i.add(new wn(l-o).mul(r)).toNumber()}),gA);return c(0,e)}function R8(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new wn(0),tickMin:new wn(0),tickMax:new wn(0)};var s=I8(new wn(e).sub(t).div(n-1),r,i),o;t<=0&&e>=0?o=new wn(0):(o=new wn(t).add(e).div(2),o=o.sub(new wn(o).mod(s)));var c=Math.ceil(o.sub(t).div(s).toNumber()),l=Math.ceil(new wn(e).sub(o).div(s).toNumber()),u=c+l+1;return u>n?R8(t,e,n,r,i+1):(u0?l+(n-u):l,c=e>0?c:c+(n-u)),{step:s,tickMin:o.sub(new wn(c).mul(s)),tickMax:o.add(new wn(l).mul(s))})}function tNe(t){var e=Rm(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),c=O8([n,r]),l=Rm(c,2),u=l[0],d=l[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(yA(gA(0,i-1).map(function(){return 1/0}))):[].concat(yA(gA(0,i-1).map(function(){return-1/0})),[d]);return n>r?vA(f):f}if(u===d)return eNe(u,i,s);var h=R8(u,d,o,s),p=h.step,g=h.tickMin,m=h.tickMax,y=Uw.rangeStep(g,m.add(new wn(.1).mul(p)),p);return n>r?vA(y):y}function nNe(t,e){var n=Rm(t,2),r=n[0],i=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=O8([r,i]),c=Rm(o,2),l=c[0],u=c[1];if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var d=Math.max(e,2),f=I8(new wn(u).sub(l).div(d-1),s,0),h=[].concat(yA(Uw.rangeStep(new wn(l),new wn(u).sub(new wn(.99).mul(f)),f)),[u]);return r>i?vA(h):h}var rNe=P8(tNe),iNe=P8(nNe),sNe="Invariant failed";function Au(t,e){throw new Error(sNe)}var oNe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function df(t){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},df(t)}function gb(){return gb=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function hNe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function pNe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mNe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var l=s.range,u=0;u0?i[u-1].coordinate:i[c-1].coordinate,f=i[u].coordinate,h=u>=c-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(mi(f-d)!==mi(h-f)){var g=[];if(mi(h-f)===mi(l[1]-l[0])){p=h;var m=f+l[1]-l[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var y=h+l[1]-l[0];g[0]=Math.min(f,(y+f)/2),g[1]=Math.max(f,(y+f)/2)}var b=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(e>b[0]&&e<=b[1]||e>=g[0]&&e<=g[1]){o=i[u].index;break}}else{var x=Math.min(d,h),w=Math.max(d,h);if(e>(x+f)/2&&e<=(w+f)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===c-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){o=r[S].index;break}return o},VP=function(e){var n,r=e,i=r.type.displayName,s=(n=e.type)!==null&&n!==void 0&&n.defaultProps?nr(nr({},e.type.defaultProps),e.props):e.props,o=s.stroke,c=s.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:c;break;default:l=c;break}return l},ONe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var o={},c=Object.keys(s),l=0,u=c.length;l=0});if(b&&b.length){var x=b[0].type.defaultProps,w=x!==void 0?nr(nr({},x),b[0].props):b[0].props,S=w.barSize,C=w[y];o[C]||(o[C]=[]);var _=$t(S)?n:S;o[C].push({item:b[0],stackList:b.slice(1),barSize:$t(_)?void 0:gi(_,r,0)})}}return o},INe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,s=e.sizeList,o=s===void 0?[]:s,c=e.maxBarSize,l=o.length;if(l<1)return null;var u=gi(n,i,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/l,g=o.reduce(function(S,C){return S+C.barSize||0},0);g+=(l-1)*u,g>=i&&(g-=(l-1)*u,u=0),g>=i&&p>0&&(h=!0,p*=.9,g=l*p);var m=(i-g)/2>>0,y={offset:m-u,size:0};d=o.reduce(function(S,C){var _={item:C.item,position:{offset:y.offset+y.size+u,size:h?p:C.barSize}},A=[].concat(FM(S),[_]);return y=A[A.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(j){A.push({item:j,position:y})}),A},f)}else{var b=gi(r,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var x=(i-2*b-(l-1)*u)/l;x>1&&(x>>=0);var w=c===+c?Math.min(x,c):x;d=o.reduce(function(S,C,_){var A=[].concat(FM(S),[{item:C.item,position:{offset:b+(x+u)*_+(x-w)/2,size:w}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(j){A.push({item:j,position:A[A.length-1].position})}),A},f)}return d},RNe=function(e,n,r,i){var s=r.children,o=r.width,c=r.margin,l=o-(c.left||0)-(c.right||0),u=L8({children:s,legendWidth:l});if(u){var d=i||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&Ee(e[p]))return nr(nr({},e),{},Td({},p,e[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&Ee(e[g]))return nr(nr({},e),{},Td({},g,e[g]+(h||0)))}return e},MNe=function(e,n,r){return $t(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},F8=function(e,n,r,i,s){var o=n.props.children,c=_s(o,Bw).filter(function(u){return MNe(i,s,u.props.direction)});if(c&&c.length){var l=c.map(function(u){return u.props.dataKey});return e.reduce(function(u,d){var f=ir(d,r);if($t(f))return u;var h=Array.isArray(f)?[Lw(f),Sc(f)]:[f,f],p=l.reduce(function(g,m){var y=ir(d,m,0),b=h[0]-Math.abs(Array.isArray(y)?y[0]:y),x=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,g[0]),Math.max(x,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},DNe=function(e,n,r,i,s){var o=n.map(function(c){return F8(e,c,r,s,i)}).filter(function(c){return!$t(c)});return o&&o.length?o.reduce(function(c,l){return[Math.min(c[0],l[0]),Math.max(c[1],l[1])]},[1/0,-1/0]):null},U8=function(e,n,r,i,s){var o=n.map(function(l){var u=l.props.dataKey;return r==="number"&&u&&F8(e,l,u,i)||vp(e,u,r,s)});if(r==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var c={};return o.reduce(function(l,u){for(var d=0,f=u.length;d=2?mi(c[0]-c[1])*2*u:u,n&&(e.ticks||e.niceTicks)){var d=(e.ticks||e.niceTicks).map(function(f){var h=s?s.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!Zf(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:s?s[f]:f,index:h,offset:u}})},SC=new WeakMap,Pv=function(e,n){if(typeof n!="function")return e;SC.has(e)||SC.set(e,new WeakMap);var r=SC.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},z8=function(e,n,r){var i=e.scale,s=e.type,o=e.layout,c=e.axisType;if(i==="auto")return o==="radial"&&c==="radiusAxis"?{scale:Nm(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:db(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:gp(),realScaleType:"point"}:s==="category"?{scale:Nm(),realScaleType:"band"}:{scale:db(),realScaleType:"linear"};if(kg(i)){var l="scale".concat(_w(i));return{scale:(IM[l]||gp)(),realScaleType:IM[l]?l:"point"}}return Et(i)?{scale:i}:{scale:gp(),realScaleType:"point"}},BM=1e-4,V8=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),s=Math.min(i[0],i[1])-BM,o=Math.max(i[0],i[1])+BM,c=e(n[0]),l=e(n[r-1]);(co||lo)&&e.domain([n[0],n[r-1]])}},$Ne=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]=0?(e[c][r][0]=s,e[c][r][1]=s+l,s=e[c][r][1]):(e[c][r][0]=o,e[c][r][1]=o+l,o=e[c][r][1])}},UNe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[o][r][0]=s,e[o][r][1]=s+c,s=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}},BNe={sign:FNe,expand:ove,none:nf,silhouette:ave,wiggle:cve,positive:UNe},HNe=function(e,n,r){var i=n.map(function(c){return c.props.dataKey}),s=BNe[r],o=sve().keys(i).value(function(c,l){return+ir(c,l,0)}).order(K1).offset(s);return o(e)},zNe=function(e,n,r,i,s,o){if(!e)return null;var c=o?n.reverse():n,l={},u=c.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?nr(nr({},h.type.defaultProps),h.props):h.props,m=g.stackId,y=g.hide;if(y)return f;var b=g[r],x=f[b]||{hasStack:!1,stackGroups:{}};if(Er(m)){var w=x.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[m]=w}else x.stackGroups[eh("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return nr(nr({},f),{},Td({},b,x))},l),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var b=p.stackGroups[y];return nr(nr({},m),{},Td({},y,{numericAxisId:r,cateAxisId:i,items:b.items,stackedData:HNe(e,b.items,s)}))},g)}return nr(nr({},f),{},Td({},h,p))},d)},G8=function(e,n){var r=n.realScaleType,i=n.type,s=n.tickCount,o=n.originalDomain,c=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(s&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=e.domain();if(!u.length)return null;var d=rNe(u,s,c);return e.domain([Lw(d),Sc(d)]),{niceTicks:d}}if(s&&i==="number"){var f=e.domain(),h=iNe(f,s,c);return{niceTicks:h}}return null};function HM(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,s=t.index,o=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!$t(i[e.dataKey])){var c=Vx(n,"value",i[e.dataKey]);if(c)return c.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var l=ir(i,$t(o)?e.dataKey:o);return $t(l)?null:e.scale(l)}var zM=function(e){var n=e.axis,r=e.ticks,i=e.offset,s=e.bandSize,o=e.entry,c=e.index;if(n.type==="category")return r[c]?r[c].coordinate+i:null;var l=ir(o,n.dataKey,n.domain[c]);return $t(l)?null:n.scale(l)-s/2+i},VNe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return i<=0&&s>=0?0:s<0?s:i}return r[0]},GNe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?nr(nr({},e.type.defaultProps),e.props):e.props,s=i.stackId;if(Er(s)){var o=n[s];if(o){var c=o.items.indexOf(e);return c>=0?o.stackedData[c]:null}}return null},KNe=function(e){return e.reduce(function(n,r){return[Lw(r.concat([n[0]]).filter(Ee)),Sc(r.concat([n[1]]).filter(Ee))]},[1/0,-1/0])},K8=function(e,n,r){return Object.keys(e).reduce(function(i,s){var o=e[s],c=o.stackedData,l=c.reduce(function(u,d){var f=KNe(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},VM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,GM=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,SA=function(e,n,r){if(Et(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(Ee(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(VM.test(e[0])){var s=+VM.exec(e[0])[1];i[0]=n[0]-s}else Et(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(Ee(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(GM.test(e[1])){var o=+GM.exec(e[1])[1];i[1]=n[1]+o}else Et(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},yb=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var s=yP(n,function(f){return f.coordinate}),o=1/0,c=1,l=s.length;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Q8=function(e,n,r,i,s){var o=e.width,c=e.height,l=e.startAngle,u=e.endAngle,d=gi(e.cx,o,o/2),f=gi(e.cy,c,c/2),h=Y8(o,c,r),p=gi(e.innerRadius,h,0),g=gi(e.outerRadius,h,h*.8),m=Object.keys(n);return m.reduce(function(y,b){var x=n[b],w=x.domain,S=x.reversed,C;if($t(x.range))i==="angleAxis"?C=[l,u]:i==="radiusAxis"&&(C=[p,g]),S&&(C=[C[1],C[0]]);else{C=x.range;var _=C,A=YNe(_,2);l=A[0],u=A[1]}var j=z8(x,s),P=j.realScaleType,k=j.scale;k.domain(w).range(C),V8(k);var O=G8(k,da(da({},x),{},{realScaleType:P})),E=da(da(da({},x),O),{},{range:C,radius:g,realScaleType:P,scale:k,cx:d,cy:f,innerRadius:p,outerRadius:g,startAngle:l,endAngle:u});return da(da({},y),{},q8({},b,E))},{})},tTe=function(e,n){var r=e.x,i=e.y,s=n.x,o=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(i-o,2))},nTe=function(e,n){var r=e.x,i=e.y,s=n.cx,o=n.cy,c=tTe({x:r,y:i},{x:s,y:o});if(c<=0)return{radius:c};var l=(r-s)/c,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:c,angle:eTe(u),angleInRadian:u}},rTe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(i,s);return{startAngle:n-o*360,endAngle:r-o*360}},iTe=function(e,n){var r=n.startAngle,i=n.endAngle,s=Math.floor(r/360),o=Math.floor(i/360),c=Math.min(s,o);return e+c*360},YM=function(e,n){var r=e.x,i=e.y,s=nTe({x:r,y:i},n),o=s.radius,c=s.angle,l=n.innerRadius,u=n.outerRadius;if(ou)return!1;if(o===0)return!0;var d=rTe(n),f=d.startAngle,h=d.endAngle,p=c,g;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return g?da(da({},n),{},{radius:o,angle:iTe(p,n)}):null},X8=function(e){return!v.isValidElement(e)&&!Et(e)&&typeof e!="boolean"?e.className:""};function Lm(t){"@babel/helpers - typeof";return Lm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lm(t)}var sTe=["offset"];function oTe(t){return uTe(t)||lTe(t)||cTe(t)||aTe()}function aTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cTe(t,e){if(t){if(typeof t=="string")return CA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CA(t,e)}}function lTe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function uTe(t){if(Array.isArray(t))return CA(t)}function CA(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function fTe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function QM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yr(t){for(var e=1;e=0?1:-1,w,S;i==="insideStart"?(w=p+x*o,S=m):i==="insideEnd"?(w=g-x*o,S=!m):i==="end"&&(w=g+x*o,S=m),S=b<=0?S:!S;var C=ln(u,d,y,w),_=ln(u,d,y,w+(S?1:-1)*359),A="M".concat(C.x,",").concat(C.y,` + A`).concat(y,",").concat(y,",0,1,").concat(S?0:1,`, + `).concat(_.x,",").concat(_.y),j=$t(e.id)?eh("recharts-radial-line-"):e.id;return T.createElement("text",Fm({},r,{dominantBaseline:"central",className:Mt("recharts-radial-bar-label",c)}),T.createElement("defs",null,T.createElement("path",{id:j,d:A})),T.createElement("textPath",{xlinkHref:"#".concat(j)},n))},xTe=function(e){var n=e.viewBox,r=e.offset,i=e.position,s=n,o=s.cx,c=s.cy,l=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,h=(d+f)/2;if(i==="outside"){var p=ln(o,c,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,b=ln(o,c,y,h),x=b.x,w=b.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},bTe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,s=e.position,o=n,c=o.x,l=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*i,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,y=m*i,b=m>0?"end":"start",x=m>0?"start":"end";if(s==="top"){var w={x:c+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:p};return yr(yr({},w),r?{height:Math.max(l-r.y,0),width:u}:{})}if(s==="bottom"){var S={x:c+u/2,y:l+d+h,textAnchor:"middle",verticalAnchor:g};return yr(yr({},S),r?{height:Math.max(r.y+r.height-(l+d),0),width:u}:{})}if(s==="left"){var C={x:c-y,y:l+d/2,textAnchor:b,verticalAnchor:"middle"};return yr(yr({},C),r?{width:Math.max(C.x-r.x,0),height:d}:{})}if(s==="right"){var _={x:c+u+y,y:l+d/2,textAnchor:x,verticalAnchor:"middle"};return yr(yr({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:d}:{})}var A=r?{width:u,height:d}:{};return s==="insideLeft"?yr({x:c+y,y:l+d/2,textAnchor:x,verticalAnchor:"middle"},A):s==="insideRight"?yr({x:c+u-y,y:l+d/2,textAnchor:b,verticalAnchor:"middle"},A):s==="insideTop"?yr({x:c+u/2,y:l+h,textAnchor:"middle",verticalAnchor:g},A):s==="insideBottom"?yr({x:c+u/2,y:l+d-h,textAnchor:"middle",verticalAnchor:p},A):s==="insideTopLeft"?yr({x:c+y,y:l+h,textAnchor:x,verticalAnchor:g},A):s==="insideTopRight"?yr({x:c+u-y,y:l+h,textAnchor:b,verticalAnchor:g},A):s==="insideBottomLeft"?yr({x:c+y,y:l+d-h,textAnchor:x,verticalAnchor:p},A):s==="insideBottomRight"?yr({x:c+u-y,y:l+d-h,textAnchor:b,verticalAnchor:p},A):Yf(s)&&(Ee(s.x)||Ll(s.x))&&(Ee(s.y)||Ll(s.y))?yr({x:c+gi(s.x,u),y:l+gi(s.y,d),textAnchor:"end",verticalAnchor:"end"},A):yr({x:c+u/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},A)},wTe=function(e){return"cx"in e&&Ee(e.cx)};function Ir(t){var e=t.offset,n=e===void 0?5:e,r=dTe(t,sTe),i=yr({offset:n},r),s=i.viewBox,o=i.position,c=i.value,l=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!s||$t(c)&&$t(l)&&!v.isValidElement(u)&&!Et(u))return null;if(v.isValidElement(u))return v.cloneElement(u,i);var p;if(Et(u)){if(p=v.createElement(u,i),v.isValidElement(p))return p}else p=gTe(i);var g=wTe(s),m=rt(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return yTe(i,p,m);var y=g?xTe(i):bTe(i);return T.createElement(Su,Fm({className:Mt("recharts-label",f)},m,y,{breakAll:h}),p)}Ir.displayName="Label";var J8=function(e){var n=e.cx,r=e.cy,i=e.angle,s=e.startAngle,o=e.endAngle,c=e.r,l=e.radius,u=e.innerRadius,d=e.outerRadius,f=e.x,h=e.y,p=e.top,g=e.left,m=e.width,y=e.height,b=e.clockWise,x=e.labelViewBox;if(x)return x;if(Ee(m)&&Ee(y)){if(Ee(f)&&Ee(h))return{x:f,y:h,width:m,height:y};if(Ee(p)&&Ee(g))return{x:p,y:g,width:m,height:y}}return Ee(f)&&Ee(h)?{x:f,y:h,width:0,height:0}:Ee(n)&&Ee(r)?{cx:n,cy:r,startAngle:s||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:d||l||c||0,clockWise:b}:e.viewBox?e.viewBox:{}},STe=function(e,n){return e?e===!0?T.createElement(Ir,{key:"label-implicit",viewBox:n}):Er(e)?T.createElement(Ir,{key:"label-implicit",viewBox:n,value:e}):v.isValidElement(e)?e.type===Ir?v.cloneElement(e,{key:"label-implicit",viewBox:n}):T.createElement(Ir,{key:"label-implicit",content:e,viewBox:n}):Et(e)?T.createElement(Ir,{key:"label-implicit",content:e,viewBox:n}):Yf(e)?T.createElement(Ir,Fm({viewBox:n},e,{key:"label-implicit"})):null:null},CTe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,s=J8(e),o=_s(i,Ir).map(function(l,u){return v.cloneElement(l,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return o;var c=STe(e.label,n||s);return[c].concat(oTe(o))};Ir.parseViewBox=J8;Ir.renderCallByParent=CTe;function _Te(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var ATe=_Te;const Z8=un(ATe);function Um(t){"@babel/helpers - typeof";return Um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Um(t)}var jTe=["valueAccessor"],ETe=["data","dataKey","clockWise","id","textBreakAll"];function NTe(t){return OTe(t)||kTe(t)||PTe(t)||TTe()}function TTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PTe(t,e){if(t){if(typeof t=="string")return _A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _A(t,e)}}function kTe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function OTe(t){if(Array.isArray(t))return _A(t)}function _A(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function DTe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var $Te=function(e){return Array.isArray(e.value)?Z8(e.value):e.value};function Uo(t){var e=t.valueAccessor,n=e===void 0?$Te:e,r=ZM(t,jTe),i=r.data,s=r.dataKey,o=r.clockWise,c=r.id,l=r.textBreakAll,u=ZM(r,ETe);return!i||!i.length?null:T.createElement(Xt,{className:"recharts-label-list"},i.map(function(d,f){var h=$t(s)?n(d,f):ir(d&&d.payload,s),p=$t(c)?{}:{id:"".concat(c,"-").concat(f)};return T.createElement(Ir,bb({},rt(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:l,viewBox:Ir.parseViewBox($t(o)?d:JM(JM({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Uo.displayName="LabelList";function LTe(t,e){return t?t===!0?T.createElement(Uo,{key:"labelList-implicit",data:e}):T.isValidElement(t)||Et(t)?T.createElement(Uo,{key:"labelList-implicit",data:e,content:t}):Yf(t)?T.createElement(Uo,bb({data:e},t,{key:"labelList-implicit"})):null:null}function FTe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=_s(r,Uo).map(function(o,c){return v.cloneElement(o,{data:e,key:"labelList-".concat(c)})});if(!n)return i;var s=LTe(t.label,e);return[s].concat(NTe(i))}Uo.renderCallByParent=FTe;function Bm(t){"@babel/helpers - typeof";return Bm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bm(t)}function AA(){return AA=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(o>u),`, + `).concat(f.x,",").concat(f.y,` + `);if(i>0){var p=ln(n,r,i,o),g=ln(n,r,i,u);h+="L ".concat(g.x,",").concat(g.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, + `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},VTe=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,s=e.outerRadius,o=e.cornerRadius,c=e.forceCornerRadius,l=e.cornerIsExternal,u=e.startAngle,d=e.endAngle,f=mi(d-u),h=kv({cx:n,cy:r,radius:s,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),p=h.circleTangency,g=h.lineTangency,m=h.theta,y=kv({cx:n,cy:r,radius:s,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:l}),b=y.circleTangency,x=y.lineTangency,w=y.theta,S=l?Math.abs(u-d):Math.abs(u-d)-m-w;if(S<0)return c?"M ".concat(g.x,",").concat(g.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):eK({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d});var C="M ".concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,` + A`).concat(s,",").concat(s,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,` + `);if(i>0){var _=kv({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=_.circleTangency,j=_.lineTangency,P=_.theta,k=kv({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=k.circleTangency,E=k.lineTangency,R=k.theta,M=l?Math.abs(u-d):Math.abs(u-d)-P-R;if(M<0&&o===0)return"".concat(C,"L").concat(n,",").concat(r,"Z");C+="L".concat(E.x,",").concat(E.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(O.x,",").concat(O.y,` + A`).concat(i,",").concat(i,",0,").concat(+(M>180),",").concat(+(f>0),",").concat(A.x,",").concat(A.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(j.x,",").concat(j.y,"Z")}else C+="L".concat(n,",").concat(r,"Z");return C},GTe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},tK=function(e){var n=tD(tD({},GTe),e),r=n.cx,i=n.cy,s=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,l=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o0&&Math.abs(d-f)<360?y=VTe({cx:r,cy:i,innerRadius:s,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:f}):y=eK({cx:r,cy:i,innerRadius:s,outerRadius:o,startAngle:d,endAngle:f}),T.createElement("path",AA({},rt(n,!0),{className:p,d:y,role:"img"}))};function Hm(t){"@babel/helpers - typeof";return Hm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hm(t)}function jA(){return jA=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function oPe(t,e){return ah(t.getTime(),e.getTime())}function lD(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,c;(o=i.next())&&!o.done;){for(var l=e.entries(),u=!1,d=0;(c=l.next())&&!c.done;){var f=o.value,h=f[0],p=f[1],g=c.value,m=g[0],y=g[1];!u&&!r[d]&&(u=n.equals(h,m,s,d,t,e,n)&&n.equals(p,y,h,m,t,e,n))&&(r[d]=!0),d++}if(!u)return!1;s++}return!0}function aPe(t,e,n){var r=cD(t),i=r.length;if(cD(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===oK&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!sK(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Rh(t,e,n){var r=oD(t),i=r.length;if(oD(e).length!==i)return!1;for(var s,o,c;i-- >0;)if(s=r[i],s===oK&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!sK(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=aD(t,s),c=aD(e,s),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function cPe(t,e){return ah(t.valueOf(),e.valueOf())}function lPe(t,e){return t.source===e.source&&t.flags===e.flags}function uD(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var c=e.values(),l=!1,u=0;(o=c.next())&&!o.done;)!l&&!r[u]&&(l=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!l)return!1}return!0}function uPe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var dPe="[object Arguments]",fPe="[object Boolean]",hPe="[object Date]",pPe="[object Map]",mPe="[object Number]",gPe="[object Object]",vPe="[object RegExp]",yPe="[object Set]",xPe="[object String]",bPe=Array.isArray,dD=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,fD=Object.assign,wPe=Object.prototype.toString.call.bind(Object.prototype.toString);function SPe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,c=t.areSetsEqual,l=t.areTypedArraysEqual;return function(d,f,h){if(d===f)return!0;if(d==null||f==null||typeof d!="object"||typeof f!="object")return d!==d&&f!==f;var p=d.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(d,f,h);if(bPe(d))return e(d,f,h);if(dD!=null&&dD(d))return l(d,f,h);if(p===Date)return n(d,f,h);if(p===RegExp)return o(d,f,h);if(p===Map)return r(d,f,h);if(p===Set)return c(d,f,h);var g=wPe(d);return g===hPe?n(d,f,h):g===vPe?o(d,f,h):g===pPe?r(d,f,h):g===yPe?c(d,f,h):g===gPe?typeof d.then!="function"&&typeof f.then!="function"&&i(d,f,h):g===dPe?i(d,f,h):g===fPe||g===mPe||g===xPe?s(d,f,h):!1}}function CPe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Rh:sPe,areDatesEqual:oPe,areMapsEqual:r?sD(lD,Rh):lD,areObjectsEqual:r?Rh:aPe,arePrimitiveWrappersEqual:cPe,areRegExpsEqual:lPe,areSetsEqual:r?sD(uD,Rh):uD,areTypedArraysEqual:r?Rh:uPe};if(n&&(i=fD({},i,n(i))),e){var s=Iv(i.areArraysEqual),o=Iv(i.areMapsEqual),c=Iv(i.areObjectsEqual),l=Iv(i.areSetsEqual);i=fD({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:c,areSetsEqual:l})}return i}function _Pe(t){return function(e,n,r,i,s,o,c){return t(e,n,c)}}function APe(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(l,u){var d=r(),f=d.cache,h=f===void 0?e?new WeakMap:void 0:f,p=d.meta;return n(l,u,{cache:h,equals:i,meta:p,strict:s})};if(e)return function(l,u){return n(l,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(l,u){return n(l,u,o)}}var jPe=gl();gl({strict:!0});gl({circular:!0});gl({circular:!0,strict:!0});gl({createInternalComparator:function(){return ah}});gl({strict:!0,createInternalComparator:function(){return ah}});gl({circular:!0,createInternalComparator:function(){return ah}});gl({circular:!0,createInternalComparator:function(){return ah},strict:!0});function gl(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,c=CPe(t),l=SPe(c),u=r?r(l):_Pe(l);return APe({circular:n,comparator:l,createState:i,equals:u,strict:o})}function EPe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function hD(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(s){n<0&&(n=s),s-n>e?(t(s),n=-1):EPe(i)};requestAnimationFrame(r)}function EA(t){"@babel/helpers - typeof";return EA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},EA(t)}function NPe(t){return OPe(t)||kPe(t)||PPe(t)||TPe()}function TPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PPe(t,e){if(t){if(typeof t=="string")return pD(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pD(t,e)}}function pD(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:b<0?0:b},m=function(b){for(var x=b>1?1:b,w=x,S=0;S<8;++S){var C=f(w)-x,_=p(w);if(Math.abs(C-x)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,s=i===void 0?8:i,o=e.dt,c=o===void 0?17:o,l=function(d,f,h){var p=-(d-f)*r,g=h*s,m=h+(p-g)*c/1e3,y=h*c/1e3+d;return Math.abs(y-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lke(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s=0)&&(n[i]=t[i]);return n}function CC(t){return hke(t)||fke(t)||dke(t)||uke()}function uke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dke(t,e){if(t){if(typeof t=="string")return OA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OA(t,e)}}function fke(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hke(t){if(Array.isArray(t))return OA(t)}function OA(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cb(t){return Cb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cb(t)}var ho=function(t){yke(n,t);var e=xke(n);function n(r,i){var s;pke(this,n),s=e.call(this,r,i);var o=s.props,c=o.isActive,l=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(MA(s)),s.changeStyle=s.changeStyle.bind(MA(s)),!c||p<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),RA(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof h=="function")return s.state={style:u},RA(s);s.state={style:l?Yh({},l,u):u}}else s.state={style:{}};return s}return gke(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,o=i.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isActive,c=s.canBegin,l=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,h=this.state.style;if(c){if(!o){var p={style:l?Yh({},l,d):d};this.state&&h&&(l&&h[l]!==d||!l&&h!==d)&&this.setState(p);return}if(!(jPe(i.to,d)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:i.to;if(this.state&&h){var y={style:l?Yh({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(Rs(Rs({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,o=i.from,c=i.to,l=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,p=oke(o,c,YPe(u),l,this.changeStyle),g=function(){s.stopJSAnimation=p()};this.manager.start([h,d,g,l,f])}},{key:"runStepAnimation",value:function(i){var s=this,o=i.steps,c=i.begin,l=i.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,y,b){if(b===0)return m;var x=y.duration,w=y.easing,S=w===void 0?"ease":w,C=y.style,_=y.properties,A=y.onAnimationEnd,j=b>0?o[b-1]:y,P=_||Object.keys(C);if(typeof S=="function"||S==="spring")return[].concat(CC(m),[s.runJSAnimation.bind(s,{from:j.style,to:C,duration:x,easing:S}),x]);var k=vD(P,x,S),O=Rs(Rs(Rs({},j.style),C),{},{transition:k});return[].concat(CC(m),[O,x,A]).filter($Pe)};return this.manager.start([l].concat(CC(o.reduce(p,[d,Math.max(h,c)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=IPe());var s=i.begin,o=i.duration,c=i.attributeName,l=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,p=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=c?Yh({},c,l):l,y=vD(Object.keys(m),o,u);g.start([d,s,Rs(Rs({},m),{},{transition:y}),o,f])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var c=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=cke(i,ake),u=v.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!c||u===0||o<=0)return s;var f=function(p){var g=p.props,m=g.style,y=m===void 0?{}:m,b=g.className,x=v.cloneElement(p,Rs(Rs({},l),{},{style:Rs(Rs({},y),d),className:b}));return x};return u===1?f(v.Children.only(s)):T.createElement("div",null,v.Children.map(s,function(h){return f(h)}))}}]),n}(v.PureComponent);ho.displayName="Animate";ho.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ho.propTypes={from:Vt.oneOfType([Vt.object,Vt.string]),to:Vt.oneOfType([Vt.object,Vt.string]),attributeName:Vt.string,duration:Vt.number,begin:Vt.number,easing:Vt.oneOfType([Vt.string,Vt.func]),steps:Vt.arrayOf(Vt.shape({duration:Vt.number.isRequired,style:Vt.object.isRequired,easing:Vt.oneOfType([Vt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Vt.func]),properties:Vt.arrayOf("string"),onAnimationEnd:Vt.func})),children:Vt.oneOfType([Vt.node,Vt.func]),isActive:Vt.bool,canBegin:Vt.bool,onAnimationEnd:Vt.func,shouldReAnimate:Vt.bool,onAnimationStart:Vt.func,onAnimationReStart:Vt.func};Vt.object,Vt.object,Vt.object,Vt.element;Vt.object,Vt.object,Vt.object,Vt.oneOfType([Vt.array,Vt.element]),Vt.any;function Gm(t){"@babel/helpers - typeof";return Gm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gm(t)}function _b(){return _b=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(o>0&&s instanceof Array){for(var f=[0,0,0,0],h=0,p=4;ho?o:s[h];d="M".concat(e,",").concat(n+c*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(e+l*f[0],",").concat(n)),d+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, + `).concat(e+r,",").concat(n+c*f[1])),d+="L ".concat(e+r,",").concat(n+i-c*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, + `).concat(e+r-l*f[2],",").concat(n+i)),d+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, + `).concat(e,",").concat(n+i-c*f[3])),d+="Z"}else if(o>0&&s===+s&&s>0){var g=Math.min(o,s);d="M ".concat(e,",").concat(n+c*g,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+l*g,",").concat(n,` + L `).concat(e+r-l*g,",").concat(n,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+r,",").concat(n+c*g,` + L `).concat(e+r,",").concat(n+i-c*g,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+r-l*g,",").concat(n+i,` + L `).concat(e+l*g,",").concat(n+i,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e,",").concat(n+i-c*g," Z")}else d="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},Tke=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,s=n.x,o=n.y,c=n.width,l=n.height;if(Math.abs(c)>0&&Math.abs(l)>0){var u=Math.min(s,s+c),d=Math.max(s,s+c),f=Math.min(o,o+l),h=Math.max(o,o+l);return r>=u&&r<=d&&i>=f&&i<=h}return!1},Pke={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},GP=function(e){var n=AD(AD({},Pke),e),r=v.useRef(),i=v.useState(-1),s=wke(i,2),o=s[0],c=s[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&c(S)}catch{}},[]);var l=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,y=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=Mt("recharts-rectangle",p);return x?T.createElement(ho,{canBegin:o>0,from:{width:d,height:f,x:l,y:u},to:{width:d,height:f,x:l,y:u},duration:m,animationEasing:g,isActive:x},function(S){var C=S.width,_=S.height,A=S.x,j=S.y;return T.createElement(ho,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:b,easing:g},T.createElement("path",_b({},rt(n,!0),{className:w,d:jD(A,j,C,_,h),ref:r})))}):T.createElement("path",_b({},rt(n,!0),{className:w,d:jD(l,u,d,f,h)}))},kke=["points","className","baseLinePoints","connectNulls"];function ud(){return ud=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ike(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function ED(t){return $ke(t)||Dke(t)||Mke(t)||Rke()}function Rke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mke(t,e){if(t){if(typeof t=="string")return DA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DA(t,e)}}function Dke(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $ke(t){if(Array.isArray(t))return DA(t)}function DA(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){ND(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),ND(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},xp=function(e,n){var r=Lke(e);n&&(r=[r.reduce(function(s,o){return[].concat(ED(s),ED(o))},[])]);var i=r.map(function(s){return s.reduce(function(o,c,l){return"".concat(o).concat(l===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Fke=function(e,n,r){var i=xp(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(xp(n.reverse(),r).slice(1))},hK=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,s=e.connectNulls,o=Oke(e,kke);if(!n||!n.length)return null;var c=Mt("recharts-polygon",r);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=Fke(n,i,s);return T.createElement("g",{className:c},T.createElement("path",ud({},rt(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?T.createElement("path",ud({},rt(o,!0),{fill:"none",d:xp(n,s)})):null,l?T.createElement("path",ud({},rt(o,!0),{fill:"none",d:xp(i,s)})):null)}var d=xp(n,s);return T.createElement("path",ud({},rt(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:c,d}))};function $A(){return $A=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Kke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var Wke=function(e,n,r,i,s,o){return"M".concat(e,",").concat(s,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},qke=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,s=i===void 0?0:i,o=e.top,c=o===void 0?0:o,l=e.left,u=l===void 0?0:l,d=e.width,f=d===void 0?0:d,h=e.height,p=h===void 0?0:h,g=e.className,m=Gke(e,Uke),y=Bke({x:r,y:s,top:c,left:u,width:f,height:p},m);return!Ee(r)||!Ee(s)||!Ee(f)||!Ee(p)||!Ee(c)||!Ee(u)?null:T.createElement("path",LA({},rt(y,!0),{className:Mt("recharts-cross",g),d:Wke(r,s,f,p,c,u)}))},Yke=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function Wm(t){"@babel/helpers - typeof";return Wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wm(t)}function Qke(t,e){if(t==null)return{};var n=Xke(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Xke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ba(){return Ba=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function bOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function wOe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ID(t,e){for(var n=0;nDD?o=i==="outer"?"start":"end":s<-DD?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,s=r.cy,o=r.radius,c=r.axisLine,l=r.axisLineType,u=Sl(Sl({},rt(this.props,!1)),{},{fill:"none"},rt(c,!1));if(l==="circle")return T.createElement(Lg,Tl({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:s,r:o}));var d=this.props.ticks,f=d.map(function(h){return ln(i,s,o,h.coordinate)});return T.createElement(hK,Tl({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,s=i.ticks,o=i.tick,c=i.tickLine,l=i.tickFormatter,u=i.stroke,d=rt(this.props,!1),f=rt(o,!1),h=Sl(Sl({},d),{},{fill:"none"},rt(c,!1)),p=s.map(function(g,m){var y=r.getTickLineCoord(g),b=r.getTickTextAnchor(g),x=Sl(Sl(Sl({textAnchor:b},d),{},{stroke:"none",fill:u},f),{},{index:m,payload:g,x:y.x2,y:y.y2});return T.createElement(Xt,Tl({className:Mt("recharts-polar-angle-axis-tick",X8(o)),key:"tick-".concat(g.coordinate)},wu(r.props,g,m)),c&&T.createElement("line",Tl({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&e.renderTickItem(o,x,l?l(g.value,m):g.value))});return T.createElement(Xt,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,i=r.ticks,s=r.radius,o=r.axisLine;return s<=0||!i||!i.length?null:T.createElement(Xt,{className:Mt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,s){var o;return T.isValidElement(r)?o=T.cloneElement(r,i):Et(r)?o=r(i):o=T.createElement(Su,Tl({},i,{className:"recharts-polar-angle-axis-tick-value"}),s),o}}])}(v.PureComponent);zw(lh,"displayName","PolarAngleAxis");zw(lh,"axisType","angleAxis");zw(lh,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var DOe=vG,$Oe=DOe(Object.getPrototypeOf,Object),LOe=$Oe,FOe=Ka,UOe=LOe,BOe=Wa,HOe="[object Object]",zOe=Function.prototype,VOe=Object.prototype,xK=zOe.toString,GOe=VOe.hasOwnProperty,KOe=xK.call(Object);function WOe(t){if(!BOe(t)||FOe(t)!=HOe)return!1;var e=UOe(t);if(e===null)return!0;var n=GOe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&xK.call(n)==KOe}var qOe=WOe;const YOe=un(qOe);var QOe=Ka,XOe=Wa,JOe="[object Boolean]";function ZOe(t){return t===!0||t===!1||XOe(t)&&QOe(t)==JOe}var eIe=ZOe;const tIe=un(eIe);function Ym(t){"@babel/helpers - typeof";return Ym=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ym(t)}function Eb(){return Eb=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:l,y:u},duration:m,animationEasing:g,isActive:b},function(w){var S=w.upperWidth,C=w.lowerWidth,_=w.height,A=w.x,j=w.y;return T.createElement(ho,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:g},T.createElement("path",Eb({},rt(n,!0),{className:x,d:UD(A,j,S,C,_),ref:r})))}):T.createElement("g",null,T.createElement("path",Eb({},rt(n,!0),{className:x,d:UD(l,u,d,f,h)})))},fIe=["option","shapeType","propTransformer","activeClassName","isActive"];function Qm(t){"@babel/helpers - typeof";return Qm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qm(t)}function hIe(t,e){if(t==null)return{};var n=pIe(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function BD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Nb(t){for(var e=1;e0?ns(w,"paddingAngle",0):0;if(C){var A=Or(C.endAngle-C.startAngle,w.endAngle-w.startAngle),j=Nn(Nn({},w),{},{startAngle:x+_,endAngle:x+A(m)+_});y.push(j),x=j.endAngle}else{var P=w.endAngle,k=w.startAngle,O=Or(0,P-k),E=O(m),R=Nn(Nn({},w),{},{startAngle:x+_,endAngle:x+E+_});y.push(R),x=R.endAngle}}),T.createElement(Xt,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(s){if(!s.altKey)switch(s.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[c].focus(),i.setState({sectorToFocus:c});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,s=r.isAnimationActive,o=this.state.prevSectors;return s&&i&&i.length&&(!o||!Cu(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,s=i.hide,o=i.sectors,c=i.className,l=i.label,u=i.cx,d=i.cy,f=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,g=this.state.isAnimationFinished;if(s||!o||!o.length||!Ee(u)||!Ee(d)||!Ee(f)||!Ee(h))return null;var m=Mt("recharts-pie",c);return T.createElement(Xt,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){r.pieRef=b}},this.renderSectors(),l&&this.renderLabels(o),Ir.renderCallByParent(this.props,null,!1),(!p||g)&&Uo.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r=360?x:x-1)*l,S=y-x*p-w,C=i.reduce(function(j,P){var k=ir(P,b,0);return j+(Ee(k)?k:0)},0),_;if(C>0){var A;_=i.map(function(j,P){var k=ir(j,b,0),O=ir(j,d,P),E=(Ee(k)?k:0)/C,R;P?R=A.endAngle+mi(m)*l*(k!==0?1:0):R=o;var M=R+mi(m)*((k!==0?p:0)+E*S),G=(R+M)/2,L=(g.innerRadius+g.outerRadius)/2,V=[{name:O,value:k,payload:j,dataKey:b,type:h}],I=ln(g.cx,g.cy,L,G);return A=Nn(Nn(Nn({percent:E,cornerRadius:s,name:O,tooltipPayload:V,midAngle:G,middleRadius:L,tooltipPosition:I},j),g),{},{value:ir(j,b),startAngle:R,endAngle:M,payload:j,paddingAngle:mi(m)*l}),A})}return Nn(Nn({},g),{},{sectors:_,data:i})});function MIe(t){return t&&t.length?t[0]:void 0}var DIe=MIe,$Ie=DIe;const LIe=un($Ie);var FIe=["key"];function gf(t){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gf(t)}function UIe(t,e){if(t==null)return{};var n=BIe(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function BIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Pb(){return Pb=Object.assign?Object.assign.bind():function(t){for(var e=1;e=2&&(l=!0),u.push(li(li({},ln(o,c,x,y)),{},{name:g,value:m,cx:o,cy:c,radius:x,angle:y,payload:h}))});var f=[];return l&&u.forEach(function(h){if(Array.isArray(h.value)){var p=LIe(h.value),g=$t(p)?void 0:e.scale(p);f.push(li(li({},h),{},{radius:g},ln(o,c,g,h.angle)))}else f.push(h)}),{points:u,isRange:l,baseLinePoints:f}});var YIe=Math.ceil,QIe=Math.max;function XIe(t,e,n,r){for(var i=-1,s=QIe(YIe((e-t)/(n||1)),0),o=Array(s);s--;)o[r?s:++i]=t,t+=n;return o}var JIe=XIe,ZIe=DG,WD=1/0,eRe=17976931348623157e292;function tRe(t){if(!t)return t===0?t:0;if(t=ZIe(t),t===WD||t===-WD){var e=t<0?-1:1;return e*eRe}return t===t?t:0}var AK=tRe,nRe=JIe,rRe=Pw,_C=AK;function iRe(t){return function(e,n,r){return r&&typeof r!="number"&&rRe(e,n,r)&&(n=r=void 0),e=_C(e),n===void 0?(n=e,e=0):n=_C(n),r=r===void 0?e0&&r.handleDrag(i.changedTouches[0])}),zi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,s=i.endIndex,o=i.onDragEnd,c=i.startIndex;o==null||o({endIndex:s,startIndex:c})}),r.detachDragEndListener()}),zi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),zi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),zi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),zi(r,"handleSlideDragStart",function(i){var s=JD(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return yRe(e,t),pRe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,s=r.endX,o=this.state.scaleValues,c=this.props,l=c.gap,u=c.data,d=u.length-1,f=Math.min(i,s),h=Math.max(i,s),p=e.getIndexInRange(o,f),g=e.getIndexInRange(o,h);return{startIndex:p-p%l,endIndex:g===d?d:g-g%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,s=i.data,o=i.tickFormatter,c=i.dataKey,l=ir(s[r],c,r);return Et(o)?o(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,s=i.slideMoveStartX,o=i.startX,c=i.endX,l=this.props,u=l.x,d=l.width,f=l.travellerWidth,h=l.startIndex,p=l.endIndex,g=l.onChange,m=r.pageX-s;m>0?m=Math.min(m,u+d-f-c,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-c));var y=this.getIndex({startX:o+m,endX:c+m});(y.startIndex!==h||y.endIndex!==p)&&g&&g(y),this.setState({startX:o+m,endX:c+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var s=JD(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,s=i.brushMoveStartX,o=i.movingTravellerId,c=i.endX,l=i.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,y=d.data,b={startX:this.state.startX,endX:this.state.endX},x=r.pageX-s;x>0?x=Math.min(x,f+h-p-u):x<0&&(x=Math.max(x,f-u)),b[o]=u+x;var w=this.getIndex(b),S=w.startIndex,C=w.endIndex,_=function(){var j=y.length-1;return o==="startX"&&(c>l?S%m===0:C%m===0)||cl?C%m===0:S%m===0)||c>l&&C===j};this.setState(zi(zi({},o,u+x),"brushMoveStartX",r.pageX),function(){g&&_()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var s=this,o=this.state,c=o.scaleValues,l=o.startX,u=o.endX,d=this.state[i],f=c.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=c.length)){var p=c[h];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(zi({},i,p),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,s=r.y,o=r.width,c=r.height,l=r.fill,u=r.stroke;return T.createElement("rect",{stroke:u,fill:l,x:i,y:s,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,s=r.y,o=r.width,c=r.height,l=r.data,u=r.children,d=r.padding,f=v.Children.only(u);return f?T.cloneElement(f,{x:i,y:s,width:o,height:c,margin:d,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var s,o,c=this,l=this.props,u=l.y,d=l.travellerWidth,f=l.height,h=l.traveller,p=l.ariaLabel,g=l.data,m=l.startIndex,y=l.endIndex,b=Math.max(r,this.props.x),x=AC(AC({},rt(this.props,!1)),{},{x:b,y:u,width:d,height:f}),w=p||"Min value: ".concat((s=g[m])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=g[y])===null||o===void 0?void 0:o.name);return T.createElement(Xt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),c.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(h,x))}},{key:"renderSlide",value:function(r,i){var s=this.props,o=s.y,c=s.height,l=s.stroke,u=s.travellerWidth,d=Math.min(r,i)+u,f=Math.max(Math.abs(i-r)-u,0);return T.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:d,y:o,width:f,height:c})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,s=r.endIndex,o=r.y,c=r.height,l=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:u};return T.createElement(Xt,{className:"recharts-brush-texts"},T.createElement(Su,Ib({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+c/2},g),this.getTextOfTick(i)),T.createElement(Su,Ib({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+p,y:o+c/2},g),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,i=r.data,s=r.className,o=r.children,c=r.x,l=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,y=h.isSlideMoving,b=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!Ee(c)||!Ee(l)||!Ee(u)||!Ee(d)||u<=0||d<=0)return null;var w=Mt("recharts-brush",s),S=T.Children.count(o)===1,C=fRe("userSelect","none");return T.createElement(Xt,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||y||b||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,s=r.y,o=r.width,c=r.height,l=r.stroke,u=Math.floor(s+c/2)-1;return T.createElement(T.Fragment,null,T.createElement("rect",{x:i,y:s,width:o,height:c,fill:l,stroke:"none"}),T.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),T.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var s;return T.isValidElement(r)?s=T.cloneElement(r,i):Et(r)?s=r(i):s=e.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(r,i){var s=r.data,o=r.width,c=r.x,l=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return AC({prevData:s,prevTravellerWidth:l,prevUpdateId:u,prevX:c,prevWidth:o},s&&s.length?bRe({data:s,width:o,x:c,travellerWidth:l,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||c!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([c,c+o-l]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:s,prevTravellerWidth:l,prevUpdateId:u,prevX:c,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var s=r.length,o=0,c=s-1;c-o>1;){var l=Math.floor((o+c)/2);r[l]>i?c=l:o=l}return i>=r[c]?c:o}}])}(v.PureComponent);zi(yf,"displayName","Brush");zi(yf,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var wRe=vP;function SRe(t,e){var n;return wRe(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}var CRe=SRe,_Re=lG,ARe=Zo,jRe=CRe,ERe=Bi,NRe=Pw;function TRe(t,e,n){var r=ERe(t)?_Re:jRe;return n&&NRe(t,e,n)&&(e=void 0),r(t,ARe(e))}var PRe=TRe;const kRe=un(PRe);var Bo=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},ZD=kG;function ORe(t,e,n){e=="__proto__"&&ZD?ZD(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var IRe=ORe,RRe=IRe,MRe=TG,DRe=Zo;function $Re(t,e){var n={};return e=DRe(e),MRe(t,function(r,i,s){RRe(n,i,e(r,i,s))}),n}var LRe=$Re;const FRe=un(LRe);function URe(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function r2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function i2e(t,e){var n=t.x,r=t.y,i=n2e(t,JRe),s="".concat(n),o=parseInt(s,10),c="".concat(r),l=parseInt(c,10),u="".concat(e.height||i.height),d=parseInt(u,10),f="".concat(e.width||i.width),h=parseInt(f,10);return Mh(Mh(Mh(Mh(Mh({},e),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:d,width:h,name:e.name,radius:e.radius})}function t$(t){return T.createElement(bK,VA({shapeType:"rectangle",propTransformer:i2e,activeClassName:"recharts-active-bar"},t))}var s2e=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var s=typeof r=="number";return s?e(r,i):(s||Au(),n)}},o2e=["value","background"],PK;function xf(t){"@babel/helpers - typeof";return xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xf(t)}function a2e(t,e){if(t==null)return{};var n=c2e(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function c2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Mb(){return Mb=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(G)0&&Math.abs(M)0&&(R=Math.min((U||0)-(M[ne-1]||0),R))}),Number.isFinite(R)){var G=R/E,L=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(A=G*L/2),m.padding==="no-gap"){var V=gi(e.barCategoryGap,G*L),I=G*L/2;A=I-V-(I-V)/L*V}}}i==="xAxis"?j=[r.left+(w.left||0)+(A||0),r.left+r.width-(w.right||0)-(A||0)]:i==="yAxis"?j=l==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(A||0),r.top+r.height-(w.bottom||0)-(A||0)]:j=m.range,C&&(j=[j[1],j[0]]);var D=z8(m,s,h),X=D.scale,Q=D.realScaleType;X.domain(b).range(j),V8(X);var J=G8(X,Hs(Hs({},m),{},{realScaleType:Q}));i==="xAxis"?(O=y==="top"&&!S||y==="bottom"&&S,P=r.left,k=f[_]-O*m.height):i==="yAxis"&&(O=y==="left"&&!S||y==="right"&&S,P=f[_]-O*m.width,k=r.top);var ye=Hs(Hs(Hs({},m),J),{},{realScaleType:Q,x:P,y:k,scale:X,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return ye.bandSize=yb(ye,J),!m.hide&&i==="xAxis"?f[_]+=(O?-1:1)*ye.height:m.hide||(f[_]+=(O?-1:1)*ye.width),Hs(Hs({},p),{},Kw({},g,ye))},{})},MK=function(e,n){var r=e.x,i=e.y,s=n.x,o=n.y;return{x:Math.min(r,s),y:Math.min(i,o),width:Math.abs(s-r),height:Math.abs(o-i)}},x2e=function(e){var n=e.x1,r=e.y1,i=e.x2,s=e.y2;return MK({x:n,y:r},{x:i,y:s})},DK=function(){function t(e){g2e(this,t),this.scale=e}return v2e(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],s=r[r.length-1];return i<=s?n>=i&&n<=s:n>=s&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();Kw(DK,"EPS",1e-4);var KP=function(e){var n=Object.keys(e).reduce(function(r,i){return Hs(Hs({},r),{},Kw({},i,DK.create(e[i])))},{});return Hs(Hs({},n),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,c=s.position;return FRe(i,function(l,u){return n[u].apply(l,{bandAware:o,position:c})})},isInRange:function(i){return TK(i,function(s,o){return n[o].isInRange(s)})}})};function b2e(t){return(t%180+180)%180}var w2e=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=b2e(i),o=s*Math.PI/180,c=Math.atan(r/n),l=o>c&&o-1?i[s?e[o]:o]:void 0}}var j2e=A2e,E2e=AK;function N2e(t){var e=E2e(t),n=e%1;return e===e?n?e-n:e:0}var T2e=N2e,P2e=CG,k2e=Zo,O2e=T2e,I2e=Math.max;function R2e(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:O2e(n);return i<0&&(i=I2e(r+i,0)),P2e(t,k2e(e),i)}var M2e=R2e,D2e=j2e,$2e=M2e,L2e=D2e($2e),F2e=L2e;const U2e=un(F2e);var B2e=Ape(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),WP=v.createContext(void 0),qP=v.createContext(void 0),$K=v.createContext(void 0),LK=v.createContext({}),FK=v.createContext(void 0),UK=v.createContext(0),BK=v.createContext(0),o$=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,s=n.offset,o=e.clipPathId,c=e.children,l=e.width,u=e.height,d=B2e(s);return T.createElement(WP.Provider,{value:r},T.createElement(qP.Provider,{value:i},T.createElement(LK.Provider,{value:s},T.createElement($K.Provider,{value:d},T.createElement(FK.Provider,{value:o},T.createElement(UK.Provider,{value:u},T.createElement(BK.Provider,{value:l},c)))))))},H2e=function(){return v.useContext(FK)},HK=function(e){var n=v.useContext(WP);n==null&&Au();var r=n[e];return r==null&&Au(),r},z2e=function(){var e=v.useContext(WP);return dc(e)},V2e=function(){var e=v.useContext(qP),n=U2e(e,function(r){return TK(r.domain,Number.isFinite)});return n||dc(e)},zK=function(e){var n=v.useContext(qP);n==null&&Au();var r=n[e];return r==null&&Au(),r},G2e=function(){var e=v.useContext($K);return e},K2e=function(){return v.useContext(LK)},YP=function(){return v.useContext(BK)},QP=function(){return v.useContext(UK)};function bf(t){"@babel/helpers - typeof";return bf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bf(t)}function W2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q2e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var s=n();return t*(e-t*s/2-r)>=0&&t*(e+t*s/2-i)<=0}function TMe(t,e){return QK(t,e+1)}function PMe(t,e,n,r,i){for(var s=(r||[]).slice(),o=e.start,c=e.end,l=0,u=1,d=o,f=function(){var g=r==null?void 0:r[l];if(g===void 0)return{v:QK(r,u)};var m=l,y,b=function(){return y===void 0&&(y=n(g,m)),y},x=g.coordinate,w=l===0||Ub(t,x,b,d,c);w||(l=0,d=o,u+=1),w&&(d=x+t*(b()/2+i),l+=u)},h;u<=s.length;)if(h=f(),h)return h.v;return[]}function tg(t){"@babel/helpers - typeof";return tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tg(t)}function p$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Xr(t){for(var e=1;e0?p.coordinate-y*t:p.coordinate})}else s[h]=p=Xr(Xr({},p),{},{tickCoord:p.coordinate});var b=Ub(t,p.tickCoord,m,c,l);b&&(l=p.tickCoord-t*(m()/2+i),s[h]=Xr(Xr({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return s}function MMe(t,e,n,r,i,s){var o=(r||[]).slice(),c=o.length,l=e.start,u=e.end;if(s){var d=r[c-1],f=n(d,c-1),h=t*(d.coordinate+t*f/2-u);o[c-1]=d=Xr(Xr({},d),{},{tickCoord:h>0?d.coordinate-h*t:d.coordinate});var p=Ub(t,d.tickCoord,function(){return f},l,u);p&&(u=d.tickCoord-t*(f/2+i),o[c-1]=Xr(Xr({},d),{},{isShow:!0}))}for(var g=s?c-1:c,m=function(x){var w=o[x],S,C=function(){return S===void 0&&(S=n(w,x)),S};if(x===0){var _=t*(w.coordinate-t*C()/2-l);o[x]=w=Xr(Xr({},w),{},{tickCoord:_<0?w.coordinate-_*t:w.coordinate})}else o[x]=w=Xr(Xr({},w),{},{tickCoord:w.coordinate});var A=Ub(t,w.tickCoord,C,l,u);A&&(l=w.tickCoord+t*(C()/2+i),o[x]=Xr(Xr({},w),{},{isShow:!0}))},y=0;y=2?mi(i[1].coordinate-i[0].coordinate):1,b=NMe(s,y,p);return l==="equidistantPreserveStart"?PMe(y,b,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=MMe(y,b,m,i,o,l==="preserveStartEnd"):h=RMe(y,b,m,i,o),h.filter(function(x){return x.isShow}))}var DMe=["viewBox"],$Me=["viewBox"],LMe=["ticks"];function Cf(t){"@babel/helpers - typeof";return Cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cf(t)}function fd(){return fd=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function FMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function UMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g$(t,e){for(var n=0;n0?l(this.props):l(p)),o<=0||c<=0||!g||!g.length?null:T.createElement(Xt,{className:Mt("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},s&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Ir.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,s){var o;return T.isValidElement(r)?o=T.cloneElement(r,i):Et(r)?o=r(i):o=T.createElement(Su,fd({},i,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(v.Component);ek(uh,"displayName","CartesianAxis");ek(uh,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var WMe=["x1","y1","x2","y2","key"],qMe=["offset"];function ju(t){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ju(t)}function v$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ti(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function JMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var ZMe=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,s=e.y,o=e.width,c=e.height,l=e.ry;return T.createElement("rect",{x:i,y:s,ry:l,width:o,height:c,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function ZK(t,e){var n;if(T.isValidElement(t))n=T.cloneElement(t,e);else if(Et(t))n=t(e);else{var r=e.x1,i=e.y1,s=e.x2,o=e.y2,c=e.key,l=y$(e,WMe),u=rt(l,!1);u.offset;var d=y$(u,qMe);n=T.createElement("line",Bl({},d,{x1:r,y1:i,x2:s,y2:o,fill:"none",key:c}))}return n}function eDe(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,s=t.horizontalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(c,l){var u=ti(ti({},t),{},{x1:e,y1:c,x2:e+n,y2:c,key:"line-".concat(l),index:l});return ZK(i,u)});return T.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function tDe(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,s=t.verticalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(c,l){var u=ti(ti({},t),{},{x1:c,y1:e,x2:c,y2:e+n,key:"line-".concat(l),index:l});return ZK(i,u)});return T.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function nDe(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,s=t.width,o=t.height,c=t.horizontalPoints,l=t.horizontal,u=l===void 0?!0:l;if(!u||!e||!e.length)return null;var d=c.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?i+o-h:d[p+1]-h;if(m<=0)return null;var y=p%e.length;return T.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:s,stroke:"none",fill:e[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return T.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function rDe(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,s=t.x,o=t.y,c=t.width,l=t.height,u=t.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,p){return h-p});s!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?s+c-h:d[p+1]-h;if(m<=0)return null;var y=p%r.length;return T.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:l,stroke:"none",fill:r[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return T.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var iDe=function(e,n){var r=e.xAxis,i=e.width,s=e.height,o=e.offset;return H8(ZP(ti(ti(ti({},uh.defaultProps),r),{},{ticks:Sa(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.left,o.left+o.width,n)},sDe=function(e,n){var r=e.yAxis,i=e.width,s=e.height,o=e.offset;return H8(ZP(ti(ti(ti({},uh.defaultProps),r),{},{ticks:Sa(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.top,o.top+o.height,n)},Gu={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function ng(t){var e,n,r,i,s,o,c=YP(),l=QP(),u=K2e(),d=ti(ti({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Gu.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:Gu.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:Gu.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:Gu.horizontalFill,vertical:(s=t.vertical)!==null&&s!==void 0?s:Gu.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:Gu.verticalFill,x:Ee(t.x)?t.x:u.left,y:Ee(t.y)?t.y:u.top,width:Ee(t.width)?t.width:u.width,height:Ee(t.height)?t.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,y=d.horizontalValues,b=d.verticalValues,x=z2e(),w=V2e();if(!Ee(p)||p<=0||!Ee(g)||g<=0||!Ee(f)||f!==+f||!Ee(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||iDe,C=d.horizontalCoordinatesGenerator||sDe,_=d.horizontalPoints,A=d.verticalPoints;if((!_||!_.length)&&Et(C)){var j=y&&y.length,P=C({yAxis:w?ti(ti({},w),{},{ticks:j?y:w.ticks}):void 0,width:c,height:l,offset:u},j?!0:m);to(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ju(P),"]")),Array.isArray(P)&&(_=P)}if((!A||!A.length)&&Et(S)){var k=b&&b.length,O=S({xAxis:x?ti(ti({},x),{},{ticks:k?b:x.ticks}):void 0,width:c,height:l,offset:u},k?!0:m);to(Array.isArray(O),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ju(O),"]")),Array.isArray(O)&&(A=O)}return T.createElement("g",{className:"recharts-cartesian-grid"},T.createElement(ZMe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),T.createElement(eDe,Bl({},d,{offset:u,horizontalPoints:_,xAxis:x,yAxis:w})),T.createElement(tDe,Bl({},d,{offset:u,verticalPoints:A,xAxis:x,yAxis:w})),T.createElement(nDe,Bl({},d,{horizontalPoints:_})),T.createElement(rDe,Bl({},d,{verticalPoints:A})))}ng.displayName="CartesianGrid";var oDe=["layout","type","stroke","connectNulls","isRange","ref"],aDe=["key"],eW;function _f(t){"@babel/helpers - typeof";return _f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_f(t)}function tW(t,e){if(t==null)return{};var n=cDe(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function cDe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Hl(){return Hl=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!Cu(d,o)||!Cu(f,c))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(o,c,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,o=i.dot,c=i.points,l=i.className,u=i.top,d=i.left,f=i.xAxis,h=i.yAxis,p=i.width,g=i.height,m=i.isAnimationActive,y=i.id;if(s||!c||!c.length)return null;var b=this.state.isAnimationFinished,x=c.length===1,w=Mt("recharts-area",l),S=f&&f.allowDataOverflow,C=h&&h.allowDataOverflow,_=S||C,A=$t(y)?this.id:y,j=(r=rt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},P=j.r,k=P===void 0?3:P,O=j.strokeWidth,E=O===void 0?2:O,R=Pme(o)?o:{},M=R.clipDot,G=M===void 0?!0:M,L=k*2+E;return T.createElement(Xt,{className:w},S||C?T.createElement("defs",null,T.createElement("clipPath",{id:"clipPath-".concat(A)},T.createElement("rect",{x:S?d:d-p/2,y:C?u:u-g/2,width:S?p:p*2,height:C?g:g*2})),!G&&T.createElement("clipPath",{id:"clipPath-dots-".concat(A)},T.createElement("rect",{x:d-L/2,y:u-L/2,width:p+L,height:g+L}))):null,x?null:this.renderArea(_,A),(o||x)&&this.renderDots(_,G,A),(!m||b)&&Uo.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(v.PureComponent);eW=ro;Ro(ro,"displayName","Area");Ro(ro,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!no.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ro(ro,"getBaseValue",function(t,e,n,r){var i=t.layout,s=t.baseValue,o=e.props.baseValue,c=o??s;if(Ee(c)&&typeof c=="number")return c;var l=i==="horizontal"?r:n,u=l.scale.domain();if(l.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return c==="dataMin"?f:c==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return c==="dataMin"?u[0]:c==="dataMax"?u[1]:u[0]});Ro(ro,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,s=t.xAxisTicks,o=t.yAxisTicks,c=t.bandSize,l=t.dataKey,u=t.stackedData,d=t.dataStartIndex,f=t.displayedData,h=t.offset,p=e.layout,g=u&&u.length,m=eW.getBaseValue(e,n,r,i),y=p==="horizontal",b=!1,x=f.map(function(S,C){var _;g?_=u[d+C]:(_=ir(S,l),Array.isArray(_)?b=!0:_=[m,_]);var A=_[1]==null||g&&ir(S,l)==null;return y?{x:HM({axis:r,ticks:s,bandSize:c,entry:S,index:C}),y:A?null:i.scale(_[1]),value:_,payload:S}:{x:A?null:r.scale(_[1]),y:HM({axis:i,ticks:o,bandSize:c,entry:S,index:C}),value:_,payload:S}}),w;return g||b?w=x.map(function(S){var C=Array.isArray(S.value)?S.value[0]:null;return y?{x:S.x,y:C!=null&&S.y!=null?i.scale(C):null}:{x:C!=null?r.scale(C):null,y:S.y}}):w=y?i.scale(m):r.scale(m),tc({points:x,baseLine:w,layout:p,isRange:b},h)});Ro(ro,"renderDotItem",function(t,e){var n;if(T.isValidElement(t))n=T.cloneElement(t,e);else if(Et(t))n=t(e);else{var r=Mt("recharts-area-dot",typeof t!="boolean"?t.className:""),i=e.key,s=tW(e,aDe);n=T.createElement(Lg,Hl({},s,{key:i,className:r}))}return n});function Af(t){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Af(t)}function gDe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vDe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function r$e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function i$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s$e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?o:e&&e.length&&Ee(i)&&Ee(s)?e.slice(i,s+1):[]};function vW(t){return t==="number"?[0,"auto"]:void 0}var cj=function(e,n,r,i){var s=e.graphicalItems,o=e.tooltipAxis,c=Xw(n,e);return r<0||!s||!s.length||r>=c.length?null:s.reduce(function(l,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?c:f;h=Vx(p,o.dataKey,i)}else h=f&&f[r]||c[r];return h?[].concat(Nf(l),[W8(u,h)]):l},[])},j$=function(e,n,r,i){var s=i||{x:e.chartX,y:e.chartY},o=v$e(s,r),c=e.orderedTooltipTicks,l=e.tooltipAxis,u=e.tooltipTicks,d=kNe(o,c,u,l);if(d>=0&&u){var f=u[d]&&u[d].value,h=cj(e,n,d,f),p=y$e(r,c,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},x$e=function(e,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,o=n.axisIdKey,c=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=e.layout,f=e.children,h=e.stackOffset,p=B8(d,s);return r.reduce(function(g,m){var y,b=m.type.defaultProps!==void 0?de(de({},m.type.defaultProps),m.props):m.props,x=b.type,w=b.dataKey,S=b.allowDataOverflow,C=b.allowDuplicatedCategory,_=b.scale,A=b.ticks,j=b.includeHidden,P=b[o];if(g[P])return g;var k=Xw(e.data,{graphicalItems:i.filter(function(J){var ye,U=o in J.props?J.props[o]:(ye=J.type.defaultProps)===null||ye===void 0?void 0:ye[o];return U===P}),dataStartIndex:l,dataEndIndex:u}),O=k.length,E,R,M;GDe(b.domain,S,x)&&(E=SA(b.domain,null,S),p&&(x==="number"||_!=="auto")&&(M=vp(k,w,"category")));var G=vW(x);if(!E||E.length===0){var L,V=(L=b.domain)!==null&&L!==void 0?L:G;if(w){if(E=vp(k,w,x),x==="category"&&p){var I=wme(E);C&&I?(R=E,E=Ob(0,O)):C||(E=KM(V,E,m).reduce(function(J,ye){return J.indexOf(ye)>=0?J:[].concat(Nf(J),[ye])},[]))}else if(x==="category")C?E=E.filter(function(J){return J!==""&&!$t(J)}):E=KM(V,E,m).reduce(function(J,ye){return J.indexOf(ye)>=0||ye===""||$t(ye)?J:[].concat(Nf(J),[ye])},[]);else if(x==="number"){var D=DNe(k,i.filter(function(J){var ye,U,ne=o in J.props?J.props[o]:(ye=J.type.defaultProps)===null||ye===void 0?void 0:ye[o],ue="hide"in J.props?J.props.hide:(U=J.type.defaultProps)===null||U===void 0?void 0:U.hide;return ne===P&&(j||!ue)}),w,s,d);D&&(E=D)}p&&(x==="number"||_!=="auto")&&(M=vp(k,w,"category"))}else p?E=Ob(0,O):c&&c[P]&&c[P].hasStack&&x==="number"?E=h==="expand"?[0,1]:K8(c[P].stackGroups,l,u):E=U8(k,i.filter(function(J){var ye=o in J.props?J.props[o]:J.type.defaultProps[o],U="hide"in J.props?J.props.hide:J.type.defaultProps.hide;return ye===P&&(j||!U)}),x,d,!0);if(x==="number")E=sj(f,E,P,s,A),V&&(E=SA(V,E,S));else if(x==="category"&&V){var X=V,Q=E.every(function(J){return X.indexOf(J)>=0});Q&&(E=X)}}return de(de({},g),{},Pt({},P,de(de({},b),{},{axisType:s,domain:E,categoricalDomain:M,duplicateDomain:R,originalDomain:(y=b.domain)!==null&&y!==void 0?y:G,isCategorical:p,layout:d})))},{})},b$e=function(e,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,o=n.axisIdKey,c=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=e.layout,f=e.children,h=Xw(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:u}),p=h.length,g=B8(d,s),m=-1;return r.reduce(function(y,b){var x=b.type.defaultProps!==void 0?de(de({},b.type.defaultProps),b.props):b.props,w=x[o],S=vW("number");if(!y[w]){m++;var C;return g?C=Ob(0,p):c&&c[w]&&c[w].hasStack?(C=K8(c[w].stackGroups,l,u),C=sj(f,C,w,s)):(C=SA(S,U8(h,r.filter(function(_){var A,j,P=o in _.props?_.props[o]:(A=_.type.defaultProps)===null||A===void 0?void 0:A[o],k="hide"in _.props?_.props.hide:(j=_.type.defaultProps)===null||j===void 0?void 0:j.hide;return P===w&&!k}),"number",d),i.defaultProps.allowDataOverflow),C=sj(f,C,w,s)),de(de({},y),{},Pt({},w,de(de({axisType:s},i.defaultProps),{},{hide:!0,orientation:ns(m$e,"".concat(s,".").concat(m%2),null),domain:C,originalDomain:S,isCategorical:g,layout:d})))}return y},{})},w$e=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=e.children,f="".concat(i,"Id"),h=_s(d,s),p={};return h&&h.length?p=x$e(e,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(p=b$e(e,{Axis:s,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:l,dataEndIndex:u})),p},S$e=function(e){var n=dc(e),r=Sa(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:yP(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:yb(n,r)}},E$=function(e){var n=e.children,r=e.defaultShowTooltip,i=Wi(n,yf),s=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},C$e=function(e){return!e||!e.length?!1:e.some(function(n){var r=Aa(n&&n.type);return r&&r.indexOf("Bar")>=0})},N$=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},_$e=function(e,n){var r=e.props,i=e.graphicalItems,s=e.xAxisMap,o=s===void 0?{}:s,c=e.yAxisMap,l=c===void 0?{}:c,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=Wi(f,yf),g=Wi(f,ja),m=Object.keys(l).reduce(function(C,_){var A=l[_],j=A.orientation;return!A.mirror&&!A.hide?de(de({},C),{},Pt({},j,C[j]+A.width)):C},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(C,_){var A=o[_],j=A.orientation;return!A.mirror&&!A.hide?de(de({},C),{},Pt({},j,ns(C,"".concat(j))+A.height)):C},{top:h.top||0,bottom:h.bottom||0}),b=de(de({},y),m),x=b.bottom;p&&(b.bottom+=p.props.height||yf.defaultProps.height),g&&n&&(b=RNe(b,i,r,n));var w=u-b.left-b.right,S=d-b.top-b.bottom;return de(de({brushBottom:x},b),{},{width:Math.max(w,0),height:Math.max(S,0)})},A$e=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},Jw=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,s=i===void 0?"axis":i,o=e.validateTooltipEventTypes,c=o===void 0?["axis"]:o,l=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,f=e.defaultProps,h=function(y,b){var x=b.graphicalItems,w=b.stackGroups,S=b.offset,C=b.updateId,_=b.dataStartIndex,A=b.dataEndIndex,j=y.barSize,P=y.layout,k=y.barGap,O=y.barCategoryGap,E=y.maxBarSize,R=N$(P),M=R.numericAxisName,G=R.cateAxisName,L=C$e(x),V=[];return x.forEach(function(I,D){var X=Xw(y.data,{graphicalItems:[I],dataStartIndex:_,dataEndIndex:A}),Q=I.type.defaultProps!==void 0?de(de({},I.type.defaultProps),I.props):I.props,J=Q.dataKey,ye=Q.maxBarSize,U=Q["".concat(M,"Id")],ne=Q["".concat(G,"Id")],ue={},F=l.reduce(function(B,K){var Z=b["".concat(K.axisType,"Map")],H=Q["".concat(K.axisType,"Id")];Z&&Z[H]||K.axisType==="zAxis"||Au();var re=Z[H];return de(de({},B),{},Pt(Pt({},K.axisType,re),"".concat(K.axisType,"Ticks"),Sa(re)))},ue),ce=F[G],te=F["".concat(G,"Ticks")],pe=w&&w[U]&&w[U].hasStack&&GNe(I,w[U].stackGroups),we=Aa(I.type).indexOf("Bar")>=0,Y=yb(ce,te),nt=[],Ue=L&&ONe({barSize:j,stackGroups:w,totalSize:A$e(F,G)});if(we){var at,Be,Bt=$t(ye)?E:ye,N=(at=(Be=yb(ce,te,!0))!==null&&Be!==void 0?Be:Bt)!==null&&at!==void 0?at:0;nt=INe({barGap:k,barCategoryGap:O,bandSize:N!==Y?N:Y,sizeList:Ue[ne],maxBarSize:Bt}),N!==Y&&(nt=nt.map(function(B){return de(de({},B),{},{position:de(de({},B.position),{},{offset:B.position.offset-N/2})})}))}var $=I&&I.type&&I.type.getComposedData;$&&V.push({props:de(de({},$(de(de({},F),{},{displayedData:X,props:y,dataKey:J,item:I,bandSize:Y,barPosition:nt,offset:S,stackedData:pe,layout:P,dataStartIndex:_,dataEndIndex:A}))),{},Pt(Pt(Pt({key:I.key||"item-".concat(D)},M,F[M]),G,F[G]),"animationId",C)),childIndex:Ime(I,y.children),item:I})}),V},p=function(y,b){var x=y.props,w=y.dataStartIndex,S=y.dataEndIndex,C=y.updateId;if(!FR({props:x}))return null;var _=x.children,A=x.layout,j=x.stackOffset,P=x.data,k=x.reverseStackOrder,O=N$(A),E=O.numericAxisName,R=O.cateAxisName,M=_s(_,r),G=zNe(P,M,"".concat(E,"Id"),"".concat(R,"Id"),j,k),L=l.reduce(function(Q,J){var ye="".concat(J.axisType,"Map");return de(de({},Q),{},Pt({},ye,w$e(x,de(de({},J),{},{graphicalItems:M,stackGroups:J.axisType===E&&G,dataStartIndex:w,dataEndIndex:S}))))},{}),V=_$e(de(de({},L),{},{props:x,graphicalItems:M}),b==null?void 0:b.legendBBox);Object.keys(L).forEach(function(Q){L[Q]=d(x,L[Q],V,Q.replace("Map",""),n)});var I=L["".concat(R,"Map")],D=S$e(I),X=h(x,de(de({},L),{},{dataStartIndex:w,dataEndIndex:S,updateId:C,graphicalItems:M,stackGroups:G,offset:V}));return de(de({formattedGraphicalItems:X,graphicalItems:M,offset:V,stackGroups:G},D),L)},g=function(m){function y(b){var x,w,S;return i$e(this,y),S=a$e(this,y,[b]),Pt(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pt(S,"accessibilityManager",new VDe),Pt(S,"handleLegendBBoxUpdate",function(C){if(C){var _=S.state,A=_.dataStartIndex,j=_.dataEndIndex,P=_.updateId;S.setState(de({legendBBox:C},p({props:S.props,dataStartIndex:A,dataEndIndex:j,updateId:P},de(de({},S.state),{},{legendBBox:C}))))}}),Pt(S,"handleReceiveSyncEvent",function(C,_,A){if(S.props.syncId===C){if(A===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(_)}}),Pt(S,"handleBrushChange",function(C){var _=C.startIndex,A=C.endIndex;if(_!==S.state.dataStartIndex||A!==S.state.dataEndIndex){var j=S.state.updateId;S.setState(function(){return de({dataStartIndex:_,dataEndIndex:A},p({props:S.props,dataStartIndex:_,dataEndIndex:A,updateId:j},S.state))}),S.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),Pt(S,"handleMouseEnter",function(C){var _=S.getMouseInfo(C);if(_){var A=de(de({},_),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var j=S.props.onMouseEnter;Et(j)&&j(A,C)}}),Pt(S,"triggeredAfterMouseMove",function(C){var _=S.getMouseInfo(C),A=_?de(de({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(A),S.triggerSyncEvent(A);var j=S.props.onMouseMove;Et(j)&&j(A,C)}),Pt(S,"handleItemMouseEnter",function(C){S.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Pt(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Pt(S,"handleMouseMove",function(C){C.persist(),S.throttleTriggeredAfterMouseMove(C)}),Pt(S,"handleMouseLeave",function(C){S.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};S.setState(_),S.triggerSyncEvent(_);var A=S.props.onMouseLeave;Et(A)&&A(_,C)}),Pt(S,"handleOuterEvent",function(C){var _=Ome(C),A=ns(S.props,"".concat(_));if(_&&Et(A)){var j,P;/.*touch.*/i.test(_)?P=S.getMouseInfo(C.changedTouches[0]):P=S.getMouseInfo(C),A((j=P)!==null&&j!==void 0?j:{},C)}}),Pt(S,"handleClick",function(C){var _=S.getMouseInfo(C);if(_){var A=de(de({},_),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var j=S.props.onClick;Et(j)&&j(A,C)}}),Pt(S,"handleMouseDown",function(C){var _=S.props.onMouseDown;if(Et(_)){var A=S.getMouseInfo(C);_(A,C)}}),Pt(S,"handleMouseUp",function(C){var _=S.props.onMouseUp;if(Et(_)){var A=S.getMouseInfo(C);_(A,C)}}),Pt(S,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Pt(S,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.handleMouseDown(C.changedTouches[0])}),Pt(S,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.handleMouseUp(C.changedTouches[0])}),Pt(S,"triggerSyncEvent",function(C){S.props.syncId!==void 0&&EC.emit(NC,S.props.syncId,C,S.eventEmitterSymbol)}),Pt(S,"applySyncEvent",function(C){var _=S.props,A=_.layout,j=_.syncMethod,P=S.state.updateId,k=C.dataStartIndex,O=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)S.setState(de({dataStartIndex:k,dataEndIndex:O},p({props:S.props,dataStartIndex:k,dataEndIndex:O,updateId:P},S.state)));else if(C.activeTooltipIndex!==void 0){var E=C.chartX,R=C.chartY,M=C.activeTooltipIndex,G=S.state,L=G.offset,V=G.tooltipTicks;if(!L)return;if(typeof j=="function")M=j(V,C);else if(j==="value"){M=-1;for(var I=0;I=0){var pe,we;if(E.dataKey&&!E.allowDuplicatedCategory){var Y=typeof E.dataKey=="function"?te:"payload.".concat(E.dataKey.toString());pe=Vx(I,Y,M),we=D&&X&&Vx(X,Y,M)}else pe=I==null?void 0:I[R],we=D&&X&&X[R];if(ne||U){var nt=C.props.activeIndex!==void 0?C.props.activeIndex:R;return[v.cloneElement(C,de(de(de({},j.props),F),{},{activeIndex:nt})),null,null]}if(!$t(pe))return[ce].concat(Nf(S.renderActivePoints({item:j,activePoint:pe,basePoint:we,childIndex:R,isRange:D})))}else{var Ue,at=(Ue=S.getItemByXY(S.state.activeCoordinate))!==null&&Ue!==void 0?Ue:{graphicalItem:ce},Be=at.graphicalItem,Bt=Be.item,N=Bt===void 0?C:Bt,$=Be.childIndex,B=de(de(de({},j.props),F),{},{activeIndex:$});return[v.cloneElement(N,B),null,null]}return D?[ce,null,null]:[ce,null]}),Pt(S,"renderCustomized",function(C,_,A){return v.cloneElement(C,de(de({key:"recharts-customized-".concat(A)},S.props),S.state))}),Pt(S,"renderMap",{CartesianGrid:{handler:Mv,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:Mv},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:Mv},YAxis:{handler:Mv},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:eh("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=$G(S.triggeredAfterMouseMove,(w=b.throttleDelay)!==null&&w!==void 0?w:1e3/60),S.state={},S}return u$e(y,m),o$e(y,[{key:"componentDidMount",value:function(){var x,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,w=x.children,S=x.data,C=x.height,_=x.layout,A=Wi(w,Zr);if(A){var j=A.props.defaultIndex;if(!(typeof j!="number"||j<0||j>this.state.tooltipTicks.length-1)){var P=this.state.tooltipTicks[j]&&this.state.tooltipTicks[j].value,k=cj(this.state,S,j,P),O=this.state.tooltipTicks[j].coordinate,E=(this.state.offset.top+C)/2,R=_==="horizontal",M=R?{x:O,y:E}:{y:O,x:E},G=this.state.formattedGraphicalItems.find(function(V){var I=V.item;return I.type.name==="Scatter"});G&&(M=de(de({},M),G.props.points[j].tooltipPosition),k=G.props.points[j].tooltipPayload);var L={activeTooltipIndex:j,isTooltipActive:!0,activeLabel:P,activePayload:k,activeCoordinate:M};this.setState(L),this.renderCursor(A),this.accessibilityManager.setIndex(j)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var S,C;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(x){$1([Wi(x.children,Zr)],[Wi(this.props.children,Zr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Wi(this.props.children,Zr);if(x&&typeof x.props.shared=="boolean"){var w=x.props.shared?"axis":"item";return c.indexOf(w)>=0?w:s}return s}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var w=this.container,S=w.getBoundingClientRect(),C=s1e(S),_={chartX:Math.round(x.pageX-C.left),chartY:Math.round(x.pageY-C.top)},A=S.width/w.offsetWidth||1,j=this.inRange(_.chartX,_.chartY,A);if(!j)return null;var P=this.state,k=P.xAxisMap,O=P.yAxisMap,E=this.getTooltipEventType();if(E!=="axis"&&k&&O){var R=dc(k).scale,M=dc(O).scale,G=R&&R.invert?R.invert(_.chartX):null,L=M&&M.invert?M.invert(_.chartY):null;return de(de({},_),{},{xValue:G,yValue:L})}var V=j$(this.state,this.props.data,this.props.layout,j);return V?de(de({},_),V):null}},{key:"inRange",value:function(x,w){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,_=x/S,A=w/S;if(C==="horizontal"||C==="vertical"){var j=this.state.offset,P=_>=j.left&&_<=j.left+j.width&&A>=j.top&&A<=j.top+j.height;return P?{x:_,y:A}:null}var k=this.state,O=k.angleAxisMap,E=k.radiusAxisMap;if(O&&E){var R=dc(O);return YM({x:_,y:A},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,w=this.getTooltipEventType(),S=Wi(x,Zr),C={};S&&w==="axis"&&(S.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var _=Gx(this.props,this.handleOuterEvent);return de(de({},_),C)}},{key:"addListener",value:function(){EC.on(NC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){EC.removeListener(NC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,w,S){for(var C=this.state.formattedGraphicalItems,_=0,A=C.length;_{var g;const[r,i]=v.useState([{name:"Very Positive",value:0,color:"#4ade80"},{name:"Positive",value:0,color:"#a3e635"},{name:"Neutral",value:0,color:"#93c5fd"},{name:"Negative",value:0,color:"#fb923c"},{name:"Very Negative",value:0,color:"#f87171"}]),[s,o]=v.useState([]),[c,l]=v.useState({}),[u,d]=v.useState({isBalanced:!1,score:0,reason:""}),f=m=>{const y=n.find(b=>b.id===m);return y?y.name:`Participant ${m}`};v.useEffect(()=>{if(t.length===0)return;const m={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0},y={},b={};t.forEach(S=>{if(S.senderId!=="moderator"&&S.senderId!=="facilitator"){const C=S.text.toLowerCase();let _="Neutral";C.includes("love")||C.includes("excellent")||C.includes("amazing")?_="Very Positive":C.includes("good")||C.includes("like")||C.includes("great")?_="Positive":C.includes("bad")||C.includes("issue")||C.includes("problem")?_="Negative":(C.includes("terrible")||C.includes("hate")||C.includes("awful"))&&(_="Very Negative"),m[_]++,b[S.senderId]||(b[S.senderId]={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0}),b[S.senderId][_]++,y[S.senderId]=(y[S.senderId]||0)+1}}),i(S=>S.map(C=>({...C,value:m[C.name]||0})));const x=Object.entries(y).map(([S,C])=>({name:f(S),messages:C}));o(x);const w={};Object.entries(b).forEach(([S,C])=>{w[S]={name:f(S),sentiments:C}}),l(w),h(y,b)},[t,n,f]);const h=(m,y)=>{if(Object.keys(m).length===0){d({isBalanced:!1,score:0,reason:"No participant data available"});return}const x=Object.values(m).reduce((V,I)=>V+I,0)/Object.keys(m).length,w=Object.values(m).map(V=>Math.abs(V-x)/x),S=w.reduce((V,I)=>V+I,0)/w.length,C=Object.values(y).map(V=>Object.values(V).filter(I=>I>0).length),_=C.reduce((V,I)=>V+I,0)/C.length,A=["Very Positive","Positive","Neutral","Negative","Very Negative"],j=Object.values(y).map(V=>{const I=Math.max(...Object.values(V));return A.find(D=>V[D]===I)||"Neutral"}),P=new Set(j).size,k=P/A.length,O=Math.max(0,100-S*100),E=_/5*100,R=k*100,M=Math.round(O*.6+E*.2+R*.2);let G="";const L=M>=70;S>.3&&(G+="Participation is uneven among participants. "),_<2&&(G+="Limited range of sentiments expressed. "),P<=1?G+="Participants show similar sentiment patterns, suggesting potential group-think. ":P>=4&&(G+="Wide divergence in participant sentiments, showing healthy diversity of opinions. "),G===""&&(G=L?"Good mix of participation and diverse opinions.":"Multiple factors affecting balance."),d({isBalanced:L,score:M,reason:G})},p=m=>{const y=c[m];if(!y)return"N/A";const b=y.sentiments;let x=0,w="Neutral";return Object.entries(b).forEach(([S,C])=>{C>x&&(x=C,w=S)}),w};return a.jsx("div",{className:"glass-panel rounded-xl p-4",children:a.jsxs(fl,{defaultValue:"sentiment",children:[a.jsxs(Va,{className:"grid grid-cols-2 mb-4",children:[a.jsxs(pn,{value:"sentiment",className:"flex items-center",children:[a.jsx(zJ,{className:"h-4 w-4 mr-2"}),"Sentiment"]}),a.jsxs(pn,{value:"participation",className:"flex items-center",children:[a.jsx(U_,{className:"h-4 w-4 mr-2"}),"Participation"]})]}),a.jsx(mn,{value:"sentiment",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Sentiment Analysis"}),a.jsxs("div",{className:`px-3 py-1 rounded-full text-sm ${u.isBalanced?"bg-green-100 text-green-800":"bg-amber-100 text-amber-800"}`,children:["Balance score: ",u.score,"/100"]})]}),a.jsx("div",{className:"h-60",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(tk,{children:[a.jsx(Zr,{}),a.jsx(vo,{data:r,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:m,percent:y})=>y>0?`${m} ${(y*100).toFixed(0)}%`:"",children:r.map((m,y)=>a.jsx(Ig,{fill:m.color},`cell-${y}`))}),a.jsx(ja,{})]})})}),a.jsxs("div",{className:"mt-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Sentiment by Participant"}),a.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto pr-2",children:Object.entries(c).map(([m,y])=>{var w;const b=p(m),x=((w=r.find(S=>S.name===b))==null?void 0:w.color)||"#93c5fd";return a.jsxs("div",{className:"flex items-center justify-between p-2 bg-slate-50 rounded",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(qp,{className:"h-4 w-4 text-slate-400 mr-2"}),a.jsx("span",{className:"text-sm",children:y.name})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("span",{className:"text-xs mr-2",children:"Predominant:"}),a.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded",style:{backgroundColor:`${x}30`,color:x},children:b})]})]},m)})})]}),a.jsxs("div",{className:"mt-4 pt-4 border-t",children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Focus Group Balance Assessment"}),a.jsxs("div",{className:`p-3 rounded text-sm ${u.isBalanced?"bg-green-50 text-green-700":"bg-amber-50 text-amber-700"}`,children:[a.jsx("span",{className:"font-medium",children:u.isBalanced?"Balanced Focus Group":"Potential Balance Issues"}),a.jsx("p",{className:"mt-1 text-xs",children:u.reason})]})]})]})})}),a.jsx(mn,{value:"participation",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"pt-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Participation Distribution"}),a.jsx("div",{className:"h-60",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(yW,{data:s,layout:"vertical",margin:{top:5,right:30,left:20,bottom:5},children:[a.jsx(ng,{strokeDasharray:"3 3"}),a.jsx(il,{type:"number"}),a.jsx(sl,{dataKey:"name",type:"category",width:100}),a.jsx(Zr,{}),a.jsx(vl,{dataKey:"messages",fill:"#8884d8",name:"Messages"})]})})}),a.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:s.length>0?`Most active: ${(g=s.sort((m,y)=>y.messages-m.messages)[0])==null?void 0:g.name}`:"No participation data available"})]})})})]})})};function N$e(t){if(console.log("🔍 [GPT-5 CONVERTER] Input wsMessage:",JSON.stringify(t,null,2)),!t)return console.error("🔍 [GPT-5 CONVERTER] ERROR: wsMessage is null/undefined"),null;const e={id:t.id,senderId:t.senderId,text:t.text,timestamp:new Date(t.timestamp),type:t.type,highlighted:t.highlighted,attached_assets:t.attached_assets||[],activates_visual_context:t.activates_visual_context||!1,visualAsset:t.visualAsset};return console.log("🔍 [GPT-5 CONVERTER] Output converted:",JSON.stringify(e,null,2)),e}function T$e(t){return{id:t.id,title:t.title,description:t.description,quotes:t.quotes,source:t.source,created_at:t.created_at}}function bW(){return!0}const P$e=({focusGroupId:t,personas:e,isVisible:n,onToggle:r})=>{const[i,s]=v.useState(null),[o,c]=v.useState(null),[l,u]=v.useState(null),[d,f]=v.useState(null),[h,p]=v.useState(!1),[g,m]=v.useState(null),[y,b]=v.useState(null);Qo();const x=bW();v.useEffect(()=>{if(!(!n||!t))return S(),console.log("📊 Setting up STABLE WebSocket event listeners for dashboard"),console.log("📊 Dashboard WebSocket listeners temporarily disabled for GPT-5 fix"),()=>{console.log("📊 Cleaning up STABLE dashboard WebSocket listeners")}},[n,t,x,!0]);const S=async()=>{p(!0),m(null);try{const[P,k,O,E]=await Promise.allSettled([er.getConversationAnalytics(t),er.getConversationState(t),er.getAutonomousConversationStatus(t),er.getConversationInsights(t)]);P.status==="fulfilled"&&s(P.value.data.analytics),k.status==="fulfilled"&&c(k.value.data.state),O.status==="fulfilled"&&u(O.value.data.status),E.status==="fulfilled"&&f(E.value.data.insights),b(new Date)}catch(P){console.error("Error fetching dashboard data:",P),m("Failed to load dashboard data")}finally{p(!1)}},C=()=>{S()},_=P=>{switch(P){case"running":return"bg-green-500";case"paused":return"bg-amber-500";case"completed":return"bg-blue-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},A=P=>{switch(P){case"positive":return"text-green-600";case"negative":return"text-red-600";default:return"text-gray-600"}},j=P=>{switch(P){case"excellent":return"text-green-600";case"good":return"text-blue-600";case"fair":return"text-amber-600";case"poor":return"text-red-600";default:return"text-gray-600"}};return n?a.jsxs("div",{className:"fixed right-4 top-4 bottom-4 w-80 bg-white rounded-lg shadow-lg border border-gray-200 flex flex-col overflow-hidden z-50",children:[a.jsxs("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(va,{className:"h-5 w-5 text-blue-600"}),a.jsx("h3",{className:"font-semibold text-gray-900",children:"AI Dashboard"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ee,{variant:"ghost",size:"sm",onClick:C,disabled:h,className:"p-1",children:a.jsx(Yl,{className:`h-4 w-4 ${h?"animate-spin":""}`})}),a.jsx(ee,{variant:"ghost",size:"sm",onClick:r,className:"p-1",children:a.jsx(YJ,{className:"h-4 w-4"})})]})]}),y&&a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Last updated: ",y.toLocaleTimeString()]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[g&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(VJ,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-sm text-red-800",children:g})]})}),l&&a.jsxs(ut,{children:[a.jsx(ji,{className:"pb-3",children:a.jsxs(qi,{className:"text-sm flex items-center gap-2",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${_(l.conversation_state)}`}),"Autonomous Status"]})}),a.jsx(Rt,{className:"pt-0",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"State:"}),a.jsx(Hn,{variant:l.conversation_state==="running"?"default":"secondary",children:l.conversation_state})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Actions:"}),a.jsx("span",{className:"font-medium",children:l.action_count||0})]})]})})]}),o&&a.jsxs(ut,{children:[a.jsx(ji,{className:"pb-3",children:a.jsxs(qi,{className:"text-sm flex items-center gap-2",children:[a.jsx(ha,{className:"h-4 w-4"}),"Conversation Health"]})}),a.jsx(Rt,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm",children:"Overall Health:"}),a.jsx(Hn,{className:j(o.conversation_health.status),children:o.conversation_health.status})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Score:"}),a.jsxs("span",{className:"font-medium",children:[o.conversation_health.score,"/100"]})]}),a.jsx(wc,{value:o.conversation_health.score,className:"h-2"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("span",{className:"text-xs text-gray-600",children:"Indicators:"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:o.conversation_health.indicators.map((P,k)=>a.jsx(Hn,{variant:"outline",className:"text-xs",children:P.replace("_"," ")},k))})]})]})})]}),i&&a.jsxs(ut,{children:[a.jsx(ji,{className:"pb-3",children:a.jsxs(qi,{className:"text-sm flex items-center gap-2",children:[a.jsx(Dr,{className:"h-4 w-4"}),"Participation"]})}),a.jsx(Rt,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-lg font-semibold text-blue-600",children:i.overview.active_participants}),a.jsx("div",{className:"text-xs text-gray-600",children:"Active"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-lg font-semibold text-green-600",children:i.overview.participant_messages}),a.jsx("div",{className:"text-xs text-gray-600",children:"Messages"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Balance:"}),a.jsx(Hn,{variant:i.participation.participation_balance==="balanced"?"default":"secondary",children:i.participation.participation_balance.replace("_"," ")})]}),i.participation.dominant_participants.length>0&&a.jsxs("div",{className:"text-xs text-amber-600",children:["Dominant: ",i.participation.dominant_participants.length," participant(s)"]}),i.participation.quiet_participants.length>0&&a.jsxs("div",{className:"text-xs text-blue-600",children:["Quiet: ",i.participation.quiet_participants.length," participant(s)"]})]})]})})]}),i&&a.jsxs(ut,{children:[a.jsx(ji,{className:"pb-3",children:a.jsxs(qi,{className:"text-sm flex items-center gap-2",children:[a.jsx(pZ,{className:"h-4 w-4"}),"Sentiment"]})}),a.jsx(Rt,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm",children:"Overall:"}),a.jsx(Hn,{className:A(i.sentiment_analysis.overall_sentiment),children:i.sentiment_analysis.overall_sentiment})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsxs("span",{children:["Positive: ",i.sentiment_analysis.sentiment_distribution.positive]}),a.jsxs("span",{children:["Neutral: ",i.sentiment_analysis.sentiment_distribution.neutral]}),a.jsxs("span",{children:["Negative: ",i.sentiment_analysis.sentiment_distribution.negative]})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Trend:"}),a.jsx("span",{className:"font-medium",children:i.sentiment_analysis.sentiment_trend})]})]})]})})]}),i&&a.jsxs(ut,{children:[a.jsx(ji,{className:"pb-3",children:a.jsxs(qi,{className:"text-sm flex items-center gap-2",children:[a.jsx(HJ,{className:"h-4 w-4"}),"Quality Metrics"]})}),a.jsx(Rt,{className:"pt-0",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Engagement:"}),a.jsxs("span",{className:"font-medium",children:[Math.round(i.quality_metrics.engagement_score),"/100"]})]}),a.jsx(wc,{value:i.quality_metrics.engagement_score,className:"h-2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Depth:"}),a.jsxs("span",{className:"font-medium",children:[Math.round(i.quality_metrics.depth_score),"/100"]})]}),a.jsx(wc,{value:i.quality_metrics.depth_score,className:"h-2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Overall:"}),a.jsxs("span",{className:"font-medium",children:[Math.round(i.quality_metrics.quality_score),"/100"]})]}),a.jsx(wc,{value:i.quality_metrics.quality_score,className:"h-2"})]})]})})]}),d&&a.jsxs(ut,{children:[a.jsx(ji,{className:"pb-3",children:a.jsxs(qi,{className:"text-sm flex items-center gap-2",children:[a.jsx(du,{className:"h-4 w-4"}),"AI Insights"]})}),a.jsx(Rt,{className:"pt-0",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Energy:"}),a.jsx(Hn,{variant:d.conversation_energy==="high"?"default":"secondary",children:d.conversation_energy})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Engagement:"}),a.jsx(Hn,{variant:d.topic_engagement==="high"?"default":"secondary",children:d.topic_engagement})]}),d.next_suggested_action&&a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-2 mt-2",children:a.jsxs("div",{className:"text-xs text-blue-800",children:[a.jsx("strong",{children:"Suggestion:"})," ",d.next_suggested_action]})})]})})]}),i&&i.recommendations.length>0&&a.jsxs(ut,{children:[a.jsx(ji,{className:"pb-3",children:a.jsxs(qi,{className:"text-sm flex items-center gap-2",children:[a.jsx(IE,{className:"h-4 w-4"}),"Recommendations"]})}),a.jsx(Rt,{className:"pt-0",children:a.jsx("div",{className:"space-y-2",children:i.recommendations.map((P,k)=>a.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-2",children:a.jsx("div",{className:"text-xs text-amber-800",children:P})},k))})})]})]})]}):null},k$e=({discussionGuide:t,moderatorStatus:e,onSectionSelect:n,onSetPosition:r,onSave:i,focusGroupId:s,isOpen:o,onToggle:c,className:l,onEditingChange:u})=>{const d=v.useRef(!1),f=v.useCallback(y=>{d.current=y,u==null||u(y)},[u]),[h,p]=v.useState(!1),g=async()=>{if(!t){se.error("No discussion guide available",{description:"The discussion guide is not available for download"});return}p(!0);try{await pt.downloadDiscussionGuide(s),se.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(y){console.error("Error downloading discussion guide:",y),se.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{p(!1)}},m=t&&typeof t=="object"&&t.sections;return a.jsx("div",{className:Pe("w-full border-b bg-white shadow-sm",l),children:a.jsxs(Ag,{open:o,onOpenChange:c,children:[a.jsx(jg,{asChild:!0,children:a.jsxs("div",{className:"w-full px-4 py-3 flex items-center justify-between hover:bg-slate-50 transition-colors cursor-pointer",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(WJ,{className:"h-5 w-5 text-slate-600"}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold text-slate-900",children:"Discussion Guide"}),m&&a.jsxs("p",{className:"text-xs text-slate-500",children:[t.title," • ",t.total_duration," minutes"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ee,{variant:"ghost",size:"sm",onClick:y=>{y.stopPropagation(),g()},disabled:!t||h,className:"h-8",children:h?a.jsx(Js,{className:"h-4 w-4 animate-spin"}):a.jsx(Xc,{className:"h-4 w-4"})}),o?a.jsx(uu,{className:"h-4 w-4 text-slate-500"}):a.jsx(Ra,{className:"h-4 w-4 text-slate-500"})]})]})}),a.jsx(Eg,{children:a.jsx("div",{className:"border-t bg-slate-50",children:a.jsx(ut,{className:"mx-4 mb-4 mt-2",children:a.jsx(Rt,{className:"p-4",children:a.jsx("div",{className:"max-h-[70vh] overflow-y-auto",children:a.jsx(VT,{discussionGuide:t,moderatorStatus:e,onSectionSelect:n,onSetPosition:r,onSave:i,showProgress:!0,collapsible:!0,defaultExpanded:!0,focusGroupId:s,onEditingChange:f})})})})})})]})})},O$e=({focusGroupId:t,focusGroupName:e="Focus Group",onNoteClick:n})=>{const[r,i]=v.useState([]),[s,o]=v.useState(!0),[c,l]=v.useState(null);v.useEffect(()=>{u()},[t]);const u=async()=>{try{o(!0);const x=await pt.getNotes(t);if(x.data&&Array.isArray(x.data)){const w=x.data.map(S=>({...S,timestamp:new Date(S.timestamp),createdAt:new Date(S.createdAt)}));i(y(w))}}catch(x){console.error("Error fetching notes:",x),se.error("Failed to load notes",{description:"Please refresh the page to try again."})}finally{o(!1)}},d=async x=>{l(x);try{await pt.deleteNote(t,x),i(r.filter(w=>w.id!==x)),se.success("Note deleted successfully")}catch(w){console.error("Error deleting note:",w),se.error("Failed to delete note",{description:"Please try again."})}finally{l(null)}},f=x=>{x.associatedMessageId&&n?n(x.associatedMessageId):se.info("No associated message",{description:"This note is not linked to a specific discussion point."})},h=()=>{if(r.length===0){se.warning("No notes to export",{description:"Create some notes first before exporting."});return}const x=p(),w=document.createElement("a"),S=new Blob([x],{type:"text/markdown"});w.href=URL.createObjectURL(S),w.download=`${e.replace(/[^a-z0-9]/gi,"_").toLowerCase()}_notes.md`,document.body.appendChild(w),w.click(),document.body.removeChild(w),se.success("Notes exported successfully",{description:`Downloaded ${r.length} notes as Markdown file.`})},p=()=>{const x=[`# Notes: ${e}`,"",`Exported on: ${new Date().toLocaleString()}`,`Total notes: ${r.length}`,"","---",""];return r.forEach((w,S)=>{var C;x.push(`## Note ${S+1}`),x.push(""),x.push(`**Created:** ${w.createdAt.toLocaleString()}`),(C=w.sectionInfo)!=null&&C.sectionTitle&&x.push(`**Section:** ${w.sectionInfo.sectionTitle}`),x.push(`**Elapsed Time:** ${g(w.elapsedTime)}`),x.push(""),x.push("**Content:**"),x.push(w.content),x.push(""),x.push("---"),x.push("")}),x.join(` +`)},g=x=>{const w=Math.floor(x/1e3),S=Math.floor(w/60),C=w%60;return`${S}:${C.toString().padStart(2,"0")}`},m=x=>x.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),y=x=>[...x].sort((w,S)=>S.createdAt.getTime()-w.createdAt.getTime()),b=x=>{i(w=>y([...w,x]))};return v.useEffect(()=>(window.notesPanelAddNote=b,()=>{delete window.notesPanelAddNote}),[]),s?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Wy,{className:"h-5 w-5 text-primary mr-2"}),a.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Notes"}),r.length>0&&a.jsxs("span",{className:"ml-2 text-sm text-slate-500",children:["(",r.length,")"]})]}),a.jsxs(ee,{variant:"outline",size:"sm",onClick:h,disabled:r.length===0,children:[a.jsx(Xc,{className:"mr-2 h-4 w-4"}),"Export Notes"]})]}),a.jsx(cw,{className:"flex-1",children:r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[a.jsx(Wy,{className:"h-8 w-8 text-slate-400 mb-3"}),a.jsx("p",{className:"text-slate-600",children:"No notes yet."}),a.jsx("p",{className:"text-sm text-slate-500 mt-2",children:'Click the "Note" button during the session to add contextual notes.'})]}):a.jsx("div",{className:"space-y-4",children:r.map(x=>{var w;return a.jsxs(ut,{className:"hover:shadow-md transition-shadow cursor-pointer group",onClick:()=>f(x),children:[a.jsx(ji,{className:"pb-2",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(qi,{className:"text-sm font-medium text-slate-600",children:m(x.createdAt)}),((w=x.sectionInfo)==null?void 0:w.sectionTitle)&&a.jsx("div",{className:"text-xs text-slate-500 mt-1",children:a.jsx("span",{children:x.sectionInfo.sectionTitle})})]}),a.jsxs("div",{className:"flex items-center space-x-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[x.associatedMessageId&&a.jsx(ee,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:S=>{S.stopPropagation(),f(x)},title:"Go to discussion point",children:a.jsx(aZ,{className:"h-3 w-3"})}),a.jsx(ee,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-red-600 hover:text-red-700",onClick:S=>{S.stopPropagation(),d(x.id)},disabled:c===x.id,title:"Delete note",children:a.jsx(qn,{className:"h-3 w-3"})})]})]})}),a.jsx(Rt,{className:"pt-0",children:a.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:x.content})})]},x.id)})})})]})},I$e=({isOpen:t,onClose:e,focusGroupId:n,associatedMessageId:r,sectionInfo:i,messageTimestamp:s,onNoteSaved:o})=>{const[c,l]=v.useState(""),[u,d]=v.useState(!1),f=async()=>{if(!c.trim()){se.error("Note content cannot be empty");return}d(!0);try{const p={content:c.trim(),associatedMessageId:r,sectionInfo:i,elapsedTime:0,timestamp:s.toISOString(),createdAt:new Date().toISOString()},g=await pt.createNote(n,p);if(g.data){const m={...g.data,timestamp:new Date(g.data.timestamp),createdAt:new Date(g.data.createdAt)},y=i!=null&&i.sectionTitle?`'${i.sectionTitle}'`:"current section",b=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});se.success("Quick note saved",{description:`Note linked to ${y} at ${b}`}),o&&o(m),l(""),e()}}catch(p){console.error("Error saving note:",p),se.error("Failed to save note",{description:"Please try again or check your connection."})}finally{d(!1)}},h=()=>{l(""),e()};return a.jsx(Jl,{open:t,onOpenChange:h,children:a.jsxs($c,{className:"sm:max-w-md",children:[a.jsx(Lc,{children:a.jsx(Uc,{children:"Quick Note"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"text-sm text-slate-600",children:[a.jsxs("div",{children:[a.jsx("strong",{children:"Section:"})," ",(i==null?void 0:i.sectionTitle)||"Unknown section"]}),a.jsxs("div",{children:[a.jsx("strong",{children:"Time:"})," ",s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),a.jsx(ht,{placeholder:"Enter your note here...",value:c,onChange:p=>l(p.target.value),className:"min-h-[100px] resize-none",autoFocus:!0})]}),a.jsxs(Fc,{children:[a.jsx(ee,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),a.jsx(ee,{onClick:f,disabled:u,children:u?"Saving...":"Save Note"})]})]})})},qo=Object.create(null);qo.open="0";qo.close="1";qo.ping="2";qo.pong="3";qo.message="4";qo.upgrade="5";qo.noop="6";const ly=Object.create(null);Object.keys(qo).forEach(t=>{ly[qo[t]]=t});const lj={type:"error",data:"parser error"},wW=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",SW=typeof ArrayBuffer=="function",CW=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,nk=({type:t,data:e},n,r)=>wW&&e instanceof Blob?n?r(e):T$(e,r):SW&&(e instanceof ArrayBuffer||CW(e))?n?r(e):T$(new Blob([e]),r):r(qo[t]+(e||"")),T$=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function P$(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let PC;function R$e(t,e){if(wW&&t.data instanceof Blob)return t.data.arrayBuffer().then(P$).then(e);if(SW&&(t.data instanceof ArrayBuffer||CW(t.data)))return e(P$(t.data));nk(t,!1,n=>{PC||(PC=new TextEncoder),e(PC.encode(n))})}const k$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t{let e=t.length*.75,n=t.length,r,i=0,s,o,c,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const u=new ArrayBuffer(e),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(o&15)<<4|c>>2,d[i++]=(c&3)<<6|l&63;return u},D$e=typeof ArrayBuffer=="function",rk=(t,e)=>{if(typeof t!="string")return{type:"message",data:_W(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:$$e(t.substring(1),e)}:ly[n]?t.length>1?{type:ly[n],data:t.substring(1)}:{type:ly[n]}:lj},$$e=(t,e)=>{if(D$e){const n=M$e(t);return _W(n,e)}else return{base64:!0,data:t}},_W=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},AW="",L$e=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{nk(s,!1,c=>{r[o]=c,++i===n&&e(r.join(AW))})})},F$e=(t,e)=>{const n=t.split(AW),r=[];for(let i=0;i{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let kC;function Dv(t){return t.reduce((e,n)=>e+n.length,0)}function $v(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;iMath.pow(2,21)-1){c.enqueue(lj);break}i=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Dv(n)t){c.enqueue(lj);break}}}})}const jW=4;function mr(t){if(t)return H$e(t)}function H$e(t){for(var e in mr.prototype)t[e]=mr.prototype[e];return t}mr.prototype.on=mr.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};mr.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};mr.prototype.off=mr.prototype.removeListener=mr.prototype.removeAllListeners=mr.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;iPromise.resolve().then(e):(e,n)=>n(e,0),vs=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),z$e="arraybuffer";function EW(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const V$e=vs.setTimeout,G$e=vs.clearTimeout;function eS(t,e){e.useNativeTimers?(t.setTimeoutFn=V$e.bind(vs),t.clearTimeoutFn=G$e.bind(vs)):(t.setTimeoutFn=vs.setTimeout.bind(vs),t.clearTimeoutFn=vs.clearTimeout.bind(vs))}const K$e=1.33;function W$e(t){return typeof t=="string"?q$e(t):Math.ceil((t.byteLength||t.size)*K$e)}function q$e(t){let e=0,n=0;for(let r=0,i=t.length;r=57344?n+=3:(r++,n+=4);return n}function NW(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Y$e(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function Q$e(t){let e={},n=t.split("&");for(let r=0,i=n.length;r{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};F$e(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,L$e(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=NW()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let TW=!1;try{TW=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Z$e=TW;function eLe(){}class tLe extends J$e{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let kd=class uy extends mr{constructor(e,n,r){super(),this.createRequest=e,eS(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=EW(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=uy.requestsCount++,uy.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=eLe,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete uy.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};kd.requestsCount=0;kd.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",O$);else if(typeof addEventListener=="function"){const t="onpagehide"in vs?"pagehide":"unload";addEventListener(t,O$,!1)}}function O$(){for(let t in kd.requests)kd.requests.hasOwnProperty(t)&&kd.requests[t].abort()}const nLe=function(){const t=PW({xdomain:!1});return t&&t.responseType!==null}();class rLe extends tLe{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=nLe&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new kd(PW,this.uri(),e)}}function PW(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Z$e))return new XMLHttpRequest}catch{}if(!e)try{return new vs[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const kW=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class iLe extends ik{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=kW?{}:EW(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n{try{this.doWrite(r,s)}catch{}i&&Zw(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=NW()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const OC=vs.WebSocket||vs.MozWebSocket;class sLe extends iLe{createSocket(e,n,r){return kW?new OC(e,n,r):n?new OC(e,n):new OC(e)}doWrite(e,n){this.ws.send(n)}}class oLe extends ik{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=B$e(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=U$e();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:c,value:l})=>{c||(this.onPacket(l),s())}).catch(c=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n{i&&Zw(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const aLe={websocket:sLe,webtransport:oLe,polling:rLe},cLe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lLe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function uj(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=cLe.exec(t||""),s={},o=14;for(;o--;)s[lLe[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=uLe(s,s.path),s.queryKey=dLe(s,s.query),s}function uLe(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function dLe(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const dj=typeof addEventListener=="function"&&typeof removeEventListener=="function",dy=[];dj&&addEventListener("offline",()=>{dy.forEach(t=>t())},!1);class Vc extends mr{constructor(e,n){if(super(),this.binaryType=z$e,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=uj(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=uj(n.host).host);eS(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Q$e(this.opts.query)),dj&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},dy.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=jW,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Vc.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Vc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Zw(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(Vc.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),dj&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=dy.indexOf(this._offlineEventListener);r!==-1&&dy.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Vc.protocol=jW;class fLe extends Vc{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Vc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=f=>{const h=new Error("probe error: "+f);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function c(){o("transport closed")}function l(){o("socket closed")}function u(f){n&&f.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",c),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",c),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;raLe[i]).filter(i=>!!i)),super(e,r)}};function pLe(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=uj(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const mLe=typeof ArrayBuffer=="function",gLe=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,OW=Object.prototype.toString,vLe=typeof Blob=="function"||typeof Blob<"u"&&OW.call(Blob)==="[object BlobConstructor]",yLe=typeof File=="function"||typeof File<"u"&&OW.call(File)==="[object FileConstructor]";function sk(t){return mLe&&(t instanceof ArrayBuffer||gLe(t))||vLe&&t instanceof Blob||yLe&&t instanceof File}function fy(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n=0&&t.num{delete this.acks[e];for(let c=0;c{this.io.clearTimeoutFn(s),n.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(o,c)=>o?i(o):r(c);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Zt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Zt.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Zt.EVENT:case Zt.BINARY_EVENT:this.onevent(e);break;case Zt.ACK:case Zt.BINARY_ACK:this.onack(e);break;case Zt.DISCONNECT:this.ondisconnect();break;case Zt.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Zt.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Zt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r0&&t.jitter<=1?t.jitter:0,this.attempts=0}dh.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0};dh.prototype.reset=function(){this.attempts=0};dh.prototype.setMin=function(t){this.ms=t};dh.prototype.setMax=function(t){this.max=t};dh.prototype.setJitter=function(t){this.jitter=t};class pj extends mr{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,eS(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new dh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||ALe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new hLe(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zs(n,"open",function(){r.onopen(),e&&e()}),s=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=zs(n,"error",s);if(this._timeout!==!1){const c=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},c);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(zs(e,"ping",this.onping.bind(this)),zs(e,"data",this.ondata.bind(this)),zs(e,"error",this.onerror.bind(this)),zs(e,"close",this.onclose.bind(this)),zs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Zw(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new IW(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;re()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Dh={};function hy(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=pLe(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Dh[i]&&s in Dh[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return c?l=new pj(r,e):(Dh[i]||(Dh[i]=new pj(r,e)),l=Dh[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(hy,{Manager:pj,Socket:IW,io:hy,connect:hy});const R$=window.location.origin,M$=new URLSearchParams(window.location.search).get("direct")==="1"?"/socket.io/":"/semblance_back/socket.io/";let It=null,nu=null,D$=!1;function RW(t){if(It)return It.io.opts.auth={token:t()},It;console.log("🔧 [GPT-5] Creating singleton socket:",R$,M$),It=hy(R$,{path:M$,transports:["websocket"],reconnection:!0,autoConnect:!1,timeout:6e4,pingInterval:45e3,pingTimeout:12e4,auth:n=>n({token:t()})}),It.io.on("reconnect_attempt",()=>{console.log("🔧 [GPT-5] Reconnect attempt - refreshing token"),It.io.opts.auth={token:t()}});const e=()=>{console.log("🔧 [GPT-5] Socket connected, rebinding listeners and rejoining room"),PLe(),nu&&TLe()};return It.on("connect",e),It.onAny((n,...r)=>{console.log(`🔧 [GPT-5 onAny] ${n}:`,r);const i=r[0];switch(n){case"joined_focus_group":console.log("🔧 [GPT-5] *** ROUTING joined_focus_group from onAny ***"),window.dispatchEvent(new CustomEvent("ws:joined_focus_group",{detail:i}));break;case"left_focus_group":console.log("🔧 [GPT-5] *** ROUTING left_focus_group from onAny ***"),window.dispatchEvent(new CustomEvent("ws:left_focus_group",{detail:i}));break;case"message_update":console.log("🔧 [GPT-5] *** ROUTING message_update from onAny ***");try{window.dispatchEvent(new CustomEvent("ws:message_update",{detail:i})),console.log("🔧 [GPT-5] DISPATCHED window event ws:message_update SUCCESS (via onAny)")}catch(s){console.error("🔧 [GPT-5] ERROR dispatching window event (via onAny):",s)}break;case"ai_status_update":console.log("🔧 [GPT-5] *** ROUTING ai_status_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:ai_status_update",{detail:i}));break;case"moderator_status_update":console.log("🔧 [GPT-5] *** ROUTING moderator_status_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:moderator_status_update",{detail:i}));break;case"theme_update":console.log("🔧 [GPT-5] *** ROUTING theme_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:theme_update",{detail:i}));break;case"focus_group_update":console.log("🔧 [GPT-5] *** ROUTING focus_group_update from onAny ***"),window.dispatchEvent(new CustomEvent("ws:focus_group_update",{detail:i}));break;case"connected":console.log("🔧 [GPT-5] *** ROUTING connected from onAny ***");break;case"error":console.error("🔧 [GPT-5] *** ROUTING error from onAny ***",i);break}}),It.on("connect_error",n=>{console.error("🔧 [GPT-5] Connect error:",n)}),It.on("disconnect",n=>{console.log("🔧 [GPT-5] Disconnected:",n)}),It}function MW(){It&&!It.connected&&(console.log("🔧 [GPT-5] Connecting socket"),It.connect())}function ELe(t,e){if(console.log("🔧 [GPT-5] Joining focus group:",t),nu=t,!(It!=null&&It.connected)){console.log("🔧 [GPT-5] Socket not connected, will auto-rejoin on connect"),MW(),setTimeout(()=>{It!=null&&It.connected?(console.log("🔧 [GPT-5] Retrying join after connection established"),It.emit("join_focus_group",{focus_group_id:t},n=>{console.log("🔧 [GPT-5] join_focus_group RETRY ACK:",n)})):console.log("🔧 [GPT-5] Still not connected, will rejoin on next connect event")},1e3);return}It.emit("join_focus_group",{focus_group_id:t},n=>{console.log("🔧 [GPT-5] join_focus_group ACK:",n)})}function NLe(t){console.log("🔧 [GPT-5] Leaving focus group:",t),nu===t&&(nu=null),It!=null&&It.connected&&It.emit("leave_focus_group",{focus_group_id:t})}function TLe(){!(It!=null&&It.connected)||!nu||(console.log("🔧 [GPT-5] Auto-rejoining room after reconnect:",nu),It.emit("join_focus_group",{focus_group_id:nu}))}function PLe(){if(!It){console.log("🔧 [GPT-5] bindCoreListeners called but socket is null!");return}D$&&console.log("🔧 [GPT-5] Listeners already bound, but rebinding anyway for safety"),console.log("🔧 [GPT-5] bindCoreListeners called - socket exists, binding listeners");const t=c=>{console.log("🔧 [GPT-5] joined_focus_group:",c),window.dispatchEvent(new CustomEvent("ws:joined_focus_group",{detail:c}))},e=c=>{console.log("🔧 [GPT-5] left_focus_group:",c),window.dispatchEvent(new CustomEvent("ws:left_focus_group",{detail:c}))},n=c=>{console.log("🔧 [GPT-5] *** MESSAGE_UPDATE LISTENER FIRED! ***"),console.log("🔧 [GPT-5] message_update payload:",c),console.log("🔧 [GPT-5] DISPATCHING window event ws:message_update");try{window.dispatchEvent(new CustomEvent("ws:message_update",{detail:c})),console.log("🔧 [GPT-5] DISPATCHED window event ws:message_update SUCCESS")}catch(l){console.error("🔧 [GPT-5] ERROR dispatching window event:",l)}},r=c=>{console.log("🔧 [GPT-5] ai_status_update:",c),console.log("🔧 [GPT-5] DISPATCHING window event ws:ai_status_update"),window.dispatchEvent(new CustomEvent("ws:ai_status_update",{detail:c})),console.log("🔧 [GPT-5] DISPATCHED window event ws:ai_status_update")},i=c=>{console.log("🔧 [GPT-5] moderator_status_update:",c),window.dispatchEvent(new CustomEvent("ws:moderator_status_update",{detail:c}))},s=c=>{console.log("🔧 [GPT-5] theme_update:",c),window.dispatchEvent(new CustomEvent("ws:theme_update",{detail:c}))},o=c=>{console.log("🔧 [GPT-5] focus_group_update:",c),window.dispatchEvent(new CustomEvent("ws:focus_group_update",{detail:c}))};console.log("🔧 [GPT-5] BINDING specific listeners to socket"),It.on("joined_focus_group",t),It.on("left_focus_group",e),It.on("message_update",n),It.on("ai_status_update",r),It.on("moderator_status_update",i),It.on("theme_update",s),It.on("focus_group_update",o),console.log("🔧 [GPT-5] BOUND specific listeners to socket"),console.log("🔧 [GPT-5] Socket listeners after binding:",It.listeners("message_update").length),console.log("🔧 [GPT-5] Socket hasListeners message_update:",It.hasListeners("message_update")),setTimeout(()=>{It!=null&&It.connected&&(console.log("🔧 [GPT-5] SELF-TEST: Emitting test event"),It.emit("message_update",{test:"self-emit-test"}))},1e3),It.on("connected",c=>{console.log("🔧 [GPT-5] connected:",c)}),It.on("error",c=>{console.error("🔧 [GPT-5] socket error:",c)}),D$=!0}const kLe=()=>{const{id:t}=OE(),e=ar(),{token:n}=Qo(),[r,i]=v.useState([]),[s,o]=v.useState([]),[c,l]=v.useState([]),[u,d]=v.useState(null),[f,h]=v.useState([]),[p,g]=v.useState("chat"),[m,y]=v.useState(null),[b,x]=v.useState(!1),[w,S]=v.useState(!1),[C,_]=v.useState(!0),[A,j]=v.useState(!1),[P,k]=v.useState(!1),O=v.useRef(!1),[E,R]=v.useState(!1),M=v.useRef(u);M.current=u;const[G,L]=v.useState([]),[V,I]=v.useState(!1),[D,X]=v.useState(""),[Q,J]=v.useState("medium"),[ye,U]=v.useState("medium"),[ne,ue]=v.useState(!1),[F,ce]=v.useState(!1),[te,pe]=v.useState(null),[we,Y]=v.useState([]),[nt,Ue]=v.useState(!1),[at,Be]=v.useState(!1),[Bt,N]=v.useState(!1),[$,B]=v.useState(!0),[K,Z]=v.useState({isOpen:!1}),H=v.useRef(!1),[re,me]=v.useState(""),be=v.useRef(""),ke=v.useRef(!1),Se=v.useRef({wasConnected:!1,wasConnecting:!1,initialConnection:!0,hasShownFallbackNotification:!1}),qe=bW(),[st,Dt]=v.useState(!1),[We,Je]=v.useState(!1),[At,Yt]=v.useState(null),Xn=v.useCallback(()=>n||"",[n]);v.useEffect(()=>{console.log("🔧 [GPT-5 Session] Initializing WebSocket"),RW(Xn)},[qe,Xn]),v.useEffect(()=>{if(!t)return;(()=>{console.log("🔧 [GPT-5 Session] Joining focus group:",t),ELe(t)})()},[t,qe]),v.useEffect(()=>{Je(!0),Dt(!1),Yt(null);const ie=setTimeout(()=>{Dt(!0),Je(!1)},1e3);return()=>{clearTimeout(ie)}},[qe]),v.useEffect(()=>{console.log("🔧 [GPT-5 Session] Setting up window event listeners");const ie=et=>{const St=et.detail;console.log("🔧 [GPT-5 Session] message_update:",St),St.focus_group_id&&(console.log("🔧 [GPT-5] Message focus_group_id:",St.focus_group_id),console.log("🔧 [GPT-5] Current focus group from URL:",t));const Ce=N$e(St.message);if(!Ce){console.error("🔧 [GPT-5] convertWebSocketMessage returned null");return}i(Qt=>Qt.find(rn=>rn.id===Ce.id)?(console.log("🔧 [GPT-5] Message already exists, skipping"),Qt):(console.log("🔧 [GPT-5] Adding new message, count:",Qt.length+1),[...Qt,Ce]))},le=et=>{const St=et.detail;console.log("🔧 [GPT-5 Session] ai_status_update:",St),S(Ce=>St.status.status==="ai_mode"),me(Ce=>St.status.status)},Te=et=>{const St=et.detail;console.log("🔧 [GPT-5 Session] moderator_status_update:",St),y(St.moderator_status)},$e=et=>{const St=et.detail;console.log("🔧 [GPT-5 Session] theme_update:",St);const Ce=T$e(St.theme);l(Qt=>{const Ct=[...Qt],rn=Ct.findIndex(Lt=>Lt.id===Ce.id);return rn>=0?Ct[rn]=Ce:Ct.push(Ce),Ct})},He=et=>{const St=et.detail;console.log("🔧 [GPT-5 Session] focus_group_update:",St),d(Ce=>Ce?{...Ce,...St}:null)},ft=et=>{const St=et.detail;console.log("🔧 [GPT-5 Session] joined_focus_group:",St)};return console.log("🔧 [GPT-5 Session] ADDING window event listeners"),window.addEventListener("ws:message_update",ie),window.addEventListener("ws:ai_status_update",le),window.addEventListener("ws:moderator_status_update",Te),window.addEventListener("ws:theme_update",$e),window.addEventListener("ws:focus_group_update",He),window.addEventListener("ws:joined_focus_group",ft),console.log("🔧 [GPT-5 Session] ADDED all window event listeners"),()=>{console.log("🔧 [GPT-5 Session] Cleaning up window event listeners"),window.removeEventListener("ws:message_update",ie),window.removeEventListener("ws:ai_status_update",le),window.removeEventListener("ws:moderator_status_update",Te),window.removeEventListener("ws:theme_update",$e),window.removeEventListener("ws:focus_group_update",He),window.removeEventListener("ws:joined_focus_group",ft),t&&NLe(t)}},[qe,t]),v.useEffect(()=>{if(!t)return;const ie=Se.current;st&&!ie.wasConnected&&(ie.initialConnection?Fe.success("Live updates enabled",{description:"Connected to real-time updates. Changes will appear instantly.",duration:3e3}):Fe.success("Real-time updates restored",{description:"WebSocket connection re-established. You'll now receive instant updates.",duration:4e3}),ie.wasConnected=!0,ie.initialConnection=!1),!st&&!We&&ie.wasConnected&&!ie.initialConnection&&(Fe.warning("Connection lost",{description:"Real-time updates unavailable. Attempting to reconnect...",duration:5e3}),ie.wasConnected=!1,B(!0)),At&&!We&&!st&&!ie.initialConnection&&(Fe.error("Connection failed",{description:"Unable to establish real-time connection. Using periodic updates instead.",duration:6e3}),B(!0)),ie.wasConnecting=We},[st,We,At,qe,t]),v.useEffect(()=>{},[qe,t,u]);const cr=async()=>{var ie;if(t)try{const le=await er.getModeratorStatus(t);if((ie=le==null?void 0:le.data)!=null&&ie.status){const Te=le.data.status;if(m){const $e=m.current_section_id!==Te.current_section_id||m.current_item_id!==Te.current_item_id||m.progress!==Te.progress}O.current||y(Te)}}catch(le){console.error("Error fetching moderator status:",le)}},ct=async()=>{if(!t)return{aiActive:!1,sessionStatus:""};try{if(typeof(pt==null?void 0:pt.getById)!="function")return console.error("focusGroupsApi.getById is not a function:",typeof(pt==null?void 0:pt.getById)),{aiActive:w,sessionStatus:re};const ie=await pt.getById(t);if(!ie||typeof ie!="object")return console.error("Invalid response object received:",ie),{aiActive:w,sessionStatus:re};if(!ie.data||typeof ie.data!="object")return console.warn("Focus group response missing data property:",ie),{aiActive:w,sessionStatus:re};const le=ie.data.status;if(typeof le>"u")return console.warn("Focus group response missing status field:",ie.data),{aiActive:w,sessionStatus:re};const Te=le==="ai_mode";return le==="autonomous_active"?console.warn('Detected legacy "autonomous_active" status - backend may need updating to "ai_mode"'):["ai_mode","active","completed","paused","draft","in-progress"].includes(le)||console.warn("Unexpected focus group status value:",le),{aiActive:Te,sessionStatus:le}}catch(ie){console.error("Error checking AI mode status:",ie);const le={focusGroupId:t,currentAiModeStatus:w,errorType:"unknown",timestamp:new Date().toISOString()};return ie.response?(le.errorType="api_error",le.status=ie.response.status,le.data=ie.response.data,console.error("API error response:",ie.response.status,ie.response.data),ie.response.status===404?console.warn("Focus group not found - may have been deleted"):ie.response.status===500&&console.error("Server error during status check - backend issue")):ie.request?(le.errorType="network_error",console.error("Network error - no response received, check connectivity")):(le.errorType="request_setup",le.message=ie.message,console.error("Request setup error:",ie.message)),console.debug("Status check error details:",le),{aiActive:w,sessionStatus:re,isGenerating:!1}}},jt=async(ie,le)=>{if(!t||ke.current)return;const Te=["completed","paused"],He=["ai_mode","autonomous_active","active","in-progress"].includes(le),ft=Te.includes(ie);if(He&&ft){ke.current=!0;try{let et="session_ended";ie==="completed"?et="auto_complete":ie==="paused"&&(et="manual_stop");const St=await er.endSession(t,et);St!=null&&St.data&&(Fe.success("Session concluded",{description:"The focus group session has ended with a concluding statement from the moderator."}),setTimeout(()=>{ot()},1e3))}catch(et){console.error("❌ Error ending session with concluding statement:",et),Fe.error("Error ending session",{description:"Failed to add concluding statement, but the session has ended."})}}},ot=async()=>{var ie;if(t)try{const le=await pt.getMessages(t);console.log("🔍 [FetchMessages] Raw API response:",le==null?void 0:le.data);let Te=[],$e=[];le&&le.data&&(Array.isArray(le.data)?(Te=le.data,$e=[]):le.data.messages||le.data.mode_events?(Te=le.data.messages||[],$e=le.data.mode_events||[]):(Te=Array.isArray(le.data)?le.data:[],$e=[]));const He=Te.map(Ce=>({id:Ce._id||Ce.id||`msg-${Date.now()}`,senderId:Ce.senderId,text:Ce.text,timestamp:new Date(Ce.timestamp||Ce.created_at),type:Ce.type||"response",highlighted:Ce.highlighted||!1,visualAsset:Ce.visualAsset}));console.log("🔍 [FetchMessages] Formatted messages with visual assets:",He.filter(Ce=>Ce.visualAsset).map(Ce=>({id:Ce.id,senderId:Ce.senderId,hasVisualAsset:!!Ce.visualAsset,visualAsset:Ce.visualAsset})));const ft=$e.map(Ce=>({id:Ce._id||Ce.id||`event-${Date.now()}`,focus_group_id:Ce.focus_group_id,event_type:Ce.event_type,timestamp:new Date(Ce.timestamp||Ce.created_at),user_id:Ce.user_id,created_at:new Date(Ce.created_at)}));o(ft),He.length>0?i(Ce=>{if(Ce.length===0)return He;{const Qt=new Map;Ce.forEach(vn=>Qt.set(vn.id,vn));const Ct=He.map(vn=>{if(Qt.has(vn.id)){const An=Qt.get(vn.id);return{...vn,highlighted:An.highlighted}}return vn}),rn=new Set(Ct.map(vn=>vn.id)),Lt=Ce.filter(vn=>!rn.has(vn.id));return[...Ct,...Lt].sort((vn,An)=>vn.timestamp.getTime()-An.timestamp.getTime())}}):He.length===0&&i(Ce=>Ce.length===0?[]:Ce);const et=He.filter(Ce=>Ce.highlighted),St=et.length>0?et.map(Ce=>({id:`theme-${Ce.id}`,text:Ce.text.substring(0,40)+(Ce.text.length>40?"...":""),count:1,messages:[Ce.id],source:"highlight"})):[];try{const Ce=await er.getKeyThemes(t);if((ie=Ce==null?void 0:Ce.data)!=null&&ie.themes&&Array.isArray(Ce.data.themes)){const Qt=Ce.data.themes;l([...St,...Qt])}else l(St)}catch(Ce){console.error("Error fetching AI-generated themes:",Ce),l(St)}}catch(le){console.error("Error fetching messages:",le),r.length===0&&Fe.error("Failed to fetch messages",{description:"Please try again later or restart the session."})}},Ze=async()=>{if(!t)return!1;try{const le=(await Rr.getAll()).data||[],Te=await pt.getById(t);if(Te&&Te.data){const $e=Te.data;console.log("Focus group data from API:",$e);const He={id:$e._id||$e.id,name:$e.name,status:$e.status||"in-progress",participants:$e.participants||[],date:$e.date||new Date().toISOString(),duration:$e.duration||60,topic:$e.topic||"general",discussionGuide:$e.discussionGuide||"",llm_model:$e.llm_model||"gemini-2.5-pro"};if(d(He),X(He.llm_model||"gemini-2.5-pro"),J(He.reasoning_effort||"medium"),U(He.verbosity||"medium"),$e.participants_data&&Array.isArray($e.participants_data))h($e.participants_data.map(et=>({...et,id:et._id||et.id})));else if(He.participants&&Array.isArray(He.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:He.participants,allPersonas:le.map(St=>({id:St._id||St.id,name:St.name}))});const et=le.filter(St=>{const Ce=St._id||St.id;return He.participants.includes(Ce)});console.log("Matched participants:",et.map(St=>St.name)),h(et)}await ot(),await cr();const ft=await ct();return S(ft.aiActive),me(ft.sessionStatus),H.current=ft.aiActive,be.current=ft.sessionStatus,!0}return!1}catch(ie){return console.error("Error fetching focus group:",ie),!1}},gn=async(ie,le,Te)=>{if(console.log("🔧 updateFocusGroupModel called with:",{id:t,focusGroup:!!u,newModel:ie,reasoningEffort:le,verbosity:Te}),!t||!u){console.log("❌ updateFocusGroupModel: Missing id or focusGroup",{id:t,focusGroup:!!u});return}ue(!0);try{const $e={llm_model:ie};ie==="gpt-5"&&($e.reasoning_effort=le||Q,$e.verbosity=Te||ye),console.log("🔧 Making API call to update focus group model:",{id:t,updateData:$e});const He=await pt.update(t,$e);console.log("🔧 API response:",He),He&&He.data?(d(ft=>ft?{...ft,llm_model:ie,reasoning_effort:ie==="gpt-5"?le||Q:ft==null?void 0:ft.reasoning_effort,verbosity:ie==="gpt-5"?Te||ye:ft==null?void 0:ft.verbosity}:null),Fe.success("AI Model Updated",{description:`Focus group will now use ${ie==="gemini-2.5-pro"?"Gemini 2.5 Pro":ie==="gpt-4.1"?"GPT-4.1":ie==="gpt-5"?"GPT-5":ie} for AI responses`}),I(!1),console.log("✅ Model update successful")):console.log("❌ API response missing data:",He)}catch($e){console.error("❌ Error updating focus group model:",$e),Fe.error("Failed to update AI model",{description:"There was an error updating the AI model. Please try again."})}finally{ue(!1)}};v.useEffect(()=>{console.log("Looking for focus group with ID:",t);const ie=async()=>{try{return(await Rr.getAll()).data||[]}catch(He){return console.error("Error fetching personas:",He),[]}},le=async He=>{try{const ft=await pt.getById(t);if(ft&&ft.data){const et=ft.data;console.log("Focus group data from API:",et);const St={id:et._id||et.id,name:et.name,status:et.status||"in-progress",participants:et.participants||[],date:et.date||new Date().toISOString(),duration:et.duration||60,topic:et.topic||"general",discussionGuide:et.discussionGuide||"",llm_model:et.llm_model||"gemini-2.5-pro"};if(d(St),X(St.llm_model||"gemini-2.5-pro"),J(St.reasoning_effort||"medium"),U(St.verbosity||"medium"),et.participants_data&&Array.isArray(et.participants_data))h(et.participants_data.map(Ce=>({...Ce,id:Ce._id||Ce.id})));else if(St.participants&&Array.isArray(St.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:St.participants,allPersonas:He.map(Qt=>({id:Qt._id||Qt.id,name:Qt.name}))});const Ce=He.filter(Qt=>{const Ct=Qt._id||Qt.id;return St.participants.includes(Ct)});console.log("Matched participants:",Ce.map(Qt=>Qt.name)),h(Ce)}return ot(),cr(),_(!1),!0}return!1}catch(ft){return console.error("Error fetching focus group:",ft),!1}};let Te,$e;return ie().then(He=>{le(He).then(ft=>{ft?At&&(At.includes("unavailable")||At.includes("websocket error"))?(console.log("📡 WebSocket connection failed, falling back to polling"),(()=>{ot(),cr(),Te&&window.clearInterval(Te);const Ct=w?3e3:1e4;console.log("📡 Setting up message polling:",{aiModeActive:w,pollInterval:Ct,timestamp:new Date().toISOString()}),Te=window.setInterval(()=>{O.current?console.log("📡 Skipping poll - editing discussion guide"):(console.log("📡 Polling for messages...",new Date().toISOString()),ot(),cr())},Ct)})(),$e=window.setInterval(async()=>{const Ct=H.current,rn=be.current,Lt=await ct();if(H.current=Lt.aiActive,be.current=Lt.sessionStatus,S(Lt.aiActive),me(Lt.sessionStatus),rn&&rn!==Lt.sessionStatus&&await jt(Lt.sessionStatus,rn),Ct!==Lt.aiActive&&Te){window.clearInterval(Te);const si=Lt.aiActive?3e3:1e4;Te=window.setInterval(()=>{O.current||(ot(),cr())},si)}},15e3)):console.log("📡 WebSocket enabled, skipping polling setup"):(console.error("Focus group not found with ID:",t),_(!1),Fe.error("Focus group not found",{description:`Could not find focus group with ID: ${t}`}))})}),()=>{Te&&window.clearInterval(Te),$e&&window.clearInterval($e)}},[t,e,qe,At]);const Os=ie=>{if(!ie||!ie.sections||!Array.isArray(ie.sections))return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const le=ie.sections[0];if(!le)return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const Te=He=>He.questions&&Array.isArray(He.questions)&&He.questions.length>0?{content:He.questions[0].content,itemId:He.questions[0].id,type:"question"}:He.activities&&Array.isArray(He.activities)&&He.activities.length>0?{content:He.activities[0].content,itemId:He.activities[0].id,type:"activity"}:null;let $e=Te(le);if(!$e&&le.subsections&&Array.isArray(le.subsections)){for(const He of le.subsections)if($e=Te(He),$e)break}return $e?{content:$e.content,sectionId:le.id,itemId:$e.itemId}:{content:`Welcome to our focus group session on "${le.title||"our topic"}". Let's begin our discussion.`,sectionId:le.id,itemId:"section-intro"}},ea=async()=>{var ie,le,Te,$e,He;if(t)try{Fe.info("Starting focus group session...",{description:"The session is now ready for AI moderation."});try{const ft=await er.getModeratorStatus(t),et=(le=(ie=ft==null?void 0:ft.data)==null?void 0:ie.status)==null?void 0:le.moderator_position;et?console.log("📍 Preserving existing moderator position:",et):(await er.setModeratorPosition(t,((He=($e=(Te=u==null?void 0:u.discussionGuide)==null?void 0:Te.sections)==null?void 0:$e[0])==null?void 0:He.id)||"welcome"),console.log("🚀 Moderator position initialized to start of discussion guide (first time)"))}catch(ft){console.warn("Failed to check/initialize moderator position:",ft)}await pt.update(t,{status:"active"});try{const ft=Os(u==null?void 0:u.discussionGuide),et=await pt.sendMessage(t,{senderId:"moderator",text:ft.content,type:"question"});console.log("🚀 Initial moderator message created:",{content:ft.content,sectionId:ft.sectionId,itemId:ft.itemId})}catch(ft){console.warn("Failed to create initial moderator message:",ft)}Fe.success("Focus group session started",{description:"The discussion has begun. Use the control panel below to moderate."})}catch(ft){console.error("Error starting session:",ft),Fe.error("Error starting session",{description:"There was a problem connecting to the server."})}},ta=ie=>{i(le=>le.find($e=>$e.id===ie.id)?(console.log("🔧 [handleNewMessage] Message already exists, skipping:",ie.id),le):(console.log("🔧 [handleNewMessage] Adding new message:",ie.id),[...le,ie]))},yl=async ie=>{const le=[...r],Te=le.findIndex($e=>$e.id===ie);if(Te!==-1){const $e=le[Te],He=!$e.highlighted;if(le[Te]={...$e,highlighted:He},i(le),t)try{!ie.startsWith("local-")&&!ie.startsWith("msg-")?await pt.updateMessageHighlight(t,ie,He):console.log("Skipping database update for local message:",ie)}catch(ft){console.error("Error updating message highlight state:",ft),Fe.error("Failed to save highlight state",{description:"The highlight may not persist if the page is refreshed."})}}},q=ie=>f.find(le=>le.id===ie||le._id===ie),Oe=()=>{const ie=r.map($e=>{var et;let He;return $e.senderId==="moderator"?He="AI Moderator":$e.senderId==="facilitator"?He="Human Facilitator":He=((et=q($e.senderId))==null?void 0:et.name)||"Unknown",`[${$e.timestamp.toLocaleTimeString()}] ${He}: ${$e.text}`}).join(` + +`),le=document.createElement("a"),Te=new Blob([ie],{type:"text/plain"});le.href=URL.createObjectURL(Te),le.download=`focus-group-${t}-transcript.txt`,document.body.appendChild(le),le.click(),document.body.removeChild(le),Fe.success("Transcript downloaded",{description:"The focus group transcript has been saved to your device."})},Ge=(ie,le)=>{const Te=Ct=>{const rn=Ct.match(/^\[([^\]]+)\]:\s*(.*)$/);return rn?rn[2].trim():Ct.trim()},$e=Ct=>Ct.toLowerCase().replace(/[^\w\s]/g," ").replace(/\s+/g," ").trim(),He=(Ct,rn)=>{const Lt=$e(Ct),si=$e(rn);if(Lt===si)return 1;if(Lt.includes(si)||si.includes(Lt))return Math.min(Lt.length,si.length)/Math.max(Lt.length,si.length);const vn=Lt.split(" "),An=si.split(" "),Ug=vn.filter(ak=>An.includes(ak)&&ak.length>2);return vn.length===0||An.length===0?0:Ug.length/Math.max(vn.length,An.length)},ft=typeof ie=="object"&&ie!==null,et=ft?ie.text:Te(ie),St=ft?ie.original:ie;let Ce=null,Qt="";if(le&&(Ce=r.find(Ct=>Ct.id===le),Ce?Qt="direct_message_id_match":console.warn(`Message ID ${le} not found in current messages array`)),Ce||(Ce=r.find(Ct=>Ct.text.includes(St)),Ce&&(Qt="exact_full_match")),Ce||(Ce=r.find(Ct=>Ct.text.includes(et)),Ce&&(Qt="exact_text_match")),Ce||(Ce=r.find(Ct=>et.includes(Ct.text.trim())),Ce&&(Qt="reverse_exact_match")),!Ce){const Ct=et.toLowerCase();Ce=r.find(rn=>rn.text.toLowerCase().includes(Ct)||Ct.includes(rn.text.toLowerCase())),Ce&&(Qt="case_insensitive_match")}if(!Ce){const Ct=r.map(rn=>({message:rn,similarity:He(et,rn.text)})).filter(rn=>rn.similarity>.7).sort((rn,Lt)=>Lt.similarity-rn.similarity);Ct.length>0&&(Ce=Ct[0].message,Qt=`fuzzy_match_${Math.round(Ct[0].similarity*100)}%`)}if(!Ce){const rn=$e(et).split(" ").filter(Lt=>Lt.length>3);rn.length>0&&(Ce=r.find(Lt=>{const si=$e(Lt.text);return rn.every(vn=>si.includes(vn))}),Ce&&(Qt="partial_word_match"))}Ce?(console.log(`Quote match found using strategy: ${Qt}`,{quoteType:ft?"QuoteData":"string",providedMessageId:le,extractedText:et,matchedMessage:Ce.text.substring(0,100),matchedMessageId:Ce.id,originalQuote:St.substring(0,100)}),g("chat"),setTimeout(()=>{const Ct=document.getElementById(`message-${Ce.id}`);Ct&&(P||Ct.scrollIntoView({behavior:"smooth",block:"center"}),Ct.style.backgroundColor="#fbbf24",Ct.style.transition="background-color 0.3s ease",setTimeout(()=>{Ct.style.backgroundColor=""},2e3))},100)):(console.warn("Quote match failed",{quoteType:ft?"QuoteData":"string",providedMessageId:le,originalQuote:St.substring(0,100),extractedText:et.substring(0,100),totalMessages:r.length,messageSample:r.slice(0,3).map(Ct=>({id:Ct.id,text:Ct.text.substring(0,50)}))}),Fe.warning("Message not found",{description:"Could not locate the original message for this quote. The quote may have been paraphrased by the AI."}))},mt=ie=>{l(le=>{const Te=new Set(le.map(He=>He.id)),$e=ie.filter(He=>!Te.has(He.id));return[...le,...$e]})},tt=async ie=>{if(!t)return;const le=c.find(Te=>Te.id===ie);if(le)try{"source"in le&&le.source==="generated"&&await er.deleteKeyTheme(t,ie),l(c.filter(Te=>Te.id!==ie))}catch(Te){console.error("Error deleting theme:",Te),Fe.error("Failed to delete theme",{description:"There was an error removing the theme. Please try again."})}},wt=v.useCallback(async(ie,le)=>{if(t)try{await er.setModeratorPosition(t,ie,le),Fe.success("Moderator position updated",{description:"The moderator has been moved to the selected section."})}catch(Te){console.error("Error setting moderator position:",Te),Fe.error("Failed to update moderator position",{description:"There was an error updating the moderator position."})}},[t]),dn=v.useCallback(async ie=>{if(console.log("💾 handleDiscussionGuideSave called:",{hasId:!!t,isEditingGuideContent:E,timestamp:new Date().toISOString()}),!!t)try{await pt.update(t,{discussionGuide:ie}),E?(M.current&&(M.current={...M.current,discussionGuide:ie}),console.log("⚠️ Skipping focus group state update during editing to preserve focus")):(console.log("🔄 Updating focus group state (not editing)"),d(le=>le?{...le,discussionGuide:ie}:null))}catch(le){throw console.error("Error saving discussion guide:",le),le}},[t,E]),dt=v.useCallback(ie=>{console.log("🔄 handleGuideEditingStateChange called:",{editing:ie,timestamp:new Date().toISOString(),currentIsEditingGuideContent:E}),k(ie),R(ie),!ie&&M.current&&(console.log("📝 Updating focus group state after editing ended"),d(M.current))},[E]),_n=v.useCallback(()=>{j(ie=>!ie)},[]),on=v.useCallback((ie,le,Te,$e,He,ft,et)=>{Z({isOpen:!0,sectionId:ie,itemId:le,content:Te,sectionTitle:$e,itemTitle:He,itemType:ft,metadata:et})},[]),nn=()=>{if(m)return{sectionId:m.current_section_id,sectionTitle:m.current_section,itemId:m.current_item_id,itemTitle:m.current_item}},lr=()=>{if(r.length!==0)return r[r.length-1].id},z=()=>{const ie=lr();if(ie&&r.length>0){const le=r.find(Te=>Te.id===ie);if(le)return le.timestamp}return u!=null&&u.date?new Date(u.date):te||new Date},he=async()=>{if(t){Ue(!0),Be(!1),N(!1),Fe.info("Analyzing discussion for key themes...",{description:"This may take a moment as we process the entire conversation."});try{const ie=await er.generateKeyThemes(t);ie.data&&ie.data.themes?(Be(!0),Fe.success(`Generated ${ie.data.themes.length} key themes`,{description:"New themes have been added to the analysis."}),l(le=>[...le,...ie.data.themes])):(Be(!0),Fe.warning("No new themes were generated",{description:"Try again when the discussion has more content."}))}catch(ie){console.error("Error generating key themes:",ie),N(!0),Fe.error("Failed to generate key themes",{description:"There was an error analyzing the discussion. Please try again."})}}},fe=()=>{Ue(!1),Be(!1),N(!1)},De=()=>{te||pe(new Date),ce(!0)},Nt=ie=>{L(le=>[...le,ie].sort((Te,$e)=>$e.createdAt.getTime()-Te.createdAt.getTime())),window.notesPanelAddNote&&window.notesPanelAddNote(ie)},an=ie=>{const le=r.find(Te=>Te.id===ie);le?(g("chat"),setTimeout(()=>{const Te=document.getElementById(`message-${le.id}`);Te&&(P||Te.scrollIntoView({behavior:"smooth",block:"center"}),Te.style.backgroundColor="#fbbf24",Te.style.transition="background-color 0.3s ease",setTimeout(()=>{Te.style.backgroundColor=""},2e3))},100)):Fe.info("Message not found",{description:"Could not locate the original message for this note."})};v.useEffect(()=>{r.length>0&&!te&&pe(new Date)},[r.length,te]),v.useEffect(()=>{O.current=P,P||cr()},[P]);const Ci=ie=>{Y(le=>le.includes(ie)?le.filter(Te=>Te!==ie):[...le,ie])};return C?a.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[a.jsx(_a,{}),a.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[a.jsx("div",{className:"flex justify-center items-center",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),a.jsx("p",{className:"mt-4 text-slate-600",children:"Loading focus group..."})]})]}):u?a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(_a,{}),$&&a.jsx("div",{className:`w-full transition-all duration-300 ${st?"bg-green-500":We?"bg-yellow-500":"bg-red-500"}`,children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between py-2 text-white text-sm font-medium",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${st?"bg-white animate-pulse":We?"bg-white animate-spin":"bg-white"}`}),a.jsx("span",{children:st?"Real-time updates active - Changes appear instantly":We?"Connecting to real-time updates...":"Real-time updates unavailable - Using periodic refresh"}),At&&a.jsx("span",{className:"text-xs opacity-75 ml-2",title:At,children:"(Connection error)"})]}),a.jsx("button",{onClick:()=>B(!1),className:"ml-4 text-white hover:text-gray-200 transition-colors",title:"Hide status bar","aria-label":"Hide connection status",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}),!$&&a.jsx("div",{className:"fixed top-20 right-4 z-40",children:a.jsx("button",{onClick:()=>B(!0),className:`px-3 py-1 rounded-full text-white text-xs font-medium shadow-lg transition-all duration-200 hover:shadow-xl ${st?"bg-green-500 hover:bg-green-600":We?"bg-yellow-500 hover:bg-yellow-600":"bg-red-500 hover:bg-red-600"}`,title:st?"WebSocket connected - Show status bar":We?"WebSocket connecting - Show status bar":"WebSocket disconnected - Show status bar",children:a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:`w-2 h-2 rounded-full bg-white ${st?"animate-pulse":""}`}),a.jsx("span",{children:st?"Live":We?"Connecting":"Offline"})]})})}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(ee,{variant:"ghost",onClick:()=>e("/focus-groups"),className:"mr-2",children:a.jsx(Gp,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-2xl font-bold text-slate-900",children:u.name}),a.jsx("p",{className:"text-slate-600",children:new Date(u.date).toLocaleString()}),a.jsxs("div",{className:"flex items-center mt-1",children:[a.jsx(va,{className:"h-3 w-3 text-slate-500 mr-1"}),a.jsx(Hn,{variant:"secondary",className:"text-xs",children:u.llm_model==="gpt-4.1"?"GPT-4.1":u.llm_model==="gpt-5"?"GPT-5":"Gemini 2.5 Pro"})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4 mt-4 sm:mt-0",children:[a.jsxs(ee,{variant:"outline",onClick:()=>x(!b),className:b?"bg-blue-50 text-blue-600":"",children:[a.jsx(U_,{className:"mr-2 h-4 w-4"}),"AI Dashboard"]}),a.jsxs(ee,{variant:"outline",onClick:()=>I(!0),children:[a.jsx(LE,{className:"mr-2 h-4 w-4"}),"AI Model"]}),a.jsxs(ee,{variant:"outline",onClick:Oe,children:[a.jsx(Xc,{className:"mr-2 h-4 w-4"}),"Download Transcript"]})]})]}),nt&&a.jsx("div",{className:"mb-6",children:a.jsx(zT,{isActive:nt,isComplete:at,hasError:Bt,label:"Analyzing discussion for key themes",onComplete:fe,className:"max-w-4xl mx-auto"})}),a.jsx(k$e,{discussionGuide:u.discussionGuide,moderatorStatus:m,onSectionSelect:wt,onSetPosition:on,onSave:dn,focusGroupId:t||"",isOpen:A,onToggle:_n,onEditingChange:dt}),a.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 h-[calc(100vh-12rem)]",children:[a.jsx(dde,{participants:f,selectedParticipantIds:we,onToggleParticipantFilter:Ci}),a.jsx("div",{className:"flex-1 flex flex-col",children:a.jsxs(fl,{defaultValue:"chat",value:p,onValueChange:g,className:"w-full h-full flex flex-col",children:[a.jsxs(Va,{className:"grid grid-cols-4 mb-4",children:[a.jsxs(pn,{value:"chat",className:"flex items-center",children:[a.jsx(jo,{className:"h-4 w-4 mr-2"}),"Discussion"]}),a.jsxs(pn,{value:"themes",className:"flex items-center",children:[a.jsx(du,{className:"h-4 w-4 mr-2"}),"Key Themes"]}),a.jsxs(pn,{value:"notes",className:"flex items-center",children:[a.jsx(Wy,{className:"h-4 w-4 mr-2"}),"Notes"]}),a.jsxs(pn,{value:"analytics",className:"flex items-center",children:[a.jsx(U_,{className:"h-4 w-4 mr-2"}),"Analytics"]})]}),a.jsx(mn,{value:"chat",className:"m-0 flex-1 flex flex-col h-0",children:r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[a.jsx("p",{className:"text-lg text-slate-600",children:"No messages yet. Start the session to begin the discussion."}),a.jsxs(ee,{onClick:ea,size:"lg",className:"flex items-center gap-2",children:[a.jsx(l5,{className:"h-5 w-5"}),"Start Session"]})]}):a.jsx(Ude,{messages:r,modeEvents:s,personas:f,isSpeaking:!1,focusGroupId:t||"",isAiModeActive:w,selectedParticipantIds:we,onToggleHighlight:yl,onAdvanceDiscussion:()=>null,onNewMessage:ta,onStatusChange:Ze,isEditingDiscussionGuide:P})}),a.jsx(mn,{value:"themes",className:"m-0",children:a.jsx(Hde,{themes:c,messages:r,personas:f,focusGroupId:t||"",onThemesGenerated:mt,onThemeDelete:tt,onQuoteClick:Ge,onGenerateKeyThemes:he})}),a.jsx(mn,{value:"notes",className:"m-0",style:{height:"calc(100% - 3.5rem)"},children:a.jsx("div",{className:"h-full",children:a.jsx(O$e,{focusGroupId:t||"",focusGroupName:u==null?void 0:u.name,onNoteClick:an})})}),a.jsx(mn,{value:"analytics",className:"m-0",children:a.jsx(E$e,{messages:r,themes:c,personas:f})})]})})]})]}),r.length>0&&a.jsx("div",{className:"fixed bottom-6 right-6 z-40",children:a.jsx(ee,{onClick:De,className:"rounded-full h-12 w-12 p-0 shadow-lg",title:"Take a quick note",children:a.jsx(Wy,{className:"h-5 w-5"})})}),a.jsx(I$e,{isOpen:F,onClose:()=>ce(!1),focusGroupId:t||"",associatedMessageId:lr(),sectionInfo:nn(),messageTimestamp:z(),onNoteSaved:Nt}),a.jsx(Jl,{open:K.isOpen,onOpenChange:ie=>Z(le=>({...le,isOpen:ie})),children:a.jsxs($c,{children:[a.jsxs(Lc,{children:[a.jsx(Uc,{children:"Set Moderator Position"}),a.jsxs(Zl,{children:['Are you sure you want to set the moderator position to "',K.itemTitle,'" in section "',K.sectionTitle,'"? This will make the moderator ask this question in the chat.']})]}),a.jsxs(Fc,{children:[a.jsx(ee,{variant:"outline",disabled:K.isLoading,onClick:()=>Z({isOpen:!1}),children:"Cancel"}),a.jsxs(ee,{disabled:K.isLoading,onClick:async()=>{var ie,le,Te,$e,He,ft,et,St,Ce;if(!(!t||!K.sectionId||!K.itemId||!K.content)){Z(Qt=>({...Qt,isLoading:!0}));try{await er.setModeratorPosition(t,K.sectionId,K.itemId);let Qt=[],Ct=!1,rn=K.content;const Lt=(ie=K.metadata)==null?void 0:ie.visual_asset,si=!!(Lt!=null&&Lt.filename),vn=Lt==null?void 0:Lt.filename;if(console.log("🔍 MANUAL POSITION DEBUG:",{itemType:K.itemType,hasImageAttached:si,visualAsset:Lt,assetFilename:vn,content:K.content,sectionTitle:K.sectionTitle,itemTitle:K.itemTitle,contentLength:(le=K.content)==null?void 0:le.length}),si&&K.content&&vn)if(console.log("🔍 VISUAL ASSET DEBUG:",{originalContent:K.content,visualAsset:Lt,displayReference:Lt==null?void 0:Lt.display_reference,filename:vn,contentLength:K.content.length}),vn){Qt=[vn],Ct=!0,console.log("🎨 MANUAL POSITION: Creative review detected, will activate visual context for:",vn);try{console.log("🎨 MANUAL MODE: Requesting AI description for",vn);const An=await pt.describeAsset(t,vn);if(An.data.description){const Ug=(Lt==null?void 0:Lt.display_reference)||"the asset";rn=K.content.replace(Ug,`${Ug} - ${An.data.description}`),console.log("✅ MANUAL MODE: Enhanced question with AI description"),console.log("🔍 Original:",K.content),console.log("🔍 Enhanced:",rn)}}catch(An){console.error("⚠️ MANUAL MODE: Failed to generate AI description:",An),console.error("⚠️ Error response data:",(Te=An.response)==null?void 0:Te.data),console.error("⚠️ Error status:",($e=An.response)==null?void 0:$e.status),console.error("⚠️ Error headers:",(He=An.response)==null?void 0:He.headers),console.error("⚠️ Full axios error:",{message:An.message,code:An.code,status:(ft=An.response)==null?void 0:ft.status,statusText:(et=An.response)==null?void 0:et.statusText,url:(St=An.config)==null?void 0:St.url,method:(Ce=An.config)==null?void 0:Ce.method}),Fe.warning("AI description failed",{description:"Using original question text. Image will still be available to participants."})}}else console.warn("⚠️ MANUAL POSITION: Creative review detected but no asset filename extracted from content");console.log("📤 Sending moderator message to API:",{text:rn,attachedAssets:Qt,activatesVisualContext:Ct});try{const An=await pt.sendMessage(t,{senderId:"moderator",text:rn,type:"question",attached_assets:Qt,activates_visual_context:Ct,visualAsset:si&&Lt?{filename:vn,displayReference:Lt.display_reference}:void 0});console.log("✅ Message API call successful:",An==null?void 0:An.data)}catch(An){console.error("❌ Failed to save message to API:",An),Fe.warning("Message not saved",{description:"Failed to save the moderator message to the server."})}Z({isOpen:!1}),console.log("✅ Set position complete, moderator message added to UI"),Fe.success("Moderator position set",{description:`Position set to "${K.itemTitle}" in "${K.sectionTitle}"`})}catch(Qt){console.error("Error setting moderator position:",Qt),Z(Ct=>({...Ct,isLoading:!1})),Fe.error("Failed to set moderator position",{description:"There was an error setting the moderator position."})}}},className:"flex items-center gap-2",children:[K.isLoading&&a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),K.isLoading?"Generating detailed image description...":"Confirm"]})]})]})}),a.jsx(Jl,{open:V,onOpenChange:I,children:a.jsxs($c,{children:[a.jsxs(Lc,{children:[a.jsx(Uc,{children:"AI Model Settings"}),a.jsx(Zl,{children:"Choose which AI model to use for generating responses and discussion guides in this focus group."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(va,{className:"h-4 w-4 text-slate-500"}),a.jsx("span",{className:"text-sm font-medium",children:"Current Model:"}),a.jsx(Hn,{variant:"secondary",children:(u==null?void 0:u.llm_model)==="gpt-4.1"?"GPT-4.1":(u==null?void 0:u.llm_model)==="gpt-5"?"GPT-5":"Gemini 2.5 Pro"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Select AI Model:"}),a.jsxs(Un,{value:D,onValueChange:ie=>{console.log("🔧 Model selection changed:",{from:D,to:ie}),X(ie)},children:[a.jsx(Dn,{className:"mt-1",children:a.jsx(Bn,{placeholder:"Select AI model"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),a.jsx(ae,{value:"gpt-4.1",children:"GPT-4.1"}),a.jsx(ae,{value:"gpt-5",children:"GPT-5"})]})]})]}),D==="gpt-5"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Reasoning Effort:"}),a.jsxs(Un,{value:Q,onValueChange:J,children:[a.jsx(Dn,{className:"mt-1",children:a.jsx(Bn,{placeholder:"Select reasoning effort"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"minimal",children:"Minimal - Fast responses"}),a.jsx(ae,{value:"low",children:"Low - Quick thinking"}),a.jsx(ae,{value:"medium",children:"Medium - Balanced (default)"}),a.jsx(ae,{value:"high",children:"High - Deep reasoning"})]})]}),a.jsx("p",{className:"text-xs text-slate-600 mt-1",children:"Controls how much time GPT-5 spends thinking before responding"}),a.jsx("p",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how thoroughly GPT-5 thinks and how detailed responses are"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Response Verbosity:"}),a.jsxs(Un,{value:ye,onValueChange:U,children:[a.jsx(Dn,{className:"mt-1",children:a.jsx(Bn,{placeholder:"Select verbosity level"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"low",children:"Low - Concise responses"}),a.jsx(ae,{value:"medium",children:"Medium - Balanced length (default)"}),a.jsx(ae,{value:"high",children:"High - Detailed responses"})]})]}),a.jsx("p",{className:"text-xs text-slate-600 mt-1",children:"Controls how detailed and lengthy GPT-5's responses will be"}),a.jsx("p",{className:"text-xs text-amber-600 font-medium mt-1",children:"Controls how thoroughly GPT-5 thinks and how detailed responses are"})]})]}),a.jsxs("div",{className:"text-xs text-slate-600",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Gemini 2.5 Pro:"})," Google's advanced model, great for creative and analytical tasks."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"GPT-4.1:"})," OpenAI's latest model, excellent for conversational and reasoning tasks."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"GPT-5:"})," OpenAI's newest model with advanced reasoning and customizable response styles."]})]})]}),a.jsxs(Fc,{children:[a.jsx(ee,{variant:"outline",onClick:()=>I(!1),disabled:ne,children:"Cancel"}),a.jsxs(ee,{onClick:()=>{console.log("🔧 Update button clicked:",{selectedModel:D,selectedReasoningEffort:Q,selectedVerbosity:ye,currentModel:u==null?void 0:u.llm_model,isDisabled:ne||D===(u==null?void 0:u.llm_model)&&(D!=="gpt-5"||Q===(u==null?void 0:u.reasoning_effort)&&ye===(u==null?void 0:u.verbosity))}),gn(D,Q,ye)},disabled:ne||D===(u==null?void 0:u.llm_model)&&(D!=="gpt-5"||Q===((u==null?void 0:u.reasoning_effort)||"medium")&&ye===((u==null?void 0:u.verbosity)||"medium")),children:[ne&&a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),ne?"Updating...":"Update Model"]})]})]})}),a.jsx(P$e,{focusGroupId:t,personas:f,isVisible:b,onToggle:()=>x(!b)})]}):a.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[a.jsx(_a,{}),a.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Focus group not found"}),a.jsx("p",{className:"mt-2 text-slate-600",children:"We couldn't find the focus group you're looking for."}),a.jsxs(ee,{onClick:()=>e("/focus-groups"),className:"mt-4",children:[a.jsx(Gp,{className:"mr-2 h-4 w-4"})," Back to Focus Groups"]})]})]})},OLe=({title:t,description:e})=>a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:t}),a.jsx("p",{className:"text-slate-600 mt-1",children:e})]}),a.jsxs("div",{className:"mt-4 sm:mt-0 flex gap-2",children:[a.jsx(ee,{variant:"outline",children:"Export Data"}),a.jsx(ee,{children:"Generate Report"})]})]}),IC=({title:t,value:e,changePercentage:n,icon:r})=>a.jsx(ut,{className:"p-6 hover:shadow-md transition-shadow",children:a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:t}),a.jsx("h3",{className:"text-2xl font-bold mt-1",children:e}),a.jsxs("p",{className:`${n>=0?"text-green-500":"text-red-500"} text-xs mt-1`,children:[n>=0?"↑":"↓"," ",Math.abs(n),"% from last month"]})]}),a.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:a.jsx(r,{className:"h-6 w-6 text-primary"})})]})}),ILe=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],RLe=[{id:"1",title:"User Interface Feedback",description:"Users consistently mentioned difficulty with the navigation menu on mobile devices.",source:"Mobile App Focus Group",date:"2023-06-12",sentiment:"negative"},{id:"2",title:"Feature Adoption",description:'The new search functionality is well-received, with 85% of users rating it as "very useful".',source:"Product Testing Group",date:"2023-06-10",sentiment:"positive"},{id:"3",title:"Pricing Strategy",description:"Price-conscious users expressed willingness to pay up to 20% more for premium features.",source:"Pricing Model Analysis",date:"2023-06-08",sentiment:"positive"},{id:"4",title:"Competitive Analysis",description:"Users who switched from competitor products cited our streamlined onboarding as a key factor.",source:"Customer Journey Mapping",date:"2023-06-05",sentiment:"positive"}],MLe=()=>a.jsxs("div",{className:"space-y-6",children:[a.jsxs(ut,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Research Activity"}),a.jsx("div",{className:"h-64",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(xW,{data:ILe,margin:{top:10,right:30,left:0,bottom:0},children:[a.jsx(ng,{strokeDasharray:"3 3"}),a.jsx(il,{dataKey:"name"}),a.jsx(sl,{}),a.jsx(Zr,{}),a.jsx(ro,{type:"monotone",dataKey:"users",stackId:"1",stroke:"#8884d8",fill:"#8884d8",name:"Synthetic Users"}),a.jsx(ro,{type:"monotone",dataKey:"groups",stackId:"2",stroke:"#82ca9d",fill:"#82ca9d",name:"Focus Groups"}),a.jsx(ro,{type:"monotone",dataKey:"interactions",stackId:"3",stroke:"#ffc658",fill:"#ffc658",name:"Interactions"})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs(ut,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Recent AI Insights"}),a.jsxs("div",{className:"space-y-4",children:[RLe.slice(0,3).map(t=>a.jsx("div",{className:"border-b pb-4 last:border-b-0 last:pb-0",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:`p-2 rounded-full mr-3 ${t.sentiment==="positive"?"bg-green-100":t.sentiment==="negative"?"bg-red-100":"bg-slate-100"}`,children:a.jsx(lu,{className:`h-4 w-4 ${t.sentiment==="positive"?"text-green-600":t.sentiment==="negative"?"text-red-600":"text-slate-600"}`})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:t.title}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.description}),a.jsxs("div",{className:"flex items-center text-xs text-muted-foreground mt-2",children:[a.jsx("span",{children:t.source}),a.jsx("span",{className:"mx-2",children:"•"}),a.jsx("span",{children:t.date})]})]})]})},t.id)),a.jsx(ee,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"View All Insights"})]})]}),a.jsxs(ut,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Upcoming Research Tasks"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-blue-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Website Redesign Feedback"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus group scheduled for Jun 20"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-purple-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Mobile App User Testing"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"8 participants needed by Jun 25"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-amber-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-amber-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Pricing Strategy Evaluation"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Create discussion guide by Jun 22"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"bg-green-100 p-2 rounded-full mr-3",children:a.jsx(uv,{className:"h-4 w-4 text-green-600"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium",children:"Product Onboarding Flow"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Results analysis due Jun 30"})]})]}),a.jsx(ee,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"Manage Research Calendar"})]})]})]})]}),DLe=[{name:"18-24",value:15},{name:"25-34",value:35},{name:"35-44",value:25},{name:"45-54",value:15},{name:"55+",value:10}],$Le=()=>a.jsxs(ut,{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Synthetic Persona Analytics"}),a.jsx(ee,{variant:"outline",size:"sm",children:"View Demographics"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Demographics"}),a.jsx("div",{className:"h-60",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(tk,{children:[a.jsx(Zr,{}),a.jsx(vo,{data:DLe,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,fill:"#FFDEE2",label:!0})]})})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Distribution"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Age: 25-34"}),a.jsx("span",{children:"35%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-400 rounded-full",style:{width:"35%"}})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Tech Savvy"}),a.jsx("span",{children:"72%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-300 rounded-full",style:{width:"72%"}})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Brand Loyal"}),a.jsx("span",{children:"58%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-500 rounded-full",style:{width:"58%"}})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Price Sensitive"}),a.jsx("span",{children:"67%"})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-pink-200 rounded-full",style:{width:"67%"}})})]})]})]})]}),a.jsx("div",{className:"flex justify-center mt-6",children:a.jsx(ee,{onClick:()=>window.location.href="/synthetic-users",children:"Manage Synthetic Personas"})})]}),LLe=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],$$=[{name:"Very Positive",value:25,color:"#4ade80"},{name:"Positive",value:40,color:"#a3e635"},{name:"Neutral",value:20,color:"#93c5fd"},{name:"Negative",value:10,color:"#fb923c"},{name:"Very Negative",value:5,color:"#f87171"}],FLe=[{name:"Navigation",count:42},{name:"Performance",count:28},{name:"UX Design",count:36},{name:"Features",count:22},{name:"Onboarding",count:18}],ULe=()=>{const t=ar();return a.jsxs(ut,{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Focus Group Insights"}),a.jsx(ee,{variant:"outline",size:"sm",onClick:()=>t("/focus-groups"),children:"View All Sessions"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Session Analytics"}),a.jsx("div",{className:"h-60",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(xW,{data:LLe,margin:{top:10,right:30,left:0,bottom:0},children:[a.jsx(ng,{strokeDasharray:"3 3"}),a.jsx(il,{dataKey:"name"}),a.jsx(sl,{}),a.jsx(Zr,{}),a.jsx(ro,{type:"monotone",dataKey:"interactions",stroke:"#8884d8",fill:"#8884d8",name:"User Interactions"})]})})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Feedback Sentiment"}),a.jsx("div",{className:"h-60",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(tk,{children:[a.jsx(Zr,{}),a.jsx(vo,{data:$$,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:e,percent:n})=>`${e} ${(n*100).toFixed(0)}%`,children:$$.map((e,n)=>a.jsx(Ig,{fill:e.color},`cell-${n}`))}),a.jsx(ja,{})]})})})]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Topic Frequency Analysis"}),a.jsx("div",{className:"h-60",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(yW,{data:FLe,margin:{top:5,right:30,left:20,bottom:5},children:[a.jsx(ng,{strokeDasharray:"3 3"}),a.jsx(il,{dataKey:"name"}),a.jsx(sl,{}),a.jsx(Zr,{}),a.jsx(ja,{}),a.jsx(vl,{dataKey:"count",name:"Mentions",fill:"#8884d8"})]})})})]}),a.jsx("div",{className:"flex justify-center",children:a.jsx(ee,{onClick:()=>t("/focus-groups"),children:"Manage Focus Groups"})})]})},BLe=()=>{const[t,e]=v.useState("overview");return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(_a,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsx(OLe,{title:"Dashboard",description:"Monitor and analyze your research insights"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[a.jsx(IC,{title:"Total Synthetic Users",value:48,changePercentage:12,icon:Dr}),a.jsx(IC,{title:"Active Focus Groups",value:7,changePercentage:5,icon:Vo}),a.jsx(IC,{title:"Research Insights",value:124,changePercentage:18,icon:du})]}),a.jsxs(fl,{value:t,onValueChange:e,className:"glass-panel rounded-xl p-6",children:[a.jsxs(Va,{className:"grid w-full grid-cols-3 mb-6",children:[a.jsx(pn,{value:"overview",children:"Overview"}),a.jsx(pn,{value:"users",children:"Synthetic Users"}),a.jsx(pn,{value:"focus-groups",children:"Focus Groups"})]}),a.jsx(mn,{value:"overview",children:a.jsx(MLe,{})}),a.jsx(mn,{value:"users",children:a.jsx($Le,{})}),a.jsx(mn,{value:"focus-groups",children:a.jsx(ULe,{})})]})]})]})},DW=v.forwardRef(({...t},e)=>a.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));DW.displayName="Breadcrumb";const $W=v.forwardRef(({className:t,...e},n)=>a.jsx("ol",{ref:n,className:Pe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));$W.displayName="BreadcrumbList";const py=v.forwardRef(({className:t,...e},n)=>a.jsx("li",{ref:n,className:Pe("inline-flex items-center gap-1.5",t),...e}));py.displayName="BreadcrumbItem";const mj=v.forwardRef(({asChild:t,className:e,...n},r)=>{const i=t?Ho:"a";return a.jsx(i,{ref:r,className:Pe("transition-colors hover:text-foreground",e),...n})});mj.displayName="BreadcrumbLink";const LW=v.forwardRef(({className:t,...e},n)=>a.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Pe("font-normal text-foreground",t),...e}));LW.displayName="BreadcrumbPage";const gj=({children:t,className:e,...n})=>a.jsx("li",{role:"presentation","aria-hidden":"true",className:Pe("[&>svg]:size-3.5",e),...n,children:t??a.jsx(us,{})});gj.displayName="BreadcrumbSeparator";function HLe({persona:t}){const e=t.id==="0",n=t.id==="1";return a.jsxs(ut,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"h-16 w-16 rounded-full bg-muted flex items-center justify-center",children:a.jsx("img",{src:_g(t),alt:t.name,className:"h-16 w-16 rounded-full object-cover"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-sf text-xl font-semibold",children:t.name}),a.jsx("p",{className:"text-muted-foreground",children:t.occupation})]})]}),a.jsxs("div",{className:"mt-6 space-y-4",children:[a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Dr,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Demographics"}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[t.age," ",t.gender?a.jsxs(a.Fragment,{children:["• ",t.gender]}):null,t.ethnicity?a.jsxs(a.Fragment,{children:[" • ",t.ethnicity]}):null]}),t.education&&a.jsx("p",{className:"sidebar-sub-item",children:t.education}),t.socialGrade&&a.jsxs("p",{className:"sidebar-sub-item",children:["Social Grade: ",t.socialGrade]}),t.householdIncome&&a.jsxs("p",{className:"sidebar-sub-item",children:["Household Income: ",t.householdIncome]}),t.householdComposition&&a.jsxs("p",{className:"sidebar-sub-item",children:["Household: ",t.householdComposition]})]})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(nZ,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Location"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.location}),t.livingSituation&&a.jsx("p",{className:"sidebar-sub-item",children:t.livingSituation})]})]}),t.interests&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(H_,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Interests"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.interests})]})]}),t.mediaConsumption&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(IS,{className:"sidebar-icon"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-sm",children:"Media"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.mediaConsumption})]})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-sm mb-3",children:"Digital Behavior"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Tech Savviness"}),a.jsxs("span",{children:[t.techSavviness,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${t.techSavviness}%`}})})]}),t.brandLoyalty!==void 0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Brand Loyalty"}),a.jsxs("span",{children:[t.brandLoyalty,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${t.brandLoyalty}%`}})})]}),t.priceConsciousness!==void 0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Price Sensitivity"}),a.jsxs("span",{children:[t.priceConsciousness,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${t.priceConsciousness}%`}})})]}),t.environmentalConcern!==void 0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:"Environmental Concern"}),a.jsxs("span",{children:[t.environmentalConcern,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${t.environmentalConcern}%`}})})]}),t.deviceUsage&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-medium mt-3",children:"Device Usage"}),a.jsx("p",{className:"sidebar-sub-item text-xs",children:t.deviceUsage})]}),t.shoppingHabits&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-medium mt-3",children:"Shopping Habits"}),a.jsx("p",{className:"sidebar-sub-item text-xs",children:t.shoppingHabits})]})]})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-sm mb-3",children:"Additional Information"}),a.jsxs("div",{className:"space-y-2",children:[t.brandPreferences&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(H_,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:t.brandPreferences})]}),t.communicationPreferences&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(qp,{className:"sidebar-icon"}),a.jsxs("span",{className:"text-muted-foreground text-sm",children:["Prefers: ",t.communicationPreferences]})]}),t.deviceUsage&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(iZ,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:t.deviceUsage})]}),t.shoppingHabits&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(cZ,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:t.shoppingHabits})]}),t.additionalInformation&&typeof t.additionalInformation=="string"&&a.jsxs("div",{className:"sidebar-section",children:[a.jsx(JJ,{className:"sidebar-icon"}),a.jsx("div",{className:"sidebar-sub-item",children:t.additionalInformation.split(` +`).map((r,i)=>a.jsx("div",{className:"mb-1",children:r.trim().startsWith("•")||r.trim().startsWith("-")?r.trim().substring(1).trim():r.trim()},i))})]}),e&&a.jsxs("div",{className:"pt-2 space-y-2",children:[a.jsxs("div",{className:"sidebar-section",children:[a.jsx(YO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Maintains an extensive network of financial and luxury industry contacts"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Ky,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Owns vacation properties in the Cotswolds and South of France"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(IS,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Collector of rare first-edition books and limited-edition art prints"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(QO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Significant investment portfolio with focus on sustainable luxury ventures"})]})]}),n&&a.jsxs("div",{className:"pt-2 space-y-2",children:[a.jsxs("div",{className:"sidebar-section",children:[a.jsx(IS,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Active in industry panels, luxury brand collaborations, follows influencers in luxury & design"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(Ky,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Modern flat in exclusive Chelsea, accessible to boutique services"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(QO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Uses premium digital payment & secure banking for HNWIs"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(YO,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Respected network in London's luxury sector; attends exclusive events"})]}),a.jsxs("div",{className:"sidebar-section",children:[a.jsx(qp,{className:"sidebar-icon"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"Seeks autonomy, bespoke service, and acknowledgment for taste"})]})]})]})]})]})]})}function zLe({persona:t}){var e,n,r,i,s,o,c,l,u;return a.jsxs("div",{className:"space-y-6",children:[a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(Xv,{className:"h-5 w-5 text-primary mr-2"}),a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Goals"})]}),a.jsx("ul",{className:"space-y-2",children:(e=t.goals)==null?void 0:e.map((d,f)=>a.jsxs("li",{className:"flex items-start",children:[a.jsx("div",{className:"h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center mt-0.5 mr-3",children:a.jsx("span",{className:"text-xs text-primary font-medium",children:f+1})}),a.jsx("p",{className:"text-sm",children:d})]},f))})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(d5,{className:"h-5 w-5 text-amber-500 mr-2"}),a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Frustrations"})]}),a.jsx("ul",{className:"space-y-2",children:(n=t.frustrations)==null?void 0:n.map((d,f)=>a.jsxs("li",{className:"text-sm flex items-start",children:[a.jsx("span",{className:"text-amber-500 mr-2",children:"•"}),a.jsx("span",{children:d})]},f))})]})}),a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx(ha,{className:"h-5 w-5 text-green-500 mr-2"}),a.jsx("h3",{className:"font-sf text-lg font-medium",children:"Motivations"})]}),a.jsx("ul",{className:"space-y-2",children:(r=t.motivations)==null?void 0:r.map((d,f)=>a.jsxs("li",{className:"text-sm flex items-start",children:[a.jsx("span",{className:"text-green-500 mr-2",children:"•"}),a.jsx("span",{children:d})]},f))})]})})]}),a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Think, Feel, Do"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(lu,{className:"h-5 w-5 text-blue-500 mr-2"}),a.jsx("h4",{className:"font-medium text-sm",children:"Thinks"})]}),a.jsx("ul",{className:"space-y-2",children:(s=(i=t.thinkFeelDo)==null?void 0:i.thinks)==null?void 0:s.map((d,f)=>a.jsxs("li",{className:"text-sm bg-blue-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(H_,{className:"h-5 w-5 text-red-500 mr-2"}),a.jsx("h4",{className:"font-medium text-sm",children:"Feels"})]}),a.jsx("ul",{className:"space-y-2",children:(c=(o=t.thinkFeelDo)==null?void 0:o.feels)==null?void 0:c.map((d,f)=>a.jsxs("li",{className:"text-sm bg-red-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-3",children:[a.jsx(ha,{className:"h-5 w-5 text-green-500 mr-2"}),a.jsx("h4",{className:"font-medium text-sm",children:"Does"})]}),a.jsx("ul",{className:"space-y-2",children:(u=(l=t.thinkFeelDo)==null?void 0:l.does)==null?void 0:u.map((d,f)=>a.jsxs("li",{className:"text-sm bg-green-50 p-2 rounded-md",children:['"',d,'"']},f))})]})]})]})})]})}function VLe({persona:t}){var n,r,i,s,o;const e=[{trait:"Openness",value:((n=t.oceanTraits)==null?void 0:n.openness)||50},{trait:"Conscientiousness",value:((r=t.oceanTraits)==null?void 0:r.conscientiousness)||50},{trait:"Extraversion",value:((i=t.oceanTraits)==null?void 0:i.extraversion)||50},{trait:"Agreeableness",value:((s=t.oceanTraits)==null?void 0:s.agreeableness)||50},{trait:"Neuroticism",value:((o=t.oceanTraits)==null?void 0:o.neuroticism)||50}];return a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"OCEAN Personality Traits"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{className:"h-80",children:a.jsx(Hc,{width:"100%",height:"100%",children:a.jsxs(j$e,{outerRadius:90,data:e,children:[a.jsx(pK,{}),a.jsx(lh,{dataKey:"trait"}),a.jsx(ch,{domain:[0,100]}),a.jsx(Fg,{name:"Personality",dataKey:"value",stroke:"#8884d8",fill:"#8884d8",fillOpacity:.5})]})})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Openness to Experience"}),a.jsxs("span",{className:"font-medium",children:[e[0].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${e[0].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[0].value>75?"Highly creative and curious":e[0].value>50?"Somewhat imaginative and open to new ideas":"Practical and prefers routine"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Conscientiousness"}),a.jsxs("span",{className:"font-medium",children:[e[1].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${e[1].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[1].value>75?"Highly organized and responsible":e[1].value>50?"Generally reliable and hardworking":"Spontaneous and flexible"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Extraversion"}),a.jsxs("span",{className:"font-medium",children:[e[2].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${e[2].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[2].value>75?"Highly sociable and outgoing":e[2].value>50?"Moderately social and talkative":"Reserved and reflective"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Agreeableness"}),a.jsxs("span",{className:"font-medium",children:[e[3].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${e[3].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[3].value>75?"Highly cooperative and compassionate":e[3].value>50?"Generally kind and helpful":"Competitive and challenging"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[a.jsx("span",{children:"Neuroticism"}),a.jsxs("span",{className:"font-medium",children:[e[4].value,"%"]})]}),a.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-red-500 rounded-full",style:{width:`${e[4].value}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e[4].value>75?"Highly sensitive and prone to stress":e[4].value>50?"Moderately reactive to challenges":"Emotionally stable and resilient"})]})]})]})]})})}function GLe({persona:t}){var r;const e=(i,s)=>{const o=[a.jsx(eZ,{className:"sidebar-icon"},"grid"),a.jsx(lZ,{className:"sidebar-icon"},"smartphone"),a.jsx(ZJ,{className:"sidebar-icon"},"laptop"),a.jsx(XJ,{className:"sidebar-icon"},"grid2x2")];return o[s%o.length]},n=()=>t.scenarioType?t.scenarioType:"Life Scenarios";return a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:n()}),a.jsx("div",{className:"space-y-4",children:(r=t.scenarios)==null?void 0:r.map((i,s)=>a.jsx("div",{className:"bg-slate-50 p-4 rounded-lg border",children:a.jsxs("div",{className:"sidebar-section",children:[e(i,s),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-sm mb-2",children:["Scenario ",s+1]}),a.jsx("p",{className:"text-sm",children:i})]})]})},s))})]})})}function KLe(){const t=ar();return a.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:a.jsxs(ut,{className:"w-96 text-center p-6",children:[a.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Persona Not Found"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"The persona you're looking for couldn't be found."}),a.jsx(ee,{onClick:()=>t("/synthetic-users"),children:"Return to Personas"})]})})}function zt({className:t,...e}){return a.jsx("div",{className:Pe("animate-pulse rounded-md bg-muted",t),...e})}function WLe(){return a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(_a,{}),a.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex items-center mb-6 relative",children:[a.jsx(zt,{className:"absolute left-0 top-0 h-10 w-20"}),a.jsx(zt,{className:"h-8 w-48 mx-auto"}),a.jsx(zt,{className:"absolute right-0 top-0 h-10 w-32"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[a.jsx("div",{className:"lg:col-span-1",children:a.jsxs(ut,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(zt,{className:"h-16 w-16 rounded-full"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(zt,{className:"h-6 w-32 mb-2"}),a.jsx(zt,{className:"h-4 w-24"})]})]}),a.jsxs("div",{className:"mt-6 space-y-4",children:[a.jsxs("div",{className:"flex items-start",children:[a.jsx(zt,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(zt,{className:"h-4 w-20 mb-2"}),a.jsx(zt,{className:"h-3 w-40 mb-1"}),a.jsx(zt,{className:"h-3 w-36"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx(zt,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(zt,{className:"h-4 w-16 mb-2"}),a.jsx(zt,{className:"h-3 w-32"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx(zt,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(zt,{className:"h-4 w-16 mb-2"}),a.jsx(zt,{className:"h-3 w-full"})]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx(zt,{className:"h-5 w-5 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(zt,{className:"h-4 w-12 mb-2"}),a.jsx(zt,{className:"h-3 w-full"})]})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx(zt,{className:"h-4 w-32 mb-3"}),a.jsx("div",{className:"space-y-3",children:[...Array(4)].map((t,e)=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx(zt,{className:"h-3 w-24"}),a.jsx(zt,{className:"h-3 w-8"})]}),a.jsx(zt,{className:"h-1.5 w-full rounded-full"})]},e))})]}),a.jsxs("div",{className:"pt-4 border-t",children:[a.jsx(zt,{className:"h-4 w-36 mb-3"}),a.jsx("div",{className:"space-y-2",children:[...Array(3)].map((t,e)=>a.jsxs("div",{className:"flex items-center",children:[a.jsx(zt,{className:"h-4 w-4 mr-2"}),a.jsx(zt,{className:"h-3 w-40"})]},e))})]})]})]})}),a.jsxs("div",{className:"lg:col-span-2",children:[a.jsxs("div",{className:"grid w-full grid-cols-3 gap-2 mb-6",children:[a.jsx(zt,{className:"h-10 w-full"}),a.jsx(zt,{className:"h-10 w-full"}),a.jsx(zt,{className:"h-10 w-full"})]}),a.jsx(ut,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(zt,{className:"h-6 w-48"}),a.jsx(zt,{className:"h-4 w-full"}),a.jsx(zt,{className:"h-4 w-full"}),a.jsx(zt,{className:"h-4 w-3/4"}),a.jsxs("div",{className:"mt-8 space-y-4",children:[a.jsx(zt,{className:"h-6 w-32"}),a.jsx(zt,{className:"h-4 w-full"}),a.jsx(zt,{className:"h-4 w-full"}),a.jsx(zt,{className:"h-4 w-2/3"})]}),a.jsxs("div",{className:"mt-8 space-y-4",children:[a.jsx(zt,{className:"h-6 w-40"}),a.jsx(zt,{className:"h-4 w-full"}),a.jsx(zt,{className:"h-4 w-full"}),a.jsx(zt,{className:"h-4 w-5/6"})]})]})})]})]})]})]})}function qLe({message:t,onLoginSuccess:e,onCancel:n}){const{login:r}=Qo(),i=ar(),[s,o]=v.useState("user"),[c,l]=v.useState("pass"),[u,d]=v.useState(!1),f=async()=>{if(!s||!c){se.error("Please enter username and password");return}d(!0);try{await r(s,c),se.success("Login successful"),e&&e()}catch(p){console.error("Login error:",p),se.error("Login failed",{description:"Please check your credentials and try again"})}finally{d(!1)}},h=()=>{n?n():i("/synthetic-users")};return a.jsxs(ut,{className:"max-w-md mx-auto shadow-lg",children:[a.jsxs(ji,{children:[a.jsx(qi,{children:"Login Required"}),a.jsx(aT,{children:t||"You need to log in to save personas to the database"})]}),a.jsxs(Rt,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(hs,{htmlFor:"username",children:"Username"}),a.jsx(Wt,{id:"username",placeholder:"Username",value:s,onChange:p=>o(p.target.value),disabled:u})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(hs,{htmlFor:"password",children:"Password"}),a.jsx(Wt,{id:"password",type:"password",placeholder:"Password",value:c,onChange:p=>l(p.target.value),disabled:u})]}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Default credentials: user / pass"})]}),a.jsxs(cT,{className:"flex justify-between",children:[a.jsx(ee,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),a.jsx(ee,{onClick:f,disabled:u,children:u?a.jsxs(a.Fragment,{children:[a.jsx(Js,{className:"h-4 w-4 mr-2 animate-spin"}),"Logging in..."]}):"Login"})]})]})}function YLe({persona:t,onSave:e,onCancel:n}){var j,P,k,O,E,R,M,G,L,V,I,D,X,Q,J,ye;const r={...t,education:t.education||"",interests:t.interests||"",brandLoyalty:t.brandLoyalty||0,priceConsciousness:t.priceConsciousness||0,environmentalConcern:t.environmentalConcern||0,hasPurchasingPower:t.hasPurchasingPower||!1,hasChildren:t.hasChildren||!1,goals:t.goals||[],frustrations:t.frustrations||[],motivations:t.motivations||[],scenarios:t.scenarios||[],oceanTraits:t.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:t.thinkFeelDo||{thinks:[],feels:[],does:[]}},[i,s]=v.useState(r),[o,c]=v.useState(!1),[l,u]=v.useState(!1),[d,f]=v.useState(null);v.useState(!1);const{isAuthenticated:h,token:p}=Qo();v.useEffect(()=>{(async()=>{l&&h&&p&&(u(!1),d&&await A())})()},[h,p,l]);const g=(U,ne)=>{s(ue=>({...ue,[U]:ne}))},m=(U,ne)=>{s(ue=>({...ue,oceanTraits:{...ue.oceanTraits,[U]:ne}}))},y=U=>{s(ne=>({...ne,[U]:[...ne[U]||[],""]}))},b=(U,ne,ue)=>{s(F=>{const ce=[...F[U]||[]];return ce[ne]=ue,{...F,[U]:ce}})},x=(U,ne)=>{s(ue=>{const F=[...ue[U]||[]];return F.splice(ne,1),{...ue,[U]:F}})},w=(U,ne,ue)=>{s(F=>{const ce={...F.thinkFeelDo},te=[...ce[U]||[]];return te[ne]=ue,ce[U]=te,{...F,thinkFeelDo:ce}})},S=U=>{s(ne=>{var F;const ue={...ne.thinkFeelDo,[U]:[...((F=ne.thinkFeelDo)==null?void 0:F[U])||[],""]};return{...ne,thinkFeelDo:ue}})},C=(U,ne)=>{s(ue=>{const F={...ue.thinkFeelDo},ce=[...F[U]||[]];return ce.splice(ne,1),F[U]=ce,{...ue,thinkFeelDo:F}})},_=()=>{d&&(se.error("Login canceled - Persona changes not saved"),u(!1),f(null),n())},A=async()=>{if(d){c(!0);try{const U={...d};delete U._id,delete U.isDbPersona;const ne=await Rr.create(U),ue={...d,id:ne.data._id||ne.data.id,_id:ne.data._id||ne.data.id,isDbPersona:!0};se.success("Persona saved to database successfully"),u(!1),f(null),e(ue)}catch(U){console.error("Error saving after login:",U),se.error("Failed to save to database after login"),u(!1),f(null)}finally{c(!1)}}};return l?a.jsxs("div",{className:"max-w-5xl mx-auto bg-background p-6",children:[a.jsx("div",{className:"flex justify-between items-center mb-6",children:a.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Authentication Required"})}),a.jsx("p",{className:"mb-6 text-muted-foreground",children:"Login is required to save personas to the database. You can either:"}),a.jsxs("ul",{className:"list-disc ml-6 mt-2 mb-6",children:[a.jsx("li",{children:"Log in to save this persona to the database"}),a.jsx("li",{children:"Cancel to discard your changes"})]}),a.jsx(qLe,{message:"Login is required to save your persona to the database",onLoginSuccess:A,onCancel:_})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(ee,{variant:"ghost",onClick:n,className:"mr-2",children:a.jsx(Gp,{className:"h-5 w-5"})}),a.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Edit Persona"})]}),a.jsxs(ee,{onClick:async()=>{c(!0);try{const U=i._id||i.id,ne={...i};ne._id&&delete ne._id,delete ne.isDbPersona;let ue;if(U&&typeof U=="string"&&U.startsWith("local-")){console.log("Creating new persona instead of updating local ID"),ue=await Rr.create(ne),se.success("Persona saved to database");const F={...i,id:ue.data._id||ue.data.id,_id:ue.data._id||ue.data.id,isDbPersona:!0};e(F)}else if(U){ue=await Rr.update(U,ne),se.success("Persona updated successfully");const F={...i,isDbPersona:!0};e(F)}else{ue=await Rr.create(ne);const F={...i,id:ue.data._id||ue.data.id,_id:ue.data._id||ue.data.id,isDbPersona:!0};se.success("Persona created successfully"),e(F)}}catch(U){console.error("Error saving persona:",U),U.response&&U.response.status===401?h&&p?(console.log("Auth error despite having token - token likely invalid"),se.error("Authentication error - saving locally instead"),e(i)):(f(i),u(!0)):(se.error("Failed to save persona"),e(i))}finally{c(!1)}},disabled:o,children:[o?a.jsx(Js,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(DE,{className:"h-4 w-4 mr-2"}),o?"Saving...":"Save Changes"]})]}),a.jsxs(fl,{defaultValue:"basic",children:[a.jsxs(Va,{className:"grid w-full grid-cols-6",children:[a.jsx(pn,{value:"basic",children:"Basic"}),a.jsx(pn,{value:"cooper",children:"Cooper"}),a.jsx(pn,{value:"personality",children:"Personality"}),a.jsx(pn,{value:"demographics",children:"Demographics"}),a.jsx(pn,{value:"lifestyle",children:"Lifestyle"}),a.jsx(pn,{value:"extended",children:"Extended"})]}),a.jsx(mn,{value:"basic",className:"mt-6",children:a.jsx(ut,{children:a.jsx(Rt,{className:"p-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Name"}),a.jsx(Wt,{value:i.name||"",onChange:U=>g("name",U.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Age Range"}),a.jsxs(Un,{value:i.age||"",onValueChange:U=>g("age",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select age range"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"18-24",children:"18-24"}),a.jsx(ae,{value:"25-34",children:"25-34"}),a.jsx(ae,{value:"35-44",children:"35-44"}),a.jsx(ae,{value:"45-54",children:"45-54"}),a.jsx(ae,{value:"55-64",children:"55-64"}),a.jsx(ae,{value:"65+",children:"65+"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Gender"}),a.jsxs(Un,{value:i.gender||"",onValueChange:U=>g("gender",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select gender"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Male",children:"Male"}),a.jsx(ae,{value:"Female",children:"Female"}),a.jsx(ae,{value:"Non-binary",children:"Non-binary"}),a.jsx(ae,{value:"Other",children:"Other"})]})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Occupation"}),a.jsx(Wt,{value:i.occupation||"",onChange:U=>g("occupation",U.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Education"}),a.jsxs(Un,{value:i.education||"",onValueChange:U=>g("education",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select education level"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"High School",children:"High School"}),a.jsx(ae,{value:"Some College",children:"Some College"}),a.jsx(ae,{value:"Associate's Degree",children:"Associate's Degree"}),a.jsx(ae,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),a.jsx(ae,{value:"Master's Degree",children:"Master's Degree"}),a.jsx(ae,{value:"PhD",children:"PhD"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Location"}),a.jsx(Wt,{value:i.location||"",onChange:U=>g("location",U.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Ethnicity (Optional)"}),a.jsxs(Un,{value:i.ethnicity||"",onValueChange:U=>g("ethnicity",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select ethnicity"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"white",children:"White"}),a.jsx(ae,{value:"black",children:"Black"}),a.jsx(ae,{value:"asian",children:"Asian"}),a.jsx(ae,{value:"hispanic",children:"Hispanic/Latino"}),a.jsx(ae,{value:"native-american",children:"Native American"}),a.jsx(ae,{value:"middle-eastern",children:"Middle Eastern"}),a.jsx(ae,{value:"mixed",children:"Mixed"}),a.jsx(ae,{value:"other",children:"Other"}),a.jsx(ae,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personality"}),a.jsx(ht,{value:i.personality||"",onChange:U=>g("personality",U.target.value),rows:3})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Interests"}),a.jsx(ht,{value:i.interests||"",onChange:U=>g("interests",U.target.value),rows:3,placeholder:"Tech, travel, cooking, etc."})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Tech Savviness"}),a.jsxs("span",{className:"text-sm",children:[i.techSavviness,"%"]})]}),a.jsx(wr,{value:[i.techSavviness],onValueChange:U=>g("techSavviness",U[0]),max:100,step:1})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Brand Loyalty"}),a.jsxs("span",{className:"text-sm",children:[i.brandLoyalty||0,"%"]})]}),a.jsx(wr,{value:[i.brandLoyalty||0],onValueChange:U=>g("brandLoyalty",U[0]),max:100,step:1})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Price Consciousness"}),a.jsxs("span",{className:"text-sm",children:[i.priceConsciousness||0,"%"]})]}),a.jsx(wr,{value:[i.priceConsciousness||0],onValueChange:U=>g("priceConsciousness",U[0]),max:100,step:1})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Environmental Concern"}),a.jsxs("span",{className:"text-sm",children:[i.environmentalConcern||0,"%"]})]}),a.jsx(wr,{value:[i.environmentalConcern||0],onValueChange:U=>g("environmentalConcern",U[0]),max:100,step:1})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-sm font-medium",children:"Purchasing Power"}),a.jsx(ym,{checked:i.hasPurchasingPower||!1,onCheckedChange:U=>g("hasPurchasingPower",U)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-sm font-medium",children:"Has Children"}),a.jsx(ym,{checked:i.hasChildren||!1,onCheckedChange:U=>g("hasChildren",U)})]})]})]})]})})})}),a.jsxs(mn,{value:"cooper",className:"mt-6 space-y-6",children:[a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(i.goals||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:U||"",onChange:ue=>b("goals",ne,ue.target.value)}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>x("goals",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>y("goals"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(i.frustrations||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:U||"",onChange:ue=>b("frustrations",ne,ue.target.value)}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>x("frustrations",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>y("frustrations"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),a.jsxs("div",{className:"mb-4 pt-4 border-t",children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(i.motivations||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:U||"",onChange:ue=>b("motivations",ne,ue.target.value)}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>x("motivations",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>y("motivations"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),(((j=i.thinkFeelDo)==null?void 0:j.thinks)||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:U||"",onChange:ue=>w("thinks",ne,ue.target.value)}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>C("thinks",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>S("thinks"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),(((P=i.thinkFeelDo)==null?void 0:P.feels)||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:U||"",onChange:ue=>w("feels",ne,ue.target.value)}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>C("feels",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>S("feels"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),(((k=i.thinkFeelDo)==null?void 0:k.does)||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:U||"",onChange:ue=>w("does",ne,ue.target.value)}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>C("does",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>S("does"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("div",{className:"space-y-4 mb-6",children:a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Scenario Section Title"}),a.jsx(Wt,{value:i.scenarioType||"",onChange:U=>g("scenarioType",U.target.value),placeholder:"Life Scenarios"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'})]})}),a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(i.scenarios||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[a.jsx(ht,{value:U||"",onChange:ue=>b("scenarios",ne,ue.target.value),rows:2}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>x("scenarios",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>y("scenarios"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})})]}),a.jsx(mn,{value:"personality",className:"mt-6",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),a.jsxs("span",{className:"text-sm",children:[((O=i.oceanTraits)==null?void 0:O.openness)||50,"%"]})]}),a.jsx(wr,{value:[((E=i.oceanTraits)==null?void 0:E.openness)||50],onValueChange:U=>m("openness",U[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),a.jsxs("span",{className:"text-sm",children:[((R=i.oceanTraits)==null?void 0:R.conscientiousness)||50,"%"]})]}),a.jsx(wr,{value:[((M=i.oceanTraits)==null?void 0:M.conscientiousness)||50],onValueChange:U=>m("conscientiousness",U[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),a.jsxs("span",{className:"text-sm",children:[((G=i.oceanTraits)==null?void 0:G.extraversion)||50,"%"]})]}),a.jsx(wr,{value:[((L=i.oceanTraits)==null?void 0:L.extraversion)||50],onValueChange:U=>m("extraversion",U[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),a.jsxs("span",{className:"text-sm",children:[((V=i.oceanTraits)==null?void 0:V.agreeableness)||50,"%"]})]}),a.jsx(wr,{value:[((I=i.oceanTraits)==null?void 0:I.agreeableness)||50],onValueChange:U=>m("agreeableness",U[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[a.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),a.jsxs("span",{className:"text-sm",children:[((D=i.oceanTraits)==null?void 0:D.neuroticism)||50,"%"]})]}),a.jsx(wr,{value:[((X=i.oceanTraits)==null?void 0:X.neuroticism)||50],onValueChange:U=>m("neuroticism",U[0]),max:100,step:1}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),a.jsx(mn,{value:"demographics",className:"mt-6",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Grade"}),a.jsxs(Un,{value:i.socialGrade||"",onValueChange:U=>g("socialGrade",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select social grade"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"A",children:"A - Higher managerial"}),a.jsx(ae,{value:"B",children:"B - Intermediate managerial"}),a.jsx(ae,{value:"C1",children:"C1 - Supervisory or clerical"}),a.jsx(ae,{value:"C2",children:"C2 - Skilled manual workers"}),a.jsx(ae,{value:"D",children:"D - Semi and unskilled manual workers"}),a.jsx(ae,{value:"E",children:"E - State pensioners, unemployed"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Income"}),a.jsxs(Un,{value:i.householdIncome||"",onValueChange:U=>g("householdIncome",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select income range"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Under $25k",children:"Under $25,000"}),a.jsx(ae,{value:"$25k-$50k",children:"$25,000 - $50,000"}),a.jsx(ae,{value:"$50k-$75k",children:"$50,000 - $75,000"}),a.jsx(ae,{value:"$75k-$100k",children:"$75,000 - $100,000"}),a.jsx(ae,{value:"$100k-$150k",children:"$100,000 - $150,000"}),a.jsx(ae,{value:"$150k-$250k",children:"$150,000 - $250,000"}),a.jsx(ae,{value:"Over $250k",children:"Over $250,000"}),a.jsx(ae,{value:"Prefer not to say",children:"Prefer not to say"})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Composition"}),a.jsxs(Un,{value:i.householdComposition||"",onValueChange:U=>g("householdComposition",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select household type"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Single person",children:"Single person"}),a.jsx(ae,{value:"Couple without children",children:"Couple without children"}),a.jsx(ae,{value:"Couple with children",children:"Couple with children"}),a.jsx(ae,{value:"Single parent",children:"Single parent"}),a.jsx(ae,{value:"Multi-generational",children:"Multi-generational"}),a.jsx(ae,{value:"Shared housing",children:"Shared housing"}),a.jsx(ae,{value:"Other",children:"Other"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Living Situation"}),a.jsxs(Un,{value:i.livingSituation||"",onValueChange:U=>g("livingSituation",U),children:[a.jsx(Dn,{children:a.jsx(Bn,{placeholder:"Select living situation"})}),a.jsxs($n,{children:[a.jsx(ae,{value:"Own home",children:"Own home"}),a.jsx(ae,{value:"Rent apartment",children:"Rent apartment"}),a.jsx(ae,{value:"Rent house",children:"Rent house"}),a.jsx(ae,{value:"Live with family",children:"Live with family"}),a.jsx(ae,{value:"Student housing",children:"Student housing"}),a.jsx(ae,{value:"Assisted living",children:"Assisted living"}),a.jsx(ae,{value:"Other",children:"Other"})]})]})]})]})]})]})})}),a.jsx(mn,{value:"lifestyle",className:"mt-6",children:a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Media Consumption"}),a.jsx(ht,{value:i.mediaConsumption||"",onChange:U=>g("mediaConsumption",U.target.value),rows:3,placeholder:"TV shows, podcasts, news sources, social media platforms"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Describe media consumption habits and preferences"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Device Usage"}),a.jsx(ht,{value:i.deviceUsage||"",onChange:U=>g("deviceUsage",U.target.value),rows:3,placeholder:"Smartphone, laptop, tablet, smart TV, gaming console"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Primary devices and usage patterns"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Shopping Habits"}),a.jsx(ht,{value:i.shoppingHabits||"",onChange:U=>g("shoppingHabits",U.target.value),rows:3,placeholder:"Online vs in-store, frequency, preferred retailers"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Shopping behavior and preferences"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Brand Preferences"}),a.jsx(ht,{value:i.brandPreferences||"",onChange:U=>g("brandPreferences",U.target.value),rows:3,placeholder:"Favorite brands, brand values alignment"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred brands and reasoning"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Communication Preferences"}),a.jsx(ht,{value:i.communicationPreferences||"",onChange:U=>g("communicationPreferences",U.target.value),rows:3,placeholder:"Email, phone, text, video calls, in-person"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred communication methods and channels"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Payment Methods"}),a.jsx(ht,{value:i.paymentMethods||"",onChange:U=>g("paymentMethods",U.target.value),rows:3,placeholder:"Credit cards, digital wallets, cash, BNPL"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred payment methods and financial tools"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Purchase Behavior"}),a.jsx(ht,{value:i.purchaseBehaviour||"",onChange:U=>g("purchaseBehaviour",U.target.value),rows:3,placeholder:"Research habits, decision factors, impulse vs planned buying"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"How they approach making purchase decisions"})]})]})]})]})})}),a.jsxs(mn,{value:"extended",className:"mt-6 space-y-6",children:[a.jsx(ut,{children:a.jsxs(Rt,{className:"p-6",children:[a.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Core Values"}),a.jsx(ht,{value:i.coreValues||"",onChange:U=>g("coreValues",U.target.value),rows:3,placeholder:"Key principles and values that guide decisions"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Lifestyle Choices"}),a.jsx(ht,{value:i.lifestyleChoices||"",onChange:U=>g("lifestyleChoices",U.target.value),rows:3,placeholder:"Health, fitness, diet, work-life balance preferences"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Activities"}),a.jsx(ht,{value:i.socialActivities||"",onChange:U=>g("socialActivities",U.target.value),rows:3,placeholder:"Social hobbies, community involvement, networking"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Category Knowledge"}),a.jsx(ht,{value:i.categoryKnowledge||"",onChange:U=>g("categoryKnowledge",U.target.value),rows:3,placeholder:"Expertise in specific product/service categories"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Decision Influences"}),a.jsx(ht,{value:i.decisionInfluences||"",onChange:U=>g("decisionInfluences",U.target.value),rows:3,placeholder:"What factors most influence their decisions"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Pain Points"}),a.jsx(ht,{value:i.painPoints||"",onChange:U=>g("painPoints",U.target.value),rows:3,placeholder:"Common challenges and friction points"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Journey Context"}),a.jsx(ht,{value:i.journeyContext||"",onChange:U=>g("journeyContext",U.target.value),rows:3,placeholder:"Current life stage and contextual factors"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Key Touchpoints"}),a.jsx(ht,{value:i.keyTouchpoints||"",onChange:U=>g("keyTouchpoints",U.target.value),rows:3,placeholder:"Important interaction points and channels"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Autonomy"}),a.jsx(ht,{value:((Q=i.selfDeterminationNeeds)==null?void 0:Q.autonomy)||"",onChange:U=>g("selfDeterminationNeeds",{...i.selfDeterminationNeeds,autonomy:U.target.value}),rows:2,placeholder:"Need for independence and self-direction"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Competence"}),a.jsx(ht,{value:((J=i.selfDeterminationNeeds)==null?void 0:J.competence)||"",onChange:U=>g("selfDeterminationNeeds",{...i.selfDeterminationNeeds,competence:U.target.value}),rows:2,placeholder:"Need to feel capable and effective"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Relatedness"}),a.jsx(ht,{value:((ye=i.selfDeterminationNeeds)==null?void 0:ye.relatedness)||"",onChange:U=>g("selfDeterminationNeeds",{...i.selfDeterminationNeeds,relatedness:U.target.value}),rows:2,placeholder:"Need for connection and belonging"})]})]})]})]})]})}),a.jsx(ut,{children:a.jsx(Rt,{className:"p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(i.fears||[]).map((U,ne)=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Wt,{value:U,onChange:ue=>b("fears",ne,ue.target.value),placeholder:"Enter a fear or concern"}),a.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>x("fears",ne),children:a.jsx(qn,{className:"h-4 w-4 text-muted-foreground"})})]},ne)),a.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>y("fears"),className:"mt-2",children:[a.jsx(Br,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personal Narrative"}),a.jsx(ht,{value:i.narrative||"",onChange:U=>g("narrative",U.target.value),rows:4,placeholder:"Personal story, background, key life experiences"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"A brief narrative that captures their personal story"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium block mb-1",children:"Additional Information"}),a.jsx(ht,{value:i.additionalInformation||"",onChange:U=>g("additionalInformation",U.target.value),rows:4,placeholder:"Any other relevant details or context"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Additional context or details not covered elsewhere"})]})]})})})]})]})]})}function QLe(){const{id:t}=OE(),e=Ui(),n=ar(),{navigationState:r,clearNavigationState:i}=xg(),[s,o]=v.useState(void 0),[c,l]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(!0);return v.useEffect(()=>{if(!t){h(!1);return}let m=!0;const b=new URLSearchParams(e.search).get("fromReview")==="true";return l(b),h(!0),(async()=>{try{const w=t.startsWith("local-")?t.substring(6):t,S=await Rr.getById(w);if(S&&S.data){const C=S.data;if(m){console.log("Found persona in database:",C),o({...C,id:C.id||C._id,isDbPersona:!0}),h(!1);return}}console.error("Could not find persona with id:",t),m&&(o(void 0),h(!1),se.error("Persona not found"))}catch(w){console.error("Error fetching persona:",w),m&&(o(void 0),h(!1),se.error("Failed to load persona details"))}})(),()=>{m=!1}},[t,e.search]),{currentPersona:s,isEditing:u,isFromReview:c,isLoading:f,setIsEditing:d,handleGoBack:()=>{r.previousRoute&&r.previousRoute.startsWith("/focus-groups/")&&r.focusGroupId?(n(`/focus-groups/${r.focusGroupId}`),i()):r.previousRoute==="/focus-groups"&&r.focusGroupTab?(r.isNewFocusGroup?n(`/focus-groups?mode=create&tab=${r.focusGroupTab}`):r.focusGroupId?n(`/focus-groups?mode=edit&id=${r.focusGroupId}&tab=${r.focusGroupTab}`):n("/focus-groups?mode=create&tab=participants"),i()):n(c?"/synthetic-users?mode=create&tab=ai&step=review":"/synthetic-users")},handleSaveEdit:async m=>{try{d(!1);const y=m.isDbPersona||t&&t.length===24&&/^[0-9a-f]{24}$/i.test(t),b={...m};if(b._id&&delete b._id,delete b.isDbPersona,y&&t&&t.length===24&&/^[0-9a-f]{24}$/i.test(t)){const x=await Rr.update(t,b);console.log("Updated persona in database:",x);const w={...m,isDbPersona:!0};o(w),se.success("Persona updated in database successfully")}else{const x=await Rr.create(b);console.log("Created new persona in database:",x.data);const w={...m,id:x.data._id||x.data.id,_id:x.data._id||x.data.id,isDbPersona:!0};o(w),se.success("Persona saved to database successfully")}}catch(y){return console.error("Error saving persona:",y),y.response&&y.response.status===401?se.error("Authentication error - Please log in to save personas"):y.response&&y.response.status===404?se.error("API endpoint not found - Database service may be unavailable"):se.error("Failed to save persona to database: "+(y.message||"Unknown error")),!1}return!0}}}function L$(){var g;const{currentPersona:t,isEditing:e,isFromReview:n,isLoading:r,setIsEditing:i,handleGoBack:s,handleSaveEdit:o}=QLe(),{navigationState:c}=xg(),[l,u]=v.useState(""),[d,f]=v.useState(!1);v.useEffect(()=>{var m;c.focusGroupId&&((m=c.previousRoute)!=null&&m.startsWith("/focus-groups/"))&&(async()=>{var b;try{const x=await pt.getById(c.focusGroupId);(b=x==null?void 0:x.data)!=null&&b.name&&u(x.data.name)}catch(x){console.error("Error fetching focus group name:",x)}})()},[c.focusGroupId,c.previousRoute]);const h=((g=c.previousRoute)==null?void 0:g.startsWith("/focus-groups/"))&&c.focusGroupId&&Object.keys(c).length>0,p=async()=>{var m;if(t){f(!0);try{Fe.info("Generating persona profile...",{description:"Using GPT-4.1 to create a beautifully formatted markdown profile"});const y=t._id||t.id;console.log(`🔽 Frontend: Exporting profile for persona ${t.name} (ID: ${y})`);const b=await Rr.exportProfile(y,{llm_model:"gpt-4.1",temperature:.3}),{markdown_content:x,persona_name:w,model_used:S,warning:C}=b.data;if(x){const _=new Date().toISOString().split("T")[0],j=`${w.replace(/[^a-zA-Z0-9\-\s]/g,"").replace(/\s+/g,"-").toLowerCase()}-profile-${_}.md`,P=document.createElement("a"),k=new Blob([x],{type:"text/markdown"});if(P.href=URL.createObjectURL(k),P.download=j,document.body.appendChild(P),P.click(),document.body.removeChild(P),C)Fe.success("Profile downloaded with fallback formatting",{description:`${w} profile saved as ${j}`});else{const O=S==="gpt-4.1"?"GPT-4.1":S;Fe.success("Profile downloaded successfully",{description:`${w} profile processed with ${O} and saved as ${j}`})}}else throw new Error("No markdown content received")}catch(y){console.error("Error exporting persona profile:",y),y.response?Fe.error("Failed to export profile",{description:((m=y.response.data)==null?void 0:m.error)||"Server error occurred"}):y.request?Fe.error("Network error",{description:"Unable to connect to the server"}):Fe.error("Export failed",{description:y.message||"An unexpected error occurred"})}finally{f(!1)}}};return r?a.jsx(WLe,{}):t?a.jsxs("div",{className:"min-h-screen bg-slate-50",children:[a.jsx(_a,{}),a.jsx("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:e?a.jsx(YLe,{persona:t,onSave:o,onCancel:()=>i(!1)}):a.jsxs(a.Fragment,{children:[h&&a.jsx("div",{className:"mb-4",children:a.jsx(DW,{children:a.jsxs($W,{children:[a.jsx(py,{children:a.jsxs(mj,{href:"/focus-groups",className:"flex items-center",children:[a.jsx(Ky,{className:"h-4 w-4 mr-1"}),"Focus Groups"]})}),a.jsx(gj,{}),a.jsx(py,{children:a.jsxs(mj,{href:`/focus-groups/${c.focusGroupId}`,className:"flex items-center",children:[a.jsx(Dr,{className:"h-4 w-4 mr-1"}),l||"Focus Group Session"]})}),a.jsx(gj,{}),a.jsx(py,{children:a.jsxs(LW,{className:"flex items-center",children:[a.jsx(qp,{className:"h-4 w-4 mr-1"}),(t==null?void 0:t.name)||"Participant"]})})]})})}),a.jsxs("div",{className:"flex items-center mb-6 relative",children:[a.jsx(ee,{variant:"ghost",onClick:s,className:"absolute left-0 top-0 flex items-center",children:a.jsx(Gp,{className:"h-5 w-5"})}),a.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900 mx-auto",children:"Persona Profile"}),a.jsxs("div",{className:"absolute right-0 top-0 flex items-center gap-3",children:[a.jsxs(ee,{variant:"outline",onClick:p,disabled:d,className:"hover-transition",children:[a.jsx(Xc,{className:"h-4 w-4 mr-2"}),d?"Generating...":"Download Profile"]}),a.jsxs(ee,{onClick:()=>i(!0),children:[a.jsx(dZ,{className:"h-4 w-4 mr-2"}),"Edit Persona"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[a.jsx("div",{className:"lg:col-span-1",children:a.jsx(HLe,{persona:t})}),a.jsx("div",{className:"lg:col-span-2",children:a.jsxs(fl,{defaultValue:"cooper-profile",children:[a.jsxs(Va,{className:"grid w-full grid-cols-3",children:[a.jsx(pn,{value:"cooper-profile",children:"Cooper Profile"}),a.jsx(pn,{value:"personality",children:"Personality"}),a.jsx(pn,{value:"scenarios",children:"Scenarios"})]}),a.jsx(mn,{value:"cooper-profile",className:"mt-6",children:a.jsx(zLe,{persona:t})}),a.jsx(mn,{value:"personality",className:"mt-6",children:a.jsx(VLe,{persona:t})}),a.jsx(mn,{value:"scenarios",className:"mt-6",children:a.jsx(GLe,{persona:t})})]})})]})]})})]}):a.jsx(KLe,{})}const XLe=Ie.object({username:Ie.string().min(3,"Username must be at least 3 characters"),password:Ie.string().min(4,"Password must be at least 4 characters")});function JLe(){var h;const t=ar(),e=Ui(),{login:n,loginWithMicrosoft:r,isAuthenticated:i,isMsalLoading:s}=Qo(),[o,c]=v.useState(!1),l=((h=e.state)==null?void 0:h.from)||"/";console.log("Login page - destination path:",l),v.useEffect(()=>{i&&(console.log("User already authenticated, redirecting from login page"),t("/",{replace:!0}))},[i,t]);const u=V0({resolver:G0(XLe),defaultValues:{username:"",password:""}});async function d(p){c(!0);try{await n(p.username,p.password)?(console.log("Login successful, received token, navigating to:",l),t(l,{replace:!0})):(console.error("Login succeeded but no token received"),c(!1))}catch(g){console.error("Login error in form handler:",g),c(!1)}}async function f(){try{await r(),console.log("Microsoft login successful, navigating to:",l),t(l,{replace:!0})}catch(p){console.error("Microsoft login error in form handler:",p)}}return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-gray-100 to-gray-200 dark:from-gray-900 dark:to-gray-800 px-4",children:a.jsxs(ut,{className:"w-full max-w-md",children:[a.jsxs(ji,{className:"space-y-1",children:[a.jsx(qi,{className:"text-2xl font-bold text-center",children:"Sign In"}),a.jsx(aT,{className:"text-center",children:"Enter your credentials to access your account"})]}),a.jsxs(Rt,{children:[a.jsx("div",{className:"mb-6",children:a.jsx(ee,{type:"button",variant:"outline",className:"w-full bg-[#0078d4] hover:bg-[#106ebe] text-white border-[#0078d4] hover:border-[#106ebe]",onClick:f,disabled:o||s,children:s?a.jsxs(a.Fragment,{children:[a.jsx(Js,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in with Microsoft..."]}):a.jsxs(a.Fragment,{children:[a.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 21 21",fill:"currentColor",children:[a.jsx("path",{d:"M10 0H0v10h10V0z"}),a.jsx("path",{d:"M21 0H11v10h10V0z"}),a.jsx("path",{d:"M10 11H0v10h10V11z"}),a.jsx("path",{d:"M21 11H11v10h10V11z"})]}),"Sign in with Microsoft"]})})}),a.jsxs("div",{className:"relative mb-6",children:[a.jsx("div",{className:"absolute inset-0 flex items-center",children:a.jsx("div",{className:"w-full border-t border-gray-200"})}),a.jsx("div",{className:"relative flex justify-center text-sm",children:a.jsx("span",{className:"bg-white px-2 text-gray-500 dark:bg-gray-800 dark:text-gray-400",children:"Or continue with username"})})]}),a.jsx(W0,{...u,children:a.jsxs("form",{onSubmit:u.handleSubmit(d),className:"space-y-4",children:[a.jsx(_t,{control:u.control,name:"username",render:({field:p})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Username"}),a.jsx(yt,{children:a.jsx(Wt,{placeholder:"Enter your username",...p,disabled:o,autoComplete:"username"})}),a.jsx(xt,{})]})}),a.jsx(_t,{control:u.control,name:"password",render:({field:p})=>a.jsxs(gt,{children:[a.jsx(vt,{children:"Password"}),a.jsx(yt,{children:a.jsx(Wt,{placeholder:"Enter your password",type:"password",...p,disabled:o,autoComplete:"current-password"})}),a.jsx(xt,{})]})}),a.jsx(ee,{type:"submit",className:"w-full",disabled:o||s,children:o?"Signing in...":"Sign In"})]})})]}),a.jsxs(cT,{className:"flex flex-col space-y-2",children:[a.jsx("div",{className:"text-sm text-center text-gray-500 mb-2",children:"Default account: user / pass"}),!o&&!s&&a.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[a.jsx(ee,{variant:"outline",onClick:()=>t("/",{replace:!0}),className:"mt-2",children:"Return to Home"}),a.jsx(ee,{variant:"link",onClick:()=>{localStorage.setItem("offline_mode","true");const p={username:"guest",email:"guest@example.com",role:"user"};localStorage.setItem("auth_token","offline-mode-token"),localStorage.setItem("user",JSON.stringify(p)),Fe.success("Offline mode activated",{description:"Using demo account with limited functionality"}),t("/",{replace:!0})},className:"text-sm text-gray-500",children:"Use offline mode"})]})]})]})})}function Ku({children:t}){const{isAuthenticated:e,isLoading:n}=Qo(),r=Ui();return console.log("ProtectedRoute check:",{isAuthenticated:e,isLoading:n,path:r.pathname}),n?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary"})}):e?(console.log("User is authenticated, showing protected content"),a.jsx(a.Fragment,{children:t})):(console.log("Not authenticated, redirecting to login"),a.jsx(a5,{to:"/login",state:{from:r.pathname},replace:!0}))}const ZLe=v.createContext({});let F$=!1;function eFe({children:t}){const{token:e}=Qo(),n=()=>{const i=e||localStorage.getItem("auth_token");return console.log("🔧 [GPT-5 Context] Getting token:",i?"Found":"Missing"),i||""};v.useEffect(()=>(F$||(console.log("🔧 [GPT-5 Context] Initializing singleton socket"),RW(n),F$=!0),console.log("🔧 [GPT-5 Context] Connecting socket"),MW(),()=>{}),[e]);const r={};return a.jsx(ZLe.Provider,{value:r,children:t})}const FW=new YN(Qie);FW.initialize().catch(t=>{console.error("MSAL initialization error:",t)});function tFe({children:t}){return a.jsx(qie,{instance:FW,children:t})}const nFe=new MX,rFe=()=>a.jsx($X,{client:nFe,children:a.jsx(IJ,{basename:"/semblance",children:a.jsx(tFe,{children:a.jsx(Jie,{children:a.jsx(eFe,{children:a.jsx(nse,{children:a.jsxs(fX,{children:[a.jsx(U9,{}),a.jsxs(AJ,{children:[a.jsx(Ms,{path:"/",element:a.jsx(ese,{})}),a.jsx(Ms,{path:"/login",element:a.jsx(JLe,{})}),a.jsx(Ms,{path:"/synthetic-users",element:a.jsx(Ku,{children:a.jsx(sde,{})})}),a.jsx(Ms,{path:"/synthetic-users/:id",element:a.jsx(Ku,{children:a.jsx(L$,{})})}),a.jsx(Ms,{path:"/personas/:id",element:a.jsx(Ku,{children:a.jsx(L$,{})})}),a.jsx(Ms,{path:"/focus-groups",element:a.jsx(Ku,{children:a.jsx(ude,{})})}),a.jsx(Ms,{path:"/focus-groups/:id",element:a.jsx(Ku,{children:a.jsx(kLe,{})})}),a.jsx(Ms,{path:"/dashboard",element:a.jsx(Ku,{children:a.jsx(BLe,{})})}),a.jsx(Ms,{path:"/old-path",element:a.jsx(a5,{to:"/",replace:!0})}),a.jsx(Ms,{path:"*",element:a.jsx(tse,{})})]})]})})})})})})});c4(document.getElementById("root")).render(a.jsx(rFe,{})); diff --git a/dist/assets/index-VgChhb1B.css b/dist/assets/index-VgChhb1B.css new file mode 100644 index 00000000..b75c873a --- /dev/null +++ b/dist/assets/index-VgChhb1B.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap";.back-button{position:absolute;top:1.25rem;left:1.25rem;z-index:10;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:9999px;background-color:#fffc;border:1px solid rgba(0,0,0,.1);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:all .15s ease}.back-button:hover{background-color:#ffffffe6;transform:translateY(-1px);box-shadow:0 2px 4px #0000000d}.back-button:active{transform:translateY(0)}.back-button-content{display:flex;align-items:center;gap:.25rem}.page-header-with-back{display:flex;align-items:center;gap:.75rem;padding-left:2.5rem;position:relative}*,: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: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 350 30% 98%;--foreground: 345 30% 15%;--card: 0 0% 100%;--card-foreground: 345 30% 15%;--popover: 0 0% 100%;--popover-foreground: 345 30% 15%;--primary: 350 85% 80%;--primary-foreground: 350 30% 20%;--secondary: 350 30% 96.1%;--secondary-foreground: 345 30% 15%;--muted: 350 30% 96.1%;--muted-foreground: 350 10% 50%;--accent: 350 30% 96.1%;--accent-foreground: 345 30% 15%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 350 30% 98%;--border: 350 30% 91.4%;--input: 350 30% 91.4%;--ring: 350 85% 80%;--radius: .5rem;--sidebar-background: 0 0% 100%;--sidebar-foreground: 345 30% 15%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 20%;--sidebar-accent: 350 30% 96.1%;--sidebar-accent-foreground: 345 30% 15%;--sidebar-border: 350 30% 91.4%;--sidebar-ring: 350 85% 80%}.dark{--background: 345 30% 10%;--foreground: 350 30% 98%;--card: 345 30% 10%;--card-foreground: 350 30% 98%;--popover: 345 30% 10%;--popover-foreground: 350 30% 98%;--primary: 350 85% 80%;--primary-foreground: 345 30% 15%;--secondary: 342 20% 17.5%;--secondary-foreground: 350 30% 98%;--muted: 342 20% 17.5%;--muted-foreground: 350 10% 70%;--accent: 342 20% 17.5%;--accent-foreground: 350 30% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 350 30% 98%;--border: 342 20% 17.5%;--input: 342 20% 17.5%;--ring: 350 70% 85%;--sidebar-background: 345 30% 10%;--sidebar-foreground: 350 30% 98%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 98%;--sidebar-accent: 342 20% 17.5%;--sidebar-accent-foreground: 350 30% 98%;--sidebar-border: 342 20% 17.5%;--sidebar-ring: 350 70% 85%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));font-family:Inter,system-ui,sans-serif;color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;background-color:hsl(var(--muted-foreground) / .4)}::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--muted-foreground) / .6)}@font-face{font-family:SF Pro Display;src:local("SF Pro Display"),local("SFProDisplay"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Medium"),local("SFProDisplay-Medium"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Semibold"),local("SFProDisplay-Semibold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Bold"),local("SFProDisplay-Bold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff) format("woff");font-weight:700;font-style:normal}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.glass-card{border-width:1px;border-color:#fff3;background-color:#fffc;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.glass-panel{border-width:1px;border-color:#fff6;background-color:#ffffffe6;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #f9a8d4 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.hover-transition{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1)}.button-transition{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.sidebar-icon{margin-right:.75rem;margin-top:.125rem;height:1rem;width:1rem;flex-shrink:0;--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.sidebar-section{display:flex;align-items:flex-start}.sidebar-sub-item{font-size:.875rem;line-height:1.25rem;color:hsl(var(--muted-foreground))}.persona-card{position:relative;overflow:hidden;min-height:360px}.persona-card-overlay{pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.persona-card:hover .persona-card-overlay,.persona-card.selected .persona-card-overlay{background-color:#ecd1de4d}.persona-card-checkmark{position:absolute;top:.75rem;left:.75rem;z-index:20;opacity:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1);border-radius:9999px;border-width:1px;border-color:#fff6;background-color:#ffffffe6;padding:.25rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.persona-card.selected .persona-card-checkmark{opacity:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-12{bottom:-3rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-top-12{top:-3rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[-10rem\]{bottom:-10rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-\[50\%\]{left:50%}.left-\[calc\(50\%\+11rem\)\]{left:calc(50% + 11rem)}.left-\[calc\(50\%-11rem\)\]{left:calc(50% - 11rem)}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-16{top:4rem}.top-2{top:.5rem}.top-20{top:5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[-10rem\]{top:-10rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.col-span-full{grid-column:1 / -1}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-5{margin-right:1.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[1155\/678\]{aspect-ratio:1155/678}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1px\]{height:1px}.h-\[25vh\]{height:25vh}.h-\[450px\]{height:450px}.h-\[70vh\]{height:70vh}.h-\[calc\(100vh-12rem\)\]{height:calc(100vh - 12rem)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-\[100px\]{min-height:100px}.min-h-\[40px\]{min-height:40px}.min-h-\[60px\]{min-height:60px}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-5\/6{width:83.333333%}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[100px\]{width:100px}.w-\[1px\]{width:1px}.w-\[350px\]{width:350px}.w-\[36\.125rem\]{width:36.125rem}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-32{min-width:8rem}.min-w-36{min-width:9rem}.min-w-5{min-width:1.25rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[400px\]{max-width:400px}.max-w-\[70\%\]{max-width:70%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;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))}.-translate-x-px{--tw-translate-x: -1px;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))}.-translate-y-1\/2{--tw-translate-y: -50%;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))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;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))}.translate-x-px{--tw-translate-x: 1px;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))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;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))}.rotate-45{--tw-rotate: 45deg;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))}.rotate-90{--tw-rotate: 90deg;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))}.rotate-\[30deg\]{--tw-rotate: 30deg;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))}.scale-\[1\.02\]{--tw-scale-x: 1.02;--tw-scale-y: 1.02;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))}.transform{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))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .5s ease-out}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}.animate-float{animation:float 3s ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.border-\[\#0078d4\]{--tw-border-opacity: 1;border-color:rgb(0 120 212 / var(--tw-border-opacity, 1))}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/20{border-color:hsl(var(--destructive) / .2)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted-foreground\/20{border-color:hsl(var(--muted-foreground) / .2)}.border-muted-foreground\/30{border-color:hsl(var(--muted-foreground) / .3)}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-200\/80{border-color:#e2e8f0cc}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-l-green-500{--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-l-primary{border-left-color:hsl(var(--primary))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[\#0078d4\]{--tw-bg-opacity: 1;background-color:rgb(0 120 212 / var(--tw-bg-opacity, 1))}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-50\/50{background-color:#eff6ff80}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-foreground{background-color:hsl(var(--foreground))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-900\/10{background-color:#1118271a}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(251 207 232 / var(--tw-bg-opacity, 1))}.bg-pink-300{--tw-bg-opacity: 1;background-color:rgb(249 168 212 / var(--tw-bg-opacity, 1))}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--tw-gradient-stops))}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position);--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-100{--tw-gradient-from: #f3f4f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(243 244 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary{--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position)}.to-blue-400\/5{--tw-gradient-to: rgb(96 165 250 / .05) var(--tw-gradient-to-position)}.to-gray-200{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.to-primary{--tw-gradient-to: hsl(var(--primary)) var(--tw-gradient-to-position)}.to-slate-50{--tw-gradient-to: #f8fafc var(--tw-gradient-to-position)}.fill-amber-400{fill:#fbbf24}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:Inter,system-ui,sans-serif}.font-sf{font-family:SF Pro Display,system-ui,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.8rem\]{font-size:.8rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-8{line-height:2rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-\[0_-2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 -2px 4px rgba(0,0,0,.05);--tw-shadow-colored: 0 -2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity, 1))}.ring-gray-900\/10{--tw-ring-color: rgb(17 24 39 / .1)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@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))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.fade-in-80{--tw-enter-opacity: .8}.zoom-in-95{--tw-enter-scale: .95}.duration-1000{animation-duration:1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.running{animation-play-state:running}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-slate-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-500::placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;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))}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:pb-0:last-child{padding-bottom:0}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.hover\:translate-y-\[-2px\]:hover{--tw-translate-y: -2px;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))}.hover\:translate-y-\[-4px\]:hover{--tw-translate-y: -4px;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))}.hover\:border-\[\#106ebe\]:hover{--tw-border-opacity: 1;border-color:rgb(16 110 190 / var(--tw-border-opacity, 1))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#106ebe\]:hover{--tw-bg-opacity: 1;background-color:rgb(16 110 190 / var(--tw-bg-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50\/50:hover{background-color:#f9fafb80}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-300:hover{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-gray-900\/20:hover{--tw-ring-color: rgb(17 24 39 / .2)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary:focus{--tw-ring-color: hsl(var(--primary))}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\: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);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\: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);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-slate-950:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(2 6 23 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.toast .group-\[\.toast\]\:absolute{position:absolute}.group.toast .group-\[\.toast\]\:left-3{left:.75rem}.group.toast .group-\[\.toast\]\:top-3{top:.75rem}.group.toast .group-\[\.toast\]\:h-5{height:1.25rem}.group.toast .group-\[\.toast\]\:w-5{width:1.25rem}.group.toast .group-\[\.toast\]\:rounded-md{border-radius:calc(var(--radius) - 2px)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.toast .group-\[\.toast\]\:p-1{padding:.25rem}.group.toaster .group-\[\.toaster\]\:pr-8{padding-right:2rem}.group.toast .group-\[\.toast\]\:text-foreground\/70{color:hsl(var(--foreground) / .7)}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toast .group-\[\.toast\]\:opacity-100{opacity:1}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.toast .group-\[\.toast\]\:transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.group.toast .hover\:group-\[\.toast\]\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.group.toast .hover\:group-\[\.toast\]\:text-foreground:hover{color:hsl(var(--foreground))}.group.toast .focus\:group-\[\.toast\]\:opacity-100:focus{opacity:1}.group.toast .focus\:group-\[\.toast\]\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.group.toast .focus\:group-\[\.toast\]\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group.toast .focus\:group-\[\.toast\]\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.has-\[\:disabled\]\:opacity-50:has(:disabled){opacity:.5}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.aria-selected\:opacity-30[aria-selected=true]{opacity:.3}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;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))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;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))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;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))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;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))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;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))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;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))}.data-\[state\=open\]\:rotate-90[data-state=open]{--tw-rotate: 90deg;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))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed],.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;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))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;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))}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;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))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180,.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;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))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:from-gray-900:is(.dark *){--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-gray-800:is(.dark *){--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:bottom-\[-20rem\]{bottom:-20rem}.sm\:left-\[calc\(50\%\+30rem\)\]{left:calc(50% + 30rem)}.sm\:left-\[calc\(50\%-30rem\)\]{left:calc(50% - 30rem)}.sm\:top-\[-20rem\]{top:-20rem}.sm\:mt-0{margin-top:0}.sm\:mt-24{margin-top:6rem}.sm\:flex{display:flex}.sm\:w-\[72\.1875rem\]{width:72.1875rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:.625rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-32{padding-top:8rem;padding-bottom:8rem}.sm\:text-left{text-align:left}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-6xl{font-size:3.75rem;line-height:1}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-64{width:16rem}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:border-l{border-left-width:1px}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-0{margin-left:0;margin-right:0}.lg\:mt-0{margin-top:0}.lg\:flex{display:flex}.lg\:w-64{width:16rem}.lg\:flex-auto{flex:1 1 auto}.lg\:flex-shrink-0{flex-shrink:0}.lg\:flex-grow{flex-grow:1}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:gap-x-10{-moz-column-gap:2.5rem;column-gap:2.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-40{padding-top:10rem;padding-bottom:10rem}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;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))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;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))}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;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))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/dist/index.html b/dist/index.html index b34dc4c1..e826c083 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,8 +7,8 @@ - - + + diff --git a/src/components/AssetUploader.tsx b/src/components/AssetUploader.tsx index 1ad48918..9e31396b 100644 --- a/src/components/AssetUploader.tsx +++ b/src/components/AssetUploader.tsx @@ -1,9 +1,11 @@ -import { useState, useEffect } from 'react'; -import { Upload, UploadCloud, X, FileText, Image as ImageIcon, FileVideo, Loader2, RefreshCw, Edit3, Check } from 'lucide-react'; +import { useState, useEffect, useRef } from 'react'; +import { Upload, UploadCloud, X, FileText, Image as ImageIcon, FileVideo, Loader2, RefreshCw, Edit3, Check, Trash2 } from 'lucide-react'; import { toast } from 'sonner'; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; +import { Progress } from "@/components/ui/progress"; +import { Badge } from "@/components/ui/badge"; import { focusGroupsApi } from '@/lib/api'; // Backend asset interface (matches what we get from the API) @@ -24,35 +26,45 @@ interface LocalAsset { status: 'uploading' | 'uploaded' | 'failed' | 'retry'; backendAsset?: BackendAsset; error?: string; + progress?: number; } interface AssetUploaderProps { onAssetsChange?: (assets: BackendAsset[]) => void; onUploadComplete?: (assets: BackendAsset[]) => void; onUploadError?: (error: unknown) => void; + onFilesChange?: (files: File[]) => void; // for non-backend file tracking focusGroupId?: string; disabled?: boolean; maxAssets?: number; allowedTypes?: string[]; label?: string; description?: string; + maxFileSize?: number; // in MB + enableRenaming?: boolean; // whether to show file renaming functionality } export default function AssetUploader({ onAssetsChange, onUploadComplete, onUploadError, + onFilesChange, focusGroupId, disabled = false, maxAssets = 10, allowedTypes = ['image/*', 'application/pdf', 'video/*'], label = 'Upload Assets', - description = 'Upload creative assets for testing' + description = 'Upload creative assets for testing', + maxFileSize = 10, // 10MB default + enableRenaming = true }: AssetUploaderProps) { const [localAssets, setLocalAssets] = useState([]); const [backendAssets, setBackendAssets] = useState([]); const [editingAsset, setEditingAsset] = useState(null); const [editingName, setEditingName] = useState(''); + const [isDragOver, setIsDragOver] = useState(false); + const fileInputRef = useRef(null); + const dropzoneRef = useRef(null); // Fetch existing backend assets when focusGroupId changes useEffect(() => { @@ -61,6 +73,14 @@ export default function AssetUploader({ } }, [focusGroupId]); // fetchBackendAssets is stable and doesn't need to be in deps + // Notify parent component of file changes for non-backend usage + useEffect(() => { + if (onFilesChange) { + const currentFiles = localAssets.map(asset => asset.file); + onFilesChange(currentFiles); + } + }, [localAssets, onFilesChange]); + const fetchBackendAssets = async () => { if (!focusGroupId) return; @@ -78,8 +98,47 @@ export default function AssetUploader({ } }; + // Validate file type and size + const validateFile = (file: File): string | null => { + // Check file type + const isValidType = allowedTypes.some(type => { + if (type.includes('*')) { + const baseType = type.split('/')[0]; + return file.type.startsWith(baseType + '/'); + } + return file.type === type; + }); + + if (!isValidType) { + return `File "${file.name}" is not a supported file type. Supported types: ${getFileTypeNames().join(', ')}.`; + } + + // Check file size (convert MB to bytes) + const maxSizeInBytes = maxFileSize * 1024 * 1024; + if (file.size > maxSizeInBytes) { + return `File "${file.name}" is too large. Maximum file size: ${maxFileSize}MB.`; + } + + return null; + }; + + // Get friendly file type names + const getFileTypeNames = () => { + const typeMap: { [key: string]: string } = { + 'image/*': 'Images', + 'application/pdf': 'PDF', + 'video/*': 'Videos', + 'text/*': 'Text files', + 'application/msword': 'Word docs', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'Word docs', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'Excel files' + }; + + return allowedTypes.map(type => typeMap[type] || type).filter((v, i, a) => a.indexOf(v) === i); + }; + const handleFileUpload = async (files: FileList | null) => { - if (!files || files.length === 0 || !focusGroupId) return; + if (!files || files.length === 0) return; // Check if adding these files would exceed the limit const totalAssets = localAssets.length + backendAssets.length; @@ -88,8 +147,29 @@ export default function AssetUploader({ return; } - // Create local asset objects for immediate UI feedback - const newLocalAssets: LocalAsset[] = Array.from(files).map(file => { + // Validate each file + const validFiles: File[] = []; + const errors: string[] = []; + + Array.from(files).forEach(file => { + const validationError = validateFile(file); + if (validationError) { + errors.push(validationError); + } else { + validFiles.push(file); + } + }); + + // Show validation errors + if (errors.length > 0) { + errors.forEach(error => toast.error(error)); + if (validFiles.length === 0) { + return; + } + } + + // Create local asset objects for immediate UI feedback (only for valid files) + const newLocalAssets: LocalAsset[] = validFiles.map(file => { const previewUrl = file.type.startsWith('image/') ? URL.createObjectURL(file) : undefined; @@ -98,29 +178,50 @@ export default function AssetUploader({ id: `local-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, file, previewUrl, - status: 'uploading' + status: 'uploading', + progress: 0 }; }); // Add to local state for immediate UI feedback setLocalAssets(prev => [...prev, ...newLocalAssets]); - // Upload each file to backend + // Upload each file to backend (only if focusGroupId exists for backend uploads) for (const localAsset of newLocalAssets) { + if (!focusGroupId) { + // For generic file upload without backend (like persona creation), just mark as complete + setLocalAssets(prev => prev.map(asset => + asset.id === localAsset.id + ? { ...asset, status: 'uploaded', progress: 100 } + : asset + )); + continue; + } + + // Simulate progress for better UX + const updateProgress = (progress: number) => { + setLocalAssets(prev => prev.map(asset => + asset.id === localAsset.id + ? { ...asset, progress } + : asset + )); + }; + try { + updateProgress(10); const formData = new FormData(); formData.append('assets', localAsset.file); + updateProgress(50); const uploadResponse = await focusGroupsApi.uploadAssets(focusGroupId, formData, false); const uploadResult = uploadResponse.data; if (uploadResult.uploaded_assets > 0) { - // Update local asset status - setLocalAssets(prev => prev.map(asset => - asset.id === localAsset.id - ? { ...asset, status: 'uploaded' } - : asset - )); + updateProgress(100); + // Remove local asset from the list since it's now a backend asset + setTimeout(() => { + setLocalAssets(prev => prev.filter(asset => asset.id !== localAsset.id)); + }, 500); // Small delay to show 100% progress // Fetch updated backend assets await fetchBackendAssets(); @@ -138,6 +239,7 @@ export default function AssetUploader({ ? { ...asset, status: 'failed', + progress: 0, error: (error as { response?: { data?: { error?: string } } }).response?.data?.error || 'Upload failed' } : asset @@ -179,6 +281,72 @@ export default function AssetUploader({ setLocalAssets(prev => prev.filter(asset => asset.id !== assetId)); }; + + // Handle drag and drop events + const handleDragEnter = (e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + setIsDragOver(true); + }; + + const handleDragLeave = (e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + // Only set drag over to false if we're leaving the dropzone entirely + if (!dropzoneRef.current?.contains(e.relatedTarget as Node)) { + setIsDragOver(false); + } + }; + + const handleDragOver = (e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + }; + + const handleDrop = (e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + setIsDragOver(false); + + if (disabled) return; + + const files = e.dataTransfer.files; + if (files.length > 0) { + handleFileUpload(files); + } + }; + + // Clear all files functionality + const handleClearAll = () => { + if (localAssets.length === 0 && backendAssets.length === 0) return; + + // Clean up preview URLs + localAssets.forEach(asset => { + if (asset.previewUrl) { + URL.revokeObjectURL(asset.previewUrl); + } + }); + + setLocalAssets([]); + + // Remove backend assets if focusGroupId exists + if (focusGroupId && backendAssets.length > 0) { + Promise.all(backendAssets.map(asset => + focusGroupsApi.deleteAsset(focusGroupId, asset.filename).catch(console.error) + )).then(() => { + setBackendAssets([]); + if (onAssetsChange) { + onAssetsChange([]); + } + toast.info('All assets cleared'); + }); + } else { + setBackendAssets([]); + if (onAssetsChange) { + onAssetsChange([]); + } + } + }; const handleRetryUpload = async (localAsset: LocalAsset) => { if (!focusGroupId) return; @@ -186,7 +354,7 @@ export default function AssetUploader({ // Update status to uploading setLocalAssets(prev => prev.map(asset => asset.id === localAsset.id - ? { ...asset, status: 'uploading', error: undefined } + ? { ...asset, status: 'uploading', error: undefined, progress: 0 } : asset )); @@ -194,16 +362,28 @@ export default function AssetUploader({ const formData = new FormData(); formData.append('assets', localAsset.file); + // Update progress during retry + setLocalAssets(prev => prev.map(asset => + asset.id === localAsset.id + ? { ...asset, progress: 50 } + : asset + )); + const uploadResponse = await focusGroupsApi.uploadAssets(focusGroupId, formData, false); const uploadResult = uploadResponse.data; if (uploadResult.uploaded_assets > 0) { setLocalAssets(prev => prev.map(asset => asset.id === localAsset.id - ? { ...asset, status: 'uploaded' } + ? { ...asset, progress: 100 } : asset )); + // Remove local asset from the list since it's now a backend asset + setTimeout(() => { + setLocalAssets(prev => prev.filter(asset => asset.id !== localAsset.id)); + }, 500); + await fetchBackendAssets(); toast.success(`${localAsset.file.name} uploaded successfully`); } else { @@ -215,6 +395,7 @@ export default function AssetUploader({ ? { ...asset, status: 'failed', + progress: 0, error: (error as { response?: { data?: { error?: string } } }).response?.data?.error || 'Upload failed' } : asset @@ -283,79 +464,150 @@ export default function AssetUploader({ const remainingSlots = maxAssets - totalAssets; return ( -
- {/* Upload area */} -
- {disabled ? ( - <> - -

Asset Upload Disabled

-

Complete focus group details above to enable asset uploads

- - ) : ( - <> - -

{label}

-

{description}

- handleFileUpload(e.target.files)} - className="hidden" - id="asset-uploader-input" - disabled={disabled} - /> - -

- {remainingSlots} of {maxAssets} uploads remaining -

- - )} +
+ {/* Enhanced Upload Dropzone */} +
+
+

{label}

+

{description}

+
+ +
!disabled && fileInputRef.current?.click()} + > +
+ + + {disabled ? ( +
+

File Upload Disabled

+

Complete the required details above to enable file uploads

+
+ ) : ( +
+

+ {isDragOver ? 'Drop files here' : 'Drag and drop files here, or click to browse'} +

+ + {/* File Type Pills */} +
+ {getFileTypeNames().map((fileType, index) => ( + + {fileType} + + ))} +
+ +

+ Maximum file size: {maxFileSize}MB +

+ + handleFileUpload(e.target.files)} + className="hidden" + disabled={disabled} + /> + +
+ + + {(localAssets.length > 0 || backendAssets.length > 0) && ( + + )} +
+ +

+ {remainingSlots} of {maxAssets} uploads remaining +

+
+ )} +
+
- {/* Assets preview */} + {/* Enhanced Assets Preview */} {(backendAssets.length > 0 || localAssets.length > 0) && ( - -

- Uploaded Assets ({backendAssets.length + localAssets.filter(a => a.status === 'uploaded').length}) -

+ +
+

+ Uploaded Files ({localAssets.length + backendAssets.length}) +

+ {(localAssets.length > 0 || backendAssets.length > 0) && ( + + )} +
{/* Backend assets (successfully uploaded) */} {backendAssets.map((asset, index) => ( -
- {/* Asset preview */} -
+
+ {/* File preview/icon */} +
{asset.mime_type?.startsWith('image/') ? ( {getDisplayName(asset, ) : ( getAssetIcon(asset.mime_type) )}
- {/* Asset info and naming */} + {/* File info */}
- {editingAsset === asset.filename ? ( + {enableRenaming && editingAsset === asset.filename ? (
{ if (e.key === 'Enter') { - e.preventDefault(); // Prevent form submission + e.preventDefault(); saveAssetName(asset.filename); } else if (e.key === 'Escape') { cancelEditingAssetName(); @@ -395,37 +647,46 @@ export default function AssetUploader({

{getDisplayName(asset, index)}

- + {enableRenaming && ( + + )} +
+
+

+ Original: {asset.original_name} +

+ + Complete +
-

- Original: {asset.original_name} -

)}
- {/* Actions and status */} + {/* Actions */}
-
-
Will appear as:
-
- "{getDisplayName(asset, index)}" + {enableRenaming && ( +
+
Will appear as:
+
+ "{getDisplayName(asset, index)}" +
-
+ )} @@ -433,43 +694,68 @@ export default function AssetUploader({
))} - {/* Local assets (uploading/failed) */} + {/* Local assets (uploading/failed/completed) */} {localAssets.map((asset) => ( -
- {/* Asset preview */} -
+
+ {/* File preview/icon */} +
{asset.previewUrl ? ( {asset.file.name} ) : ( getAssetIcon(asset.file.type) )}
- {/* Asset info */} + {/* File info */}

{asset.file.name}

-

- {(asset.file.size / 1024).toFixed(1)} KB +

+ {(asset.file.size / 1024 / 1024).toFixed(2)} MB

+ + {/* Progress bar for uploading files */} + {asset.status === 'uploading' && ( +
+ +
+ Uploading... + {asset.progress || 0}% +
+
+ )} + + {/* Error message for failed files */} {asset.error && ( -

{asset.error}

+

{asset.error}

)}
- {/* Status and actions */} + {/* Status badge and actions */}
+ {/* Status badge */} {asset.status === 'uploading' && ( -
- - Uploading... +
+ + + Uploading +
)} + {asset.status === 'uploaded' && ( + + + Complete + + )} {asset.status === 'failed' && (
+ + Failed +
)} + + {/* Remove button */} @@ -497,9 +785,9 @@ export default function AssetUploader({
{/* Help text */} - {backendAssets.length > 0 && ( -
-

+ {enableRenaming && backendAssets.length > 0 && ( +

+

Asset Names: Click the edit icon to customize how assets will be referenced in the discussion guide. Leave blank to use default numbering.

diff --git a/src/components/FocusGroupModerator.tsx b/src/components/FocusGroupModerator.tsx index a39c1e90..445f7dc9 100644 --- a/src/components/FocusGroupModerator.tsx +++ b/src/components/FocusGroupModerator.tsx @@ -1545,9 +1545,11 @@ Controls how much time GPT-5 spends thinking before responding setBackendAssets(assets); }} maxAssets={10} - allowedTypes={['image/*', 'application/pdf', 'video/*']} - label="Upload Creative Assets" - description="Upload images, mockups, or product designs for testing" + maxFileSize={10} + allowedTypes={['image/*', 'application/pdf', 'video/*', 'text/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']} + label="Asset Upload" + description="Provide any files you wish the moderator to use in the focus group session. This could include mockups, designs, documents, or other materials for discussion." + enableRenaming={true} />

Upload visuals that you want feedback on during the session diff --git a/src/components/ai-recruiter/AIRecruiterForm.tsx b/src/components/ai-recruiter/AIRecruiterForm.tsx index 1bf7f22e..70b89509 100644 --- a/src/components/ai-recruiter/AIRecruiterForm.tsx +++ b/src/components/ai-recruiter/AIRecruiterForm.tsx @@ -6,6 +6,7 @@ import { z } from "zod"; import { Upload, Users, FileText, RefreshCw, CheckCircle2, UploadCloud, Lightbulb, X, ChevronDown, ChevronUp } from 'lucide-react'; import { toast } from 'sonner'; import { aiPersonasApi } from '@/lib/api'; +import AssetUploader from '@/components/AssetUploader'; import { Button } from "@/components/ui/button"; import { @@ -51,6 +52,15 @@ export default function AIRecruiterForm({ onSubmit, isGenerating }: AIRecruiterF const [suggestions, setSuggestions] = useState<{audience_brief: string[], research_objective: string[]}>({audience_brief: [], research_objective: []}); const [isLoadingSuggestions, setIsLoadingSuggestions] = useState(false); const [enhancementError, setEnhancementError] = useState(null); + const [uploadedFiles, setUploadedFiles] = useState(null); + const [currentFiles, setCurrentFiles] = useState([]); + + // Helper function to convert File array to FileList + const createFileList = (files: File[]): FileList => { + const dt = new DataTransfer(); + files.forEach(file => dt.items.add(file)); + return dt.files; + }; const form = useForm>({ resolver: zodResolver(formSchema), @@ -212,54 +222,25 @@ export default function AIRecruiterForm({ onSubmit, isGenerating }: AIRecruiterF

- ( - - Customer Data (Optional) - -
- -

Upload customer data for more accurate personas

-

Supports PDF, Office docs, images, and more

- { - onChange(e.target.files); - }} - className="hidden" - id="data-file-input" - /> - - {value && value.length > 0 && ( -

- {value.length === 1 - ? value[0].name - : `${value.length} files selected` - } -

- )} -
-
- - Upload existing customer data to create more realistic personas - - -
- )} - /> +
+ { + setCurrentFiles(files); + setUploadedFiles(files.length > 0 ? createFileList(files) : null); + }} + /> +

+ Supports PDF, Word docs, Excel files, text files, and images +

+
@@ -431,9 +412,17 @@ export default function AIRecruiterForm({ onSubmit, isGenerating }: AIRecruiterF