diff --git a/_swaggers/guild_quality.json b/_swaggers/guild_quality.json new file mode 100644 index 000000000..97c4a03da --- /dev/null +++ b/_swaggers/guild_quality.json @@ -0,0 +1,1108 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "GuildQuality API Documentation", + "description": "GuildQuality offers several methods for retrieving data from and adding data to your GuildQuality account.\n\n# Authentication\nEach request to the API is authenticated by an API bearer token which is unique to each member account. To activate your API credentials, go to Account > API.\n\nOnce your API credentials have been activated, make sure to keep them guarded. Anyone who has access to them will have access to your survey data as long as the credentials remain active. If you ever need new credentials for any reason, deactivate your current credentials then you’ll be provided with option to request new ones. Credentials are available on the API section of the Settings page of the GuildQuality app.\n\n# Error Codes\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Status codeMeaning
400Malformed parameters or other bad request.
401Unauthorized. (Login is required. Check Bearer token is correct.)
422Unprocessable Entity. (Validation error. Check error message for specific valiation.)
\n\n# Rate limit\nAPI requests are limited to 300 requests per minute. If requests from a unique IP exceed that limit, then the IP will be blocked for 1 minute.", + "contact": {}, + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://sandbox.www.guildquality.com" + } + ], + "tags": [], + "paths": { + "/company-api/v3/children": { + "get": { + "summary": "Get Company Children", + "description": "Returns child accounts for a given account.", + "operationId": "getCompanyChildren", + "responses": { + "200": { + "description": "Get Company Children", + "headers": { + "X-RateLimit-Remaining": { + "schema": { + "type": "string" + } + }, + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "Server": { + "schema": { + "type": "string" + } + }, + "Connection": { + "schema": { + "type": "string" + } + }, + "Content-Encoding": { + "schema": { + "type": "string" + } + }, + "Set-Cookie": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + }, + "Expires": { + "schema": { + "type": "string" + } + }, + "X-RateLimit-Limit": { + "schema": { + "type": "string" + } + }, + "Content-Length": { + "schema": { + "type": "string" + } + }, + "Date": { + "schema": { + "type": "string" + } + }, + "X-Powered-By": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "example": [ + { + "createdAt": "2017-01-10T23:23:39-05:00", + "id": 908534, + "name": "Alpha Construction" + }, + { + "createdAt": "2019-06-21T17:16:58-04:00", + "id": 403593, + "name": "24-7 Restorations" + }, + { + "createdAt": "2019-09-05T15:43:39-04:00", + "id": 796431, + "name": "Master Craftz" + } + ], + "items": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "example": "2017-01-10T23:23:39-05:00" + }, + "id": { + "type": "number", + "example": 908534 + }, + "name": { + "type": "string", + "example": "Alpha Construction" + } + } + } + } + } + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/custom-fields": { + "get": { + "summary": "Get Custom Fields", + "description": "Returns available custom fields and values for an account.", + "operationId": "getCustomFields", + "responses": { + "200": { + "description": "Get Custom Fields", + "headers": { + "X-RateLimit-Remaining": { + "schema": { + "type": "string" + } + }, + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "Server": { + "schema": { + "type": "string" + } + }, + "Connection": { + "schema": { + "type": "string" + } + }, + "Content-Encoding": { + "schema": { + "type": "string" + } + }, + "Set-Cookie": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + }, + "Expires": { + "schema": { + "type": "string" + } + }, + "X-RateLimit-Limit": { + "schema": { + "type": "string" + } + }, + "Content-Length": { + "schema": { + "type": "string" + } + }, + "Date": { + "schema": { + "type": "string" + } + }, + "X-Powered-By": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "id": 14, + "label": "Region", + "values": [ + { + "id": 9342, + "value": "East" + }, + { + "id": 9340, + "value": "North" + }, + { + "id": 9341, + "value": "South" + }, + { + "id": 9343, + "value": "West" + } + ] + }, + { + "id": 210, + "label": "Team Name", + "values": [ + { + "id": 14336, + "value": "T Mobile" + } + ] + } + ], + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 14 + }, + "label": { + "type": "string", + "example": "Region" + }, + "values": { + "type": "array", + "example": [ + { + "id": 9342, + "value": "East" + }, + { + "id": 9340, + "value": "North" + }, + { + "id": 9341, + "value": "South" + }, + { + "id": 9343, + "value": "West" + } + ], + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 9342 + }, + "value": { + "type": "string", + "example": "East" + } + } + } + } + } + } + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/project-user-roles": { + "get": { + "summary": "Get Project User Roles", + "description": "Get Project User Roles", + "operationId": "getProjectUserRoles", + "responses": { + "200": { + "description": "Get Project User Roles", + "headers": { + "X-RateLimit-Remaining": { + "schema": { + "type": "string" + } + }, + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "Server": { + "schema": { + "type": "string" + } + }, + "Connection": { + "schema": { + "type": "string" + } + }, + "Content-Encoding": { + "schema": { + "type": "string" + } + }, + "Set-Cookie": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + }, + "Expires": { + "schema": { + "type": "string" + } + }, + "X-RateLimit-Limit": { + "schema": { + "type": "string" + } + }, + "Content-Length": { + "schema": { + "type": "string" + } + }, + "Date": { + "schema": { + "type": "string" + } + }, + "X-Powered-By": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "example": [ + { + "id": 1, + "name": "Project Manager" + }, + { + "id": 2, + "name": "Salesperson" + } + ], + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 1 + }, + "name": { + "type": "string", + "example": "Project Manager" + } + } + } + } + } + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/reports": { + "get": { + "summary": "Get Reports", + "description": "Return company reports.", + "operationId": "getReports", + "responses": { + "200": { + "description": "Get all Reports", + "headers": { + "X-RateLimit-Remaining": { + "schema": { + "type": "string" + } + }, + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "Server": { + "schema": { + "type": "string" + } + }, + "Connection": { + "schema": { + "type": "string" + } + }, + "Content-Encoding": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + }, + "X-RateLimit-Limit": { + "schema": { + "type": "string" + } + }, + "Content-Length": { + "schema": { + "type": "string" + } + }, + "Date": { + "schema": { + "type": "string" + } + }, + "phpdebugbar-id": { + "schema": { + "type": "string" + } + }, + "X-Powered-By": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "example": [ + { + "id": 7783, + "name": "3 stars or less, only Value" + }, + { + "id": 33354, + "name": "Chris's Report Card" + }, + { + "id": 7558, + "name": "GQI" + }, + { + "id": 115, + "name": "Monthly Report" + }, + { + "id": 96103, + "name": "New report" + }, + { + "id": 24176, + "name": "Sales Rep" + }, + { + "id": 472, + "name": "Schedule & Budget" + }, + { + "id": 11, + "name": "Test Report" + } + ], + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 7783 + }, + "name": { + "type": "string", + "example": "3 stars or less, only Value" + } + } + } + } + } + } + } + } + } + } + } + }, + "/company-api/v3/review-summary": { + "get": { + "summary": "Get Review Summary", + "description": "Return affiliate summary review data grouped by company. The following data is returned:\n\n- Company information\n- Total number of completed surveys\n- Breakdown of review data including average and stars received\n- Satisfactory data by question", + "operationId": "getReviewSummary", + "parameters": [ + { + "name": "filterByCompanyIds", + "in": "query", + "description": "(Optional) For partner/parent accounts, filter by affiliate/child company id
\nFormat: INT", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "description": "(Optional) Specify to paginate company reviews 100 companies at a time. A value of 1 will return companies 1 to 100; a value of 2 will return companies 101 to 200; etc. Next, Previous, etc. meta data is also returned.
\nFormat: INT", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": {} + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/reviews": { + "get": { + "summary": "Get Reviews", + "description": "Return company reviews.", + "operationId": "getReviews", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "(Optional) Specifies the max number of reviews to return
\nNote: When a limit is specified, the response body will not be paginated
\nFormat: INT", + "schema": { + "type": "string" + } + }, + { + "name": "since", + "in": "query", + "description": "(Optional) Return all completed reviews since the given date
\nFormat: YYYY-MM-DD\n", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "(Optional) Return all completed reviews before the given date
\nFormat: YYYY-MM-DD", + "schema": { + "type": "string" + } + }, + { + "name": "dateFilter", + "in": "query", + "description": "(Optional) Specify which date to use when filter by since and/or until dates
\nFormat: enum(‘reviewedAt’, lastActivityAt’)
\nDefault: reviewedAt", + "schema": { + "type": "string" + } + }, + { + "name": "filterByCompanyIds", + "in": "query", + "description": "(Optional) For partner/parent accounts, filter by affiliate/child company id
\nFormat: INT", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": {} + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/reviews/{reviewId}": { + "get": { + "summary": "Get Review", + "description": "Return company reviews.", + "operationId": "getReview", + "parameters": [ + { + "name": "reviewId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": {} + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/survey-templates": { + "get": { + "summary": "Get Survey Templates", + "description": "Returns available survey templates for an account.", + "operationId": "getSurveyTemplates", + "parameters": [ + { + "name": "archived", + "in": "query", + "description": "(Optional) Include archived survey templates
\nFormat: To include archived survey templates set this parameter to 1. To exclude them, don’t include the parameter or set it to 0.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Get Survey Templates including archived", + "headers": { + "X-RateLimit-Remaining": { + "schema": { + "type": "string" + } + }, + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "Server": { + "schema": { + "type": "string" + } + }, + "Connection": { + "schema": { + "type": "string" + } + }, + "Content-Encoding": { + "schema": { + "type": "string" + } + }, + "Set-Cookie": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + }, + "Expires": { + "schema": { + "type": "string" + } + }, + "X-RateLimit-Limit": { + "schema": { + "type": "string" + } + }, + "Content-Length": { + "schema": { + "type": "string" + } + }, + "Date": { + "schema": { + "type": "string" + } + }, + "X-Powered-By": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "example": [ + { + "archivedAt": "2021-09-08T10:19:21-04:00", + "id": 231, + "name": "Email-only smart survey", + "schedule": "4 weeks after the project end date", + "smartQuestionsMuted": false, + "surveyProcess": "email" + }, + { + "id": 232, + "name": "Finished project survey", + "schedule": "4 weeks after the project end date", + "smartQuestionsMuted": false, + "surveyProcess": "email" + }, + { + "archivedAt": "2021-09-08T10:19:21-04:00", + "id": 1185, + "name": "In progress", + "schedule": "10 days after the project start date", + "smartQuestionsMuted": false, + "surveyProcess": "full" + }, + { + "id": 2861, + "name": "Prospect survey", + "schedule": "0 days after the project creation date", + "smartQuestionsMuted": true, + "surveyProcess": "full" + } + ], + "items": { + "type": "object", + "properties": { + "archivedAt": { + "type": "string", + "example": "2021-09-08T10:19:21-04:00" + }, + "id": { + "type": "number", + "example": 231 + }, + "name": { + "type": "string", + "example": "Email-only smart survey" + }, + "schedule": { + "type": "string", + "example": "4 weeks after the project end date" + }, + "smartQuestionsMuted": { + "type": "boolean", + "example": false + }, + "surveyProcess": { + "type": "string", + "example": "email" + } + } + } + } + } + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/surveys": { + "get": { + "summary": "Get Surveys", + "description": "Return company surveys.", + "operationId": "getSurveys", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "(Optional) Return all surveys with the given status
\nFormat: enum(‘completed’, ‘scheduled’, ‘in-progress’, ‘no-response’, 'abandoned')", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "(Optional) Specifies the max number of surveys to return
\nNote: When a limit is specified, the response body will not be paginated
\nFormat: INT", + "schema": { + "type": "string" + } + }, + { + "name": "since", + "in": "query", + "description": "(Optional) Return surveys since the given date
\nFormat: YYYY-MM-DD\n", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "(Optional) Return surveys before the given date
\nFormat: YYYY-MM-DD", + "schema": { + "type": "string" + } + }, + { + "name": "questions", + "in": "query", + "description": "(Optional) Return all question data included on returned surveys
\nFormat: To include questions set this parameter to 1. To exclude them, don’t include the parameter or set it to 0.", + "schema": { + "type": "string" + } + }, + { + "name": "orderBy", + "in": "query", + "description": "(Optional) Specify which date to use for DESC ordering
\nFormat: enum(‘endedAt’, 'sendAt’, 'createdAt')
\nDefault: sendAt", + "schema": { + "type": "string" + } + }, + { + "name": "dateFilter", + "in": "query", + "description": "(Optional) Specify which date to use when filter by since and/or until dates
\nFormat: enum(‘endedAt’, 'sendAt’, 'createdAt')
\nDefault: endedAt", + "schema": { + "type": "string" + } + }, + { + "name": "reportId", + "in": "query", + "description": "(Optional) Return all surveys associated with a specific report
\nFormat: INT", + "schema": { + "type": "string" + } + }, + { + "name": "projectIds", + "in": "query", + "description": "(Optional) Return all surveys associated with specific project ids
\nFormat: INT, comma separated", + "schema": { + "type": "string" + } + }, + { + "name": "contactIds", + "in": "query", + "description": "(Optional) Return all surveys for the projects associated with specific contact ids
\nFormat: INT, comma separated", + "schema": { + "type": "string" + } + }, + { + "name": "externalIds", + "in": "query", + "description": "(Optional) Return all surveys for the projects associated with specific external ids
\nFormat: STRING, comma separated", + "schema": { + "type": "string" + } + }, + { + "name": "contactEmails", + "in": "query", + "description": "(Optional) Return all surveys for the projects associated with specific contact emails
\nFormat: STRING, comma separated", + "schema": { + "type": "string" + } + }, + { + "name": "filterByCompanyIds", + "in": "query", + "description": "(Optional) For partner/parent accounts, filter by affiliate/child company id
\nFormat: INT", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Get all Surveys", + "headers": { + "X-RateLimit-Remaining": { + "schema": { + "type": "string" + } + }, + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "Server": { + "schema": { + "type": "string" + } + }, + "Connection": { + "schema": { + "type": "string" + } + }, + "Content-Encoding": { + "schema": { + "type": "string" + } + }, + "Set-Cookie": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + }, + "Expires": { + "schema": { + "type": "string" + } + }, + "X-RateLimit-Limit": { + "schema": { + "type": "string" + } + }, + "Content-Length": { + "schema": { + "type": "string" + } + }, + "Date": { + "schema": { + "type": "string" + } + }, + "X-Powered-By": { + "schema": { + "type": "string" + } + } + }, + "content": {} + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/surveys/{surveyId}": { + "get": { + "summary": "Get Survey", + "description": "Returns data for a single survey.", + "operationId": "getSurvey", + "parameters": [ + { + "name": "surveyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "questions", + "in": "query", + "description": "(Optional) Return all question data included on returned surveys
\nFormat: To include questions set this parameter to 1. To exclude them, don’t include the parameter or set it to 0.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": {} + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/company-api/v3/team": { + "get": { + "summary": "Get Team", + "description": "Returns team members defined in an account.", + "operationId": "getTeam", + "responses": { + "200": { + "description": "Get Team", + "headers": { + "X-RateLimit-Remaining": { + "schema": { + "type": "string" + } + }, + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "Server": { + "schema": { + "type": "string" + } + }, + "Connection": { + "schema": { + "type": "string" + } + }, + "Content-Encoding": { + "schema": { + "type": "string" + } + }, + "Set-Cookie": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + }, + "Expires": { + "schema": { + "type": "string" + } + }, + "X-RateLimit-Limit": { + "schema": { + "type": "string" + } + }, + "Content-Length": { + "schema": { + "type": "string" + } + }, + "Date": { + "schema": { + "type": "string" + } + }, + "X-Powered-By": { + "schema": { + "type": "string" + } + } + }, + "content": {} + } + }, + "x-codegen-request-body-name": "body" + } + } + }, + "components": {}, + "x-original-swagger-version": "2.0" +} \ No newline at end of file diff --git a/backend/public/pilot.js b/backend/public/pilot.js index 5e6e587b5..aa8525fff 100644 --- a/backend/public/pilot.js +++ b/backend/public/pilot.js @@ -1,4 +1,4 @@ -function Lw(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function _r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pg={exports:{}},Ea={},Og={exports:{}},ce={};/** +function Lw(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function _r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pg={exports:{}},Pa={},Og={exports:{}},ce={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function Lw(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ou=Object.prototype.hasOwnProperty,rx=/^[: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]*$/,zf={},Nf={};function ox(e){return Ou.call(Nf,e)?!0:Ou.call(zf,e)?!1:rx.test(e)?Nf[e]=!0:(zf[e]=!0,!1)}function ix(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lx(e,t,n,r){if(t===null||typeof t>"u"||ix(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ct(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Je[e]=new ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Je[t]=new ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Je[e]=new ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Je[e]=new ct(e,2,!1,e,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(e){Je[e]=new ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Je[e]=new ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Je[e]=new ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Je[e]=new ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Je[e]=new ct(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zc=/[\-:]([a-z])/g;function Jc(e){return e[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(e){var t=e.replace(Zc,Jc);Je[t]=new ct(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zc,Jc);Je[t]=new ct(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zc,Jc);Je[t]=new ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Je[e]=new ct(e,1,!1,e.toLowerCase(),null,!1,!1)});Je.xlinkHref=new ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Je[e]=new ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function ep(e,t,n,r){var o=Je.hasOwnProperty(t)?Je[t]:null;(o!==null?o.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ou=Object.prototype.hasOwnProperty,rx=/^[: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]*$/,zf={},Nf={};function ox(e){return Ou.call(Nf,e)?!0:Ou.call(zf,e)?!1:rx.test(e)?Nf[e]=!0:(zf[e]=!0,!1)}function ix(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lx(e,t,n,r){if(t===null||typeof t>"u"||ix(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ct(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Je[e]=new ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Je[t]=new ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Je[e]=new ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Je[e]=new ct(e,2,!1,e,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(e){Je[e]=new ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Je[e]=new ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Je[e]=new ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Je[e]=new ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Je[e]=new ct(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zc=/[\-:]([a-z])/g;function Jc(e){return e[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(e){var t=e.replace(Zc,Jc);Je[t]=new ct(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zc,Jc);Je[t]=new ct(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zc,Jc);Je[t]=new ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Je[e]=new ct(e,1,!1,e.toLowerCase(),null,!1,!1)});Je.xlinkHref=new ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Je[e]=new ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function ep(e,t,n,r){var o=Je.hasOwnProperty(t)?Je[t]:null;(o!==null?o.type!==0:r||!(2a||o[l]!==i[a]){var s=` -`+o[l].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{As=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Vo(e):""}function ax(e){switch(e.tag){case 5:return Vo(e.type);case 16:return Vo("Lazy");case 13:return Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 2:case 15:return e=$s(e.type,!1),e;case 11:return e=$s(e.type.render,!1),e;case 1:return e=$s(e.type,!0),e;default:return""}}function _u(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hr:return"Fragment";case Ur:return"Portal";case Tu:return"Profiler";case tp:return"StrictMode";case Au:return"Suspense";case $u:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ug:return(e.displayName||"Context")+".Consumer";case Bg:return(e._context.displayName||"Context")+".Provider";case np:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rp:return t=e.displayName||null,t!==null?t:_u(e.type)||"Memo";case Bn:t=e._payload,e=e._init;try{return _u(e(t))}catch{}}return null}function sx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _u(t);case 8:return t===tp?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function rr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ux(e){var t=Wg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yi(e){e._valueTracker||(e._valueTracker=ux(e))}function Vg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Wl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ru(e,t){var n=t.checked;return De({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ff(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=rr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gg(e,t){t=t.checked,t!=null&&ep(e,"checked",t,!1)}function Lu(e,t){Gg(e,t);var n=rr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Du(e,t.type,n):t.hasOwnProperty("defaultValue")&&Du(e,t.type,rr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Du(e,t,n){(t!=="number"||Wl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Go=Array.isArray;function to(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Qi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ui(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qo={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},cx=["Webkit","ms","Moz","O"];Object.keys(Qo).forEach(function(e){cx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qo[t]=Qo[e]})});function Kg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qo.hasOwnProperty(e)&&Qo[e]?(""+t).trim():t+"px"}function Xg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Kg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var px=De({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 Iu(e,t){if(t){if(px[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Fu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 ju=null;function op(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mu=null,no=null,ro=null;function Uf(e){if(e=Di(e)){if(typeof Mu!="function")throw Error(F(280));var t=e.stateNode;t&&(t=$a(t),Mu(e.stateNode,e.type,t))}}function Zg(e){no?ro?ro.push(e):ro=[e]:no=e}function Jg(){if(no){var e=no,t=ro;if(ro=no=null,Uf(e),t)for(e=0;e>>=0,e===0?32:31-(kx(e)/Sx|0)|0}var Ki=64,Xi=4194304;function qo(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Yl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=qo(a):(i&=l,i!==0&&(r=qo(i)))}else l=n&~o,l!==0?r=qo(l):i!==0&&(r=qo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ri(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function Ox(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Xo),Xf=String.fromCharCode(32),Zf=!1;function wy(e,t){switch(e){case"keyup":return tb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function rb(e,t){switch(e){case"compositionend":return xy(t);case"keypress":return t.which!==32?null:(Zf=!0,Xf);case"textInput":return e=t.data,e===Xf&&Zf?null:e;default:return null}}function ob(e,t){if(Wr)return e==="compositionend"||!fp&&wy(e,t)?(e=yy(),Cl=up=Vn=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nd(n)}}function Cy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ey(){for(var e=window,t=Wl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wl(e.document)}return t}function dp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function db(e){var t=Ey(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cy(n.ownerDocument.documentElement,n)){if(r!==null&&dp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=rd(n,i);var l=rd(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Vr=null,Gu=null,Jo=null,qu=!1;function od(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qu||Vr==null||Vr!==Wl(r)||(r=Vr,"selectionStart"in r&&dp(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}),Jo&&mi(Jo,r)||(Jo=r,r=Xl(Gu,"onSelect"),0Yr||(e.current=Ju[Yr],Ju[Yr]=null,Yr--)}function Ce(e,t){Yr++,Ju[Yr]=e.current,e.current=t}var or={},ot=ur(or),ht=ur(!1),Cr=or;function co(e,t){var n=e.type.contextTypes;if(!n)return or;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function mt(e){return e=e.childContextTypes,e!=null}function Jl(){Ae(ht),Ae(ot)}function pd(e,t,n){if(ot.current!==or)throw Error(F(168));Ce(ot,t),Ce(ht,n)}function Dy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(F(108,sx(e)||"Unknown",o));return De({},n,r)}function ea(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||or,Cr=ot.current,Ce(ot,e),Ce(ht,ht.current),!0}function fd(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=Dy(e,t,Cr),r.__reactInternalMemoizedMergedChildContext=e,Ae(ht),Ae(ot),Ce(ot,e)):Ae(ht),Ce(ht,n)}var vn=null,_a=!1,Ws=!1;function zy(e){vn===null?vn=[e]:vn.push(e)}function Eb(e){_a=!0,zy(e)}function cr(){if(!Ws&&vn!==null){Ws=!0;var e=0,t=ve;try{var n=vn;for(ve=1;e>=l,o-=l,wn=1<<32-Kt(t)+o|n<T?(N=O,O=null):N=O.sibling;var P=d(g,O,v[T],C);if(P===null){O===null&&(O=N);break}e&&O&&P.alternate===null&&t(g,O),y=i(P,y,T),k===null?E=P:k.sibling=P,k=P,O=N}if(T===v.length)return n(g,O),$e&&mr(g,T),E;if(O===null){for(;TT?(N=O,O=null):N=O.sibling;var _=d(g,O,P.value,C);if(_===null){O===null&&(O=N);break}e&&O&&_.alternate===null&&t(g,O),y=i(_,y,T),k===null?E=_:k.sibling=_,k=_,O=N}if(P.done)return n(g,O),$e&&mr(g,T),E;if(O===null){for(;!P.done;T++,P=v.next())P=c(g,P.value,C),P!==null&&(y=i(P,y,T),k===null?E=P:k.sibling=P,k=P);return $e&&mr(g,T),E}for(O=r(g,O);!P.done;T++,P=v.next())P=f(O,g,T,P.value,C),P!==null&&(e&&P.alternate!==null&&O.delete(P.key===null?T:P.key),y=i(P,y,T),k===null?E=P:k.sibling=P,k=P);return e&&O.forEach(function(R){return t(g,R)}),$e&&mr(g,T),E}function w(g,y,v,C){if(typeof v=="object"&&v!==null&&v.type===Hr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case qi:e:{for(var E=v.key,k=y;k!==null;){if(k.key===E){if(E=v.type,E===Hr){if(k.tag===7){n(g,k.sibling),y=o(k,v.props.children),y.return=g,g=y;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Bn&&wd(E)===k.type){n(g,k.sibling),y=o(k,v.props),y.ref=Fo(g,k,v),y.return=g,g=y;break e}n(g,k);break}else t(g,k);k=k.sibling}v.type===Hr?(y=Sr(v.props.children,g.mode,C,v.key),y.return=g,g=y):(C=Rl(v.type,v.key,v.props,null,g.mode,C),C.ref=Fo(g,y,v),C.return=g,g=C)}return l(g);case Ur:e:{for(k=v.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(g,y.sibling),y=o(y,v.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=Zs(v,g.mode,C),y.return=g,g=y}return l(g);case Bn:return k=v._init,w(g,y,k(v._payload),C)}if(Go(v))return h(g,y,v,C);if(Lo(v))return m(g,y,v,C);ol(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(g,y.sibling),y=o(y,v),y.return=g,g=y):(n(g,y),y=Xs(v,g.mode,C),y.return=g,g=y),l(g)):n(g,y)}return w}var fo=Hy(!0),Wy=Hy(!1),zi={},sn=ur(zi),wi=ur(zi),xi=ur(zi);function xr(e){if(e===zi)throw Error(F(174));return e}function kp(e,t){switch(Ce(xi,t),Ce(wi,e),Ce(sn,zi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Nu(t,e)}Ae(sn),Ce(sn,t)}function ho(){Ae(sn),Ae(wi),Ae(xi)}function Vy(e){xr(xi.current);var t=xr(sn.current),n=Nu(t,e.type);t!==n&&(Ce(wi,e),Ce(sn,n))}function Sp(e){wi.current===e&&(Ae(sn),Ae(wi))}var Re=ur(0);function la(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vs=[];function Cp(){for(var e=0;en?n:4,e(!0);var r=Gs.transition;Gs.transition={};try{e(!1),t()}finally{ve=n,Gs.transition=r}}function a0(){return It().memoizedState}function Ab(e,t,n){var r=Jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},s0(e))u0(t,n);else if(n=jy(e,t,n,r),n!==null){var o=st();Xt(n,e,r,o),c0(n,t,r)}}function $b(e,t,n){var r=Jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(s0(e))u0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(o.hasEagerState=!0,o.eagerState=a,Jt(a,l)){var s=t.interleaved;s===null?(o.next=o,xp(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=jy(e,t,o,r),n!==null&&(o=st(),Xt(n,e,r,o),c0(n,t,r))}}function s0(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function u0(e,t){ei=aa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function c0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lp(e,n)}}var sa={readContext:Nt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},_b={readContext:Nt,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:bd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Tl(4194308,4,n0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Tl(4,2,e,t)},useMemo:function(e,t){var n=nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ab.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:xd,useDebugValue:Ap,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=xd(!1),t=e[0];return e=Tb.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Le,o=nn();if($e){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Ye===null)throw Error(F(349));Pr&30||Yy(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,bd(Ky.bind(null,r,i,e),[e]),r.flags|=2048,Si(9,Qy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=nn(),t=Ye.identifierPrefix;if($e){var n=xn,r=wn;n=(r&~(1<<32-Kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bi++,0")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{As=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Vo(e):""}function ax(e){switch(e.tag){case 5:return Vo(e.type);case 16:return Vo("Lazy");case 13:return Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 2:case 15:return e=$s(e.type,!1),e;case 11:return e=$s(e.type.render,!1),e;case 1:return e=$s(e.type,!0),e;default:return""}}function _u(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hr:return"Fragment";case Ur:return"Portal";case Tu:return"Profiler";case tp:return"StrictMode";case Au:return"Suspense";case $u:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ug:return(e.displayName||"Context")+".Consumer";case Bg:return(e._context.displayName||"Context")+".Provider";case np:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rp:return t=e.displayName||null,t!==null?t:_u(e.type)||"Memo";case Bn:t=e._payload,e=e._init;try{return _u(e(t))}catch{}}return null}function sx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _u(t);case 8:return t===tp?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function rr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ux(e){var t=Wg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qi(e){e._valueTracker||(e._valueTracker=ux(e))}function Vg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ru(e,t){var n=t.checked;return De({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ff(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=rr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gg(e,t){t=t.checked,t!=null&&ep(e,"checked",t,!1)}function Lu(e,t){Gg(e,t);var n=rr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Du(e,t.type,n):t.hasOwnProperty("defaultValue")&&Du(e,t.type,rr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Du(e,t,n){(t!=="number"||Vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Go=Array.isArray;function to(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ki.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ui(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qo={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},cx=["Webkit","ms","Moz","O"];Object.keys(Qo).forEach(function(e){cx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qo[t]=Qo[e]})});function Kg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qo.hasOwnProperty(e)&&Qo[e]?(""+t).trim():t+"px"}function Xg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Kg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var px=De({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 Iu(e,t){if(t){if(px[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Fu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 ju=null;function op(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mu=null,no=null,ro=null;function Uf(e){if(e=Di(e)){if(typeof Mu!="function")throw Error(F(280));var t=e.stateNode;t&&(t=_a(t),Mu(e.stateNode,e.type,t))}}function Zg(e){no?ro?ro.push(e):ro=[e]:no=e}function Jg(){if(no){var e=no,t=ro;if(ro=no=null,Uf(e),t)for(e=0;e>>=0,e===0?32:31-(kx(e)/Sx|0)|0}var Xi=64,Zi=4194304;function qo(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=qo(a):(i&=l,i!==0&&(r=qo(i)))}else l=n&~o,l!==0?r=qo(l):i!==0&&(r=qo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ri(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function Ox(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Xo),Xf=String.fromCharCode(32),Zf=!1;function wy(e,t){switch(e){case"keyup":return tb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function rb(e,t){switch(e){case"compositionend":return xy(t);case"keypress":return t.which!==32?null:(Zf=!0,Xf);case"textInput":return e=t.data,e===Xf&&Zf?null:e;default:return null}}function ob(e,t){if(Wr)return e==="compositionend"||!fp&&wy(e,t)?(e=yy(),El=up=Vn=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nd(n)}}function Cy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ey(){for(var e=window,t=Vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vl(e.document)}return t}function dp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function db(e){var t=Ey(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cy(n.ownerDocument.documentElement,n)){if(r!==null&&dp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=rd(n,i);var l=rd(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Vr=null,Gu=null,Jo=null,qu=!1;function od(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qu||Vr==null||Vr!==Vl(r)||(r=Vr,"selectionStart"in r&&dp(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}),Jo&&mi(Jo,r)||(Jo=r,r=Zl(Gu,"onSelect"),0Yr||(e.current=Ju[Yr],Ju[Yr]=null,Yr--)}function Ce(e,t){Yr++,Ju[Yr]=e.current,e.current=t}var or={},ot=ur(or),ht=ur(!1),Cr=or;function co(e,t){var n=e.type.contextTypes;if(!n)return or;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function mt(e){return e=e.childContextTypes,e!=null}function ea(){Ae(ht),Ae(ot)}function pd(e,t,n){if(ot.current!==or)throw Error(F(168));Ce(ot,t),Ce(ht,n)}function Dy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(F(108,sx(e)||"Unknown",o));return De({},n,r)}function ta(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||or,Cr=ot.current,Ce(ot,e),Ce(ht,ht.current),!0}function fd(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=Dy(e,t,Cr),r.__reactInternalMemoizedMergedChildContext=e,Ae(ht),Ae(ot),Ce(ot,e)):Ae(ht),Ce(ht,n)}var vn=null,Ra=!1,Ws=!1;function zy(e){vn===null?vn=[e]:vn.push(e)}function Eb(e){Ra=!0,zy(e)}function cr(){if(!Ws&&vn!==null){Ws=!0;var e=0,t=ve;try{var n=vn;for(ve=1;e>=l,o-=l,wn=1<<32-Kt(t)+o|n<T?(N=O,O=null):N=O.sibling;var P=d(g,O,v[T],C);if(P===null){O===null&&(O=N);break}e&&O&&P.alternate===null&&t(g,O),y=i(P,y,T),k===null?E=P:k.sibling=P,k=P,O=N}if(T===v.length)return n(g,O),$e&&mr(g,T),E;if(O===null){for(;TT?(N=O,O=null):N=O.sibling;var _=d(g,O,P.value,C);if(_===null){O===null&&(O=N);break}e&&O&&_.alternate===null&&t(g,O),y=i(_,y,T),k===null?E=_:k.sibling=_,k=_,O=N}if(P.done)return n(g,O),$e&&mr(g,T),E;if(O===null){for(;!P.done;T++,P=v.next())P=c(g,P.value,C),P!==null&&(y=i(P,y,T),k===null?E=P:k.sibling=P,k=P);return $e&&mr(g,T),E}for(O=r(g,O);!P.done;T++,P=v.next())P=f(O,g,T,P.value,C),P!==null&&(e&&P.alternate!==null&&O.delete(P.key===null?T:P.key),y=i(P,y,T),k===null?E=P:k.sibling=P,k=P);return e&&O.forEach(function(R){return t(g,R)}),$e&&mr(g,T),E}function w(g,y,v,C){if(typeof v=="object"&&v!==null&&v.type===Hr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Yi:e:{for(var E=v.key,k=y;k!==null;){if(k.key===E){if(E=v.type,E===Hr){if(k.tag===7){n(g,k.sibling),y=o(k,v.props.children),y.return=g,g=y;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Bn&&wd(E)===k.type){n(g,k.sibling),y=o(k,v.props),y.ref=Fo(g,k,v),y.return=g,g=y;break e}n(g,k);break}else t(g,k);k=k.sibling}v.type===Hr?(y=Sr(v.props.children,g.mode,C,v.key),y.return=g,g=y):(C=Ll(v.type,v.key,v.props,null,g.mode,C),C.ref=Fo(g,y,v),C.return=g,g=C)}return l(g);case Ur:e:{for(k=v.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(g,y.sibling),y=o(y,v.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=Zs(v,g.mode,C),y.return=g,g=y}return l(g);case Bn:return k=v._init,w(g,y,k(v._payload),C)}if(Go(v))return h(g,y,v,C);if(Lo(v))return m(g,y,v,C);il(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(g,y.sibling),y=o(y,v),y.return=g,g=y):(n(g,y),y=Xs(v,g.mode,C),y.return=g,g=y),l(g)):n(g,y)}return w}var fo=Hy(!0),Wy=Hy(!1),zi={},sn=ur(zi),wi=ur(zi),xi=ur(zi);function xr(e){if(e===zi)throw Error(F(174));return e}function kp(e,t){switch(Ce(xi,t),Ce(wi,e),Ce(sn,zi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Nu(t,e)}Ae(sn),Ce(sn,t)}function ho(){Ae(sn),Ae(wi),Ae(xi)}function Vy(e){xr(xi.current);var t=xr(sn.current),n=Nu(t,e.type);t!==n&&(Ce(wi,e),Ce(sn,n))}function Sp(e){wi.current===e&&(Ae(sn),Ae(wi))}var Re=ur(0);function aa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vs=[];function Cp(){for(var e=0;en?n:4,e(!0);var r=Gs.transition;Gs.transition={};try{e(!1),t()}finally{ve=n,Gs.transition=r}}function a0(){return It().memoizedState}function Ab(e,t,n){var r=Jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},s0(e))u0(t,n);else if(n=jy(e,t,n,r),n!==null){var o=st();Xt(n,e,r,o),c0(n,t,r)}}function $b(e,t,n){var r=Jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(s0(e))u0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(o.hasEagerState=!0,o.eagerState=a,Jt(a,l)){var s=t.interleaved;s===null?(o.next=o,xp(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=jy(e,t,o,r),n!==null&&(o=st(),Xt(n,e,r,o),c0(n,t,r))}}function s0(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function u0(e,t){ei=sa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function c0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lp(e,n)}}var ua={readContext:Nt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},_b={readContext:Nt,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:bd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Al(4194308,4,n0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Al(4194308,4,e,t)},useInsertionEffect:function(e,t){return Al(4,2,e,t)},useMemo:function(e,t){var n=nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ab.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:xd,useDebugValue:Ap,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=xd(!1),t=e[0];return e=Tb.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Le,o=nn();if($e){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Ye===null)throw Error(F(349));Pr&30||Yy(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,bd(Ky.bind(null,r,i,e),[e]),r.flags|=2048,Si(9,Qy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=nn(),t=Ye.identifierPrefix;if($e){var n=xn,r=wn;n=(r&~(1<<32-Kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[on]=t,e[vi]=r,w0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Fu(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),o=r;break;case"iframe":case"object":case"embed":Oe("load",e),o=r;break;case"video":case"audio":for(o=0;ogo&&(t.flags|=128,r=!0,jo(i,!1),t.lanes=4194304)}else{if(!r)if(e=la(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!$e)return tt(t),null}else 2*Me()-i.renderingStartTime>go&&n!==1073741824&&(t.flags|=128,r=!0,jo(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Me(),t.sibling=null,n=Re.current,Ce(Re,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return zp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?wt&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function jb(e,t){switch(mp(t),t.tag){case 1:return mt(t.type)&&Jl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ho(),Ae(ht),Ae(ot),Cp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sp(t),null;case 13:if(Ae(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ae(Re),null;case 4:return ho(),null;case 10:return wp(t.type._context),null;case 22:case 23:return zp(),null;case 24:return null;default:return null}}var ll=!1,nt=!1,Mb=typeof WeakSet=="function"?WeakSet:Set,V=null;function Zr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ne(e,t,r)}else n.current=null}function pc(e,t,n){try{n()}catch(r){Ne(e,t,r)}}var $d=!1;function Bb(e,t){if(Yu=Ql,e=Ey(),dp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,u=0,p=0,c=e,d=null;t:for(;;){for(var f;c!==n||o!==0&&c.nodeType!==3||(a=l+o),c!==i||r!==0&&c.nodeType!==3||(s=l+r),c.nodeType===3&&(l+=c.nodeValue.length),(f=c.firstChild)!==null;)d=c,c=f;for(;;){if(c===e)break t;if(d===n&&++u===o&&(a=l),d===i&&++p===r&&(s=l),(f=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=f}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qu={focusedElem:e,selectionRange:n},Ql=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,w=h.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:Gt(t.type,m),w);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(C){Ne(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return h=$d,$d=!1,h}function ti(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&pc(t,n,i)}o=o.next}while(o!==r)}}function Da(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function k0(e){var t=e.alternate;t!==null&&(e.alternate=null,k0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[on],delete t[vi],delete t[Zu],delete t[Sb],delete t[Cb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function S0(e){return e.tag===5||e.tag===3||e.tag===4}function _d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||S0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zl));else if(r!==4&&(e=e.child,e!==null))for(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}function hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}var Ke=null,qt=!1;function Nn(e,t,n){for(n=n.child;n!==null;)C0(e,t,n),n=n.sibling}function C0(e,t,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Pa,n)}catch{}switch(n.tag){case 5:nt||Zr(n,t);case 6:var r=Ke,o=qt;Ke=null,Nn(e,t,n),Ke=r,qt=o,Ke!==null&&(qt?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(qt?(e=Ke,n=n.stateNode,e.nodeType===8?Hs(e.parentNode,n):e.nodeType===1&&Hs(e,n),di(e)):Hs(Ke,n.stateNode));break;case 4:r=Ke,o=qt,Ke=n.stateNode.containerInfo,qt=!0,Nn(e,t,n),Ke=r,qt=o;break;case 0:case 11:case 14:case 15:if(!nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&pc(n,t,l),o=o.next}while(o!==r)}Nn(e,t,n);break;case 1:if(!nt&&(Zr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ne(n,t,a)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(nt=(r=nt)||n.memoizedState!==null,Nn(e,t,n),nt=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function Rd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mb),t.forEach(function(r){var o=Kb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Hb(r/1960))-r,10e?16:e,Gn===null)var r=!1;else{if(e=Gn,Gn=null,pa=0,me&6)throw Error(F(331));var o=me;for(me|=4,V=e.current;V!==null;){var i=V,l=i.child;if(V.flags&16){var a=i.deletions;if(a!==null){for(var s=0;sMe()-Lp?kr(e,0):Rp|=n),gt(e,t)}function R0(e,t){t===0&&(e.mode&1?(t=Xi,Xi<<=1,!(Xi&130023424)&&(Xi=4194304)):t=1);var n=st();e=Pn(e,t),e!==null&&(Ri(e,t,n),gt(e,n))}function Qb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),R0(e,n)}function Kb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),R0(e,n)}var L0;L0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ht.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,Ib(e,t,n);dt=!!(e.flags&131072)}else dt=!1,$e&&t.flags&1048576&&Ny(t,na,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Al(e,t),e=t.pendingProps;var o=co(t,ot.current);io(t,n),o=Pp(null,t,r,e,o,n);var i=Op();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,mt(r)?(i=!0,ea(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,bp(t),o.updater=Ra,t.stateNode=o,o._reactInternals=t,oc(t,r,e,n),t=ac(null,t,r,!0,i,n)):(t.tag=0,$e&&i&&hp(t),lt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Al(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Zb(r),e=Gt(r,e),o){case 0:t=lc(null,t,r,e,n);break e;case 1:t=Od(null,t,r,e,n);break e;case 11:t=Ed(null,t,r,e,n);break e;case 14:t=Pd(null,t,r,Gt(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),lc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),Od(e,t,r,o,n);case 3:e:{if(g0(t),e===null)throw Error(F(387));r=t.pendingProps,i=t.memoizedState,o=i.element,My(e,t),ia(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=mo(Error(F(423)),t),t=Td(e,t,r,n,o);break e}else if(r!==o){o=mo(Error(F(424)),t),t=Td(e,t,r,n,o);break e}else for(bt=Kn(t.stateNode.containerInfo.firstChild),kt=t,$e=!0,Yt=null,n=Wy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(po(),r===o){t=On(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return Vy(t),e===null&&tc(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Ku(r,o)?l=null:i!==null&&Ku(r,i)&&(t.flags|=32),m0(e,t),lt(e,t,l,n),t.child;case 6:return e===null&&tc(t),null;case 13:return y0(e,t,n);case 4:return kp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):lt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),Ed(e,t,r,o,n);case 7:return lt(e,t,t.pendingProps,n),t.child;case 8:return lt(e,t,t.pendingProps.children,n),t.child;case 12:return lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,Ce(ra,r._currentValue),r._currentValue=l,i!==null)if(Jt(i.value,l)){if(i.children===o.children&&!ht.current){t=On(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=kn(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),nc(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(F(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),nc(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}lt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,io(t,n),o=Nt(o),r=r(o),t.flags|=1,lt(e,t,r,n),t.child;case 14:return r=t.type,o=Gt(r,t.pendingProps),o=Gt(r.type,o),Pd(e,t,r,o,n);case 15:return d0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),Al(e,t),t.tag=1,mt(r)?(e=!0,ea(t)):e=!1,io(t,n),Uy(t,r,o),oc(t,r,o,n),ac(null,t,r,!0,e,n);case 19:return v0(e,t,n);case 22:return h0(e,t,n)}throw Error(F(156,t.tag))};function D0(e,t){return ly(e,t)}function Xb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 Lt(e,t,n,r){return new Xb(e,t,n,r)}function Ip(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zb(e){if(typeof e=="function")return Ip(e)?1:0;if(e!=null){if(e=e.$$typeof,e===np)return 11;if(e===rp)return 14}return 2}function er(e,t){var n=e.alternate;return n===null?(n=Lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Rl(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")Ip(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Hr:return Sr(n.children,o,i,t);case tp:l=8,o|=8;break;case Tu:return e=Lt(12,n,t,o|2),e.elementType=Tu,e.lanes=i,e;case Au:return e=Lt(13,n,t,o),e.elementType=Au,e.lanes=i,e;case $u:return e=Lt(19,n,t,o),e.elementType=$u,e.lanes=i,e;case Hg:return Na(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Bg:l=10;break e;case Ug:l=9;break e;case np:l=11;break e;case rp:l=14;break e;case Bn:l=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Lt(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Sr(e,t,n,r){return e=Lt(7,e,r,t),e.lanes=n,e}function Na(e,t,n,r){return e=Lt(22,e,r,t),e.elementType=Hg,e.lanes=n,e.stateNode={isHidden:!1},e}function Xs(e,t,n){return e=Lt(6,e,null,t),e.lanes=n,e}function Zs(e,t,n){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jb(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rs(0),this.expirationTimes=Rs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rs(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Fp(e,t,n,r,o,i,l,a,s){return e=new Jb(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Lt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bp(i),e}function ek(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(F0)}catch(e){console.error(e)}}F0(),Ng.exports=Pt;var Ba=Ng.exports,Md=Ba;Pu.createRoot=Md.createRoot,Pu.hydrateRoot=Md.hydrateRoot;const ik='@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;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";font-feature-settings:normal;font-variation-settings:normal}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-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;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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]{display:none}*{scrollbar-color:initial;scrollbar-width:initial}:root{--opencopilot-primary-clr: #703ea8;--opencopilot-accent-clr: #f8f7f8;--opencopilot-accnet-2-clr: #817f81;--opencopilot-primary-light-clr: rgba(0, 87, 255, .1)}*,: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: }::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: }.opencopilot-fixed{position:fixed}.opencopilot-absolute{position:absolute}.opencopilot-relative{position:relative}.opencopilot-inset-0{top:0;right:0;bottom:0;left:0}.opencopilot-bottom-0{bottom:0}.opencopilot-right-0{right:0}.opencopilot-top-0{top:0}.\\!opencopilot-z-\\[100000\\]{z-index:100000!important}.opencopilot-z-50{z-index:50}.opencopilot-z-\\[10000000\\]{z-index:10000000}.opencopilot-z-\\[100\\]{z-index:100}.opencopilot-z-\\[50000\\]{z-index:50000}.opencopilot-clear-both{clear:both}.opencopilot-m-0{margin:0}.opencopilot-mx-auto{margin-left:auto;margin-right:auto}.opencopilot-mb-3{margin-bottom:.75rem}.opencopilot-mb-auto{margin-bottom:auto}.opencopilot-mt-auto{margin-top:auto}.opencopilot-block{display:block}.opencopilot-flex{display:flex}.opencopilot-grid{display:grid}.opencopilot-hidden{display:none}.opencopilot-aspect-square{aspect-ratio:1 / 1}.opencopilot-h-7{height:1.75rem}.opencopilot-h-fit{height:-moz-fit-content;height:fit-content}.opencopilot-h-full{height:100%}.opencopilot-h-screen{height:100vh}.opencopilot-max-h-full{max-height:100%}.opencopilot-w-7{width:1.75rem}.opencopilot-w-fit{width:-moz-fit-content;width:fit-content}.opencopilot-w-full{width:100%}.opencopilot-w-screen{width:100vw}.opencopilot-min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.opencopilot-max-w-\\[15rem\\]{max-width:15rem}.opencopilot-max-w-full{max-width:100%}.opencopilot-max-w-lg{max-width:32rem}.opencopilot-flex-1{flex:1 1 0%}.opencopilot-shrink-0{flex-shrink:0}.opencopilot-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.opencopilot-resize-none{resize:none}.opencopilot-flex-col{flex-direction:column}.opencopilot-flex-col-reverse{flex-direction:column-reverse}.opencopilot-flex-wrap{flex-wrap:wrap}.opencopilot-items-start{align-items:flex-start}.opencopilot-items-center{align-items:center}.opencopilot-justify-center{justify-content:center}.opencopilot-justify-between{justify-content:space-between}.opencopilot-gap-1{gap:.25rem}.opencopilot-gap-2{gap:.5rem}.opencopilot-gap-3{gap:.75rem}.opencopilot-gap-4{gap:1rem}.opencopilot-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))}.opencopilot-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))}.opencopilot-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))}.opencopilot-justify-self-end{justify-self:end}.opencopilot-overflow-auto{overflow:auto}.opencopilot-overflow-hidden{overflow:hidden}.opencopilot-overflow-x-auto{overflow-x:auto}.opencopilot-overflow-y-auto{overflow-y:auto}.opencopilot-overflow-x-hidden{overflow-x:hidden}.opencopilot-scroll-smooth{scroll-behavior:smooth}.opencopilot-whitespace-nowrap{white-space:nowrap}.opencopilot-whitespace-pre-wrap{white-space:pre-wrap}.opencopilot-rounded-2xl{border-radius:1rem}.opencopilot-rounded-full{border-radius:9999px}.opencopilot-rounded-lg{border-radius:.5rem}.opencopilot-rounded-md{border-radius:.375rem}.opencopilot-rounded-sm{border-radius:.125rem}.opencopilot-rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.opencopilot-border{border-width:1px}.opencopilot-border-b{border-bottom-width:1px}.opencopilot-border-none{border-style:none}.opencopilot-border-primary-light{border-color:var(--opencopilot-primary-light-clr)}.opencopilot-border-rose-500{--tw-border-opacity: 1;border-color:rgb(244 63 94 / var(--tw-border-opacity))}.opencopilot-border-transparent{border-color:transparent}.opencopilot-border-b-black\\/10{border-bottom-color:#0000001a}.opencopilot-bg-accent{background-color:var(--opencopilot-accent-clr)}.opencopilot-bg-black\\/50{background-color:#00000080}.opencopilot-bg-primary{background-color:var(--opencopilot-primary-clr)}.opencopilot-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.opencopilot-bg-transparent{background-color:transparent}.opencopilot-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.opencopilot-fill-current{fill:currentColor}.opencopilot-object-cover{-o-object-fit:cover;object-fit:cover}.opencopilot-p-0{padding:0}.opencopilot-p-0\\.5{padding:.125rem}.opencopilot-p-2{padding:.5rem}.opencopilot-p-3{padding:.75rem}.opencopilot-p-6{padding:1.5rem}.opencopilot-px-2{padding-left:.5rem;padding-right:.5rem}.opencopilot-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.opencopilot-px-4{padding-left:1rem;padding-right:1rem}.opencopilot-py-1{padding-top:.25rem;padding-bottom:.25rem}.opencopilot-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.opencopilot-py-2{padding-top:.5rem;padding-bottom:.5rem}.opencopilot-ps-10{padding-inline-start:2.5rem}.opencopilot-text-center{text-align:center}.opencopilot-font-inter{font-family:Inter,sans-serif,system-ui}.opencopilot-text-2xl{font-size:1.5rem;line-height:2rem}.opencopilot-text-\\[14px\\]{font-size:14px}.opencopilot-text-lg{font-size:1.125rem;line-height:1.75rem}.opencopilot-text-sm{font-size:.875rem;line-height:1.25rem}.opencopilot-text-xl{font-size:1.25rem;line-height:1.75rem}.opencopilot-text-xs{font-size:.75rem;line-height:1rem}.opencopilot-font-medium{font-weight:500}.opencopilot-font-normal{font-weight:400}.opencopilot-font-semibold{font-weight:600}.opencopilot-lowercase{text-transform:lowercase}.opencopilot-leading-none{line-height:1}.opencopilot-leading-tight{line-height:1.25}.opencopilot-tracking-tight{letter-spacing:-.025em}.opencopilot-text-\\[\\#5e5c5e\\]{--tw-text-opacity: 1;color:rgb(94 92 94 / var(--tw-text-opacity))}.opencopilot-text-accent{color:var(--opencopilot-accent-clr)}.opencopilot-text-accent2{color:var(--opencopilot-accent-2-clr)}.opencopilot-text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.opencopilot-text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity))}.opencopilot-text-primary{color:var(--opencopilot-primary-clr)}.opencopilot-text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity))}.opencopilot-text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opencopilot-opacity-0{opacity:0}.opencopilot-opacity-100{opacity:1}.opencopilot-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)}.opencopilot-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)}.opencopilot-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)}.opencopilot-outline-none{outline:2px solid transparent;outline-offset:2px}.opencopilot-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)}.opencopilot-ring-\\[\\#334155\\]\\/60{--tw-ring-color: rgb(51 65 85 / .6)}.opencopilot-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)}.opencopilot-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.opencopilot-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}.opencopilot-transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.opencopilot-transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.opencopilot-duration-300{transition-duration:.3s}.opencopilot-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.opencopilot-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@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))}}.opencopilot-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}.opencopilot-animate-out{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}.opencopilot-fade-in,.opencopilot-fade-in-0{--tw-enter-opacity: 0}.opencopilot-fade-out{--tw-exit-opacity: 0}.opencopilot-slide-in-from-bottom-5{--tw-enter-translate-y: 1.25rem}.opencopilot-slide-in-from-top-1{--tw-enter-translate-y: -.25rem}.opencopilot-duration-300{animation-duration:.3s}.opencopilot-ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.opencopilot-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.opencopilot-scrollbar-thin{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.opencopilot-scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.opencopilot-scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.opencopilot-scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.opencopilot-scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.opencopilot-scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.opencopilot-scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.opencopilot-scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.opencopilot-scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.opencopilot-scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.opencopilot-scrollbar-thin{scrollbar-width:thin}.opencopilot-scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.opencopilot-prose{color:var(--tw-prose-body);max-width:65ch}.opencopilot-prose :where(p):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.opencopilot-prose :where([class~=lead]):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.opencopilot-prose :where(a):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.opencopilot-prose :where(strong):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.opencopilot-prose :where(a strong):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(blockquote strong):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(thead th strong):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(ol):not(:where([class~=opencopilot-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.opencopilot-prose :where(ol[type=A]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-alpha}.opencopilot-prose :where(ol[type=a]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-alpha}.opencopilot-prose :where(ol[type=A s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-alpha}.opencopilot-prose :where(ol[type=a s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-alpha}.opencopilot-prose :where(ol[type=I]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-roman}.opencopilot-prose :where(ol[type=i]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-roman}.opencopilot-prose :where(ol[type=I s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-roman}.opencopilot-prose :where(ol[type=i s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-roman}.opencopilot-prose :where(ol[type="1"]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:decimal}.opencopilot-prose :where(ul):not(:where([class~=opencopilot-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.opencopilot-prose :where(ol>li):not(:where([class~=opencopilot-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.opencopilot-prose :where(ul>li):not(:where([class~=opencopilot-not-prose] *))::marker{color:var(--tw-prose-bullets)}.opencopilot-prose :where(hr):not(:where([class~=opencopilot-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.opencopilot-prose :where(blockquote):not(:where([class~=opencopilot-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.opencopilot-prose :where(blockquote p:first-of-type):not(:where([class~=opencopilot-not-prose] *)):before{content:open-quote}.opencopilot-prose :where(blockquote p:last-of-type):not(:where([class~=opencopilot-not-prose] *)):after{content:close-quote}.opencopilot-prose :where(h1):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.opencopilot-prose :where(h1 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:900;color:inherit}.opencopilot-prose :where(h2):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.opencopilot-prose :where(h2 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:800;color:inherit}.opencopilot-prose :where(h3):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.opencopilot-prose :where(h3 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:700;color:inherit}.opencopilot-prose :where(h4):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.opencopilot-prose :where(h4 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:700;color:inherit}.opencopilot-prose :where(img):not(:where([class~=opencopilot-not-prose] *)){margin-top:2em;margin-bottom:2em}.opencopilot-prose :where(figure>*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0;margin-bottom:0}.opencopilot-prose :where(figcaption):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.opencopilot-prose :where(code):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.opencopilot-prose :where(code):not(:where([class~=opencopilot-not-prose] *)):before{content:"`"}.opencopilot-prose :where(code):not(:where([class~=opencopilot-not-prose] *)):after{content:"`"}.opencopilot-prose :where(a code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(h1 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(h2 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit;font-size:.875em}.opencopilot-prose :where(h3 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit;font-size:.9em}.opencopilot-prose :where(h4 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(blockquote code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(thead th code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(pre):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.opencopilot-prose :where(pre code):not(:where([class~=opencopilot-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.opencopilot-prose :where(pre code):not(:where([class~=opencopilot-not-prose] *)):before{content:none}.opencopilot-prose :where(pre code):not(:where([class~=opencopilot-not-prose] *)):after{content:none}.opencopilot-prose :where(table):not(:where([class~=opencopilot-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.opencopilot-prose :where(thead):not(:where([class~=opencopilot-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.opencopilot-prose :where(thead th):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.opencopilot-prose :where(tbody tr):not(:where([class~=opencopilot-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.opencopilot-prose :where(tbody tr:last-child):not(:where([class~=opencopilot-not-prose] *)){border-bottom-width:0}.opencopilot-prose :where(tbody td):not(:where([class~=opencopilot-not-prose] *)){vertical-align:baseline}.opencopilot-prose :where(tfoot):not(:where([class~=opencopilot-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.opencopilot-prose :where(tfoot td):not(:where([class~=opencopilot-not-prose] *)){vertical-align:top}.opencopilot-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.opencopilot-prose :where(video):not(:where([class~=opencopilot-not-prose] *)){margin-top:2em;margin-bottom:2em}.opencopilot-prose :where(figure):not(:where([class~=opencopilot-not-prose] *)){margin-top:2em;margin-bottom:2em}.opencopilot-prose :where(li):not(:where([class~=opencopilot-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.opencopilot-prose :where(ol>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.375em}.opencopilot-prose :where(ul>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.375em}.opencopilot-prose :where(.opencopilot-prose>ul>li p):not(:where([class~=opencopilot-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.opencopilot-prose :where(.opencopilot-prose>ul>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.25em}.opencopilot-prose :where(.opencopilot-prose>ul>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.25em}.opencopilot-prose :where(.opencopilot-prose>ol>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.25em}.opencopilot-prose :where(.opencopilot-prose>ol>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.25em}.opencopilot-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=opencopilot-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.opencopilot-prose :where(hr+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(h2+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(h3+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(h4+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(thead th:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose :where(thead th:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose :where(tbody td,tfoot td):not(:where([class~=opencopilot-not-prose] *)){padding:.5714286em}.opencopilot-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose :where(.opencopilot-prose>:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(.opencopilot-prose>:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:0}.opencopilot-prose-sm{font-size:.875rem;line-height:1.7142857}.opencopilot-prose-sm :where(p):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.opencopilot-prose-sm :where([class~=lead]):not(:where([class~=opencopilot-not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.opencopilot-prose-sm :where(blockquote):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.1111111em}.opencopilot-prose-sm :where(h1):not(:where([class~=opencopilot-not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.opencopilot-prose-sm :where(h2):not(:where([class~=opencopilot-not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.opencopilot-prose-sm :where(h3):not(:where([class~=opencopilot-not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.opencopilot-prose-sm :where(h4):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.opencopilot-prose-sm :where(img):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.opencopilot-prose-sm :where(video):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.opencopilot-prose-sm :where(figure):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.opencopilot-prose-sm :where(figure>*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0;margin-bottom:0}.opencopilot-prose-sm :where(figcaption):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.opencopilot-prose-sm :where(code):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em}.opencopilot-prose-sm :where(h2 code):not(:where([class~=opencopilot-not-prose] *)){font-size:.9em}.opencopilot-prose-sm :where(h3 code):not(:where([class~=opencopilot-not-prose] *)){font-size:.8888889em}.opencopilot-prose-sm :where(pre):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding:.6666667em 1em}.opencopilot-prose-sm :where(ol):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.opencopilot-prose-sm :where(ul):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.opencopilot-prose-sm :where(li):not(:where([class~=opencopilot-not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.opencopilot-prose-sm :where(ol>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.4285714em}.opencopilot-prose-sm :where(ul>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.4285714em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ul>li p):not(:where([class~=opencopilot-not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ul>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ul>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.1428571em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ol>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ol>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.1428571em}.opencopilot-prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=opencopilot-not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.opencopilot-prose-sm :where(hr):not(:where([class~=opencopilot-not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.opencopilot-prose-sm :where(hr+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(h2+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(h3+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(h4+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(table):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em;line-height:1.5}.opencopilot-prose-sm :where(thead th):not(:where([class~=opencopilot-not-prose] *)){padding-right:1em;padding-bottom:.6666667em;padding-left:1em}.opencopilot-prose-sm :where(thead th:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose-sm :where(thead th:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose-sm :where(tbody td,tfoot td):not(:where([class~=opencopilot-not-prose] *)){padding:.6666667em 1em}.opencopilot-prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose-sm :where(.opencopilot-prose-sm>:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(.opencopilot-prose-sm>:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:0}.opencopilot-prose-slate{--tw-prose-body: #334155;--tw-prose-headings: #0f172a;--tw-prose-lead: #475569;--tw-prose-links: #0f172a;--tw-prose-bold: #0f172a;--tw-prose-counters: #64748b;--tw-prose-bullets: #cbd5e1;--tw-prose-hr: #e2e8f0;--tw-prose-quotes: #0f172a;--tw-prose-quote-borders: #e2e8f0;--tw-prose-captions: #64748b;--tw-prose-code: #0f172a;--tw-prose-pre-code: #e2e8f0;--tw-prose-pre-bg: #1e293b;--tw-prose-th-borders: #cbd5e1;--tw-prose-td-borders: #e2e8f0;--tw-prose-invert-body: #cbd5e1;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #94a3b8;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #94a3b8;--tw-prose-invert-bullets: #475569;--tw-prose-invert-hr: #334155;--tw-prose-invert-quotes: #f1f5f9;--tw-prose-invert-quote-borders: #334155;--tw-prose-invert-captions: #94a3b8;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #cbd5e1;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #475569;--tw-prose-invert-td-borders: #334155}@keyframes fade-in-bottom{0%{transform:translateY(50px);opacity:0}to{transform:translateY(0);opacity:1}}.fade-in-bottom{animation:fade-in-bottom .4s cubic-bezier(.39,.575,.565,1) both}.flex-center{display:flex;align-items:center;justify-content:center}@keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}.fade-in-top{animation:fade-in-top .6s cubic-bezier(.39,.575,.565,1) both}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.fade-in{animation:fade-in 1.2s cubic-bezier(.39,.575,.565,1) both}em-emoji-picker{--background-rgb: 85, 170, 255;--border-radius: 10px;--category-icon-size: 24px;--font-family: inherit;--font-size: 14px;min-height:250px;max-height:300px}.PopoverContent{transform-origin:var(--radix-popover-content-transform-origin);animation:scaleIn .5s ease-out}@keyframes scaleIn{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.PopoverContent{animation-duration:.6s;animation-timing-function:cubic-bezier(.16,1,.3,1)}.PopoverContent[data-side=top]{animation-name:slideUp}.PopoverContent[data-side=bottom]{animation-name:slideDown}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes fade-in-right{0%{transform:translate(50px);opacity:0}to{transform:translate(0);opacity:1}}.fade-in-right{animation:fade-in-right .6s both}@keyframes scale-out-br{0%{transform:scale(1);transform-origin:100% 100%;opacity:1}to{transform:scale(0);transform-origin:100% 100%;opacity:1}}.scale-out-br{animation:scale-out-br .5s ease-in-out forwards}.placeholder\\:opencopilot-align-middle::-moz-placeholder{vertical-align:middle}.placeholder\\:opencopilot-align-middle::placeholder{vertical-align:middle}.placeholder\\:opencopilot-text-xs::-moz-placeholder{font-size:.75rem;line-height:1rem}.placeholder\\:opencopilot-text-xs::placeholder{font-size:.75rem;line-height:1rem}.last-of-type\\:opencopilot-mb-10:last-of-type{margin-bottom:2.5rem}.focus-within\\:opencopilot-ring-primary:focus-within{--tw-ring-color: var(--opencopilot-primary-clr)}.data-\\[state\\=open\\]\\:opencopilot-animate-in[data-state=open]{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-\\[state\\=closed\\]\\:opencopilot-animate-out[data-state=closed]{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-\\[state\\=closed\\]\\:opencopilot-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:opencopilot-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:opencopilot-slide-in-from-top-0[data-state=closed]{--tw-enter-translate-y: -0px}.data-\\[state\\=open\\]\\:opencopilot-slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.prose-headings\\:opencopilot-my-1 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=opencopilot-not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-h1\\:opencopilot-font-medium :is(:where(h1):not(:where([class~=opencopilot-not-prose] *))){font-weight:500}.prose-h2\\:opencopilot-font-normal :is(:where(h2):not(:where([class~=opencopilot-not-prose] *))){font-weight:400}.hover\\:opencopilot-scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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\\:opencopilot-shadow:hover{--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)}.focus\\:opencopilot-border-none:focus{border-style:none}.focus\\:opencopilot-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:opencopilot-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.disabled\\:opencopilot-pointer-events-none:disabled{pointer-events:none}.disabled\\:opencopilot-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opencopilot-opacity-40:disabled{opacity:.4}@media (min-width: 640px){.sm\\:opencopilot-w-96{width:24rem}.sm\\:opencopilot-flex-row{flex-direction:row}.sm\\:opencopilot-justify-end{justify-content:flex-end}.sm\\:opencopilot-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\\:opencopilot-rounded-xl{border-radius:.75rem}.sm\\:opencopilot-text-left{text-align:left}}\n',j0=x.createContext(void 0);function lk({children:e,data:t}){return L.jsx(j0.Provider,{value:t,children:e})}function Ua(){const e=x.useContext(j0);if(!e)throw new Error("useConfigData must be used within a ConfigDataProvider");return e}function ak(e){const[t,n]=x.useState(!!e),r=x.useCallback(()=>n(o=>!o),[]);return[t,r,n]}const M0=x.createContext(void 0);function B0(){const e=x.useContext(M0);if(!e)throw new Error("useAppContext must be used within an AppProvider");return e}function sk({children:e}){const t=ak(!1);return L.jsx(M0.Provider,{value:t,children:e})}function U0(e,t){return function(){return e.apply(t,arguments)}}const{toString:uk}=Object.prototype,{getPrototypeOf:Up}=Object,Ha=(e=>t=>{const n=uk.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pn=e=>(e=e.toLowerCase(),t=>Ha(t)===e),Wa=e=>t=>typeof t===e,{isArray:Eo}=Array,Ei=Wa("undefined");function ck(e){return e!==null&&!Ei(e)&&e.constructor!==null&&!Ei(e.constructor)&&zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const H0=pn("ArrayBuffer");function pk(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&H0(e.buffer),t}const fk=Wa("string"),zt=Wa("function"),W0=Wa("number"),Va=e=>e!==null&&typeof e=="object",dk=e=>e===!0||e===!1,Ll=e=>{if(Ha(e)!=="object")return!1;const t=Up(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},hk=pn("Date"),mk=pn("File"),gk=pn("Blob"),yk=pn("FileList"),vk=e=>Va(e)&&zt(e.pipe),wk=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zt(e.append)&&((t=Ha(e))==="formdata"||t==="object"&&zt(e.toString)&&e.toString()==="[object FormData]"))},xk=pn("URLSearchParams"),bk=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ni(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Eo(e))for(r=0,o=e.length;r0;)if(o=n[r],t===o.toLowerCase())return o;return null}const G0=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),q0=e=>!Ei(e)&&e!==G0;function wc(){const{caseless:e}=q0(this)&&this||{},t={},n=(r,o)=>{const i=e&&V0(t,o)||o;Ll(t[i])&&Ll(r)?t[i]=wc(t[i],r):Ll(r)?t[i]=wc({},r):Eo(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r(Ni(t,(o,i)=>{n&&zt(o)?e[i]=U0(o,n):e[i]=o},{allOwnKeys:r}),e),Sk=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ck=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Ek=(e,t,n,r)=>{let o,i,l;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)l=o[i],(!r||r(l,e,t))&&!a[l]&&(t[l]=e[l],a[l]=!0);e=n!==!1&&Up(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Pk=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ok=e=>{if(!e)return null;if(Eo(e))return e;let t=e.length;if(!W0(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Tk=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Up(Uint8Array)),Ak=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},$k=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},_k=pn("HTMLFormElement"),Rk=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Bd=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Lk=pn("RegExp"),Y0=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ni(n,(o,i)=>{let l;(l=t(o,i,e))!==!1&&(r[i]=l||o)}),Object.defineProperties(e,r)},Dk=e=>{Y0(e,(t,n)=>{if(zt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(zt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zk=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return Eo(e)?r(e):r(String(e).split(t)),n},Nk=()=>{},Ik=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Js="abcdefghijklmnopqrstuvwxyz",Ud="0123456789",Q0={DIGIT:Ud,ALPHA:Js,ALPHA_DIGIT:Js+Js.toUpperCase()+Ud},Fk=(e=16,t=Q0.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function jk(e){return!!(e&&zt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Mk=e=>{const t=new Array(10),n=(r,o)=>{if(Va(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=Eo(r)?[]:{};return Ni(r,(l,a)=>{const s=n(l,o+1);!Ei(s)&&(i[a]=s)}),t[o]=void 0,i}}return r};return n(e,0)},Bk=pn("AsyncFunction"),Uk=e=>e&&(Va(e)||zt(e))&&zt(e.then)&&zt(e.catch),D={isArray:Eo,isArrayBuffer:H0,isBuffer:ck,isFormData:wk,isArrayBufferView:pk,isString:fk,isNumber:W0,isBoolean:dk,isObject:Va,isPlainObject:Ll,isUndefined:Ei,isDate:hk,isFile:mk,isBlob:gk,isRegExp:Lk,isFunction:zt,isStream:vk,isURLSearchParams:xk,isTypedArray:Tk,isFileList:yk,forEach:Ni,merge:wc,extend:kk,trim:bk,stripBOM:Sk,inherits:Ck,toFlatObject:Ek,kindOf:Ha,kindOfTest:pn,endsWith:Pk,toArray:Ok,forEachEntry:Ak,matchAll:$k,isHTMLForm:_k,hasOwnProperty:Bd,hasOwnProp:Bd,reduceDescriptors:Y0,freezeMethods:Dk,toObjectSet:zk,toCamelCase:Rk,noop:Nk,toFiniteNumber:Ik,findKey:V0,global:G0,isContextDefined:q0,ALPHABET:Q0,generateString:Fk,isSpecCompliantForm:jk,toJSONObject:Mk,isAsyncFn:Bk,isThenable:Uk};function he(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}D.inherits(he,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:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const K0=he.prototype,X0={};["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(e=>{X0[e]={value:e}});Object.defineProperties(he,X0);Object.defineProperty(K0,"isAxiosError",{value:!0});he.from=(e,t,n,r,o,i)=>{const l=Object.create(K0);return D.toFlatObject(e,l,function(s){return s!==Error.prototype},a=>a!=="isAxiosError"),he.call(l,e.message,t,n,r,o),l.cause=e,l.name=e.name,i&&Object.assign(l,i),l};const Hk=null;function xc(e){return D.isPlainObject(e)||D.isArray(e)}function Z0(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function Hd(e,t,n){return e?e.concat(t).map(function(o,i){return o=Z0(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function Wk(e){return D.isArray(e)&&!e.some(xc)}const Vk=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function Ga(e,t,n){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=D.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,w){return!D.isUndefined(w[m])});const r=n.metaTokens,o=n.visitor||p,i=n.dots,l=n.indexes,s=(n.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(o))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(D.isDate(h))return h.toISOString();if(!s&&D.isBlob(h))throw new he("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(h)||D.isTypedArray(h)?s&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function p(h,m,w){let g=h;if(h&&!w&&typeof h=="object"){if(D.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(D.isArray(h)&&Wk(h)||(D.isFileList(h)||D.endsWith(m,"[]"))&&(g=D.toArray(h)))return m=Z0(m),g.forEach(function(v,C){!(D.isUndefined(v)||v===null)&&t.append(l===!0?Hd([m],C,i):l===null?m:m+"[]",u(v))}),!1}return xc(h)?!0:(t.append(Hd(w,m,i),u(h)),!1)}const c=[],d=Object.assign(Vk,{defaultVisitor:p,convertValue:u,isVisitable:xc});function f(h,m){if(!D.isUndefined(h)){if(c.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));c.push(h),D.forEach(h,function(g,y){(!(D.isUndefined(g)||g===null)&&o.call(t,g,D.isString(y)?y.trim():y,m,d))===!0&&f(g,m?m.concat(y):[y])}),c.pop()}}if(!D.isObject(e))throw new TypeError("data must be an object");return f(e),t}function Wd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Hp(e,t){this._pairs=[],e&&Ga(e,this,t)}const J0=Hp.prototype;J0.append=function(t,n){this._pairs.push([t,n])};J0.toString=function(t){const n=t?function(r){return t.call(this,r,Wd)}:Wd;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Gk(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function e1(e,t,n){if(!t)return e;const r=n&&n.encode||Gk,o=n&&n.serialize;let i;if(o?i=o(t,n):i=D.isURLSearchParams(t)?t.toString():new Hp(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qk{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){D.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Vd=qk,t1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Yk=typeof URLSearchParams<"u"?URLSearchParams:Hp,Qk=typeof FormData<"u"?FormData:null,Kk=typeof Blob<"u"?Blob:null,Xk=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Zk=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Qt={isBrowser:!0,classes:{URLSearchParams:Yk,FormData:Qk,Blob:Kk},isStandardBrowserEnv:Xk,isStandardBrowserWebWorkerEnv:Zk,protocols:["http","https","file","blob","url","data"]};function Jk(e,t){return Ga(e,new Qt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Qt.isNode&&D.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function eS(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tS(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r=n.length;return l=!l&&D.isArray(o)?o.length:l,s?(D.hasOwnProp(o,l)?o[l]=[o[l],r]:o[l]=r,!a):((!o[l]||!D.isObject(o[l]))&&(o[l]=[]),t(n,r,o[l],i)&&D.isArray(o[l])&&(o[l]=tS(o[l])),!a)}if(D.isFormData(e)&&D.isFunction(e.entries)){const n={};return D.forEachEntry(e,(r,o)=>{t(eS(r),o,n,0)}),n}return null}function nS(e,t,n){if(D.isString(e))try{return(t||JSON.parse)(e),D.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Wp={transitional:t1,adapter:Qt.isNode?"http":"xhr",transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=D.isObject(t);if(i&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return o&&o?JSON.stringify(n1(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jk(t,this.formSerializer).toString();if((a=D.isFileList(t))||r.indexOf("multipart/form-data")>-1){const s=this.env&&this.env.FormData;return Ga(a?{"files[]":t}:t,s&&new s,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),nS(t)):t}],transformResponse:[function(t){const n=this.transitional||Wp.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&D.isString(t)&&(r&&!this.responseType||o)){const l=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(l)throw a.name==="SyntaxError"?he.from(a,he.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],e=>{Wp.headers[e]={}});const Vp=Wp,rS=D.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"]),oS=e=>{const t={};let n,r,o;return e&&e.split(` -`).forEach(function(l){o=l.indexOf(":"),n=l.substring(0,o).trim().toLowerCase(),r=l.substring(o+1).trim(),!(!n||t[n]&&rS[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Gd=Symbol("internals");function Bo(e){return e&&String(e).trim().toLowerCase()}function Dl(e){return e===!1||e==null?e:D.isArray(e)?e.map(Dl):String(e)}function iS(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const lS=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eu(e,t,n,r,o){if(D.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!D.isString(t)){if(D.isString(r))return t.indexOf(r)!==-1;if(D.isRegExp(r))return r.test(t)}}function aS(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function sS(e,t){const n=D.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,l){return this[r].call(this,t,o,i,l)},configurable:!0})})}class qa{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(a,s,u){const p=Bo(s);if(!p)throw new Error("header name must be a non-empty string");const c=D.findKey(o,p);(!c||o[c]===void 0||u===!0||u===void 0&&o[c]!==!1)&&(o[c||s]=Dl(a))}const l=(a,s)=>D.forEach(a,(u,p)=>i(u,p,s));return D.isPlainObject(t)||t instanceof this.constructor?l(t,n):D.isString(t)&&(t=t.trim())&&!lS(t)?l(oS(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Bo(t),t){const r=D.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return iS(o);if(D.isFunction(n))return n.call(this,o,r);if(D.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Bo(t),t){const r=D.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||eu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(l){if(l=Bo(l),l){const a=D.findKey(r,l);a&&(!n||eu(r,r[a],a,n))&&(delete r[a],o=!0)}}return D.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||eu(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return D.forEach(this,(o,i)=>{const l=D.findKey(r,i);if(l){n[l]=Dl(o),delete n[i];return}const a=t?aS(i):String(i).trim();a!==i&&delete n[i],n[a]=Dl(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return D.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&D.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Gd]=this[Gd]={accessors:{}}).accessors,o=this.prototype;function i(l){const a=Bo(l);r[a]||(sS(o,l),r[a]=!0)}return D.isArray(t)?t.forEach(i):i(t),this}}qa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);D.reduceDescriptors(qa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});D.freezeMethods(qa);const Sn=qa;function tu(e,t){const n=this||Vp,r=t||n,o=Sn.from(r.headers);let i=r.data;return D.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function r1(e){return!!(e&&e.__CANCEL__)}function Ii(e,t,n){he.call(this,e??"canceled",he.ERR_CANCELED,t,n),this.name="CanceledError"}D.inherits(Ii,he,{__CANCEL__:!0});function uS(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new he("Request failed with status code "+n.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const cS=Qt.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,l,a){const s=[];s.push(n+"="+encodeURIComponent(r)),D.isNumber(o)&&s.push("expires="+new Date(o).toGMTString()),D.isString(i)&&s.push("path="+i),D.isString(l)&&s.push("domain="+l),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function pS(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fS(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function o1(e,t){return e&&!pS(t)?fS(e,t):t}const dS=Qt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let l=i;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(l){const a=D.isString(l)?o(l):l;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function hS(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mS(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,l;return t=t!==void 0?t:1e3,function(s){const u=Date.now(),p=r[i];l||(l=u),n[o]=s,r[o]=u;let c=i,d=0;for(;c!==o;)d+=n[c++],c=c%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-l{const i=o.loaded,l=o.lengthComputable?o.total:void 0,a=i-n,s=r(a),u=i<=l;n=i;const p={loaded:i,total:l,progress:l?i/l:void 0,bytes:a,rate:s||void 0,estimated:s&&l&&u?(l-i)/s:void 0,event:o};p[t?"download":"upload"]=!0,e(p)}}const gS=typeof XMLHttpRequest<"u",yS=gS&&function(e){return new Promise(function(n,r){let o=e.data;const i=Sn.from(e.headers).normalize(),l=e.responseType;let a;function s(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}D.isFormData(o)&&(Qt.isStandardBrowserEnv||Qt.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(f+":"+h))}const p=o1(e.baseURL,e.url);u.open(e.method.toUpperCase(),e1(p,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function c(){if(!u)return;const f=Sn.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!l||l==="text"||l==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:f,config:e,request:u};uS(function(g){n(g),s()},function(g){r(g),s()},m),u=null}if("onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(c)},u.onabort=function(){u&&(r(new he("Request aborted",he.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new he("Network Error",he.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||t1;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),r(new he(h,m.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,u)),u=null},Qt.isStandardBrowserEnv){const f=(e.withCredentials||dS(p))&&e.xsrfCookieName&&cS.read(e.xsrfCookieName);f&&i.set(e.xsrfHeaderName,f)}o===void 0&&i.setContentType(null),"setRequestHeader"in u&&D.forEach(i.toJSON(),function(h,m){u.setRequestHeader(m,h)}),D.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),l&&l!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",qd(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",qd(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{u&&(r(!f||f.type?new Ii(null,e,u):f),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=hS(p);if(d&&Qt.protocols.indexOf(d)===-1){r(new he("Unsupported protocol "+d+":",he.ERR_BAD_REQUEST,e));return}u.send(o||null)})},zl={http:Hk,xhr:yS};D.forEach(zl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const i1={getAdapter:e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;oe instanceof Sn?e.toJSON():e;function yo(e,t){t=t||{};const n={};function r(u,p,c){return D.isPlainObject(u)&&D.isPlainObject(p)?D.merge.call({caseless:c},u,p):D.isPlainObject(p)?D.merge({},p):D.isArray(p)?p.slice():p}function o(u,p,c){if(D.isUndefined(p)){if(!D.isUndefined(u))return r(void 0,u,c)}else return r(u,p,c)}function i(u,p){if(!D.isUndefined(p))return r(void 0,p)}function l(u,p){if(D.isUndefined(p)){if(!D.isUndefined(u))return r(void 0,u)}else return r(void 0,p)}function a(u,p,c){if(c in t)return r(u,p);if(c in e)return r(void 0,u)}const s={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:a,headers:(u,p)=>o(Qd(u),Qd(p),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),function(p){const c=s[p]||o,d=c(e[p],t[p],p);D.isUndefined(d)&&c!==a||(n[p]=d)}),n}const l1="1.5.0",Gp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Gp[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Kd={};Gp.transitional=function(t,n,r){function o(i,l){return"[Axios v"+l1+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,a)=>{if(t===!1)throw new he(o(l," has been removed"+(n?" in "+n:"")),he.ERR_DEPRECATED);return n&&!Kd[l]&&(Kd[l]=!0,console.warn(o(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,a):!0}};function vS(e,t,n){if(typeof e!="object")throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],l=t[i];if(l){const a=e[i],s=a===void 0||l(a,i,e);if(s!==!0)throw new he("option "+i+" must be "+s,he.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new he("Unknown option "+i,he.ERR_BAD_OPTION)}}const bc={assertOptions:vS,validators:Gp},In=bc.validators;class ha{constructor(t){this.defaults=t,this.interceptors={request:new Vd,response:new Vd}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=yo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&bc.assertOptions(r,{silentJSONParsing:In.transitional(In.boolean),forcedJSONParsing:In.transitional(In.boolean),clarifyTimeoutError:In.transitional(In.boolean)},!1),o!=null&&(D.isFunction(o)?n.paramsSerializer={serialize:o}:bc.assertOptions(o,{encode:In.function,serialize:In.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&D.merge(i.common,i[n.method]);i&&D.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=Sn.concat(l,i);const a=[];let s=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(s=s&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let p,c=0,d;if(!s){const h=[Yd.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,u),d=h.length,p=Promise.resolve(n);c{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const l=new Promise(a=>{r.subscribe(a),i=a}).then(o);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,a){r.reason||(r.reason=new Ii(i,l,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new qp(function(o){t=o}),cancel:t}}}const wS=qp;function xS(e){return function(n){return e.apply(null,n)}}function bS(e){return D.isObject(e)&&e.isAxiosError===!0}const kc={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(kc).forEach(([e,t])=>{kc[t]=e});const kS=kc;function a1(e){const t=new Nl(e),n=U0(Nl.prototype.request,t);return D.extend(n,Nl.prototype,t,{allOwnKeys:!0}),D.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return a1(yo(e,o))},n}const We=a1(Vp);We.Axios=Nl;We.CanceledError=Ii;We.CancelToken=wS;We.isCancel=r1;We.VERSION=l1;We.toFormData=Ga;We.AxiosError=he;We.Cancel=We.CanceledError;We.all=function(t){return Promise.all(t)};We.spread=xS;We.isAxiosError=bS;We.mergeConfig=yo;We.AxiosHeaders=Sn;We.formToJSON=e=>n1(D.isHTMLForm(e)?new FormData(e):e);We.getAdapter=i1.getAdapter;We.HttpStatusCode=kS;We.default=We;const SS=We,Xd="@openchatai:session_id";function CS(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=localStorage.getItem(Xd);if(n)t(n);else{const r=Math.random().toString(36).substring(2,15);localStorage.setItem(Xd,r),t(r)}},[]),{sessionId:e,setSessionId:t}}function ES(e,t){const n=SS.create({baseURL:e,headers:{"X-Session-Id":t}});return n.interceptors.request.use(r=>(r.data={...r.data,session_id:t},r)),n}const s1=x.createContext(void 0);function PS({children:e}){const t=Ua(),{sessionId:n}=CS(),r=x.useMemo(()=>ES(t==null?void 0:t.apiUrl,n),[t,n]);return t!=null&&t.token?r.defaults.headers["X-Bot-Token"]=t==null?void 0:t.token:console.warn("No token!"),L.jsx(s1.Provider,{value:{axiosInstance:r},children:e})}const u1=()=>{const e=x.useContext(s1);if(!e)throw new Error("useAxiosInstance must be used within a AxiosProvider");return e},c1=x.createContext({});function OS({children:e}){const{axiosInstance:t}=u1(),[n,r]=x.useState(),[o,i]=x.useState(!0);async function l(){i(!0),t.get("/chat/init").then(({data:a})=>r(a)).finally(()=>i(!1))}return x.useEffect(()=>{l()},[]),L.jsx(c1.Provider,{value:{data:n,loading:o,refetch:l},children:e})}const p1=()=>{const e=x.useContext(c1);return e||console.warn("Error loading initial data...."),e};function TS({children:e,options:t}){return L.jsx(lk,{data:t,children:L.jsx(sk,{children:L.jsx(PS,{children:L.jsx(OS,{children:e})})})})}function AS(){for(var e=0,t,n,r="";ee&&(t=0,r=n,n=new Map)}return{get:function(l){var a=n.get(l);if(a!==void 0)return a;if((a=r.get(l))!==void 0)return o(l,a),a},set:function(l,a){n.has(l)?n.set(l,a):o(l,a)}}}var h1="!";function NS(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(l){for(var a=[],s=0,u=0,p,c=0;cu?p-u:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:w}}}function IS(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var o=r[0]==="[";o?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function FS(e){return{cache:zS(e.cacheSize),splitModifiers:NS(e),...$S(e)}}var jS=/\s+/;function MS(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,i=new Set;return e.trim().split(jS).map(function(l){var a=n(l),s=a.modifiers,u=a.hasImportantModifier,p=a.baseClassName,c=a.maybePostfixModifierPosition,d=r(c?p.substring(0,c):p),f=!!c;if(!d){if(!c)return{isTailwindClass:!1,originalClassName:l};if(d=r(p),!d)return{isTailwindClass:!1,originalClassName:l};f=!1}var h=IS(s).join(":"),m=u?h+h1:h;return{isTailwindClass:!0,modifierId:m,classGroupId:d,originalClassName:l,hasPostfixModifier:f}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var a=l.modifierId,s=l.classGroupId,u=l.hasPostfixModifier,p=a+s;return i.has(p)?!1:(i.add(p),o(s,u).forEach(function(c){return i.add(a+c)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function BS(){for(var e=arguments.length,t=new Array(e),n=0;ne.forEach(n=>l2(n,t))}function en(...e){return x.useCallback(w1(...e),e)}function Qp(e,t=[]){let n=[];function r(i,l){const a=x.createContext(l),s=n.length;n=[...n,l];function u(c){const{scope:d,children:f,...h}=c,m=(d==null?void 0:d[e][s])||a,w=x.useMemo(()=>h,Object.values(h));return x.createElement(m.Provider,{value:w},f)}function p(c,d){const f=(d==null?void 0:d[e][s])||a,h=x.useContext(f);if(h)return h;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,p]}const o=()=>{const i=n.map(l=>x.createContext(l));return function(a){const s=(a==null?void 0:a[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])}};return o.scopeName=e,[r,a2(o,...t)]}function a2(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((a,{useScope:s,scopeName:u})=>{const c=s(i)[`__scope${u}`];return{...a,...c}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}const vo=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},s2=Qw["useId".toString()]||(()=>{});let u2=0;function Il(e){const[t,n]=x.useState(s2());return vo(()=>{e||n(r=>r??String(u2++))},[e]),e||(t?`radix-${t}`:"")}function un(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function x1({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=c2({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,a=un(n),s=x.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&a(c)}else o(u)},[i,e,o,a]);return[l,s]}function c2({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,o=x.useRef(r),i=un(t);return x.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Kp=x.forwardRef((e,t)=>{const{children:n,...r}=e,o=x.Children.toArray(n),i=o.find(p2);if(i){const l=i.props.children,a=o.map(s=>s===i?x.Children.count(l)>1?x.Children.only(null):x.isValidElement(l)?l.props.children:null:s);return x.createElement(Ec,ge({},r,{ref:t}),x.isValidElement(l)?x.cloneElement(l,void 0,a):null)}return x.createElement(Ec,ge({},r,{ref:t}),n)});Kp.displayName="Slot";const Ec=x.forwardRef((e,t)=>{const{children:n,...r}=e;return x.isValidElement(n)?x.cloneElement(n,{...f2(r,n.props),ref:t?w1(t,n.ref):n.ref}):x.Children.count(n)>1?x.Children.only(null):null});Ec.displayName="SlotClone";const b1=({children:e})=>x.createElement(x.Fragment,null,e);function p2(e){return x.isValidElement(e)&&e.type===b1}function f2(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const d2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Tt=d2.reduce((e,t)=>{const n=x.forwardRef((r,o)=>{const{asChild:i,...l}=r,a=i?Kp:t;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(a,ge({},l,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function k1(e,t){e&&Ba.flushSync(()=>e.dispatchEvent(t))}function S1(e,t=globalThis==null?void 0:globalThis.document){const n=un(e);x.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Pc="dismissableLayer.update",h2="dismissableLayer.pointerDownOutside",m2="dismissableLayer.focusOutside";let nh;const g2=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),y2=x.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:a,onDismiss:s,...u}=e,p=x.useContext(g2),[c,d]=x.useState(null),f=(n=c==null?void 0:c.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=x.useState({}),m=en(t,T=>d(T)),w=Array.from(p.layers),[g]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(g),v=c?w.indexOf(c):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,k=v2(T=>{const N=T.target,P=[...p.branches].some(_=>_.contains(N));!E||P||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),O=w2(T=>{const N=T.target;[...p.branches].some(_=>_.contains(N))||(l==null||l(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return S1(T=>{v===p.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),x.useEffect(()=>{if(c)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(nh=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(c)),p.layers.add(c),rh(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=nh)}},[c,f,r,p]),x.useEffect(()=>()=>{c&&(p.layers.delete(c),p.layersWithOutsidePointerEventsDisabled.delete(c),rh())},[c,p]),x.useEffect(()=>{const T=()=>h({});return document.addEventListener(Pc,T),()=>document.removeEventListener(Pc,T)},[]),x.createElement(Tt.div,ge({},u,{ref:m,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Xe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Xe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Xe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function v2(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let p=function(){C1(h2,n,u,{discrete:!0})};var s=p;const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=p,t.addEventListener("click",o.current,{once:!0})):p()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function w2(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!r.current&&C1(m2,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rh(){const e=new CustomEvent(Pc);document.dispatchEvent(e)}function C1(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?k1(o,i):o.dispatchEvent(i)}const ru="focusScope.autoFocusOnMount",ou="focusScope.autoFocusOnUnmount",oh={bubbles:!1,cancelable:!0},x2=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...l}=e,[a,s]=x.useState(null),u=un(o),p=un(i),c=x.useRef(null),d=en(t,m=>s(m)),f=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let y=function(k){if(f.paused||!a)return;const O=k.target;a.contains(O)?c.current=O:Mn(c.current,{select:!0})},v=function(k){if(f.paused||!a)return;const O=k.relatedTarget;O!==null&&(a.contains(O)||Mn(c.current,{select:!0}))},C=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&Mn(a)};var m=y,w=v,g=C;document.addEventListener("focusin",y),document.addEventListener("focusout",v);const E=new MutationObserver(C);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),E.disconnect()}}},[r,a,f.paused]),x.useEffect(()=>{if(a){lh.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(ru,oh);a.addEventListener(ru,u),a.dispatchEvent(g),g.defaultPrevented||(b2(P2(E1(a)),{select:!0}),document.activeElement===m&&Mn(a))}return()=>{a.removeEventListener(ru,u),setTimeout(()=>{const g=new CustomEvent(ou,oh);a.addEventListener(ou,p),a.dispatchEvent(g),g.defaultPrevented||Mn(m??document.body,{select:!0}),a.removeEventListener(ou,p),lh.remove(f)},0)}}},[a,u,p,f]);const h=x.useCallback(m=>{if(!n&&!r||f.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(w&&g){const y=m.currentTarget,[v,C]=k2(y);v&&C?!m.shiftKey&&g===C?(m.preventDefault(),n&&Mn(v,{select:!0})):m.shiftKey&&g===v&&(m.preventDefault(),n&&Mn(C,{select:!0})):g===y&&m.preventDefault()}},[n,r,f.paused]);return x.createElement(Tt.div,ge({tabIndex:-1},l,{ref:d,onKeyDown:h}))});function b2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mn(r,{select:t}),document.activeElement!==n)return}function k2(e){const t=E1(e),n=ih(t,e),r=ih(t.reverse(),e);return[n,r]}function E1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ih(e,t){for(const n of e)if(!S2(n,{upTo:t}))return n}function S2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function C2(e){return e instanceof HTMLInputElement&&"select"in e}function Mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&C2(e)&&t&&e.select()}}const lh=E2();function E2(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ah(e,t),e.unshift(t)},remove(t){var n;e=ah(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function ah(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function P2(e){return e.filter(t=>t.tagName!=="A")}function O2(e,t){return x.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Ya=e=>{const{present:t,children:n}=e,r=T2(t),o=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=en(r.ref,o.ref);return typeof n=="function"||r.isPresent?x.cloneElement(o,{ref:i}):null};Ya.displayName="Presence";function T2(e){const[t,n]=x.useState(),r=x.useRef({}),o=x.useRef(e),i=x.useRef("none"),l=e?"mounted":"unmounted",[a,s]=O2(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=cl(r.current);i.current=a==="mounted"?u:"none"},[a]),vo(()=>{const u=r.current,p=o.current;if(p!==e){const d=i.current,f=cl(u);e?s("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?s("UNMOUNT"):s(p&&d!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,s]),vo(()=>{if(t){const u=c=>{const f=cl(r.current).includes(c.animationName);c.target===t&&f&&Ba.flushSync(()=>s("ANIMATION_END"))},p=c=>{c.target===t&&(i.current=cl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function cl(e){return(e==null?void 0:e.animationName)||"none"}let iu=0;function A2(){x.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:sh()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:sh()),iu++,()=>{iu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),iu--}},[])}function sh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var ln=function(){return ln=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return G2;var t=q2(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Q2=A1(),K2=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,a=e.gap;return n===void 0&&(n="margin"),` +`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Qs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ic(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Db=typeof WeakMap=="function"?WeakMap:Map;function p0(e,t,n){n=kn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pa||(pa=!0,mc=r),ic(e,t)},n}function f0(e,t,n){n=kn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ic(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ic(e,t),typeof r!="function"&&(Zn===null?Zn=new Set([this]):Zn.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function kd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Db;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Yb.bind(null,e,t,n),t.then(e,e))}function Sd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Cd(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kn(-1,1),t.tag=2,Xn(n,t,1))),n.lanes|=1),e)}var zb=Rn.ReactCurrentOwner,dt=!1;function lt(e,t,n,r){t.child=e===null?Wy(t,null,n,r):fo(t,e.child,n,r)}function Ed(e,t,n,r,o){n=n.render;var i=t.ref;return io(t,o),r=Pp(e,t,n,r,i,o),n=Op(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,On(e,t,o)):($e&&n&&hp(t),t.flags|=1,lt(e,t,r,o),t.child)}function Pd(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Ip(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,d0(e,t,i,r,o)):(e=Ll(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:mi,n(l,r)&&e.ref===t.ref)return On(e,t,o)}return t.flags|=1,e=er(i,r),e.ref=t.ref,e.return=t,t.child=e}function d0(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(mi(i,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(dt=!0);else return t.lanes=e.lanes,On(e,t,o)}return lc(e,t,n,r,o)}function h0(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ce(Jr,wt),wt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ce(Jr,wt),wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ce(Jr,wt),wt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ce(Jr,wt),wt|=r;return lt(e,t,o,n),t.child}function m0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function lc(e,t,n,r,o){var i=mt(n)?Cr:ot.current;return i=co(t,i),io(t,o),n=Pp(e,t,n,r,i,o),r=Op(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,On(e,t,o)):($e&&r&&hp(t),t.flags|=1,lt(e,t,n,o),t.child)}function Od(e,t,n,r,o){if(mt(n)){var i=!0;ta(t)}else i=!1;if(io(t,o),t.stateNode===null)$l(e,t),Uy(t,n,r),oc(t,n,r,o),r=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var s=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=Nt(u):(u=mt(n)?Cr:ot.current,u=co(t,u));var p=n.getDerivedStateFromProps,c=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";c||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||s!==u)&&vd(t,l,r,u),Un=!1;var d=t.memoizedState;l.state=d,la(t,r,l,o),s=t.memoizedState,a!==r||d!==s||ht.current||Un?(typeof p=="function"&&(rc(t,n,p,r),s=t.memoizedState),(a=Un||yd(t,n,a,r,d,s,u))?(c||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),l.props=r,l.state=s,l.context=u,r=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,My(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Gt(t.type,a),l.props=u,c=t.pendingProps,d=l.context,s=n.contextType,typeof s=="object"&&s!==null?s=Nt(s):(s=mt(n)?Cr:ot.current,s=co(t,s));var f=n.getDerivedStateFromProps;(p=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==c||d!==s)&&vd(t,l,r,s),Un=!1,d=t.memoizedState,l.state=d,la(t,r,l,o);var h=t.memoizedState;a!==c||d!==h||ht.current||Un?(typeof f=="function"&&(rc(t,n,f,r),h=t.memoizedState),(u=Un||yd(t,n,u,r,d,h,s)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,h,s),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,h,s)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),l.props=r,l.state=h,l.context=s,r=u):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return ac(e,t,n,r,i,o)}function ac(e,t,n,r,o,i){m0(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&fd(t,n,!1),On(e,t,i);r=t.stateNode,zb.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=fo(t,e.child,null,i),t.child=fo(t,null,a,i)):lt(e,t,a,i),t.memoizedState=r.state,o&&fd(t,n,!0),t.child}function g0(e){var t=e.stateNode;t.pendingContext?pd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&pd(e,t.context,!1),kp(e,t.containerInfo)}function Td(e,t,n,r,o){return po(),gp(o),t.flags|=256,lt(e,t,n,r),t.child}var sc={dehydrated:null,treeContext:null,retryLane:0};function uc(e){return{baseLanes:e,cachePool:null,transitions:null}}function y0(e,t,n){var r=t.pendingProps,o=Re.current,i=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ce(Re,o&1),e===null)return tc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,i?(r=t.mode,i=t.child,l={mode:"hidden",children:l},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=Ia(l,r,0,null),e=Sr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uc(n),t.memoizedState=sc,e):$p(t,l));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return Nb(e,t,l,r,a,o,n);if(i){i=r.fallback,l=t.mode,o=e.child,a=o.sibling;var s={mode:"hidden",children:r.children};return!(l&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=er(o,s),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=er(a,i):(i=Sr(i,l,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,l=e.child.memoizedState,l=l===null?uc(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=sc,r}return i=e.child,e=i.sibling,r=er(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $p(e,t){return t=Ia({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ll(e,t,n,r){return r!==null&&gp(r),fo(t,e.child,null,n),e=$p(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nb(e,t,n,r,o,i,l){if(n)return t.flags&256?(t.flags&=-257,r=Qs(Error(F(422))),ll(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Ia({mode:"visible",children:r.children},o,0,null),i=Sr(i,o,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&fo(t,e.child,null,l),t.child.memoizedState=uc(l),t.memoizedState=sc,i);if(!(t.mode&1))return ll(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(F(419)),r=Qs(i,r,void 0),ll(e,t,l,r)}if(a=(l&e.childLanes)!==0,dt||a){if(r=Ye,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|l)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Pn(e,o),Xt(r,e,o,-1))}return Np(),r=Qs(Error(F(421))),ll(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Qb.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,bt=Kn(o.nextSibling),kt=t,$e=!0,Yt=null,e!==null&&($t[_t++]=wn,$t[_t++]=xn,$t[_t++]=Er,wn=e.id,xn=e.overflow,Er=t),t=$p(t,r.children),t.flags|=4096,t)}function Ad(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),nc(e.return,t,n)}function Ks(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function v0(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(lt(e,t,r.children,n),r=Re.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ad(e,n,t);else if(e.tag===19)Ad(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ce(Re,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&aa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ks(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&aa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ks(t,!0,n,null,i);break;case"together":Ks(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $l(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function On(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=er(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=er(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ib(e,t,n){switch(t.tag){case 3:g0(t),po();break;case 5:Vy(t);break;case 1:mt(t.type)&&ta(t);break;case 4:kp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ce(oa,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ce(Re,Re.current&1),t.flags|=128,null):n&t.child.childLanes?y0(e,t,n):(Ce(Re,Re.current&1),e=On(e,t,n),e!==null?e.sibling:null);Ce(Re,Re.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return v0(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ce(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,h0(e,t,n)}return On(e,t,n)}var w0,cc,x0,b0;w0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};cc=function(){};x0=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,xr(sn.current);var i=null;switch(n){case"input":o=Ru(e,o),r=Ru(e,r),i=[];break;case"select":o=De({},o,{value:void 0}),r=De({},r,{value:void 0}),i=[];break;case"textarea":o=zu(e,o),r=zu(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Jl)}Iu(n,r);var l;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(si.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var s=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&s!==a&&(s!=null||a!=null))if(u==="style")if(a){for(l in a)!a.hasOwnProperty(l)||s&&s.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in s)s.hasOwnProperty(l)&&a[l]!==s[l]&&(n||(n={}),n[l]=s[l])}else n||(i||(i=[]),i.push(u,n)),n=s;else u==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,a=a?a.__html:void 0,s!=null&&a!==s&&(i=i||[]).push(u,s)):u==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(u,""+s):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(si.hasOwnProperty(u)?(s!=null&&u==="onScroll"&&Oe("scroll",e),i||a===s||(i=[])):(i=i||[]).push(u,s))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};b0=function(e,t,n,r){n!==r&&(t.flags|=4)};function jo(e,t){if(!$e)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fb(e,t,n){var r=t.pendingProps;switch(mp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return mt(t.type)&&ea(),tt(t),null;case 3:return r=t.stateNode,ho(),Ae(ht),Ae(ot),Cp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ol(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yt!==null&&(vc(Yt),Yt=null))),cc(e,t),tt(t),null;case 5:Sp(t);var o=xr(xi.current);if(n=t.type,e!==null&&t.stateNode!=null)x0(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(F(166));return tt(t),null}if(e=xr(sn.current),ol(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[on]=t,r[vi]=i,e=(t.mode&1)!==0,n){case"dialog":Oe("cancel",r),Oe("close",r);break;case"iframe":case"object":case"embed":Oe("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[on]=t,e[vi]=r,w0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Fu(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),o=r;break;case"iframe":case"object":case"embed":Oe("load",e),o=r;break;case"video":case"audio":for(o=0;ogo&&(t.flags|=128,r=!0,jo(i,!1),t.lanes=4194304)}else{if(!r)if(e=aa(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!$e)return tt(t),null}else 2*Me()-i.renderingStartTime>go&&n!==1073741824&&(t.flags|=128,r=!0,jo(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Me(),t.sibling=null,n=Re.current,Ce(Re,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return zp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?wt&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function jb(e,t){switch(mp(t),t.tag){case 1:return mt(t.type)&&ea(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ho(),Ae(ht),Ae(ot),Cp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sp(t),null;case 13:if(Ae(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ae(Re),null;case 4:return ho(),null;case 10:return wp(t.type._context),null;case 22:case 23:return zp(),null;case 24:return null;default:return null}}var al=!1,nt=!1,Mb=typeof WeakSet=="function"?WeakSet:Set,V=null;function Zr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ne(e,t,r)}else n.current=null}function pc(e,t,n){try{n()}catch(r){Ne(e,t,r)}}var $d=!1;function Bb(e,t){if(Yu=Kl,e=Ey(),dp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,u=0,p=0,c=e,d=null;t:for(;;){for(var f;c!==n||o!==0&&c.nodeType!==3||(a=l+o),c!==i||r!==0&&c.nodeType!==3||(s=l+r),c.nodeType===3&&(l+=c.nodeValue.length),(f=c.firstChild)!==null;)d=c,c=f;for(;;){if(c===e)break t;if(d===n&&++u===o&&(a=l),d===i&&++p===r&&(s=l),(f=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=f}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qu={focusedElem:e,selectionRange:n},Kl=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,w=h.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:Gt(t.type,m),w);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(C){Ne(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return h=$d,$d=!1,h}function ti(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&pc(t,n,i)}o=o.next}while(o!==r)}}function za(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function k0(e){var t=e.alternate;t!==null&&(e.alternate=null,k0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[on],delete t[vi],delete t[Zu],delete t[Sb],delete t[Cb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function S0(e){return e.tag===5||e.tag===3||e.tag===4}function _d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||S0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jl));else if(r!==4&&(e=e.child,e!==null))for(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}function hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}var Ke=null,qt=!1;function Nn(e,t,n){for(n=n.child;n!==null;)C0(e,t,n),n=n.sibling}function C0(e,t,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Oa,n)}catch{}switch(n.tag){case 5:nt||Zr(n,t);case 6:var r=Ke,o=qt;Ke=null,Nn(e,t,n),Ke=r,qt=o,Ke!==null&&(qt?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(qt?(e=Ke,n=n.stateNode,e.nodeType===8?Hs(e.parentNode,n):e.nodeType===1&&Hs(e,n),di(e)):Hs(Ke,n.stateNode));break;case 4:r=Ke,o=qt,Ke=n.stateNode.containerInfo,qt=!0,Nn(e,t,n),Ke=r,qt=o;break;case 0:case 11:case 14:case 15:if(!nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&pc(n,t,l),o=o.next}while(o!==r)}Nn(e,t,n);break;case 1:if(!nt&&(Zr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ne(n,t,a)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(nt=(r=nt)||n.memoizedState!==null,Nn(e,t,n),nt=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function Rd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mb),t.forEach(function(r){var o=Kb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Hb(r/1960))-r,10e?16:e,Gn===null)var r=!1;else{if(e=Gn,Gn=null,fa=0,me&6)throw Error(F(331));var o=me;for(me|=4,V=e.current;V!==null;){var i=V,l=i.child;if(V.flags&16){var a=i.deletions;if(a!==null){for(var s=0;sMe()-Lp?kr(e,0):Rp|=n),gt(e,t)}function R0(e,t){t===0&&(e.mode&1?(t=Zi,Zi<<=1,!(Zi&130023424)&&(Zi=4194304)):t=1);var n=st();e=Pn(e,t),e!==null&&(Ri(e,t,n),gt(e,n))}function Qb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),R0(e,n)}function Kb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),R0(e,n)}var L0;L0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ht.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,Ib(e,t,n);dt=!!(e.flags&131072)}else dt=!1,$e&&t.flags&1048576&&Ny(t,ra,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;$l(e,t),e=t.pendingProps;var o=co(t,ot.current);io(t,n),o=Pp(null,t,r,e,o,n);var i=Op();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,mt(r)?(i=!0,ta(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,bp(t),o.updater=La,t.stateNode=o,o._reactInternals=t,oc(t,r,e,n),t=ac(null,t,r,!0,i,n)):(t.tag=0,$e&&i&&hp(t),lt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch($l(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Zb(r),e=Gt(r,e),o){case 0:t=lc(null,t,r,e,n);break e;case 1:t=Od(null,t,r,e,n);break e;case 11:t=Ed(null,t,r,e,n);break e;case 14:t=Pd(null,t,r,Gt(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),lc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),Od(e,t,r,o,n);case 3:e:{if(g0(t),e===null)throw Error(F(387));r=t.pendingProps,i=t.memoizedState,o=i.element,My(e,t),la(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=mo(Error(F(423)),t),t=Td(e,t,r,n,o);break e}else if(r!==o){o=mo(Error(F(424)),t),t=Td(e,t,r,n,o);break e}else for(bt=Kn(t.stateNode.containerInfo.firstChild),kt=t,$e=!0,Yt=null,n=Wy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(po(),r===o){t=On(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return Vy(t),e===null&&tc(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Ku(r,o)?l=null:i!==null&&Ku(r,i)&&(t.flags|=32),m0(e,t),lt(e,t,l,n),t.child;case 6:return e===null&&tc(t),null;case 13:return y0(e,t,n);case 4:return kp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):lt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),Ed(e,t,r,o,n);case 7:return lt(e,t,t.pendingProps,n),t.child;case 8:return lt(e,t,t.pendingProps.children,n),t.child;case 12:return lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,Ce(oa,r._currentValue),r._currentValue=l,i!==null)if(Jt(i.value,l)){if(i.children===o.children&&!ht.current){t=On(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=kn(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),nc(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(F(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),nc(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}lt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,io(t,n),o=Nt(o),r=r(o),t.flags|=1,lt(e,t,r,n),t.child;case 14:return r=t.type,o=Gt(r,t.pendingProps),o=Gt(r.type,o),Pd(e,t,r,o,n);case 15:return d0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Gt(r,o),$l(e,t),t.tag=1,mt(r)?(e=!0,ta(t)):e=!1,io(t,n),Uy(t,r,o),oc(t,r,o,n),ac(null,t,r,!0,e,n);case 19:return v0(e,t,n);case 22:return h0(e,t,n)}throw Error(F(156,t.tag))};function D0(e,t){return ly(e,t)}function Xb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 Lt(e,t,n,r){return new Xb(e,t,n,r)}function Ip(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zb(e){if(typeof e=="function")return Ip(e)?1:0;if(e!=null){if(e=e.$$typeof,e===np)return 11;if(e===rp)return 14}return 2}function er(e,t){var n=e.alternate;return n===null?(n=Lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ll(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")Ip(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Hr:return Sr(n.children,o,i,t);case tp:l=8,o|=8;break;case Tu:return e=Lt(12,n,t,o|2),e.elementType=Tu,e.lanes=i,e;case Au:return e=Lt(13,n,t,o),e.elementType=Au,e.lanes=i,e;case $u:return e=Lt(19,n,t,o),e.elementType=$u,e.lanes=i,e;case Hg:return Ia(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Bg:l=10;break e;case Ug:l=9;break e;case np:l=11;break e;case rp:l=14;break e;case Bn:l=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Lt(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Sr(e,t,n,r){return e=Lt(7,e,r,t),e.lanes=n,e}function Ia(e,t,n,r){return e=Lt(22,e,r,t),e.elementType=Hg,e.lanes=n,e.stateNode={isHidden:!1},e}function Xs(e,t,n){return e=Lt(6,e,null,t),e.lanes=n,e}function Zs(e,t,n){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jb(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rs(0),this.expirationTimes=Rs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rs(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Fp(e,t,n,r,o,i,l,a,s){return e=new Jb(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Lt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bp(i),e}function ek(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(F0)}catch(e){console.error(e)}}F0(),Ng.exports=Pt;var Ua=Ng.exports,Md=Ua;Pu.createRoot=Md.createRoot,Pu.hydrateRoot=Md.hydrateRoot;const ik='@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;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";font-feature-settings:normal;font-variation-settings:normal}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-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;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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]{display:none}*{scrollbar-color:initial;scrollbar-width:initial}:root{--opencopilot-primary-clr: #703ea8;--opencopilot-accent-clr: #f8f7f8;--opencopilot-accnet-2-clr: #817f81;--opencopilot-primary-light-clr: rgba(0, 87, 255, .1)}*,: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: }::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: }.opencopilot-fixed{position:fixed}.opencopilot-absolute{position:absolute}.opencopilot-relative{position:relative}.opencopilot-inset-0{top:0;right:0;bottom:0;left:0}.opencopilot-bottom-0{bottom:0}.opencopilot-right-0{right:0}.opencopilot-top-0{top:0}.\\!opencopilot-z-\\[100000\\]{z-index:100000!important}.opencopilot-z-50{z-index:50}.opencopilot-z-\\[10000000\\]{z-index:10000000}.opencopilot-z-\\[100\\]{z-index:100}.opencopilot-z-\\[50000\\]{z-index:50000}.opencopilot-clear-both{clear:both}.opencopilot-m-0{margin:0}.opencopilot-mx-auto{margin-left:auto;margin-right:auto}.opencopilot-mb-3{margin-bottom:.75rem}.opencopilot-mb-auto{margin-bottom:auto}.opencopilot-mt-auto{margin-top:auto}.opencopilot-block{display:block}.opencopilot-flex{display:flex}.opencopilot-grid{display:grid}.opencopilot-hidden{display:none}.opencopilot-aspect-square{aspect-ratio:1 / 1}.opencopilot-h-7{height:1.75rem}.opencopilot-h-fit{height:-moz-fit-content;height:fit-content}.opencopilot-h-full{height:100%}.opencopilot-h-screen{height:100vh}.opencopilot-max-h-full{max-height:100%}.opencopilot-w-7{width:1.75rem}.opencopilot-w-fit{width:-moz-fit-content;width:fit-content}.opencopilot-w-full{width:100%}.opencopilot-w-screen{width:100vw}.opencopilot-min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.opencopilot-max-w-\\[15rem\\]{max-width:15rem}.opencopilot-max-w-full{max-width:100%}.opencopilot-max-w-lg{max-width:32rem}.opencopilot-flex-1{flex:1 1 0%}.opencopilot-shrink-0{flex-shrink:0}.opencopilot-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.opencopilot-resize-none{resize:none}.opencopilot-flex-col{flex-direction:column}.opencopilot-flex-col-reverse{flex-direction:column-reverse}.opencopilot-flex-wrap{flex-wrap:wrap}.opencopilot-items-start{align-items:flex-start}.opencopilot-items-center{align-items:center}.opencopilot-justify-center{justify-content:center}.opencopilot-justify-between{justify-content:space-between}.opencopilot-gap-1{gap:.25rem}.opencopilot-gap-2{gap:.5rem}.opencopilot-gap-3{gap:.75rem}.opencopilot-gap-4{gap:1rem}.opencopilot-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))}.opencopilot-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))}.opencopilot-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))}.opencopilot-justify-self-end{justify-self:end}.opencopilot-overflow-auto{overflow:auto}.opencopilot-overflow-hidden{overflow:hidden}.opencopilot-overflow-x-auto{overflow-x:auto}.opencopilot-overflow-y-auto{overflow-y:auto}.opencopilot-overflow-x-hidden{overflow-x:hidden}.opencopilot-scroll-smooth{scroll-behavior:smooth}.opencopilot-whitespace-nowrap{white-space:nowrap}.opencopilot-whitespace-pre-wrap{white-space:pre-wrap}.opencopilot-rounded-2xl{border-radius:1rem}.opencopilot-rounded-full{border-radius:9999px}.opencopilot-rounded-lg{border-radius:.5rem}.opencopilot-rounded-md{border-radius:.375rem}.opencopilot-rounded-sm{border-radius:.125rem}.opencopilot-rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.opencopilot-border{border-width:1px}.opencopilot-border-b{border-bottom-width:1px}.opencopilot-border-none{border-style:none}.opencopilot-border-primary-light{border-color:var(--opencopilot-primary-light-clr)}.opencopilot-border-rose-500{--tw-border-opacity: 1;border-color:rgb(244 63 94 / var(--tw-border-opacity))}.opencopilot-border-transparent{border-color:transparent}.opencopilot-border-b-black\\/10{border-bottom-color:#0000001a}.opencopilot-bg-accent{background-color:var(--opencopilot-accent-clr)}.opencopilot-bg-black\\/50{background-color:#00000080}.opencopilot-bg-primary{background-color:var(--opencopilot-primary-clr)}.opencopilot-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.opencopilot-bg-transparent{background-color:transparent}.opencopilot-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.opencopilot-fill-current{fill:currentColor}.opencopilot-object-cover{-o-object-fit:cover;object-fit:cover}.opencopilot-p-0{padding:0}.opencopilot-p-0\\.5{padding:.125rem}.opencopilot-p-2{padding:.5rem}.opencopilot-p-3{padding:.75rem}.opencopilot-p-6{padding:1.5rem}.opencopilot-px-2{padding-left:.5rem;padding-right:.5rem}.opencopilot-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.opencopilot-px-4{padding-left:1rem;padding-right:1rem}.opencopilot-py-1{padding-top:.25rem;padding-bottom:.25rem}.opencopilot-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.opencopilot-py-2{padding-top:.5rem;padding-bottom:.5rem}.opencopilot-ps-10{padding-inline-start:2.5rem}.opencopilot-text-center{text-align:center}.opencopilot-font-inter{font-family:Inter,sans-serif,system-ui}.opencopilot-text-2xl{font-size:1.5rem;line-height:2rem}.opencopilot-text-\\[14px\\]{font-size:14px}.opencopilot-text-lg{font-size:1.125rem;line-height:1.75rem}.opencopilot-text-sm{font-size:.875rem;line-height:1.25rem}.opencopilot-text-xl{font-size:1.25rem;line-height:1.75rem}.opencopilot-text-xs{font-size:.75rem;line-height:1rem}.opencopilot-font-medium{font-weight:500}.opencopilot-font-normal{font-weight:400}.opencopilot-font-semibold{font-weight:600}.opencopilot-lowercase{text-transform:lowercase}.opencopilot-leading-none{line-height:1}.opencopilot-leading-tight{line-height:1.25}.opencopilot-tracking-tight{letter-spacing:-.025em}.opencopilot-text-\\[\\#5e5c5e\\]{--tw-text-opacity: 1;color:rgb(94 92 94 / var(--tw-text-opacity))}.opencopilot-text-accent{color:var(--opencopilot-accent-clr)}.opencopilot-text-accent2{color:var(--opencopilot-accent-2-clr)}.opencopilot-text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.opencopilot-text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity))}.opencopilot-text-primary{color:var(--opencopilot-primary-clr)}.opencopilot-text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity))}.opencopilot-text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opencopilot-opacity-0{opacity:0}.opencopilot-opacity-100{opacity:1}.opencopilot-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)}.opencopilot-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)}.opencopilot-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)}.opencopilot-outline-none{outline:2px solid transparent;outline-offset:2px}.opencopilot-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)}.opencopilot-ring-\\[\\#334155\\]\\/60{--tw-ring-color: rgb(51 65 85 / .6)}.opencopilot-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)}.opencopilot-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.opencopilot-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}.opencopilot-transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.opencopilot-transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.opencopilot-duration-300{transition-duration:.3s}.opencopilot-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.opencopilot-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@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))}}.opencopilot-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}.opencopilot-animate-out{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}.opencopilot-fade-in,.opencopilot-fade-in-0{--tw-enter-opacity: 0}.opencopilot-fade-out{--tw-exit-opacity: 0}.opencopilot-slide-in-from-bottom-5{--tw-enter-translate-y: 1.25rem}.opencopilot-slide-in-from-top-1{--tw-enter-translate-y: -.25rem}.opencopilot-duration-300{animation-duration:.3s}.opencopilot-ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.opencopilot-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.opencopilot-scrollbar-thin{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.opencopilot-scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.opencopilot-scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.opencopilot-scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.opencopilot-scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.opencopilot-scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.opencopilot-scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.opencopilot-scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.opencopilot-scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.opencopilot-scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.opencopilot-scrollbar-thin{scrollbar-width:thin}.opencopilot-scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.opencopilot-prose{color:var(--tw-prose-body);max-width:65ch}.opencopilot-prose :where(p):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.opencopilot-prose :where([class~=lead]):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.opencopilot-prose :where(a):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.opencopilot-prose :where(strong):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.opencopilot-prose :where(a strong):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(blockquote strong):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(thead th strong):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(ol):not(:where([class~=opencopilot-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.opencopilot-prose :where(ol[type=A]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-alpha}.opencopilot-prose :where(ol[type=a]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-alpha}.opencopilot-prose :where(ol[type=A s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-alpha}.opencopilot-prose :where(ol[type=a s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-alpha}.opencopilot-prose :where(ol[type=I]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-roman}.opencopilot-prose :where(ol[type=i]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-roman}.opencopilot-prose :where(ol[type=I s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:upper-roman}.opencopilot-prose :where(ol[type=i s]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:lower-roman}.opencopilot-prose :where(ol[type="1"]):not(:where([class~=opencopilot-not-prose] *)){list-style-type:decimal}.opencopilot-prose :where(ul):not(:where([class~=opencopilot-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.opencopilot-prose :where(ol>li):not(:where([class~=opencopilot-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.opencopilot-prose :where(ul>li):not(:where([class~=opencopilot-not-prose] *))::marker{color:var(--tw-prose-bullets)}.opencopilot-prose :where(hr):not(:where([class~=opencopilot-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.opencopilot-prose :where(blockquote):not(:where([class~=opencopilot-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.opencopilot-prose :where(blockquote p:first-of-type):not(:where([class~=opencopilot-not-prose] *)):before{content:open-quote}.opencopilot-prose :where(blockquote p:last-of-type):not(:where([class~=opencopilot-not-prose] *)):after{content:close-quote}.opencopilot-prose :where(h1):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.opencopilot-prose :where(h1 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:900;color:inherit}.opencopilot-prose :where(h2):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.opencopilot-prose :where(h2 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:800;color:inherit}.opencopilot-prose :where(h3):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.opencopilot-prose :where(h3 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:700;color:inherit}.opencopilot-prose :where(h4):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.opencopilot-prose :where(h4 strong):not(:where([class~=opencopilot-not-prose] *)){font-weight:700;color:inherit}.opencopilot-prose :where(img):not(:where([class~=opencopilot-not-prose] *)){margin-top:2em;margin-bottom:2em}.opencopilot-prose :where(figure>*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0;margin-bottom:0}.opencopilot-prose :where(figcaption):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.opencopilot-prose :where(code):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.opencopilot-prose :where(code):not(:where([class~=opencopilot-not-prose] *)):before{content:"`"}.opencopilot-prose :where(code):not(:where([class~=opencopilot-not-prose] *)):after{content:"`"}.opencopilot-prose :where(a code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(h1 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(h2 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit;font-size:.875em}.opencopilot-prose :where(h3 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit;font-size:.9em}.opencopilot-prose :where(h4 code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(blockquote code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(thead th code):not(:where([class~=opencopilot-not-prose] *)){color:inherit}.opencopilot-prose :where(pre):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.opencopilot-prose :where(pre code):not(:where([class~=opencopilot-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.opencopilot-prose :where(pre code):not(:where([class~=opencopilot-not-prose] *)):before{content:none}.opencopilot-prose :where(pre code):not(:where([class~=opencopilot-not-prose] *)):after{content:none}.opencopilot-prose :where(table):not(:where([class~=opencopilot-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.opencopilot-prose :where(thead):not(:where([class~=opencopilot-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.opencopilot-prose :where(thead th):not(:where([class~=opencopilot-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.opencopilot-prose :where(tbody tr):not(:where([class~=opencopilot-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.opencopilot-prose :where(tbody tr:last-child):not(:where([class~=opencopilot-not-prose] *)){border-bottom-width:0}.opencopilot-prose :where(tbody td):not(:where([class~=opencopilot-not-prose] *)){vertical-align:baseline}.opencopilot-prose :where(tfoot):not(:where([class~=opencopilot-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.opencopilot-prose :where(tfoot td):not(:where([class~=opencopilot-not-prose] *)){vertical-align:top}.opencopilot-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.opencopilot-prose :where(video):not(:where([class~=opencopilot-not-prose] *)){margin-top:2em;margin-bottom:2em}.opencopilot-prose :where(figure):not(:where([class~=opencopilot-not-prose] *)){margin-top:2em;margin-bottom:2em}.opencopilot-prose :where(li):not(:where([class~=opencopilot-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.opencopilot-prose :where(ol>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.375em}.opencopilot-prose :where(ul>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.375em}.opencopilot-prose :where(.opencopilot-prose>ul>li p):not(:where([class~=opencopilot-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.opencopilot-prose :where(.opencopilot-prose>ul>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.25em}.opencopilot-prose :where(.opencopilot-prose>ul>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.25em}.opencopilot-prose :where(.opencopilot-prose>ol>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.25em}.opencopilot-prose :where(.opencopilot-prose>ol>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.25em}.opencopilot-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=opencopilot-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.opencopilot-prose :where(hr+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(h2+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(h3+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(h4+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(thead th:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose :where(thead th:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose :where(tbody td,tfoot td):not(:where([class~=opencopilot-not-prose] *)){padding:.5714286em}.opencopilot-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose :where(.opencopilot-prose>:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose :where(.opencopilot-prose>:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:0}.opencopilot-prose-sm{font-size:.875rem;line-height:1.7142857}.opencopilot-prose-sm :where(p):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.opencopilot-prose-sm :where([class~=lead]):not(:where([class~=opencopilot-not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.opencopilot-prose-sm :where(blockquote):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.1111111em}.opencopilot-prose-sm :where(h1):not(:where([class~=opencopilot-not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.opencopilot-prose-sm :where(h2):not(:where([class~=opencopilot-not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.opencopilot-prose-sm :where(h3):not(:where([class~=opencopilot-not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.opencopilot-prose-sm :where(h4):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.opencopilot-prose-sm :where(img):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.opencopilot-prose-sm :where(video):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.opencopilot-prose-sm :where(figure):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.opencopilot-prose-sm :where(figure>*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0;margin-bottom:0}.opencopilot-prose-sm :where(figcaption):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.opencopilot-prose-sm :where(code):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em}.opencopilot-prose-sm :where(h2 code):not(:where([class~=opencopilot-not-prose] *)){font-size:.9em}.opencopilot-prose-sm :where(h3 code):not(:where([class~=opencopilot-not-prose] *)){font-size:.8888889em}.opencopilot-prose-sm :where(pre):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding:.6666667em 1em}.opencopilot-prose-sm :where(ol):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.opencopilot-prose-sm :where(ul):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.opencopilot-prose-sm :where(li):not(:where([class~=opencopilot-not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.opencopilot-prose-sm :where(ol>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.4285714em}.opencopilot-prose-sm :where(ul>li):not(:where([class~=opencopilot-not-prose] *)){padding-left:.4285714em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ul>li p):not(:where([class~=opencopilot-not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ul>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ul>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.1428571em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ol>li>*:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:1.1428571em}.opencopilot-prose-sm :where(.opencopilot-prose-sm>ol>li>*:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:1.1428571em}.opencopilot-prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=opencopilot-not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.opencopilot-prose-sm :where(hr):not(:where([class~=opencopilot-not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.opencopilot-prose-sm :where(hr+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(h2+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(h3+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(h4+*):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(table):not(:where([class~=opencopilot-not-prose] *)){font-size:.8571429em;line-height:1.5}.opencopilot-prose-sm :where(thead th):not(:where([class~=opencopilot-not-prose] *)){padding-right:1em;padding-bottom:.6666667em;padding-left:1em}.opencopilot-prose-sm :where(thead th:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose-sm :where(thead th:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose-sm :where(tbody td,tfoot td):not(:where([class~=opencopilot-not-prose] *)){padding:.6666667em 1em}.opencopilot-prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=opencopilot-not-prose] *)){padding-left:0}.opencopilot-prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=opencopilot-not-prose] *)){padding-right:0}.opencopilot-prose-sm :where(.opencopilot-prose-sm>:first-child):not(:where([class~=opencopilot-not-prose] *)){margin-top:0}.opencopilot-prose-sm :where(.opencopilot-prose-sm>:last-child):not(:where([class~=opencopilot-not-prose] *)){margin-bottom:0}.opencopilot-prose-slate{--tw-prose-body: #334155;--tw-prose-headings: #0f172a;--tw-prose-lead: #475569;--tw-prose-links: #0f172a;--tw-prose-bold: #0f172a;--tw-prose-counters: #64748b;--tw-prose-bullets: #cbd5e1;--tw-prose-hr: #e2e8f0;--tw-prose-quotes: #0f172a;--tw-prose-quote-borders: #e2e8f0;--tw-prose-captions: #64748b;--tw-prose-code: #0f172a;--tw-prose-pre-code: #e2e8f0;--tw-prose-pre-bg: #1e293b;--tw-prose-th-borders: #cbd5e1;--tw-prose-td-borders: #e2e8f0;--tw-prose-invert-body: #cbd5e1;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #94a3b8;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #94a3b8;--tw-prose-invert-bullets: #475569;--tw-prose-invert-hr: #334155;--tw-prose-invert-quotes: #f1f5f9;--tw-prose-invert-quote-borders: #334155;--tw-prose-invert-captions: #94a3b8;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #cbd5e1;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #475569;--tw-prose-invert-td-borders: #334155}@keyframes fade-in-bottom{0%{transform:translateY(50px);opacity:0}to{transform:translateY(0);opacity:1}}.fade-in-bottom{animation:fade-in-bottom .4s cubic-bezier(.39,.575,.565,1) both}.flex-center{display:flex;align-items:center;justify-content:center}@keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}.fade-in-top{animation:fade-in-top .6s cubic-bezier(.39,.575,.565,1) both}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.fade-in{animation:fade-in 1.2s cubic-bezier(.39,.575,.565,1) both}em-emoji-picker{--background-rgb: 85, 170, 255;--border-radius: 10px;--category-icon-size: 24px;--font-family: inherit;--font-size: 14px;min-height:250px;max-height:300px}.PopoverContent{transform-origin:var(--radix-popover-content-transform-origin);animation:scaleIn .5s ease-out}@keyframes scaleIn{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.PopoverContent{animation-duration:.6s;animation-timing-function:cubic-bezier(.16,1,.3,1)}.PopoverContent[data-side=top]{animation-name:slideUp}.PopoverContent[data-side=bottom]{animation-name:slideDown}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes fade-in-right{0%{transform:translate(50px);opacity:0}to{transform:translate(0);opacity:1}}.fade-in-right{animation:fade-in-right .6s both}@keyframes scale-out-br{0%{transform:scale(1);transform-origin:100% 100%;opacity:1}to{transform:scale(0);transform-origin:100% 100%;opacity:1}}.scale-out-br{animation:scale-out-br .5s ease-in-out forwards}.placeholder\\:opencopilot-align-middle::-moz-placeholder{vertical-align:middle}.placeholder\\:opencopilot-align-middle::placeholder{vertical-align:middle}.placeholder\\:opencopilot-text-xs::-moz-placeholder{font-size:.75rem;line-height:1rem}.placeholder\\:opencopilot-text-xs::placeholder{font-size:.75rem;line-height:1rem}.last-of-type\\:opencopilot-mb-10:last-of-type{margin-bottom:2.5rem}.focus-within\\:opencopilot-ring-primary:focus-within{--tw-ring-color: var(--opencopilot-primary-clr)}.data-\\[state\\=open\\]\\:opencopilot-animate-in[data-state=open]{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-\\[state\\=closed\\]\\:opencopilot-animate-out[data-state=closed]{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-\\[state\\=closed\\]\\:opencopilot-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:opencopilot-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:opencopilot-slide-in-from-top-0[data-state=closed]{--tw-enter-translate-y: -0px}.data-\\[state\\=open\\]\\:opencopilot-slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.prose-headings\\:opencopilot-my-1 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=opencopilot-not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-h1\\:opencopilot-font-medium :is(:where(h1):not(:where([class~=opencopilot-not-prose] *))){font-weight:500}.prose-h2\\:opencopilot-font-normal :is(:where(h2):not(:where([class~=opencopilot-not-prose] *))){font-weight:400}.hover\\:opencopilot-scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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\\:opencopilot-shadow:hover{--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)}.focus\\:opencopilot-border-none:focus{border-style:none}.focus\\:opencopilot-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:opencopilot-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.disabled\\:opencopilot-pointer-events-none:disabled{pointer-events:none}.disabled\\:opencopilot-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opencopilot-opacity-40:disabled{opacity:.4}@media (min-width: 640px){.sm\\:opencopilot-w-96{width:24rem}.sm\\:opencopilot-flex-row{flex-direction:row}.sm\\:opencopilot-justify-end{justify-content:flex-end}.sm\\:opencopilot-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\\:opencopilot-rounded-xl{border-radius:.75rem}.sm\\:opencopilot-text-left{text-align:left}}\n',j0=x.createContext(void 0);function lk({children:e,data:t}){return L.jsx(j0.Provider,{value:t,children:e})}function Ni(){const e=x.useContext(j0);if(!e)throw new Error("useConfigData must be used within a ConfigDataProvider");return e}function ak(e){const[t,n]=x.useState(!!e),r=x.useCallback(()=>n(o=>!o),[]);return[t,r,n]}const M0=x.createContext(void 0);function B0(){const e=x.useContext(M0);if(!e)throw new Error("useAppContext must be used within an AppProvider");return e}function sk({children:e}){const t=Ni(),n=ak((t==null?void 0:t.defaultOpen)||!1);return L.jsx(M0.Provider,{value:n,children:e})}function U0(e,t){return function(){return e.apply(t,arguments)}}const{toString:uk}=Object.prototype,{getPrototypeOf:Up}=Object,Ha=(e=>t=>{const n=uk.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pn=e=>(e=e.toLowerCase(),t=>Ha(t)===e),Wa=e=>t=>typeof t===e,{isArray:Eo}=Array,Ei=Wa("undefined");function ck(e){return e!==null&&!Ei(e)&&e.constructor!==null&&!Ei(e.constructor)&&zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const H0=pn("ArrayBuffer");function pk(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&H0(e.buffer),t}const fk=Wa("string"),zt=Wa("function"),W0=Wa("number"),Va=e=>e!==null&&typeof e=="object",dk=e=>e===!0||e===!1,Dl=e=>{if(Ha(e)!=="object")return!1;const t=Up(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},hk=pn("Date"),mk=pn("File"),gk=pn("Blob"),yk=pn("FileList"),vk=e=>Va(e)&&zt(e.pipe),wk=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zt(e.append)&&((t=Ha(e))==="formdata"||t==="object"&&zt(e.toString)&&e.toString()==="[object FormData]"))},xk=pn("URLSearchParams"),bk=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ii(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Eo(e))for(r=0,o=e.length;r0;)if(o=n[r],t===o.toLowerCase())return o;return null}const G0=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),q0=e=>!Ei(e)&&e!==G0;function wc(){const{caseless:e}=q0(this)&&this||{},t={},n=(r,o)=>{const i=e&&V0(t,o)||o;Dl(t[i])&&Dl(r)?t[i]=wc(t[i],r):Dl(r)?t[i]=wc({},r):Eo(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r(Ii(t,(o,i)=>{n&&zt(o)?e[i]=U0(o,n):e[i]=o},{allOwnKeys:r}),e),Sk=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ck=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Ek=(e,t,n,r)=>{let o,i,l;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)l=o[i],(!r||r(l,e,t))&&!a[l]&&(t[l]=e[l],a[l]=!0);e=n!==!1&&Up(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Pk=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ok=e=>{if(!e)return null;if(Eo(e))return e;let t=e.length;if(!W0(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Tk=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Up(Uint8Array)),Ak=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},$k=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},_k=pn("HTMLFormElement"),Rk=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Bd=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Lk=pn("RegExp"),Y0=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ii(n,(o,i)=>{let l;(l=t(o,i,e))!==!1&&(r[i]=l||o)}),Object.defineProperties(e,r)},Dk=e=>{Y0(e,(t,n)=>{if(zt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(zt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zk=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return Eo(e)?r(e):r(String(e).split(t)),n},Nk=()=>{},Ik=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Js="abcdefghijklmnopqrstuvwxyz",Ud="0123456789",Q0={DIGIT:Ud,ALPHA:Js,ALPHA_DIGIT:Js+Js.toUpperCase()+Ud},Fk=(e=16,t=Q0.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function jk(e){return!!(e&&zt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Mk=e=>{const t=new Array(10),n=(r,o)=>{if(Va(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=Eo(r)?[]:{};return Ii(r,(l,a)=>{const s=n(l,o+1);!Ei(s)&&(i[a]=s)}),t[o]=void 0,i}}return r};return n(e,0)},Bk=pn("AsyncFunction"),Uk=e=>e&&(Va(e)||zt(e))&&zt(e.then)&&zt(e.catch),D={isArray:Eo,isArrayBuffer:H0,isBuffer:ck,isFormData:wk,isArrayBufferView:pk,isString:fk,isNumber:W0,isBoolean:dk,isObject:Va,isPlainObject:Dl,isUndefined:Ei,isDate:hk,isFile:mk,isBlob:gk,isRegExp:Lk,isFunction:zt,isStream:vk,isURLSearchParams:xk,isTypedArray:Tk,isFileList:yk,forEach:Ii,merge:wc,extend:kk,trim:bk,stripBOM:Sk,inherits:Ck,toFlatObject:Ek,kindOf:Ha,kindOfTest:pn,endsWith:Pk,toArray:Ok,forEachEntry:Ak,matchAll:$k,isHTMLForm:_k,hasOwnProperty:Bd,hasOwnProp:Bd,reduceDescriptors:Y0,freezeMethods:Dk,toObjectSet:zk,toCamelCase:Rk,noop:Nk,toFiniteNumber:Ik,findKey:V0,global:G0,isContextDefined:q0,ALPHABET:Q0,generateString:Fk,isSpecCompliantForm:jk,toJSONObject:Mk,isAsyncFn:Bk,isThenable:Uk};function he(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}D.inherits(he,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:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const K0=he.prototype,X0={};["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(e=>{X0[e]={value:e}});Object.defineProperties(he,X0);Object.defineProperty(K0,"isAxiosError",{value:!0});he.from=(e,t,n,r,o,i)=>{const l=Object.create(K0);return D.toFlatObject(e,l,function(s){return s!==Error.prototype},a=>a!=="isAxiosError"),he.call(l,e.message,t,n,r,o),l.cause=e,l.name=e.name,i&&Object.assign(l,i),l};const Hk=null;function xc(e){return D.isPlainObject(e)||D.isArray(e)}function Z0(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function Hd(e,t,n){return e?e.concat(t).map(function(o,i){return o=Z0(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function Wk(e){return D.isArray(e)&&!e.some(xc)}const Vk=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function Ga(e,t,n){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=D.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,w){return!D.isUndefined(w[m])});const r=n.metaTokens,o=n.visitor||p,i=n.dots,l=n.indexes,s=(n.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(o))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(D.isDate(h))return h.toISOString();if(!s&&D.isBlob(h))throw new he("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(h)||D.isTypedArray(h)?s&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function p(h,m,w){let g=h;if(h&&!w&&typeof h=="object"){if(D.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(D.isArray(h)&&Wk(h)||(D.isFileList(h)||D.endsWith(m,"[]"))&&(g=D.toArray(h)))return m=Z0(m),g.forEach(function(v,C){!(D.isUndefined(v)||v===null)&&t.append(l===!0?Hd([m],C,i):l===null?m:m+"[]",u(v))}),!1}return xc(h)?!0:(t.append(Hd(w,m,i),u(h)),!1)}const c=[],d=Object.assign(Vk,{defaultVisitor:p,convertValue:u,isVisitable:xc});function f(h,m){if(!D.isUndefined(h)){if(c.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));c.push(h),D.forEach(h,function(g,y){(!(D.isUndefined(g)||g===null)&&o.call(t,g,D.isString(y)?y.trim():y,m,d))===!0&&f(g,m?m.concat(y):[y])}),c.pop()}}if(!D.isObject(e))throw new TypeError("data must be an object");return f(e),t}function Wd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Hp(e,t){this._pairs=[],e&&Ga(e,this,t)}const J0=Hp.prototype;J0.append=function(t,n){this._pairs.push([t,n])};J0.toString=function(t){const n=t?function(r){return t.call(this,r,Wd)}:Wd;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Gk(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function e1(e,t,n){if(!t)return e;const r=n&&n.encode||Gk,o=n&&n.serialize;let i;if(o?i=o(t,n):i=D.isURLSearchParams(t)?t.toString():new Hp(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qk{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){D.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Vd=qk,t1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Yk=typeof URLSearchParams<"u"?URLSearchParams:Hp,Qk=typeof FormData<"u"?FormData:null,Kk=typeof Blob<"u"?Blob:null,Xk=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Zk=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Qt={isBrowser:!0,classes:{URLSearchParams:Yk,FormData:Qk,Blob:Kk},isStandardBrowserEnv:Xk,isStandardBrowserWebWorkerEnv:Zk,protocols:["http","https","file","blob","url","data"]};function Jk(e,t){return Ga(e,new Qt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Qt.isNode&&D.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function eS(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tS(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r=n.length;return l=!l&&D.isArray(o)?o.length:l,s?(D.hasOwnProp(o,l)?o[l]=[o[l],r]:o[l]=r,!a):((!o[l]||!D.isObject(o[l]))&&(o[l]=[]),t(n,r,o[l],i)&&D.isArray(o[l])&&(o[l]=tS(o[l])),!a)}if(D.isFormData(e)&&D.isFunction(e.entries)){const n={};return D.forEachEntry(e,(r,o)=>{t(eS(r),o,n,0)}),n}return null}function nS(e,t,n){if(D.isString(e))try{return(t||JSON.parse)(e),D.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Wp={transitional:t1,adapter:Qt.isNode?"http":"xhr",transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=D.isObject(t);if(i&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return o&&o?JSON.stringify(n1(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jk(t,this.formSerializer).toString();if((a=D.isFileList(t))||r.indexOf("multipart/form-data")>-1){const s=this.env&&this.env.FormData;return Ga(a?{"files[]":t}:t,s&&new s,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),nS(t)):t}],transformResponse:[function(t){const n=this.transitional||Wp.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&D.isString(t)&&(r&&!this.responseType||o)){const l=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(l)throw a.name==="SyntaxError"?he.from(a,he.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],e=>{Wp.headers[e]={}});const Vp=Wp,rS=D.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"]),oS=e=>{const t={};let n,r,o;return e&&e.split(` +`).forEach(function(l){o=l.indexOf(":"),n=l.substring(0,o).trim().toLowerCase(),r=l.substring(o+1).trim(),!(!n||t[n]&&rS[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Gd=Symbol("internals");function Bo(e){return e&&String(e).trim().toLowerCase()}function zl(e){return e===!1||e==null?e:D.isArray(e)?e.map(zl):String(e)}function iS(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const lS=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eu(e,t,n,r,o){if(D.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!D.isString(t)){if(D.isString(r))return t.indexOf(r)!==-1;if(D.isRegExp(r))return r.test(t)}}function aS(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function sS(e,t){const n=D.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,l){return this[r].call(this,t,o,i,l)},configurable:!0})})}class qa{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(a,s,u){const p=Bo(s);if(!p)throw new Error("header name must be a non-empty string");const c=D.findKey(o,p);(!c||o[c]===void 0||u===!0||u===void 0&&o[c]!==!1)&&(o[c||s]=zl(a))}const l=(a,s)=>D.forEach(a,(u,p)=>i(u,p,s));return D.isPlainObject(t)||t instanceof this.constructor?l(t,n):D.isString(t)&&(t=t.trim())&&!lS(t)?l(oS(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Bo(t),t){const r=D.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return iS(o);if(D.isFunction(n))return n.call(this,o,r);if(D.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Bo(t),t){const r=D.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||eu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(l){if(l=Bo(l),l){const a=D.findKey(r,l);a&&(!n||eu(r,r[a],a,n))&&(delete r[a],o=!0)}}return D.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||eu(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return D.forEach(this,(o,i)=>{const l=D.findKey(r,i);if(l){n[l]=zl(o),delete n[i];return}const a=t?aS(i):String(i).trim();a!==i&&delete n[i],n[a]=zl(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return D.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&D.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Gd]=this[Gd]={accessors:{}}).accessors,o=this.prototype;function i(l){const a=Bo(l);r[a]||(sS(o,l),r[a]=!0)}return D.isArray(t)?t.forEach(i):i(t),this}}qa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);D.reduceDescriptors(qa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});D.freezeMethods(qa);const Sn=qa;function tu(e,t){const n=this||Vp,r=t||n,o=Sn.from(r.headers);let i=r.data;return D.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function r1(e){return!!(e&&e.__CANCEL__)}function Fi(e,t,n){he.call(this,e??"canceled",he.ERR_CANCELED,t,n),this.name="CanceledError"}D.inherits(Fi,he,{__CANCEL__:!0});function uS(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new he("Request failed with status code "+n.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const cS=Qt.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,l,a){const s=[];s.push(n+"="+encodeURIComponent(r)),D.isNumber(o)&&s.push("expires="+new Date(o).toGMTString()),D.isString(i)&&s.push("path="+i),D.isString(l)&&s.push("domain="+l),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function pS(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fS(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function o1(e,t){return e&&!pS(t)?fS(e,t):t}const dS=Qt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let l=i;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(l){const a=D.isString(l)?o(l):l;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function hS(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mS(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,l;return t=t!==void 0?t:1e3,function(s){const u=Date.now(),p=r[i];l||(l=u),n[o]=s,r[o]=u;let c=i,d=0;for(;c!==o;)d+=n[c++],c=c%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-l{const i=o.loaded,l=o.lengthComputable?o.total:void 0,a=i-n,s=r(a),u=i<=l;n=i;const p={loaded:i,total:l,progress:l?i/l:void 0,bytes:a,rate:s||void 0,estimated:s&&l&&u?(l-i)/s:void 0,event:o};p[t?"download":"upload"]=!0,e(p)}}const gS=typeof XMLHttpRequest<"u",yS=gS&&function(e){return new Promise(function(n,r){let o=e.data;const i=Sn.from(e.headers).normalize(),l=e.responseType;let a;function s(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}D.isFormData(o)&&(Qt.isStandardBrowserEnv||Qt.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(f+":"+h))}const p=o1(e.baseURL,e.url);u.open(e.method.toUpperCase(),e1(p,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function c(){if(!u)return;const f=Sn.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!l||l==="text"||l==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:f,config:e,request:u};uS(function(g){n(g),s()},function(g){r(g),s()},m),u=null}if("onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(c)},u.onabort=function(){u&&(r(new he("Request aborted",he.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new he("Network Error",he.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||t1;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),r(new he(h,m.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,u)),u=null},Qt.isStandardBrowserEnv){const f=(e.withCredentials||dS(p))&&e.xsrfCookieName&&cS.read(e.xsrfCookieName);f&&i.set(e.xsrfHeaderName,f)}o===void 0&&i.setContentType(null),"setRequestHeader"in u&&D.forEach(i.toJSON(),function(h,m){u.setRequestHeader(m,h)}),D.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),l&&l!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",qd(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",qd(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{u&&(r(!f||f.type?new Fi(null,e,u):f),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=hS(p);if(d&&Qt.protocols.indexOf(d)===-1){r(new he("Unsupported protocol "+d+":",he.ERR_BAD_REQUEST,e));return}u.send(o||null)})},Nl={http:Hk,xhr:yS};D.forEach(Nl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const i1={getAdapter:e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;oe instanceof Sn?e.toJSON():e;function yo(e,t){t=t||{};const n={};function r(u,p,c){return D.isPlainObject(u)&&D.isPlainObject(p)?D.merge.call({caseless:c},u,p):D.isPlainObject(p)?D.merge({},p):D.isArray(p)?p.slice():p}function o(u,p,c){if(D.isUndefined(p)){if(!D.isUndefined(u))return r(void 0,u,c)}else return r(u,p,c)}function i(u,p){if(!D.isUndefined(p))return r(void 0,p)}function l(u,p){if(D.isUndefined(p)){if(!D.isUndefined(u))return r(void 0,u)}else return r(void 0,p)}function a(u,p,c){if(c in t)return r(u,p);if(c in e)return r(void 0,u)}const s={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:a,headers:(u,p)=>o(Qd(u),Qd(p),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),function(p){const c=s[p]||o,d=c(e[p],t[p],p);D.isUndefined(d)&&c!==a||(n[p]=d)}),n}const l1="1.5.0",Gp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Gp[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Kd={};Gp.transitional=function(t,n,r){function o(i,l){return"[Axios v"+l1+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,a)=>{if(t===!1)throw new he(o(l," has been removed"+(n?" in "+n:"")),he.ERR_DEPRECATED);return n&&!Kd[l]&&(Kd[l]=!0,console.warn(o(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,a):!0}};function vS(e,t,n){if(typeof e!="object")throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],l=t[i];if(l){const a=e[i],s=a===void 0||l(a,i,e);if(s!==!0)throw new he("option "+i+" must be "+s,he.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new he("Unknown option "+i,he.ERR_BAD_OPTION)}}const bc={assertOptions:vS,validators:Gp},In=bc.validators;class ma{constructor(t){this.defaults=t,this.interceptors={request:new Vd,response:new Vd}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=yo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&bc.assertOptions(r,{silentJSONParsing:In.transitional(In.boolean),forcedJSONParsing:In.transitional(In.boolean),clarifyTimeoutError:In.transitional(In.boolean)},!1),o!=null&&(D.isFunction(o)?n.paramsSerializer={serialize:o}:bc.assertOptions(o,{encode:In.function,serialize:In.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&D.merge(i.common,i[n.method]);i&&D.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=Sn.concat(l,i);const a=[];let s=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(s=s&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let p,c=0,d;if(!s){const h=[Yd.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,u),d=h.length,p=Promise.resolve(n);c{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const l=new Promise(a=>{r.subscribe(a),i=a}).then(o);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,a){r.reason||(r.reason=new Fi(i,l,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new qp(function(o){t=o}),cancel:t}}}const wS=qp;function xS(e){return function(n){return e.apply(null,n)}}function bS(e){return D.isObject(e)&&e.isAxiosError===!0}const kc={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(kc).forEach(([e,t])=>{kc[t]=e});const kS=kc;function a1(e){const t=new Il(e),n=U0(Il.prototype.request,t);return D.extend(n,Il.prototype,t,{allOwnKeys:!0}),D.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return a1(yo(e,o))},n}const We=a1(Vp);We.Axios=Il;We.CanceledError=Fi;We.CancelToken=wS;We.isCancel=r1;We.VERSION=l1;We.toFormData=Ga;We.AxiosError=he;We.Cancel=We.CanceledError;We.all=function(t){return Promise.all(t)};We.spread=xS;We.isAxiosError=bS;We.mergeConfig=yo;We.AxiosHeaders=Sn;We.formToJSON=e=>n1(D.isHTMLForm(e)?new FormData(e):e);We.getAdapter=i1.getAdapter;We.HttpStatusCode=kS;We.default=We;const SS=We,Xd="@openchatai:session_id";function CS(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=localStorage.getItem(Xd);if(n)t(n);else{const r=Math.random().toString(36).substring(2,15);localStorage.setItem(Xd,r),t(r)}},[]),{sessionId:e,setSessionId:t}}function ES(e,t){const n=SS.create({baseURL:e,headers:{"X-Session-Id":t}});return n.interceptors.request.use(r=>(r.data={...r.data,session_id:t},r)),n}const s1=x.createContext(void 0);function PS({children:e}){const t=Ni(),{sessionId:n}=CS(),r=x.useMemo(()=>ES(t==null?void 0:t.apiUrl,n),[t,n]);return t!=null&&t.token?r.defaults.headers["X-Bot-Token"]=t==null?void 0:t.token:console.warn("No token!"),L.jsx(s1.Provider,{value:{axiosInstance:r},children:e})}const u1=()=>{const e=x.useContext(s1);if(!e)throw new Error("useAxiosInstance must be used within a AxiosProvider");return e},c1=x.createContext({});function OS({children:e}){const{axiosInstance:t}=u1(),[n,r]=x.useState(),[o,i]=x.useState(!0);async function l(){i(!0),t.get("/chat/init").then(({data:a})=>r(a)).finally(()=>i(!1))}return x.useEffect(()=>{l()},[]),L.jsx(c1.Provider,{value:{data:n,loading:o,refetch:l},children:e})}const p1=()=>{const e=x.useContext(c1);return e||console.warn("Error loading initial data...."),e};function TS({children:e,options:t}){return L.jsx(lk,{data:t,children:L.jsx(sk,{children:L.jsx(PS,{children:L.jsx(OS,{children:e})})})})}function AS(){for(var e=0,t,n,r="";ee&&(t=0,r=n,n=new Map)}return{get:function(l){var a=n.get(l);if(a!==void 0)return a;if((a=r.get(l))!==void 0)return o(l,a),a},set:function(l,a){n.has(l)?n.set(l,a):o(l,a)}}}var h1="!";function NS(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(l){for(var a=[],s=0,u=0,p,c=0;cu?p-u:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:w}}}function IS(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var o=r[0]==="[";o?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function FS(e){return{cache:zS(e.cacheSize),splitModifiers:NS(e),...$S(e)}}var jS=/\s+/;function MS(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,i=new Set;return e.trim().split(jS).map(function(l){var a=n(l),s=a.modifiers,u=a.hasImportantModifier,p=a.baseClassName,c=a.maybePostfixModifierPosition,d=r(c?p.substring(0,c):p),f=!!c;if(!d){if(!c)return{isTailwindClass:!1,originalClassName:l};if(d=r(p),!d)return{isTailwindClass:!1,originalClassName:l};f=!1}var h=IS(s).join(":"),m=u?h+h1:h;return{isTailwindClass:!0,modifierId:m,classGroupId:d,originalClassName:l,hasPostfixModifier:f}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var a=l.modifierId,s=l.classGroupId,u=l.hasPostfixModifier,p=a+s;return i.has(p)?!1:(i.add(p),o(s,u).forEach(function(c){return i.add(a+c)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function BS(){for(var e=arguments.length,t=new Array(e),n=0;ne.forEach(n=>l2(n,t))}function en(...e){return x.useCallback(w1(...e),e)}function Qp(e,t=[]){let n=[];function r(i,l){const a=x.createContext(l),s=n.length;n=[...n,l];function u(c){const{scope:d,children:f,...h}=c,m=(d==null?void 0:d[e][s])||a,w=x.useMemo(()=>h,Object.values(h));return x.createElement(m.Provider,{value:w},f)}function p(c,d){const f=(d==null?void 0:d[e][s])||a,h=x.useContext(f);if(h)return h;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,p]}const o=()=>{const i=n.map(l=>x.createContext(l));return function(a){const s=(a==null?void 0:a[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])}};return o.scopeName=e,[r,a2(o,...t)]}function a2(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((a,{useScope:s,scopeName:u})=>{const c=s(i)[`__scope${u}`];return{...a,...c}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}const vo=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},s2=Qw["useId".toString()]||(()=>{});let u2=0;function Fl(e){const[t,n]=x.useState(s2());return vo(()=>{e||n(r=>r??String(u2++))},[e]),e||(t?`radix-${t}`:"")}function un(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function x1({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=c2({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,a=un(n),s=x.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&a(c)}else o(u)},[i,e,o,a]);return[l,s]}function c2({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,o=x.useRef(r),i=un(t);return x.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Kp=x.forwardRef((e,t)=>{const{children:n,...r}=e,o=x.Children.toArray(n),i=o.find(p2);if(i){const l=i.props.children,a=o.map(s=>s===i?x.Children.count(l)>1?x.Children.only(null):x.isValidElement(l)?l.props.children:null:s);return x.createElement(Ec,ge({},r,{ref:t}),x.isValidElement(l)?x.cloneElement(l,void 0,a):null)}return x.createElement(Ec,ge({},r,{ref:t}),n)});Kp.displayName="Slot";const Ec=x.forwardRef((e,t)=>{const{children:n,...r}=e;return x.isValidElement(n)?x.cloneElement(n,{...f2(r,n.props),ref:t?w1(t,n.ref):n.ref}):x.Children.count(n)>1?x.Children.only(null):null});Ec.displayName="SlotClone";const b1=({children:e})=>x.createElement(x.Fragment,null,e);function p2(e){return x.isValidElement(e)&&e.type===b1}function f2(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const d2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Tt=d2.reduce((e,t)=>{const n=x.forwardRef((r,o)=>{const{asChild:i,...l}=r,a=i?Kp:t;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(a,ge({},l,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function k1(e,t){e&&Ua.flushSync(()=>e.dispatchEvent(t))}function S1(e,t=globalThis==null?void 0:globalThis.document){const n=un(e);x.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Pc="dismissableLayer.update",h2="dismissableLayer.pointerDownOutside",m2="dismissableLayer.focusOutside";let nh;const g2=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),y2=x.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:a,onDismiss:s,...u}=e,p=x.useContext(g2),[c,d]=x.useState(null),f=(n=c==null?void 0:c.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=x.useState({}),m=en(t,T=>d(T)),w=Array.from(p.layers),[g]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(g),v=c?w.indexOf(c):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,k=v2(T=>{const N=T.target,P=[...p.branches].some(_=>_.contains(N));!E||P||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),O=w2(T=>{const N=T.target;[...p.branches].some(_=>_.contains(N))||(l==null||l(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return S1(T=>{v===p.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),x.useEffect(()=>{if(c)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(nh=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(c)),p.layers.add(c),rh(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=nh)}},[c,f,r,p]),x.useEffect(()=>()=>{c&&(p.layers.delete(c),p.layersWithOutsidePointerEventsDisabled.delete(c),rh())},[c,p]),x.useEffect(()=>{const T=()=>h({});return document.addEventListener(Pc,T),()=>document.removeEventListener(Pc,T)},[]),x.createElement(Tt.div,ge({},u,{ref:m,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Xe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Xe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Xe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function v2(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let p=function(){C1(h2,n,u,{discrete:!0})};var s=p;const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=p,t.addEventListener("click",o.current,{once:!0})):p()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function w2(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!r.current&&C1(m2,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rh(){const e=new CustomEvent(Pc);document.dispatchEvent(e)}function C1(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?k1(o,i):o.dispatchEvent(i)}const ru="focusScope.autoFocusOnMount",ou="focusScope.autoFocusOnUnmount",oh={bubbles:!1,cancelable:!0},x2=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...l}=e,[a,s]=x.useState(null),u=un(o),p=un(i),c=x.useRef(null),d=en(t,m=>s(m)),f=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let y=function(k){if(f.paused||!a)return;const O=k.target;a.contains(O)?c.current=O:Mn(c.current,{select:!0})},v=function(k){if(f.paused||!a)return;const O=k.relatedTarget;O!==null&&(a.contains(O)||Mn(c.current,{select:!0}))},C=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&Mn(a)};var m=y,w=v,g=C;document.addEventListener("focusin",y),document.addEventListener("focusout",v);const E=new MutationObserver(C);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),E.disconnect()}}},[r,a,f.paused]),x.useEffect(()=>{if(a){lh.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(ru,oh);a.addEventListener(ru,u),a.dispatchEvent(g),g.defaultPrevented||(b2(P2(E1(a)),{select:!0}),document.activeElement===m&&Mn(a))}return()=>{a.removeEventListener(ru,u),setTimeout(()=>{const g=new CustomEvent(ou,oh);a.addEventListener(ou,p),a.dispatchEvent(g),g.defaultPrevented||Mn(m??document.body,{select:!0}),a.removeEventListener(ou,p),lh.remove(f)},0)}}},[a,u,p,f]);const h=x.useCallback(m=>{if(!n&&!r||f.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(w&&g){const y=m.currentTarget,[v,C]=k2(y);v&&C?!m.shiftKey&&g===C?(m.preventDefault(),n&&Mn(v,{select:!0})):m.shiftKey&&g===v&&(m.preventDefault(),n&&Mn(C,{select:!0})):g===y&&m.preventDefault()}},[n,r,f.paused]);return x.createElement(Tt.div,ge({tabIndex:-1},l,{ref:d,onKeyDown:h}))});function b2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mn(r,{select:t}),document.activeElement!==n)return}function k2(e){const t=E1(e),n=ih(t,e),r=ih(t.reverse(),e);return[n,r]}function E1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ih(e,t){for(const n of e)if(!S2(n,{upTo:t}))return n}function S2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function C2(e){return e instanceof HTMLInputElement&&"select"in e}function Mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&C2(e)&&t&&e.select()}}const lh=E2();function E2(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ah(e,t),e.unshift(t)},remove(t){var n;e=ah(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function ah(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function P2(e){return e.filter(t=>t.tagName!=="A")}function O2(e,t){return x.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Ya=e=>{const{present:t,children:n}=e,r=T2(t),o=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=en(r.ref,o.ref);return typeof n=="function"||r.isPresent?x.cloneElement(o,{ref:i}):null};Ya.displayName="Presence";function T2(e){const[t,n]=x.useState(),r=x.useRef({}),o=x.useRef(e),i=x.useRef("none"),l=e?"mounted":"unmounted",[a,s]=O2(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=pl(r.current);i.current=a==="mounted"?u:"none"},[a]),vo(()=>{const u=r.current,p=o.current;if(p!==e){const d=i.current,f=pl(u);e?s("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?s("UNMOUNT"):s(p&&d!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,s]),vo(()=>{if(t){const u=c=>{const f=pl(r.current).includes(c.animationName);c.target===t&&f&&Ua.flushSync(()=>s("ANIMATION_END"))},p=c=>{c.target===t&&(i.current=pl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function pl(e){return(e==null?void 0:e.animationName)||"none"}let iu=0;function A2(){x.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:sh()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:sh()),iu++,()=>{iu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),iu--}},[])}function sh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var ln=function(){return ln=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return G2;var t=q2(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Q2=A1(),K2=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(_2,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; @@ -57,29 +57,29 @@ Error generating stack: `+i.message+` `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } - .`).concat(Fl,` { + .`).concat(jl,` { right: `).concat(a,"px ").concat(r,`; } - .`).concat(jl,` { + .`).concat(Ml,` { margin-right: `).concat(a,"px ").concat(r,`; } - .`).concat(Fl," .").concat(Fl,` { + .`).concat(jl," .").concat(jl,` { right: 0 `).concat(r,`; } - .`).concat(jl," .").concat(jl,` { + .`).concat(Ml," .").concat(Ml,` { margin-right: 0 `).concat(r,`; } body { `).concat(R2,": ").concat(a,`px; } -`)},X2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=x.useMemo(function(){return Y2(o)},[o]);return x.createElement(Q2,{styles:K2(i,!t,o,n?"":"!important")})},Oc=!1;if(typeof window<"u")try{var pl=Object.defineProperty({},"passive",{get:function(){return Oc=!0,!0}});window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch{Oc=!1}var Fr=Oc?{passive:!1}:!1,Z2=function(e){return e.tagName==="TEXTAREA"},$1=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Z2(e)&&n[t]==="visible")},J2=function(e){return $1(e,"overflowY")},eC=function(e){return $1(e,"overflowX")},ch=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=_1(e,n);if(r){var o=R1(e,n),i=o[1],l=o[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},tC=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nC=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_1=function(e,t){return e==="v"?J2(t):eC(t)},R1=function(e,t){return e==="v"?tC(t):nC(t)},rC=function(e,t){return e==="h"&&t==="rtl"?-1:1},oC=function(e,t,n,r,o){var i=rC(e,window.getComputedStyle(t).direction),l=i*r,a=n.target,s=t.contains(a),u=!1,p=l>0,c=0,d=0;do{var f=R1(e,a),h=f[0],m=f[1],w=f[2],g=m-w-i*h;(h||g)&&_1(e,a)&&(c+=g,d+=h),a=a.parentNode}while(!s&&a!==document.body||s&&(t.contains(a)||t===a));return(p&&(o&&c===0||!o&&l>c)||!p&&(o&&d===0||!o&&-l>d))&&(u=!0),u},fl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ph=function(e){return[e.deltaX,e.deltaY]},fh=function(e){return e&&"current"in e?e.current:e},iC=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lC=function(e){return` +`)},X2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=x.useMemo(function(){return Y2(o)},[o]);return x.createElement(Q2,{styles:K2(i,!t,o,n?"":"!important")})},Oc=!1;if(typeof window<"u")try{var fl=Object.defineProperty({},"passive",{get:function(){return Oc=!0,!0}});window.addEventListener("test",fl,fl),window.removeEventListener("test",fl,fl)}catch{Oc=!1}var Fr=Oc?{passive:!1}:!1,Z2=function(e){return e.tagName==="TEXTAREA"},$1=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Z2(e)&&n[t]==="visible")},J2=function(e){return $1(e,"overflowY")},eC=function(e){return $1(e,"overflowX")},ch=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=_1(e,n);if(r){var o=R1(e,n),i=o[1],l=o[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},tC=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nC=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_1=function(e,t){return e==="v"?J2(t):eC(t)},R1=function(e,t){return e==="v"?tC(t):nC(t)},rC=function(e,t){return e==="h"&&t==="rtl"?-1:1},oC=function(e,t,n,r,o){var i=rC(e,window.getComputedStyle(t).direction),l=i*r,a=n.target,s=t.contains(a),u=!1,p=l>0,c=0,d=0;do{var f=R1(e,a),h=f[0],m=f[1],w=f[2],g=m-w-i*h;(h||g)&&_1(e,a)&&(c+=g,d+=h),a=a.parentNode}while(!s&&a!==document.body||s&&(t.contains(a)||t===a));return(p&&(o&&c===0||!o&&l>c)||!p&&(o&&d===0||!o&&-l>d))&&(u=!0),u},dl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ph=function(e){return[e.deltaX,e.deltaY]},fh=function(e){return e&&"current"in e?e.current:e},iC=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lC=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},aC=0,jr=[];function sC(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),o=x.useState(aC++)[0],i=x.useState(function(){return A1()})[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=$2([e.lockRef.current],(e.shards||[]).map(fh),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=x.useCallback(function(m,w){if("touches"in m&&m.touches.length===2)return!l.current.allowPinchZoom;var g=fl(m),y=n.current,v="deltaX"in m?m.deltaX:y[0]-g[0],C="deltaY"in m?m.deltaY:y[1]-g[1],E,k=m.target,O=Math.abs(v)>Math.abs(C)?"h":"v";if("touches"in m&&O==="h"&&k.type==="range")return!1;var T=ch(O,k);if(!T)return!0;if(T?E=O:(E=O==="v"?"h":"v",T=ch(O,k)),!T)return!1;if(!r.current&&"changedTouches"in m&&(v||C)&&(r.current=E),!E)return!0;var N=r.current||E;return oC(N,w,m,N==="h"?v:C,!0)},[]),s=x.useCallback(function(m){var w=m;if(!(!jr.length||jr[jr.length-1]!==i)){var g="deltaY"in w?ph(w):fl(w),y=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&iC(E.delta,g)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var v=(l.current.shards||[]).map(fh).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=v.length>0?a(w,v[0]):!l.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=x.useCallback(function(m,w,g,y){var v={name:m,delta:w,target:g,should:y};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(C){return C!==v})},1)},[]),p=x.useCallback(function(m){n.current=fl(m),r.current=void 0},[]),c=x.useCallback(function(m){u(m.type,ph(m),m.target,a(m,e.lockRef.current))},[]),d=x.useCallback(function(m){u(m.type,fl(m),m.target,a(m,e.lockRef.current))},[]);x.useEffect(function(){return jr.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:d}),document.addEventListener("wheel",s,Fr),document.addEventListener("touchmove",s,Fr),document.addEventListener("touchstart",p,Fr),function(){jr=jr.filter(function(m){return m!==i}),document.removeEventListener("wheel",s,Fr),document.removeEventListener("touchmove",s,Fr),document.removeEventListener("touchstart",p,Fr)}},[]);var f=e.removeScrollBar,h=e.inert;return x.createElement(x.Fragment,null,h?x.createElement(i,{styles:lC(o)}):null,f?x.createElement(X2,{gapMode:"margin"}):null)}const uC=j2(T1,sC);var L1=x.forwardRef(function(e,t){return x.createElement(Qa,ln({},e,{ref:t,sideCar:uC}))});L1.classNames=Qa.classNames;const cC=L1;var pC=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mr=new WeakMap,dl=new WeakMap,hl={},su=0,D1=function(e){return e&&(e.host||D1(e.parentNode))},fC=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=D1(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dC=function(e,t,n,r){var o=fC(t,Array.isArray(e)?e:[e]);hl[n]||(hl[n]=new WeakMap);var i=hl[n],l=[],a=new Set,s=new Set(o),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};o.forEach(u);var p=function(c){!c||s.has(c)||Array.prototype.forEach.call(c.children,function(d){if(a.has(d))p(d);else{var f=d.getAttribute(r),h=f!==null&&f!=="false",m=(Mr.get(d)||0)+1,w=(i.get(d)||0)+1;Mr.set(d,m),i.set(d,w),l.push(d),m===1&&h&&dl.set(d,!0),w===1&&d.setAttribute(n,"true"),h||d.setAttribute(r,"true")}})};return p(t),a.clear(),su++,function(){l.forEach(function(c){var d=Mr.get(c)-1,f=i.get(c)-1;Mr.set(c,d),i.set(c,f),d||(dl.has(c)||c.removeAttribute(r),dl.delete(c)),f||c.removeAttribute(n)}),su--,su||(Mr=new WeakMap,Mr=new WeakMap,dl=new WeakMap,hl={})}},hC=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||pC(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),dC(r,o,n,"aria-hidden")):function(){return null}};const z1="Dialog",[N1,h_]=Qp(z1),[mC,fn]=N1(z1),gC=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,a=x.useRef(null),s=x.useRef(null),[u=!1,p]=x1({prop:r,defaultProp:o,onChange:i});return x.createElement(mC,{scope:t,triggerRef:a,contentRef:s,contentId:Il(),titleId:Il(),descriptionId:Il(),open:u,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(c=>!c),[p]),modal:l},n)},yC="DialogTrigger",vC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(yC,n),i=en(t,o.triggerRef);return x.createElement(Tt.button,ge({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Xp(o.open)},r,{ref:i,onClick:Xe(e.onClick,o.onOpenToggle)}))}),wC="DialogPortal",[m_,I1]=N1(wC,{forceMount:void 0}),Tc="DialogOverlay",xC=x.forwardRef((e,t)=>{const n=I1(Tc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=fn(Tc,e.__scopeDialog);return i.modal?x.createElement(Ya,{present:r||i.open},x.createElement(bC,ge({},o,{ref:t}))):null}),bC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(Tc,n);return x.createElement(cC,{as:Kp,allowPinchZoom:!0,shards:[o.contentRef]},x.createElement(Tt.div,ge({"data-state":Xp(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Pi="DialogContent",kC=x.forwardRef((e,t)=>{const n=I1(Pi,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=fn(Pi,e.__scopeDialog);return x.createElement(Ya,{present:r||i.open},i.modal?x.createElement(SC,ge({},o,{ref:t})):x.createElement(CC,ge({},o,{ref:t})))}),SC=x.forwardRef((e,t)=>{const n=fn(Pi,e.__scopeDialog),r=x.useRef(null),o=en(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return hC(i)},[]),x.createElement(F1,ge({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xe(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)===null||l===void 0||l.focus()}),onPointerDownOutside:Xe(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&i.preventDefault()}),onFocusOutside:Xe(e.onFocusOutside,i=>i.preventDefault())}))}),CC=x.forwardRef((e,t)=>{const n=fn(Pi,e.__scopeDialog),r=x.useRef(!1),o=x.useRef(!1);return x.createElement(F1,ge({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l;if((l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var l,a;(l=e.onInteractOutside)===null||l===void 0||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),F1=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,a=fn(Pi,n),s=x.useRef(null),u=en(t,s);return A2(),x.createElement(x.Fragment,null,x.createElement(x2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},x.createElement(y2,ge({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Xp(a.open)},l,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),EC="DialogTitle",PC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(EC,n);return x.createElement(Tt.h2,ge({id:o.titleId},r,{ref:t}))}),OC="DialogDescription",TC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(OC,n);return x.createElement(Tt.p,ge({id:o.descriptionId},r,{ref:t}))}),AC="DialogClose",$C=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(AC,n);return x.createElement(Tt.button,ge({type:"button"},r,{ref:t,onClick:Xe(e.onClick,()=>o.onOpenChange(!1))}))});function Xp(e){return e?"open":"closed"}const _C=gC,RC=vC,LC=xC,j1=kC,M1=PC,B1=TC,DC=$C,zC=_C,dh=DC,NC=RC,IC=LC,U1=x.forwardRef(({className:e,children:t,...n},r)=>L.jsx(IC,{className:"opencopilot-absolute opencopilot-inset-0 opencopilot-z-50 opencopilot-bg-black/50 opencopilot-backdrop-blur-sm data-[state=open]:opencopilot-animate-in data-[state=closed]:opencopilot-animate-out data-[state=closed]:opencopilot-fade-out-0 data-[state=open]:opencopilot-fade-in-0",children:L.jsx(j1,{ref:r,className:Tn("opencopilot-rounded-t-lg opencopilot-z-[100] opencopilot-absolute opencopilot-bottom-0 opencopilot-duration-300 opencopilot-w-full opencopilot-grid opencopilot-max-w-lg opencopilot-bg-white opencopilot-gap-4 opencopilot-shadow-lg opencopilot-p-6 opencopilot-animate-in data-[state=closed]:opencopilot-animate-out data-[state=closed]:opencopilot-fade-out-0 data-[state=open]:opencopilot-fade-in-0 data-[state=closed]:slide-out-to-bottom data-[state=open]:opencopilot-slide-in-from-bottom",e),...n,children:t})}));U1.displayName=j1.displayName;const H1=({className:e,...t})=>L.jsx("div",{className:Tn("opencopilot-flex opencopilot-flex-col opencopilot-space-y-1.5 opencopilot-text-center sm:opencopilot-text-left",e),...t});H1.displayName="DialogHeader";const FC=x.forwardRef(({className:e,...t},n)=>L.jsx(M1,{ref:n,className:Tn("opencopilot-text-lg opencopilot-font-semibold opencopilot-leading-none opencopilot-tracking-tight",e),...t}));FC.displayName=M1.displayName;const jC=x.forwardRef(({className:e,...t},n)=>L.jsx(B1,{ref:n,className:Tn("opencopilot-text-sm opencopilot-text-muted-foreground",e),...t}));jC.displayName=B1.displayName;function MC(){const[,,e]=B0();return L.jsx("header",{className:"opencopilot-fade-in-top opencopilot-border-b opencopilot-border-b-black/10 opencopilot-w-full",children:L.jsx("div",{className:"opencopilot-p-3",children:L.jsxs("div",{className:"opencopilot-w-full opencopilot-flex opencopilot-items-center opencopilot-justify-between",children:[L.jsx("div",{children:L.jsx("h1",{className:"opencopilot-font-semibold opencopilot-text-sm",children:"OpenPilot"})}),L.jsx("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-gap-3",children:L.jsxs(zC,{children:[L.jsx(NC,{children:L.jsx(i2,{size:19})}),L.jsxs(U1,{children:[L.jsx(H1,{className:"opencopilot-mx-auto",children:"Are you sure?"}),L.jsxs("div",{className:"opencopilot-space-y-1.5",children:[L.jsx(dh,{onClick:()=>{setTimeout(()=>{e(!1)},100)},className:"opencopilot-block opencopilot-w-full opencopilot-px-2 opencopilot-text-white opencopilot-shadow opencopilot-py-1 opencopilot-border opencopilot-border-transparent opencopilot-rounded-md opencopilot-bg-rose-500",children:L.jsx("span",{children:"Exit"})}),L.jsx(dh,{className:"opencopilot-block opencopilot-w-full opencopilot-px-2 opencopilot-py-1 opencopilot-rounded-md opencopilot-text-black",children:L.jsx("span",{children:"Cancel"})})]})]})]})})]})})})}var BC=function(e){return{display:e?"flex":"none"}},UC="#4fa94d",HC={"aria-busy":!0,role:"status"},hh=globalThis&&globalThis.__assign||function(){return hh=Object.assign||function(e){for(var t,n=1,r=arguments.length;nMath.abs(C)?"h":"v";if("touches"in m&&O==="h"&&k.type==="range")return!1;var T=ch(O,k);if(!T)return!0;if(T?E=O:(E=O==="v"?"h":"v",T=ch(O,k)),!T)return!1;if(!r.current&&"changedTouches"in m&&(v||C)&&(r.current=E),!E)return!0;var N=r.current||E;return oC(N,w,m,N==="h"?v:C,!0)},[]),s=x.useCallback(function(m){var w=m;if(!(!jr.length||jr[jr.length-1]!==i)){var g="deltaY"in w?ph(w):dl(w),y=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&iC(E.delta,g)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var v=(l.current.shards||[]).map(fh).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=v.length>0?a(w,v[0]):!l.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=x.useCallback(function(m,w,g,y){var v={name:m,delta:w,target:g,should:y};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(C){return C!==v})},1)},[]),p=x.useCallback(function(m){n.current=dl(m),r.current=void 0},[]),c=x.useCallback(function(m){u(m.type,ph(m),m.target,a(m,e.lockRef.current))},[]),d=x.useCallback(function(m){u(m.type,dl(m),m.target,a(m,e.lockRef.current))},[]);x.useEffect(function(){return jr.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:d}),document.addEventListener("wheel",s,Fr),document.addEventListener("touchmove",s,Fr),document.addEventListener("touchstart",p,Fr),function(){jr=jr.filter(function(m){return m!==i}),document.removeEventListener("wheel",s,Fr),document.removeEventListener("touchmove",s,Fr),document.removeEventListener("touchstart",p,Fr)}},[]);var f=e.removeScrollBar,h=e.inert;return x.createElement(x.Fragment,null,h?x.createElement(i,{styles:lC(o)}):null,f?x.createElement(X2,{gapMode:"margin"}):null)}const uC=j2(T1,sC);var L1=x.forwardRef(function(e,t){return x.createElement(Qa,ln({},e,{ref:t,sideCar:uC}))});L1.classNames=Qa.classNames;const cC=L1;var pC=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mr=new WeakMap,hl=new WeakMap,ml={},su=0,D1=function(e){return e&&(e.host||D1(e.parentNode))},fC=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=D1(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dC=function(e,t,n,r){var o=fC(t,Array.isArray(e)?e:[e]);ml[n]||(ml[n]=new WeakMap);var i=ml[n],l=[],a=new Set,s=new Set(o),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};o.forEach(u);var p=function(c){!c||s.has(c)||Array.prototype.forEach.call(c.children,function(d){if(a.has(d))p(d);else{var f=d.getAttribute(r),h=f!==null&&f!=="false",m=(Mr.get(d)||0)+1,w=(i.get(d)||0)+1;Mr.set(d,m),i.set(d,w),l.push(d),m===1&&h&&hl.set(d,!0),w===1&&d.setAttribute(n,"true"),h||d.setAttribute(r,"true")}})};return p(t),a.clear(),su++,function(){l.forEach(function(c){var d=Mr.get(c)-1,f=i.get(c)-1;Mr.set(c,d),i.set(c,f),d||(hl.has(c)||c.removeAttribute(r),hl.delete(c)),f||c.removeAttribute(n)}),su--,su||(Mr=new WeakMap,Mr=new WeakMap,hl=new WeakMap,ml={})}},hC=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||pC(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),dC(r,o,n,"aria-hidden")):function(){return null}};const z1="Dialog",[N1,h_]=Qp(z1),[mC,fn]=N1(z1),gC=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,a=x.useRef(null),s=x.useRef(null),[u=!1,p]=x1({prop:r,defaultProp:o,onChange:i});return x.createElement(mC,{scope:t,triggerRef:a,contentRef:s,contentId:Fl(),titleId:Fl(),descriptionId:Fl(),open:u,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(c=>!c),[p]),modal:l},n)},yC="DialogTrigger",vC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(yC,n),i=en(t,o.triggerRef);return x.createElement(Tt.button,ge({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Xp(o.open)},r,{ref:i,onClick:Xe(e.onClick,o.onOpenToggle)}))}),wC="DialogPortal",[m_,I1]=N1(wC,{forceMount:void 0}),Tc="DialogOverlay",xC=x.forwardRef((e,t)=>{const n=I1(Tc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=fn(Tc,e.__scopeDialog);return i.modal?x.createElement(Ya,{present:r||i.open},x.createElement(bC,ge({},o,{ref:t}))):null}),bC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(Tc,n);return x.createElement(cC,{as:Kp,allowPinchZoom:!0,shards:[o.contentRef]},x.createElement(Tt.div,ge({"data-state":Xp(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Pi="DialogContent",kC=x.forwardRef((e,t)=>{const n=I1(Pi,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=fn(Pi,e.__scopeDialog);return x.createElement(Ya,{present:r||i.open},i.modal?x.createElement(SC,ge({},o,{ref:t})):x.createElement(CC,ge({},o,{ref:t})))}),SC=x.forwardRef((e,t)=>{const n=fn(Pi,e.__scopeDialog),r=x.useRef(null),o=en(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return hC(i)},[]),x.createElement(F1,ge({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xe(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)===null||l===void 0||l.focus()}),onPointerDownOutside:Xe(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&i.preventDefault()}),onFocusOutside:Xe(e.onFocusOutside,i=>i.preventDefault())}))}),CC=x.forwardRef((e,t)=>{const n=fn(Pi,e.__scopeDialog),r=x.useRef(!1),o=x.useRef(!1);return x.createElement(F1,ge({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l;if((l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var l,a;(l=e.onInteractOutside)===null||l===void 0||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),F1=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,a=fn(Pi,n),s=x.useRef(null),u=en(t,s);return A2(),x.createElement(x.Fragment,null,x.createElement(x2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},x.createElement(y2,ge({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Xp(a.open)},l,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),EC="DialogTitle",PC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(EC,n);return x.createElement(Tt.h2,ge({id:o.titleId},r,{ref:t}))}),OC="DialogDescription",TC=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(OC,n);return x.createElement(Tt.p,ge({id:o.descriptionId},r,{ref:t}))}),AC="DialogClose",$C=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=fn(AC,n);return x.createElement(Tt.button,ge({type:"button"},r,{ref:t,onClick:Xe(e.onClick,()=>o.onOpenChange(!1))}))});function Xp(e){return e?"open":"closed"}const _C=gC,RC=vC,LC=xC,j1=kC,M1=PC,B1=TC,DC=$C,zC=_C,dh=DC,NC=RC,IC=LC,U1=x.forwardRef(({className:e,children:t,...n},r)=>L.jsx(IC,{className:"opencopilot-absolute opencopilot-inset-0 opencopilot-z-50 opencopilot-bg-black/50 opencopilot-backdrop-blur-sm data-[state=open]:opencopilot-animate-in data-[state=closed]:opencopilot-animate-out data-[state=closed]:opencopilot-fade-out-0 data-[state=open]:opencopilot-fade-in-0",children:L.jsx(j1,{ref:r,className:Tn("opencopilot-rounded-t-lg opencopilot-z-[100] opencopilot-absolute opencopilot-bottom-0 opencopilot-duration-300 opencopilot-w-full opencopilot-grid opencopilot-max-w-lg opencopilot-bg-white opencopilot-gap-4 opencopilot-shadow-lg opencopilot-p-6 opencopilot-animate-in data-[state=closed]:opencopilot-animate-out data-[state=closed]:opencopilot-fade-out-0 data-[state=open]:opencopilot-fade-in-0 data-[state=closed]:slide-out-to-bottom data-[state=open]:opencopilot-slide-in-from-bottom",e),...n,children:t})}));U1.displayName=j1.displayName;const H1=({className:e,...t})=>L.jsx("div",{className:Tn("opencopilot-flex opencopilot-flex-col opencopilot-space-y-1.5 opencopilot-text-center sm:opencopilot-text-left",e),...t});H1.displayName="DialogHeader";const FC=x.forwardRef(({className:e,...t},n)=>L.jsx(M1,{ref:n,className:Tn("opencopilot-text-lg opencopilot-font-semibold opencopilot-leading-none opencopilot-tracking-tight",e),...t}));FC.displayName=M1.displayName;const jC=x.forwardRef(({className:e,...t},n)=>L.jsx(B1,{ref:n,className:Tn("opencopilot-text-sm opencopilot-text-muted-foreground",e),...t}));jC.displayName=B1.displayName;function MC(){const[,,e]=B0();return L.jsx("header",{className:"opencopilot-fade-in-top opencopilot-border-b opencopilot-border-b-black/10 opencopilot-w-full",children:L.jsx("div",{className:"opencopilot-p-3",children:L.jsxs("div",{className:"opencopilot-w-full opencopilot-flex opencopilot-items-center opencopilot-justify-between",children:[L.jsx("div",{children:L.jsx("h1",{className:"opencopilot-font-semibold opencopilot-text-sm",children:"OpenPilot"})}),L.jsx("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-gap-3",children:L.jsxs(zC,{children:[L.jsx(NC,{children:L.jsx(i2,{size:19})}),L.jsxs(U1,{children:[L.jsx(H1,{className:"opencopilot-mx-auto",children:"Are you sure?"}),L.jsxs("div",{className:"opencopilot-space-y-1.5",children:[L.jsx(dh,{onClick:()=>{setTimeout(()=>{e(!1)},100)},className:"opencopilot-block opencopilot-w-full opencopilot-px-2 opencopilot-text-white opencopilot-shadow opencopilot-py-1 opencopilot-border opencopilot-border-transparent opencopilot-rounded-md opencopilot-bg-rose-500",children:L.jsx("span",{children:"Exit"})}),L.jsx(dh,{className:"opencopilot-block opencopilot-w-full opencopilot-px-2 opencopilot-py-1 opencopilot-rounded-md opencopilot-text-black",children:L.jsx("span",{children:"Cancel"})})]})]})]})})]})})})}var BC=function(e){return{display:e?"flex":"none"}},UC="#4fa94d",HC={"aria-busy":!0,role:"status"},hh=globalThis&&globalThis.__assign||function(){return hh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var hE=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,i=o.length,l=i;n>=l;)(l<<=1)<0&&Fi(16,""+n);this.groupSizes=new Uint32Array(l),this.groupSizes.set(o),this.length=l;for(var a=i;a=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],i=this.indexOfGroup(n),l=i+o,a=i;a=ii&&(ii=t+1),Ml.set(e,t),ga.set(t,e)},yE="style["+wo+'][data-styled-version="5.3.11"]',vE=new RegExp("^"+wo+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),wE=function(e,t,n){for(var r,o=n.split(","),i=0,l=o.length;i=0;u--){var p=s[u];if(p&&p.nodeType===1&&p.hasAttribute(wo))return p}}(n),i=o!==void 0?o.nextSibling:null;r.setAttribute(wo,"active"),r.setAttribute("data-styled-version","5.3.11");var l=bE();return l&&r.setAttribute("nonce",l),n.insertBefore(r,i),r},kE=function(){function e(n){var r=this.element=K1(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var i=document.styleSheets,l=0,a=i.length;l=0){var o=document.createTextNode(r),i=this.nodes[n];return this.element.insertBefore(o,i||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(c+=d+",")}),i+=""+u+p+'{content:"'+c+`"}/*!sc*/ -`}}}return i}(this)},e}(),PE=/(a)(d)/gi,Oh=function(e){return String.fromCharCode(e+(e>25?39:97))};function $c(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Oh(t%52)+n;return(Oh(t%52)+n).replace(PE,"$1-$2")}var eo=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Z1=function(e){return eo(5381,e)};function OE(e){for(var t=0;t>>0);if(!n.hasNameForId(o,a)){var s=r(l,"."+a,void 0,o);n.insertRules(o,a,s)}i.push(a),this.staticRulesId=a}else{for(var u=this.rules.length,p=eo(this.baseHash,r.hash),c="",d=0;d>>0);if(!n.hasNameForId(o,w)){var g=r(c,"."+w,void 0,o);n.insertRules(o,w,g)}i.push(w)}}return i.join(" ")},e}(),$E=/^\s*\/\/.*$/gm,_E=[":","[",".","#"];function RE(e){var t,n,r,o,i=e===void 0?nr:e,l=i.options,a=l===void 0?nr:l,s=i.plugins,u=s===void 0?ma:s,p=new YC(a),c=[],d=function(m){function w(g){if(g)try{m(g+"}")}catch{}}return function(g,y,v,C,E,k,O,T,N,P){switch(g){case 1:if(N===0&&y.charCodeAt(0)===64)return m(y+";"),"";break;case 2:if(T===0)return y+"/*|*/";break;case 3:switch(T){case 102:case 112:return m(v[0]+y),"";default:return y+(P===0?"/*|*/":"")}case-2:y.split("/*|*/}").forEach(w)}}}(function(m){c.push(m)}),f=function(m,w,g){return w===0&&_E.indexOf(g[n.length])!==-1||g.match(o)?m:"."+t};function h(m,w,g,y){y===void 0&&(y="&");var v=m.replace($E,""),C=w&&g?g+" "+w+" { "+v+" }":v;return t=y,n=w,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),p(g||!w?"":w,C)}return p.use([].concat(u,[function(m,w,g){m===2&&g.length&&g[0].lastIndexOf(n)>0&&(g[0]=g[0].replace(r,f))},d,function(m){if(m===-2){var w=c;return c=[],w}}])),h.hash=u.length?u.reduce(function(m,w){return w.name||Fi(15),eo(m,w.name)},5381).toString():"",h}var J1=le.createContext();J1.Consumer;var ev=le.createContext(),LE=(ev.Consumer,new X1),_c=RE();function DE(){return x.useContext(J1)||LE}function zE(){return x.useContext(ev)||_c}var tv=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=_c);var l=r.name+i.hash;o.hasNameForId(r.id,l)||o.insertRules(r.id,l,i(r.rules,l,"@keyframes"))},this.toString=function(){return Fi(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=_c),this.name+t.hash},e}(),NE=/([A-Z])/,IE=/([A-Z])/g,FE=/^ms-/,jE=function(e){return"-"+e.toLowerCase()};function Th(e){return NE.test(e)?e.replace(IE,jE).replace(FE,"-ms-"):e}var Ah=function(e){return e==null||e===!1||e===""};function xo(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],l=0,a=e.length;l1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,UE=/(^-|-$)/g;function uu(e){return e.replace(BE,"-").replace(UE,"")}var rv=function(e){return $c(Z1(e)>>>0)};function gl(e){return typeof e=="string"&&!0}var Rc=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},HE=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function WE(e,t,n){var r=e[n];Rc(t)&&Rc(r)?ov(r,t):e[n]=t}function ov(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[T]=k[T]);return P}(t,["componentId"]),E=v&&v+"-"+(gl(y)?y:uu(Eh(y)));return lv(y,bn({},C,{attrs:d,componentId:E}),n)},Object.defineProperty(h,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(y){this._foldedDefaultProps=r?ov({},e.defaultProps,y):y}}),Object.defineProperty(h,"toString",{value:function(){return"."+h.styledComponentId}}),o&&fE(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),h}var Lc=function(e){return function t(n,r,o){if(o===void 0&&(o=nr),!ef.isValidElementType(r))return Fi(1,String(r));var i=function(){return n(r,o,nv.apply(void 0,arguments))};return i.withConfig=function(l){return t(n,r,bn({},o,{},l))},i.attrs=function(l){return t(n,r,bn({},o,{attrs:Array.prototype.concat(o.attrs,l).filter(Boolean)}))},i}(lv,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Lc[e]=Lc(e)});function uf(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var hE=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,i=o.length,l=i;n>=l;)(l<<=1)<0&&ji(16,""+n);this.groupSizes=new Uint32Array(l),this.groupSizes.set(o),this.length=l;for(var a=i;a=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],i=this.indexOfGroup(n),l=i+o,a=i;a=ii&&(ii=t+1),Bl.set(e,t),ya.set(t,e)},yE="style["+wo+'][data-styled-version="5.3.11"]',vE=new RegExp("^"+wo+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),wE=function(e,t,n){for(var r,o=n.split(","),i=0,l=o.length;i=0;u--){var p=s[u];if(p&&p.nodeType===1&&p.hasAttribute(wo))return p}}(n),i=o!==void 0?o.nextSibling:null;r.setAttribute(wo,"active"),r.setAttribute("data-styled-version","5.3.11");var l=bE();return l&&r.setAttribute("nonce",l),n.insertBefore(r,i),r},kE=function(){function e(n){var r=this.element=K1(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var i=document.styleSheets,l=0,a=i.length;l=0){var o=document.createTextNode(r),i=this.nodes[n];return this.element.insertBefore(o,i||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(c+=d+",")}),i+=""+u+p+'{content:"'+c+`"}/*!sc*/ +`}}}return i}(this)},e}(),PE=/(a)(d)/gi,Oh=function(e){return String.fromCharCode(e+(e>25?39:97))};function $c(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Oh(t%52)+n;return(Oh(t%52)+n).replace(PE,"$1-$2")}var eo=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Z1=function(e){return eo(5381,e)};function OE(e){for(var t=0;t>>0);if(!n.hasNameForId(o,a)){var s=r(l,"."+a,void 0,o);n.insertRules(o,a,s)}i.push(a),this.staticRulesId=a}else{for(var u=this.rules.length,p=eo(this.baseHash,r.hash),c="",d=0;d>>0);if(!n.hasNameForId(o,w)){var g=r(c,"."+w,void 0,o);n.insertRules(o,w,g)}i.push(w)}}return i.join(" ")},e}(),$E=/^\s*\/\/.*$/gm,_E=[":","[",".","#"];function RE(e){var t,n,r,o,i=e===void 0?nr:e,l=i.options,a=l===void 0?nr:l,s=i.plugins,u=s===void 0?ga:s,p=new YC(a),c=[],d=function(m){function w(g){if(g)try{m(g+"}")}catch{}}return function(g,y,v,C,E,k,O,T,N,P){switch(g){case 1:if(N===0&&y.charCodeAt(0)===64)return m(y+";"),"";break;case 2:if(T===0)return y+"/*|*/";break;case 3:switch(T){case 102:case 112:return m(v[0]+y),"";default:return y+(P===0?"/*|*/":"")}case-2:y.split("/*|*/}").forEach(w)}}}(function(m){c.push(m)}),f=function(m,w,g){return w===0&&_E.indexOf(g[n.length])!==-1||g.match(o)?m:"."+t};function h(m,w,g,y){y===void 0&&(y="&");var v=m.replace($E,""),C=w&&g?g+" "+w+" { "+v+" }":v;return t=y,n=w,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),p(g||!w?"":w,C)}return p.use([].concat(u,[function(m,w,g){m===2&&g.length&&g[0].lastIndexOf(n)>0&&(g[0]=g[0].replace(r,f))},d,function(m){if(m===-2){var w=c;return c=[],w}}])),h.hash=u.length?u.reduce(function(m,w){return w.name||ji(15),eo(m,w.name)},5381).toString():"",h}var J1=le.createContext();J1.Consumer;var ev=le.createContext(),LE=(ev.Consumer,new X1),_c=RE();function DE(){return x.useContext(J1)||LE}function zE(){return x.useContext(ev)||_c}var tv=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=_c);var l=r.name+i.hash;o.hasNameForId(r.id,l)||o.insertRules(r.id,l,i(r.rules,l,"@keyframes"))},this.toString=function(){return ji(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=_c),this.name+t.hash},e}(),NE=/([A-Z])/,IE=/([A-Z])/g,FE=/^ms-/,jE=function(e){return"-"+e.toLowerCase()};function Th(e){return NE.test(e)?e.replace(IE,jE).replace(FE,"-ms-"):e}var Ah=function(e){return e==null||e===!1||e===""};function xo(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],l=0,a=e.length;l1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,UE=/(^-|-$)/g;function uu(e){return e.replace(BE,"-").replace(UE,"")}var rv=function(e){return $c(Z1(e)>>>0)};function yl(e){return typeof e=="string"&&!0}var Rc=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},HE=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function WE(e,t,n){var r=e[n];Rc(t)&&Rc(r)?ov(r,t):e[n]=t}function ov(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[T]=k[T]);return P}(t,["componentId"]),E=v&&v+"-"+(yl(y)?y:uu(Eh(y)));return lv(y,bn({},C,{attrs:d,componentId:E}),n)},Object.defineProperty(h,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(y){this._foldedDefaultProps=r?ov({},e.defaultProps,y):y}}),Object.defineProperty(h,"toString",{value:function(){return"."+h.styledComponentId}}),o&&fE(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),h}var Lc=function(e){return function t(n,r,o){if(o===void 0&&(o=nr),!ef.isValidElementType(r))return ji(1,String(r));var i=function(){return n(r,o,nv.apply(void 0,arguments))};return i.withConfig=function(l){return t(n,r,bn({},o,{},l))},i.attrs=function(l){return t(n,r,bn({},o,{attrs:Array.prototype.concat(o.attrs,l).filter(Boolean)}))},i}(lv,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Lc[e]=Lc(e)});function uf(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:a,onDismiss:s,...u}=e,p=x.useContext(ZE),[c,d]=x.useState(null),f=(n=c==null?void 0:c.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=x.useState({}),m=en(t,T=>d(T)),w=Array.from(p.layers),[g]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(g),v=c?w.indexOf(c):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,k=e5(T=>{const N=T.target,P=[...p.branches].some(_=>_.contains(N));!E||P||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),O=t5(T=>{const N=T.target;[...p.branches].some(_=>_.contains(N))||(l==null||l(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return S1(T=>{v===p.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),x.useEffect(()=>{if(c)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(pm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(c)),p.layers.add(c),fm(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=pm)}},[c,f,r,p]),x.useEffect(()=>()=>{c&&(p.layers.delete(c),p.layersWithOutsidePointerEventsDisabled.delete(c),fm())},[c,p]),x.useEffect(()=>{const T=()=>h({});return document.addEventListener(Dc,T),()=>document.removeEventListener(Dc,T)},[]),x.createElement(Tt.div,ge({},u,{ref:m,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Xe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Xe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Xe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function e5(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let p=function(){sv(KE,n,u,{discrete:!0})};var s=p;const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=p,t.addEventListener("click",o.current,{once:!0})):p()}r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function t5(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!r.current&&sv(XE,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fm(){const e=new CustomEvent(Dc);document.dispatchEvent(e)}function sv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?k1(o,i):o.dispatchEvent(i)}const n5=["top","right","bottom","left"],ir=Math.min,xt=Math.max,ya=Math.round,yl=Math.floor,lr=e=>({x:e,y:e}),r5={left:"right",right:"left",bottom:"top",top:"bottom"},o5={start:"end",end:"start"};function zc(e,t,n){return xt(e,ir(t,n))}function An(e,t){return typeof e=="function"?e(t):e}function $n(e){return e.split("-")[0]}function Po(e){return e.split("-")[1]}function ff(e){return e==="x"?"y":"x"}function df(e){return e==="y"?"height":"width"}function Oo(e){return["top","bottom"].includes($n(e))?"y":"x"}function hf(e){return ff(Oo(e))}function i5(e,t,n){n===void 0&&(n=!1);const r=Po(e),o=hf(e),i=df(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=va(l)),[l,va(l)]}function l5(e){const t=va(e);return[Nc(e),t,Nc(t)]}function Nc(e){return e.replace(/start|end/g,t=>o5[t])}function a5(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}function s5(e,t,n,r){const o=Po(e);let i=a5($n(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Nc)))),i}function va(e){return e.replace(/left|right|bottom|top/g,t=>r5[t])}function u5(e){return{top:0,right:0,bottom:0,left:0,...e}}function uv(e){return typeof e!="number"?u5(e):{top:e,right:e,bottom:e,left:e}}function wa(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function dm(e,t,n){let{reference:r,floating:o}=e;const i=Oo(t),l=hf(t),a=df(l),s=$n(t),u=i==="y",p=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let f;switch(s){case"top":f={x:p,y:r.y-o.height};break;case"bottom":f={x:p,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:c};break;case"left":f={x:r.x-o.width,y:c};break;default:f={x:r.x,y:r.y}}switch(Po(t)){case"start":f[l]-=d*(n&&u?-1:1);break;case"end":f[l]+=d*(n&&u?-1:1);break}return f}const c5=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:c}=dm(u,r,s),d=r,f={},h=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:a}=t,{element:s,padding:u=0}=An(e,t)||{};if(s==null)return{};const p=uv(u),c={x:n,y:r},d=hf(o),f=df(d),h=await l.getDimensions(s),m=d==="y",w=m?"top":"left",g=m?"bottom":"right",y=m?"clientHeight":"clientWidth",v=i.reference[f]+i.reference[d]-c[d]-i.floating[f],C=c[d]-i.reference[d],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(s));let k=E?E[y]:0;(!k||!await(l.isElement==null?void 0:l.isElement(E)))&&(k=a.floating[y]||i.floating[f]);const O=v/2-C/2,T=k/2-h[f]/2-1,N=ir(p[w],T),P=ir(p[g],T),_=N,R=k-h[f]-P,H=k/2-h[f]/2+O,q=zc(_,H,R),Q=Po(o)!=null&&H!=q&&i.reference[f]/2-(H<_?N:P)-h[f]/2<0?H<_?_-H:R-H:0;return{[d]:c[d]-Q,data:{[d]:q,centerOffset:H-q+Q}}}}),p5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:s}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:c,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...m}=An(e,t),w=$n(r),g=$n(l)===l,y=await(a.isRTL==null?void 0:a.isRTL(s.floating)),v=c||(g||!h?[va(l)]:l5(l));!c&&f!=="none"&&v.push(...s5(l,h,f,y));const C=[l,...v],E=await Ti(t,m),k=[];let O=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&k.push(E[w]),p){const _=i5(r,i,y);k.push(E[_[0]],E[_[1]])}if(O=[...O,{placement:r,overflows:k}],!k.every(_=>_<=0)){var T,N;const _=(((T=o.flip)==null?void 0:T.index)||0)+1,R=C[_];if(R)return{data:{index:_,overflows:O},reset:{placement:R}};let H=(N=O.filter(q=>q.overflows[0]<=0).sort((q,W)=>q.overflows[1]-W.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(d){case"bestFit":{var P;const q=(P=O.map(W=>[W.placement,W.overflows.filter(Q=>Q>0).reduce((Q,te)=>Q+te,0)]).sort((W,Q)=>W[1]-Q[1])[0])==null?void 0:P[0];q&&(H=q);break}case"initialPlacement":H=l;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function mm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gm(e){return n5.some(t=>e[t]>=0)}const f5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=An(e,t);switch(r){case"referenceHidden":{const i=await Ti(t,{...o,elementContext:"reference"}),l=mm(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:gm(l)}}}case"escaped":{const i=await Ti(t,{...o,altBoundary:!0}),l=mm(i,n.floating);return{data:{escapedOffsets:l,escaped:gm(l)}}}default:return{}}}}};async function d5(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=$n(n),a=Po(n),s=Oo(n)==="y",u=["left","top"].includes(l)?-1:1,p=i&&s?-1:1,c=An(t,e);let{mainAxis:d,crossAxis:f,alignmentAxis:h}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof h=="number"&&(f=a==="end"?h*-1:h),s?{x:f*p,y:d*u}:{x:d*u,y:f*p}}const h5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await d5(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},m5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:w=>{let{x:g,y}=w;return{x:g,y}}},...s}=An(e,t),u={x:n,y:r},p=await Ti(t,s),c=Oo($n(o)),d=ff(c);let f=u[d],h=u[c];if(i){const w=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=f+p[w],v=f-p[g];f=zc(y,f,v)}if(l){const w=c==="y"?"top":"left",g=c==="y"?"bottom":"right",y=h+p[w],v=h-p[g];h=zc(y,h,v)}const m=a.fn({...t,[d]:f,[c]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},g5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:s=!0,crossAxis:u=!0}=An(e,t),p={x:n,y:r},c=Oo(o),d=ff(c);let f=p[d],h=p[c];const m=An(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(s){const v=d==="y"?"height":"width",C=i.reference[d]-i.floating[v]+w.mainAxis,E=i.reference[d]+i.reference[v]-w.mainAxis;fE&&(f=E)}if(u){var g,y;const v=d==="y"?"width":"height",C=["top","left"].includes($n(o)),E=i.reference[c]-i.floating[v]+(C&&((g=l.offset)==null?void 0:g[c])||0)+(C?0:w.crossAxis),k=i.reference[c]+i.reference[v]+(C?0:((y=l.offset)==null?void 0:y[c])||0)-(C?w.crossAxis:0);hk&&(h=k)}return{[d]:f,[c]:h}}}},y5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:l=()=>{},...a}=An(e,t),s=await Ti(t,a),u=$n(n),p=Po(n),c=Oo(n)==="y",{width:d,height:f}=r.floating;let h,m;u==="top"||u==="bottom"?(h=u,m=p===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=u,h=p==="end"?"top":"bottom");const w=f-s[h],g=d-s[m],y=!t.middlewareData.shift;let v=w,C=g;if(c){const k=d-s.left-s.right;C=p||y?ir(g,k):k}else{const k=f-s.top-s.bottom;v=p||y?ir(w,k):k}if(y&&!p){const k=xt(s.left,0),O=xt(s.right,0),T=xt(s.top,0),N=xt(s.bottom,0);c?C=d-2*(k!==0||O!==0?k+O:xt(s.left,s.right)):v=f-2*(T!==0||N!==0?T+N:xt(s.top,s.bottom))}await l({...t,availableWidth:C,availableHeight:v});const E=await o.getDimensions(i.floating);return d!==E.width||f!==E.height?{reset:{rects:!0}}:{}}}};function ar(e){return cv(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ln(e){var t;return(t=(cv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cv(e){return e instanceof Node||e instanceof St(e).Node}function _n(e){return e instanceof Element||e instanceof St(e).Element}function cn(e){return e instanceof HTMLElement||e instanceof St(e).HTMLElement}function ym(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}function Mi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function v5(e){return["table","td","th"].includes(ar(e))}function mf(e){const t=gf(),n=Ft(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 w5(e){let t=bo(e);for(;cn(t)&&!gs(t);){if(mf(t))return t;t=bo(t)}return null}function gf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gs(e){return["html","body","#document"].includes(ar(e))}function Ft(e){return St(e).getComputedStyle(e)}function ys(e){return _n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function bo(e){if(ar(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ym(e)&&e.host||Ln(e);return ym(t)?t.host:t}function pv(e){const t=bo(e);return gs(t)?e.ownerDocument?e.ownerDocument.body:e.body:cn(t)&&Mi(t)?t:pv(t)}function xa(e,t){var n;t===void 0&&(t=[]);const r=pv(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=St(r);return o?t.concat(i,i.visualViewport||[],Mi(r)?r:[]):t.concat(r,xa(r))}function fv(e){const t=Ft(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=cn(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=ya(n)!==i||ya(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function yf(e){return _n(e)?e:e.contextElement}function ao(e){const t=yf(e);if(!cn(t))return lr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fv(t);let l=(i?ya(n.width):n.width)/r,a=(i?ya(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const x5=lr(0);function dv(e){const t=St(e);return!gf()||!t.visualViewport?x5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function b5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==St(e)?!1:t}function Ar(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=yf(e);let l=lr(1);t&&(r?_n(r)&&(l=ao(r)):l=ao(e));const a=b5(i,n,r)?dv(i):lr(0);let s=(o.left+a.x)/l.x,u=(o.top+a.y)/l.y,p=o.width/l.x,c=o.height/l.y;if(i){const d=St(i),f=r&&_n(r)?St(r):r;let h=d.frameElement;for(;h&&r&&f!==d;){const m=ao(h),w=h.getBoundingClientRect(),g=Ft(h),y=w.left+(h.clientLeft+parseFloat(g.paddingLeft))*m.x,v=w.top+(h.clientTop+parseFloat(g.paddingTop))*m.y;s*=m.x,u*=m.y,p*=m.x,c*=m.y,s+=y,u+=v,h=St(h).frameElement}}return wa({width:p,height:c,x:s,y:u})}function k5(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=cn(n),i=Ln(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a=lr(1);const s=lr(0);if((o||!o&&r!=="fixed")&&((ar(n)!=="body"||Mi(i))&&(l=ys(n)),cn(n))){const u=Ar(n);a=ao(n),s.x=u.x+n.clientLeft,s.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+s.x,y:t.y*a.y-l.scrollTop*a.y+s.y}}function S5(e){return Array.from(e.getClientRects())}function hv(e){return Ar(Ln(e)).left+ys(e).scrollLeft}function C5(e){const t=Ln(e),n=ys(e),r=e.ownerDocument.body,o=xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+hv(e);const a=-n.scrollTop;return Ft(r).direction==="rtl"&&(l+=xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}function E5(e,t){const n=St(e),r=Ln(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const u=gf();(!u||u&&t==="fixed")&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}function P5(e,t){const n=Ar(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=cn(e)?ao(e):lr(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,s=o*i.x,u=r*i.y;return{width:l,height:a,x:s,y:u}}function vm(e,t,n){let r;if(t==="viewport")r=E5(e,n);else if(t==="document")r=C5(Ln(e));else if(_n(t))r=P5(t,n);else{const o=dv(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return wa(r)}function mv(e,t){const n=bo(e);return n===t||!_n(n)||gs(n)?!1:Ft(n).position==="fixed"||mv(n,t)}function O5(e,t){const n=t.get(e);if(n)return n;let r=xa(e).filter(a=>_n(a)&&ar(a)!=="body"),o=null;const i=Ft(e).position==="fixed";let l=i?bo(e):e;for(;_n(l)&&!gs(l);){const a=Ft(l),s=mf(l);!s&&a.position==="fixed"&&(o=null),(i?!s&&!o:!s&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Mi(l)&&!s&&mv(e,l))?r=r.filter(p=>p!==l):o=a,l=bo(l)}return t.set(e,r),r}function T5(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?O5(t,this._c):[].concat(n),r],a=l[0],s=l.reduce((u,p)=>{const c=vm(t,p,o);return u.top=xt(c.top,u.top),u.right=ir(c.right,u.right),u.bottom=ir(c.bottom,u.bottom),u.left=xt(c.left,u.left),u},vm(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function A5(e){return fv(e)}function $5(e,t,n){const r=cn(t),o=Ln(t),i=n==="fixed",l=Ar(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=lr(0);if(r||!r&&!i)if((ar(t)!=="body"||Mi(o))&&(a=ys(t)),r){const u=Ar(t,!0,i,t);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else o&&(s.x=hv(o));return{x:l.left+a.scrollLeft-s.x,y:l.top+a.scrollTop-s.y,width:l.width,height:l.height}}function wm(e,t){return!cn(e)||Ft(e).position==="fixed"?null:t?t(e):e.offsetParent}function gv(e,t){const n=St(e);if(!cn(e))return n;let r=wm(e,t);for(;r&&v5(r)&&Ft(r).position==="static";)r=wm(r,t);return r&&(ar(r)==="html"||ar(r)==="body"&&Ft(r).position==="static"&&!mf(r))?n:r||w5(e)||n}const _5=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||gv,i=this.getDimensions;return{reference:$5(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function R5(e){return Ft(e).direction==="rtl"}const L5={convertOffsetParentRelativeRectToViewportRelativeRect:k5,getDocumentElement:Ln,getClippingRect:T5,getOffsetParent:gv,getElementRects:_5,getClientRects:S5,getDimensions:A5,getScale:ao,isElement:_n,isRTL:R5};function D5(e,t){let n=null,r;const o=Ln(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),i();const{left:u,top:p,width:c,height:d}=e.getBoundingClientRect();if(a||t(),!c||!d)return;const f=yl(p),h=yl(o.clientWidth-(u+c)),m=yl(o.clientHeight-(p+d)),w=yl(u),y={rootMargin:-f+"px "+-h+"px "+-m+"px "+-w+"px",threshold:xt(0,ir(1,s))||1};let v=!0;function C(E){const k=E[0].intersectionRatio;if(k!==s){if(!v)return l();k?l(!1,k):r=setTimeout(()=>{l(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(C,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return l(!0),i}function z5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=yf(e),p=o||i?[...u?xa(u):[],...xa(t)]:[];p.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const c=u&&a?D5(u,n):null;let d=-1,f=null;l&&(f=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),u&&!s&&f.observe(u),f.observe(t));let h,m=s?Ar(e):null;s&&w();function w(){const g=Ar(e);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,h=requestAnimationFrame(w)}return n(),()=>{p.forEach(g=>{o&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),c&&c(),f&&f.disconnect(),f=null,s&&cancelAnimationFrame(h)}}const N5=(e,t,n)=>{const r=new Map,o={platform:L5,...n},i={...o.platform,_c:r};return c5(e,t,{...o,platform:i})},I5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hm({element:r.current,padding:o}).fn(n):{}:r?hm({element:r,padding:o}).fn(n):{}}}};var Bl=typeof document<"u"?x.useLayoutEffect:x.useEffect;function ba(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ba(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ba(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function yv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xm(e,t){const n=yv(e);return Math.round(t*n)/n}function bm(e){const t=x.useRef(e);return Bl(()=>{t.current=e}),t}function F5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:a=!0,whileElementsMounted:s,open:u}=e,[p,c]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=x.useState(r);ba(d,r)||f(r);const[h,m]=x.useState(null),[w,g]=x.useState(null),y=x.useCallback(Q=>{Q!=k.current&&(k.current=Q,m(Q))},[m]),v=x.useCallback(Q=>{Q!==O.current&&(O.current=Q,g(Q))},[g]),C=i||h,E=l||w,k=x.useRef(null),O=x.useRef(null),T=x.useRef(p),N=bm(s),P=bm(o),_=x.useCallback(()=>{if(!k.current||!O.current)return;const Q={placement:t,strategy:n,middleware:d};P.current&&(Q.platform=P.current),N5(k.current,O.current,Q).then(te=>{const z={...te,isPositioned:!0};R.current&&!ba(T.current,z)&&(T.current=z,Ba.flushSync(()=>{c(z)}))})},[d,t,n,P]);Bl(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,c(Q=>({...Q,isPositioned:!1})))},[u]);const R=x.useRef(!1);Bl(()=>(R.current=!0,()=>{R.current=!1}),[]),Bl(()=>{if(C&&(k.current=C),E&&(O.current=E),C&&E){if(N.current)return N.current(C,E,_);_()}},[C,E,_,N]);const H=x.useMemo(()=>({reference:k,floating:O,setReference:y,setFloating:v}),[y,v]),q=x.useMemo(()=>({reference:C,floating:E}),[C,E]),W=x.useMemo(()=>{const Q={position:n,left:0,top:0};if(!q.floating)return Q;const te=xm(q.floating,p.x),z=xm(q.floating,p.y);return a?{...Q,transform:"translate("+te+"px, "+z+"px)",...yv(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:z}},[n,a,q.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:_,refs:H,elements:q,floatingStyles:W}),[p,_,H,q,W])}const j5=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return x.createElement(Tt.svg,ge({},i,{ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:x.createElement("polygon",{points:"0,0 30,0 15,10"}))}),M5=j5;function B5(e){const[t,n]=x.useState(void 0);return vo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,a;if("borderBoxSize"in i){const s=i.borderBoxSize,u=Array.isArray(s)?s[0]:s;l=u.inlineSize,a=u.blockSize}else l=e.offsetWidth,a=e.offsetHeight;n({width:l,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const vv="Popper",[wv,xv]=Qp(vv),[U5,bv]=wv(vv),H5=e=>{const{__scopePopper:t,children:n}=e,[r,o]=x.useState(null);return x.createElement(U5,{scope:t,anchor:r,onAnchorChange:o},n)},W5="PopperAnchor",V5=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=bv(W5,n),l=x.useRef(null),a=en(t,l);return x.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:x.createElement(Tt.div,ge({},o,{ref:a}))}),kv="PopperContent",[G5,q5]=wv(kv),Y5=x.forwardRef((e,t)=>{var n,r,o,i,l,a,s,u;const{__scopePopper:p,side:c="bottom",sideOffset:d=0,align:f="center",alignOffset:h=0,arrowPadding:m=0,collisionBoundary:w=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:v=!1,avoidCollisions:C=!0,onPlaced:E,...k}=e,O=bv(kv,p),[T,N]=x.useState(null),P=en(t,Be=>N(Be)),[_,R]=x.useState(null),H=B5(_),q=(n=H==null?void 0:H.width)!==null&&n!==void 0?n:0,W=(r=H==null?void 0:H.height)!==null&&r!==void 0?r:0,Q=c+(f!=="center"?"-"+f:""),te=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},z=Array.isArray(w)?w:[w],G=z.length>0,S={padding:te,boundary:z.filter(Z5),altBoundary:G},{refs:X,floatingStyles:I,placement:b,isPositioned:U,middlewareData:Y}=F5({strategy:"fixed",placement:Q,whileElementsMounted:z5,elements:{reference:O.anchor},middleware:[h5({mainAxis:d+W,alignmentAxis:h}),C&&m5({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?g5():void 0,...S}),C&&p5({...S}),y5({...S,apply:({elements:Be,rects:se,availableWidth:Fe,availableHeight:fe})=>{const{width:ze,height:hn}=se.reference,Ee=Be.floating.style;Ee.setProperty("--radix-popper-available-width",`${Fe}px`),Ee.setProperty("--radix-popper-available-height",`${fe}px`),Ee.setProperty("--radix-popper-anchor-width",`${ze}px`),Ee.setProperty("--radix-popper-anchor-height",`${hn}px`)}}),_&&I5({element:_,padding:m}),J5({arrowWidth:q,arrowHeight:W}),v&&f5({strategy:"referenceHidden"})]}),[A,ne]=Sv(b),B=un(E);vo(()=>{U&&(B==null||B())},[U,B]);const ye=(o=Y.arrow)===null||o===void 0?void 0:o.x,ie=(i=Y.arrow)===null||i===void 0?void 0:i.y,pe=((l=Y.arrow)===null||l===void 0?void 0:l.centerOffset)!==0,[J,Ie]=x.useState();return vo(()=>{T&&Ie(window.getComputedStyle(T).zIndex)},[T]),x.createElement("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:U?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(a=Y.transformOrigin)===null||a===void 0?void 0:a.x,(s=Y.transformOrigin)===null||s===void 0?void 0:s.y].join(" ")},dir:e.dir},x.createElement(G5,{scope:p,placedSide:A,onArrowChange:R,arrowX:ye,arrowY:ie,shouldHideArrow:pe},x.createElement(Tt.div,ge({"data-side":A,"data-align":ne},k,{ref:P,style:{...k.style,animation:U?void 0:"none",opacity:(u=Y.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))}),Q5="PopperArrow",K5={top:"bottom",right:"left",bottom:"top",left:"right"},X5=x.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=q5(Q5,r),l=K5[i.placedSide];return x.createElement("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},x.createElement(M5,ge({},o,{ref:n,style:{...o.style,display:"block"}})))});function Z5(e){return e!==null}const J5=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,l;const{placement:a,rects:s,middlewareData:u}=t,c=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,m]=Sv(a),w={start:"0%",center:"50%",end:"100%"}[m],g=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+d/2,y=((i=(l=u.arrow)===null||l===void 0?void 0:l.y)!==null&&i!==void 0?i:0)+f/2;let v="",C="";return h==="bottom"?(v=c?w:`${g}px`,C=`${-f}px`):h==="top"?(v=c?w:`${g}px`,C=`${s.floating.height+f}px`):h==="right"?(v=`${-f}px`,C=c?w:`${y}px`):h==="left"&&(v=`${s.floating.width+f}px`,C=c?w:`${y}px`),{data:{x:v,y:C}}}});function Sv(e){const[t,n="center"]=e.split("-");return[t,n]}const e4=H5,t4=V5,n4=Y5,r4=X5,o4=x.forwardRef((e,t)=>x.createElement(Tt.span,ge({},e,{ref:t,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",...e.style}}))),i4=o4,[vs,g_]=Qp("Tooltip",[xv]),ws=xv(),l4="TooltipProvider",a4=700,Ic="tooltip.open",[s4,vf]=vs(l4),u4=e=>{const{__scopeTooltip:t,delayDuration:n=a4,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[l,a]=x.useState(!0),s=x.useRef(!1),u=x.useRef(0);return x.useEffect(()=>{const p=u.current;return()=>window.clearTimeout(p)},[]),x.createElement(s4,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:x.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:x.useCallback(p=>{s.current=p},[]),disableHoverableContent:o},i)},wf="Tooltip",[c4,xs]=vs(wf),p4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:a}=e,s=vf(wf,e.__scopeTooltip),u=ws(t),[p,c]=x.useState(null),d=Il(),f=x.useRef(0),h=l??s.disableHoverableContent,m=a??s.delayDuration,w=x.useRef(!1),[g=!1,y]=x1({prop:r,defaultProp:o,onChange:O=>{O?(s.onOpen(),document.dispatchEvent(new CustomEvent(Ic))):s.onClose(),i==null||i(O)}}),v=x.useMemo(()=>g?w.current?"delayed-open":"instant-open":"closed",[g]),C=x.useCallback(()=>{window.clearTimeout(f.current),w.current=!1,y(!0)},[y]),E=x.useCallback(()=>{window.clearTimeout(f.current),y(!1)},[y]),k=x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{w.current=!0,y(!0)},m)},[m,y]);return x.useEffect(()=>()=>window.clearTimeout(f.current),[]),x.createElement(e4,u,x.createElement(c4,{scope:t,contentId:d,open:g,stateAttribute:v,trigger:p,onTriggerChange:c,onTriggerEnter:x.useCallback(()=>{s.isOpenDelayed?k():C()},[s.isOpenDelayed,k,C]),onTriggerLeave:x.useCallback(()=>{h?E():window.clearTimeout(f.current)},[E,h]),onOpen:C,onClose:E,disableHoverableContent:h},n))},km="TooltipTrigger",f4=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xs(km,n),i=vf(km,n),l=ws(n),a=x.useRef(null),s=en(t,a,o.onTriggerChange),u=x.useRef(!1),p=x.useRef(!1),c=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),x.createElement(t4,ge({asChild:!0},l),x.createElement(Tt.button,ge({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:s,onPointerMove:Xe(e.onPointerMove,d=>{d.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Xe(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Xe(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:Xe(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Xe(e.onBlur,o.onClose),onClick:Xe(e.onClick,o.onClose)})))}),d4="TooltipPortal",[y_,h4]=vs(d4,{forceMount:void 0}),Ai="TooltipContent",m4=x.forwardRef((e,t)=>{const n=h4(Ai,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,l=xs(Ai,e.__scopeTooltip);return x.createElement(Ya,{present:r||l.open},l.disableHoverableContent?x.createElement(Cv,ge({side:o},i,{ref:t})):x.createElement(g4,ge({side:o},i,{ref:t})))}),g4=x.forwardRef((e,t)=>{const n=xs(Ai,e.__scopeTooltip),r=vf(Ai,e.__scopeTooltip),o=x.useRef(null),i=en(t,o),[l,a]=x.useState(null),{trigger:s,onClose:u}=n,p=o.current,{onPointerInTransitChange:c}=r,d=x.useCallback(()=>{a(null),c(!1)},[c]),f=x.useCallback((h,m)=>{const w=h.currentTarget,g={x:h.clientX,y:h.clientY},y=b4(g,w.getBoundingClientRect()),v=k4(g,y),C=S4(m.getBoundingClientRect()),E=E4([...v,...C]);a(E),c(!0)},[c]);return x.useEffect(()=>()=>d(),[d]),x.useEffect(()=>{if(s&&p){const h=w=>f(w,p),m=w=>f(w,s);return s.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{s.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[s,p,f,d]),x.useEffect(()=>{if(l){const h=m=>{const w=m.target,g={x:m.clientX,y:m.clientY},y=(s==null?void 0:s.contains(w))||(p==null?void 0:p.contains(w)),v=!C4(g,l);y?d():v&&(d(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[s,p,l,u,d]),x.createElement(Cv,ge({},e,{ref:i}))}),[y4,v4]=vs(wf,{isInside:!1}),Cv=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:l,...a}=e,s=xs(Ai,n),u=ws(n),{onClose:p}=s;return x.useEffect(()=>(document.addEventListener(Ic,p),()=>document.removeEventListener(Ic,p)),[p]),x.useEffect(()=>{if(s.trigger){const c=d=>{const f=d.target;f!=null&&f.contains(s.trigger)&&p()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[s.trigger,p]),x.createElement(JE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c=>c.preventDefault(),onDismiss:p},x.createElement(n4,ge({"data-state":s.stateAttribute},u,a,{ref:t,style:{...a.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)"}}),x.createElement(b1,null,r),x.createElement(y4,{scope:n,isInside:!0},x.createElement(i4,{id:s.contentId,role:"tooltip"},o||r))))}),w4="TooltipArrow",x4=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ws(n);return v4(w4,n).isInside?null:x.createElement(r4,ge({},o,r,{ref:t}))});function b4(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function k4(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function S4(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function C4(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(u-a)*(r-s)/(p-s)+a&&(o=!o)}return o}function E4(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),P4(t)}function P4(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const O4=u4,T4=p4,A4=f4,Ev=m4,$4=x4,bs=A4;function Bi({children:e}){return L.jsx(O4,{children:L.jsx(T4,{children:e})})}Bi.displayName="ToolTip";const Ui=x.forwardRef(({className:e,children:t,sideOffset:n=0,arrowClassName:r,...o},i)=>L.jsx(Ev,{ref:i,sideOffset:n,dir:"auto",className:Tn("opencopilot-text-primary opencopilot-font-medium opencopilot-px-2 opencopilot-bg-accent opencopilot-z-[50000] opencopilot-py-1 opencopilot-overflow-hidden opencopilot-shadow opencopilot-min-w-fit opencopilot-max-w-[15rem] opencopilot-select-none opencopilot-rounded-sm opencopilot-p-0.5 opencopilot-text-xs opencopilot-leading-none","opencopilot-animate-in opencopilot-fade-in-0 opencopilot-slide-in-from-bottom-5 data-[state=closed]:animate-out data-[state=closed]:opencopilot-slide-in-from-top-0",e),...o,children:L.jsxs(L.Fragment,{children:[t,L.jsx($4,{className:Tn("opencopilot-fill-current opencopilot-text-accent opencopilot-animate-in opencopilot-slide-in-from-top-1 opencopilot-ease-out data-[state=closed]:opencopilot-animate-out",r)})]})}));Ui.displayName=Ev.displayName;function xf({text:e,every:t,onFinish:n,shouldStart:r=!0}){const[o,i]=x.useState(""),[l,a]=x.useState(0),[s,u]=x.useState(!1),p=t||1e-5;return x.useEffect(()=>{if(r)if(l{i(e.substring(0,l+1)),a(d=>d+1)},p);return()=>{clearInterval(c)}}else u(!0),typeof n=="function"&&n()},[e,l,p,n,r]),{displayText:o,isComplete:s,text:e}}const Sm=["http","https","mailto","tel"];function _4(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let o=-1;for(;++oo||(o=t.indexOf("#"),o!==-1&&r>o)?t:"javascript:void(0)"}/*! +`])));var Yh,Qh,Kh,Xh=globalThis&&globalThis.__assign||function(){return Xh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:a,onDismiss:s,...u}=e,p=x.useContext(ZE),[c,d]=x.useState(null),f=(n=c==null?void 0:c.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=x.useState({}),m=en(t,T=>d(T)),w=Array.from(p.layers),[g]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(g),v=c?w.indexOf(c):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,k=e5(T=>{const N=T.target,P=[...p.branches].some(_=>_.contains(N));!E||P||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),O=t5(T=>{const N=T.target;[...p.branches].some(_=>_.contains(N))||(l==null||l(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return S1(T=>{v===p.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),x.useEffect(()=>{if(c)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(pm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(c)),p.layers.add(c),fm(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=pm)}},[c,f,r,p]),x.useEffect(()=>()=>{c&&(p.layers.delete(c),p.layersWithOutsidePointerEventsDisabled.delete(c),fm())},[c,p]),x.useEffect(()=>{const T=()=>h({});return document.addEventListener(Dc,T),()=>document.removeEventListener(Dc,T)},[]),x.createElement(Tt.div,ge({},u,{ref:m,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Xe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Xe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Xe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function e5(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let p=function(){sv(KE,n,u,{discrete:!0})};var s=p;const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=p,t.addEventListener("click",o.current,{once:!0})):p()}r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function t5(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!r.current&&sv(XE,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fm(){const e=new CustomEvent(Dc);document.dispatchEvent(e)}function sv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?k1(o,i):o.dispatchEvent(i)}const n5=["top","right","bottom","left"],ir=Math.min,xt=Math.max,va=Math.round,vl=Math.floor,lr=e=>({x:e,y:e}),r5={left:"right",right:"left",bottom:"top",top:"bottom"},o5={start:"end",end:"start"};function zc(e,t,n){return xt(e,ir(t,n))}function An(e,t){return typeof e=="function"?e(t):e}function $n(e){return e.split("-")[0]}function Po(e){return e.split("-")[1]}function ff(e){return e==="x"?"y":"x"}function df(e){return e==="y"?"height":"width"}function Oo(e){return["top","bottom"].includes($n(e))?"y":"x"}function hf(e){return ff(Oo(e))}function i5(e,t,n){n===void 0&&(n=!1);const r=Po(e),o=hf(e),i=df(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=wa(l)),[l,wa(l)]}function l5(e){const t=wa(e);return[Nc(e),t,Nc(t)]}function Nc(e){return e.replace(/start|end/g,t=>o5[t])}function a5(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}function s5(e,t,n,r){const o=Po(e);let i=a5($n(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Nc)))),i}function wa(e){return e.replace(/left|right|bottom|top/g,t=>r5[t])}function u5(e){return{top:0,right:0,bottom:0,left:0,...e}}function uv(e){return typeof e!="number"?u5(e):{top:e,right:e,bottom:e,left:e}}function xa(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function dm(e,t,n){let{reference:r,floating:o}=e;const i=Oo(t),l=hf(t),a=df(l),s=$n(t),u=i==="y",p=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let f;switch(s){case"top":f={x:p,y:r.y-o.height};break;case"bottom":f={x:p,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:c};break;case"left":f={x:r.x-o.width,y:c};break;default:f={x:r.x,y:r.y}}switch(Po(t)){case"start":f[l]-=d*(n&&u?-1:1);break;case"end":f[l]+=d*(n&&u?-1:1);break}return f}const c5=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:c}=dm(u,r,s),d=r,f={},h=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:a}=t,{element:s,padding:u=0}=An(e,t)||{};if(s==null)return{};const p=uv(u),c={x:n,y:r},d=hf(o),f=df(d),h=await l.getDimensions(s),m=d==="y",w=m?"top":"left",g=m?"bottom":"right",y=m?"clientHeight":"clientWidth",v=i.reference[f]+i.reference[d]-c[d]-i.floating[f],C=c[d]-i.reference[d],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(s));let k=E?E[y]:0;(!k||!await(l.isElement==null?void 0:l.isElement(E)))&&(k=a.floating[y]||i.floating[f]);const O=v/2-C/2,T=k/2-h[f]/2-1,N=ir(p[w],T),P=ir(p[g],T),_=N,R=k-h[f]-P,H=k/2-h[f]/2+O,q=zc(_,H,R),Q=Po(o)!=null&&H!=q&&i.reference[f]/2-(H<_?N:P)-h[f]/2<0?H<_?_-H:R-H:0;return{[d]:c[d]-Q,data:{[d]:q,centerOffset:H-q+Q}}}}),p5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:s}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:c,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...m}=An(e,t),w=$n(r),g=$n(l)===l,y=await(a.isRTL==null?void 0:a.isRTL(s.floating)),v=c||(g||!h?[wa(l)]:l5(l));!c&&f!=="none"&&v.push(...s5(l,h,f,y));const C=[l,...v],E=await Ti(t,m),k=[];let O=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&k.push(E[w]),p){const _=i5(r,i,y);k.push(E[_[0]],E[_[1]])}if(O=[...O,{placement:r,overflows:k}],!k.every(_=>_<=0)){var T,N;const _=(((T=o.flip)==null?void 0:T.index)||0)+1,R=C[_];if(R)return{data:{index:_,overflows:O},reset:{placement:R}};let H=(N=O.filter(q=>q.overflows[0]<=0).sort((q,W)=>q.overflows[1]-W.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(d){case"bestFit":{var P;const q=(P=O.map(W=>[W.placement,W.overflows.filter(Q=>Q>0).reduce((Q,te)=>Q+te,0)]).sort((W,Q)=>W[1]-Q[1])[0])==null?void 0:P[0];q&&(H=q);break}case"initialPlacement":H=l;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function mm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gm(e){return n5.some(t=>e[t]>=0)}const f5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=An(e,t);switch(r){case"referenceHidden":{const i=await Ti(t,{...o,elementContext:"reference"}),l=mm(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:gm(l)}}}case"escaped":{const i=await Ti(t,{...o,altBoundary:!0}),l=mm(i,n.floating);return{data:{escapedOffsets:l,escaped:gm(l)}}}default:return{}}}}};async function d5(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=$n(n),a=Po(n),s=Oo(n)==="y",u=["left","top"].includes(l)?-1:1,p=i&&s?-1:1,c=An(t,e);let{mainAxis:d,crossAxis:f,alignmentAxis:h}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof h=="number"&&(f=a==="end"?h*-1:h),s?{x:f*p,y:d*u}:{x:d*u,y:f*p}}const h5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await d5(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},m5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:w=>{let{x:g,y}=w;return{x:g,y}}},...s}=An(e,t),u={x:n,y:r},p=await Ti(t,s),c=Oo($n(o)),d=ff(c);let f=u[d],h=u[c];if(i){const w=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=f+p[w],v=f-p[g];f=zc(y,f,v)}if(l){const w=c==="y"?"top":"left",g=c==="y"?"bottom":"right",y=h+p[w],v=h-p[g];h=zc(y,h,v)}const m=a.fn({...t,[d]:f,[c]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},g5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:s=!0,crossAxis:u=!0}=An(e,t),p={x:n,y:r},c=Oo(o),d=ff(c);let f=p[d],h=p[c];const m=An(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(s){const v=d==="y"?"height":"width",C=i.reference[d]-i.floating[v]+w.mainAxis,E=i.reference[d]+i.reference[v]-w.mainAxis;fE&&(f=E)}if(u){var g,y;const v=d==="y"?"width":"height",C=["top","left"].includes($n(o)),E=i.reference[c]-i.floating[v]+(C&&((g=l.offset)==null?void 0:g[c])||0)+(C?0:w.crossAxis),k=i.reference[c]+i.reference[v]+(C?0:((y=l.offset)==null?void 0:y[c])||0)-(C?w.crossAxis:0);hk&&(h=k)}return{[d]:f,[c]:h}}}},y5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:l=()=>{},...a}=An(e,t),s=await Ti(t,a),u=$n(n),p=Po(n),c=Oo(n)==="y",{width:d,height:f}=r.floating;let h,m;u==="top"||u==="bottom"?(h=u,m=p===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=u,h=p==="end"?"top":"bottom");const w=f-s[h],g=d-s[m],y=!t.middlewareData.shift;let v=w,C=g;if(c){const k=d-s.left-s.right;C=p||y?ir(g,k):k}else{const k=f-s.top-s.bottom;v=p||y?ir(w,k):k}if(y&&!p){const k=xt(s.left,0),O=xt(s.right,0),T=xt(s.top,0),N=xt(s.bottom,0);c?C=d-2*(k!==0||O!==0?k+O:xt(s.left,s.right)):v=f-2*(T!==0||N!==0?T+N:xt(s.top,s.bottom))}await l({...t,availableWidth:C,availableHeight:v});const E=await o.getDimensions(i.floating);return d!==E.width||f!==E.height?{reset:{rects:!0}}:{}}}};function ar(e){return cv(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ln(e){var t;return(t=(cv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cv(e){return e instanceof Node||e instanceof St(e).Node}function _n(e){return e instanceof Element||e instanceof St(e).Element}function cn(e){return e instanceof HTMLElement||e instanceof St(e).HTMLElement}function ym(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}function Bi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function v5(e){return["table","td","th"].includes(ar(e))}function mf(e){const t=gf(),n=Ft(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 w5(e){let t=bo(e);for(;cn(t)&&!gs(t);){if(mf(t))return t;t=bo(t)}return null}function gf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gs(e){return["html","body","#document"].includes(ar(e))}function Ft(e){return St(e).getComputedStyle(e)}function ys(e){return _n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function bo(e){if(ar(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ym(e)&&e.host||Ln(e);return ym(t)?t.host:t}function pv(e){const t=bo(e);return gs(t)?e.ownerDocument?e.ownerDocument.body:e.body:cn(t)&&Bi(t)?t:pv(t)}function ba(e,t){var n;t===void 0&&(t=[]);const r=pv(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=St(r);return o?t.concat(i,i.visualViewport||[],Bi(r)?r:[]):t.concat(r,ba(r))}function fv(e){const t=Ft(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=cn(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=va(n)!==i||va(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function yf(e){return _n(e)?e:e.contextElement}function ao(e){const t=yf(e);if(!cn(t))return lr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fv(t);let l=(i?va(n.width):n.width)/r,a=(i?va(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const x5=lr(0);function dv(e){const t=St(e);return!gf()||!t.visualViewport?x5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function b5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==St(e)?!1:t}function Ar(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=yf(e);let l=lr(1);t&&(r?_n(r)&&(l=ao(r)):l=ao(e));const a=b5(i,n,r)?dv(i):lr(0);let s=(o.left+a.x)/l.x,u=(o.top+a.y)/l.y,p=o.width/l.x,c=o.height/l.y;if(i){const d=St(i),f=r&&_n(r)?St(r):r;let h=d.frameElement;for(;h&&r&&f!==d;){const m=ao(h),w=h.getBoundingClientRect(),g=Ft(h),y=w.left+(h.clientLeft+parseFloat(g.paddingLeft))*m.x,v=w.top+(h.clientTop+parseFloat(g.paddingTop))*m.y;s*=m.x,u*=m.y,p*=m.x,c*=m.y,s+=y,u+=v,h=St(h).frameElement}}return xa({width:p,height:c,x:s,y:u})}function k5(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=cn(n),i=Ln(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a=lr(1);const s=lr(0);if((o||!o&&r!=="fixed")&&((ar(n)!=="body"||Bi(i))&&(l=ys(n)),cn(n))){const u=Ar(n);a=ao(n),s.x=u.x+n.clientLeft,s.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+s.x,y:t.y*a.y-l.scrollTop*a.y+s.y}}function S5(e){return Array.from(e.getClientRects())}function hv(e){return Ar(Ln(e)).left+ys(e).scrollLeft}function C5(e){const t=Ln(e),n=ys(e),r=e.ownerDocument.body,o=xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+hv(e);const a=-n.scrollTop;return Ft(r).direction==="rtl"&&(l+=xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}function E5(e,t){const n=St(e),r=Ln(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const u=gf();(!u||u&&t==="fixed")&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}function P5(e,t){const n=Ar(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=cn(e)?ao(e):lr(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,s=o*i.x,u=r*i.y;return{width:l,height:a,x:s,y:u}}function vm(e,t,n){let r;if(t==="viewport")r=E5(e,n);else if(t==="document")r=C5(Ln(e));else if(_n(t))r=P5(t,n);else{const o=dv(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return xa(r)}function mv(e,t){const n=bo(e);return n===t||!_n(n)||gs(n)?!1:Ft(n).position==="fixed"||mv(n,t)}function O5(e,t){const n=t.get(e);if(n)return n;let r=ba(e).filter(a=>_n(a)&&ar(a)!=="body"),o=null;const i=Ft(e).position==="fixed";let l=i?bo(e):e;for(;_n(l)&&!gs(l);){const a=Ft(l),s=mf(l);!s&&a.position==="fixed"&&(o=null),(i?!s&&!o:!s&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Bi(l)&&!s&&mv(e,l))?r=r.filter(p=>p!==l):o=a,l=bo(l)}return t.set(e,r),r}function T5(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?O5(t,this._c):[].concat(n),r],a=l[0],s=l.reduce((u,p)=>{const c=vm(t,p,o);return u.top=xt(c.top,u.top),u.right=ir(c.right,u.right),u.bottom=ir(c.bottom,u.bottom),u.left=xt(c.left,u.left),u},vm(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function A5(e){return fv(e)}function $5(e,t,n){const r=cn(t),o=Ln(t),i=n==="fixed",l=Ar(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=lr(0);if(r||!r&&!i)if((ar(t)!=="body"||Bi(o))&&(a=ys(t)),r){const u=Ar(t,!0,i,t);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else o&&(s.x=hv(o));return{x:l.left+a.scrollLeft-s.x,y:l.top+a.scrollTop-s.y,width:l.width,height:l.height}}function wm(e,t){return!cn(e)||Ft(e).position==="fixed"?null:t?t(e):e.offsetParent}function gv(e,t){const n=St(e);if(!cn(e))return n;let r=wm(e,t);for(;r&&v5(r)&&Ft(r).position==="static";)r=wm(r,t);return r&&(ar(r)==="html"||ar(r)==="body"&&Ft(r).position==="static"&&!mf(r))?n:r||w5(e)||n}const _5=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||gv,i=this.getDimensions;return{reference:$5(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function R5(e){return Ft(e).direction==="rtl"}const L5={convertOffsetParentRelativeRectToViewportRelativeRect:k5,getDocumentElement:Ln,getClippingRect:T5,getOffsetParent:gv,getElementRects:_5,getClientRects:S5,getDimensions:A5,getScale:ao,isElement:_n,isRTL:R5};function D5(e,t){let n=null,r;const o=Ln(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),i();const{left:u,top:p,width:c,height:d}=e.getBoundingClientRect();if(a||t(),!c||!d)return;const f=vl(p),h=vl(o.clientWidth-(u+c)),m=vl(o.clientHeight-(p+d)),w=vl(u),y={rootMargin:-f+"px "+-h+"px "+-m+"px "+-w+"px",threshold:xt(0,ir(1,s))||1};let v=!0;function C(E){const k=E[0].intersectionRatio;if(k!==s){if(!v)return l();k?l(!1,k):r=setTimeout(()=>{l(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(C,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return l(!0),i}function z5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=yf(e),p=o||i?[...u?ba(u):[],...ba(t)]:[];p.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const c=u&&a?D5(u,n):null;let d=-1,f=null;l&&(f=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),u&&!s&&f.observe(u),f.observe(t));let h,m=s?Ar(e):null;s&&w();function w(){const g=Ar(e);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,h=requestAnimationFrame(w)}return n(),()=>{p.forEach(g=>{o&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),c&&c(),f&&f.disconnect(),f=null,s&&cancelAnimationFrame(h)}}const N5=(e,t,n)=>{const r=new Map,o={platform:L5,...n},i={...o.platform,_c:r};return c5(e,t,{...o,platform:i})},I5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hm({element:r.current,padding:o}).fn(n):{}:r?hm({element:r,padding:o}).fn(n):{}}}};var Ul=typeof document<"u"?x.useLayoutEffect:x.useEffect;function ka(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ka(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ka(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function yv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xm(e,t){const n=yv(e);return Math.round(t*n)/n}function bm(e){const t=x.useRef(e);return Ul(()=>{t.current=e}),t}function F5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:a=!0,whileElementsMounted:s,open:u}=e,[p,c]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=x.useState(r);ka(d,r)||f(r);const[h,m]=x.useState(null),[w,g]=x.useState(null),y=x.useCallback(Q=>{Q!=k.current&&(k.current=Q,m(Q))},[m]),v=x.useCallback(Q=>{Q!==O.current&&(O.current=Q,g(Q))},[g]),C=i||h,E=l||w,k=x.useRef(null),O=x.useRef(null),T=x.useRef(p),N=bm(s),P=bm(o),_=x.useCallback(()=>{if(!k.current||!O.current)return;const Q={placement:t,strategy:n,middleware:d};P.current&&(Q.platform=P.current),N5(k.current,O.current,Q).then(te=>{const z={...te,isPositioned:!0};R.current&&!ka(T.current,z)&&(T.current=z,Ua.flushSync(()=>{c(z)}))})},[d,t,n,P]);Ul(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,c(Q=>({...Q,isPositioned:!1})))},[u]);const R=x.useRef(!1);Ul(()=>(R.current=!0,()=>{R.current=!1}),[]),Ul(()=>{if(C&&(k.current=C),E&&(O.current=E),C&&E){if(N.current)return N.current(C,E,_);_()}},[C,E,_,N]);const H=x.useMemo(()=>({reference:k,floating:O,setReference:y,setFloating:v}),[y,v]),q=x.useMemo(()=>({reference:C,floating:E}),[C,E]),W=x.useMemo(()=>{const Q={position:n,left:0,top:0};if(!q.floating)return Q;const te=xm(q.floating,p.x),z=xm(q.floating,p.y);return a?{...Q,transform:"translate("+te+"px, "+z+"px)",...yv(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:z}},[n,a,q.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:_,refs:H,elements:q,floatingStyles:W}),[p,_,H,q,W])}const j5=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return x.createElement(Tt.svg,ge({},i,{ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:x.createElement("polygon",{points:"0,0 30,0 15,10"}))}),M5=j5;function B5(e){const[t,n]=x.useState(void 0);return vo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,a;if("borderBoxSize"in i){const s=i.borderBoxSize,u=Array.isArray(s)?s[0]:s;l=u.inlineSize,a=u.blockSize}else l=e.offsetWidth,a=e.offsetHeight;n({width:l,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const vv="Popper",[wv,xv]=Qp(vv),[U5,bv]=wv(vv),H5=e=>{const{__scopePopper:t,children:n}=e,[r,o]=x.useState(null);return x.createElement(U5,{scope:t,anchor:r,onAnchorChange:o},n)},W5="PopperAnchor",V5=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=bv(W5,n),l=x.useRef(null),a=en(t,l);return x.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:x.createElement(Tt.div,ge({},o,{ref:a}))}),kv="PopperContent",[G5,q5]=wv(kv),Y5=x.forwardRef((e,t)=>{var n,r,o,i,l,a,s,u;const{__scopePopper:p,side:c="bottom",sideOffset:d=0,align:f="center",alignOffset:h=0,arrowPadding:m=0,collisionBoundary:w=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:v=!1,avoidCollisions:C=!0,onPlaced:E,...k}=e,O=bv(kv,p),[T,N]=x.useState(null),P=en(t,Be=>N(Be)),[_,R]=x.useState(null),H=B5(_),q=(n=H==null?void 0:H.width)!==null&&n!==void 0?n:0,W=(r=H==null?void 0:H.height)!==null&&r!==void 0?r:0,Q=c+(f!=="center"?"-"+f:""),te=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},z=Array.isArray(w)?w:[w],G=z.length>0,S={padding:te,boundary:z.filter(Z5),altBoundary:G},{refs:X,floatingStyles:I,placement:b,isPositioned:U,middlewareData:Y}=F5({strategy:"fixed",placement:Q,whileElementsMounted:z5,elements:{reference:O.anchor},middleware:[h5({mainAxis:d+W,alignmentAxis:h}),C&&m5({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?g5():void 0,...S}),C&&p5({...S}),y5({...S,apply:({elements:Be,rects:se,availableWidth:Fe,availableHeight:fe})=>{const{width:ze,height:hn}=se.reference,Ee=Be.floating.style;Ee.setProperty("--radix-popper-available-width",`${Fe}px`),Ee.setProperty("--radix-popper-available-height",`${fe}px`),Ee.setProperty("--radix-popper-anchor-width",`${ze}px`),Ee.setProperty("--radix-popper-anchor-height",`${hn}px`)}}),_&&I5({element:_,padding:m}),J5({arrowWidth:q,arrowHeight:W}),v&&f5({strategy:"referenceHidden"})]}),[A,ne]=Sv(b),B=un(E);vo(()=>{U&&(B==null||B())},[U,B]);const ye=(o=Y.arrow)===null||o===void 0?void 0:o.x,ie=(i=Y.arrow)===null||i===void 0?void 0:i.y,pe=((l=Y.arrow)===null||l===void 0?void 0:l.centerOffset)!==0,[J,Ie]=x.useState();return vo(()=>{T&&Ie(window.getComputedStyle(T).zIndex)},[T]),x.createElement("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:U?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(a=Y.transformOrigin)===null||a===void 0?void 0:a.x,(s=Y.transformOrigin)===null||s===void 0?void 0:s.y].join(" ")},dir:e.dir},x.createElement(G5,{scope:p,placedSide:A,onArrowChange:R,arrowX:ye,arrowY:ie,shouldHideArrow:pe},x.createElement(Tt.div,ge({"data-side":A,"data-align":ne},k,{ref:P,style:{...k.style,animation:U?void 0:"none",opacity:(u=Y.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))}),Q5="PopperArrow",K5={top:"bottom",right:"left",bottom:"top",left:"right"},X5=x.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=q5(Q5,r),l=K5[i.placedSide];return x.createElement("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},x.createElement(M5,ge({},o,{ref:n,style:{...o.style,display:"block"}})))});function Z5(e){return e!==null}const J5=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,l;const{placement:a,rects:s,middlewareData:u}=t,c=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,m]=Sv(a),w={start:"0%",center:"50%",end:"100%"}[m],g=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+d/2,y=((i=(l=u.arrow)===null||l===void 0?void 0:l.y)!==null&&i!==void 0?i:0)+f/2;let v="",C="";return h==="bottom"?(v=c?w:`${g}px`,C=`${-f}px`):h==="top"?(v=c?w:`${g}px`,C=`${s.floating.height+f}px`):h==="right"?(v=`${-f}px`,C=c?w:`${y}px`):h==="left"&&(v=`${s.floating.width+f}px`,C=c?w:`${y}px`),{data:{x:v,y:C}}}});function Sv(e){const[t,n="center"]=e.split("-");return[t,n]}const e4=H5,t4=V5,n4=Y5,r4=X5,o4=x.forwardRef((e,t)=>x.createElement(Tt.span,ge({},e,{ref:t,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",...e.style}}))),i4=o4,[vs,g_]=Qp("Tooltip",[xv]),ws=xv(),l4="TooltipProvider",a4=700,Ic="tooltip.open",[s4,vf]=vs(l4),u4=e=>{const{__scopeTooltip:t,delayDuration:n=a4,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[l,a]=x.useState(!0),s=x.useRef(!1),u=x.useRef(0);return x.useEffect(()=>{const p=u.current;return()=>window.clearTimeout(p)},[]),x.createElement(s4,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:x.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:x.useCallback(p=>{s.current=p},[]),disableHoverableContent:o},i)},wf="Tooltip",[c4,xs]=vs(wf),p4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:a}=e,s=vf(wf,e.__scopeTooltip),u=ws(t),[p,c]=x.useState(null),d=Fl(),f=x.useRef(0),h=l??s.disableHoverableContent,m=a??s.delayDuration,w=x.useRef(!1),[g=!1,y]=x1({prop:r,defaultProp:o,onChange:O=>{O?(s.onOpen(),document.dispatchEvent(new CustomEvent(Ic))):s.onClose(),i==null||i(O)}}),v=x.useMemo(()=>g?w.current?"delayed-open":"instant-open":"closed",[g]),C=x.useCallback(()=>{window.clearTimeout(f.current),w.current=!1,y(!0)},[y]),E=x.useCallback(()=>{window.clearTimeout(f.current),y(!1)},[y]),k=x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{w.current=!0,y(!0)},m)},[m,y]);return x.useEffect(()=>()=>window.clearTimeout(f.current),[]),x.createElement(e4,u,x.createElement(c4,{scope:t,contentId:d,open:g,stateAttribute:v,trigger:p,onTriggerChange:c,onTriggerEnter:x.useCallback(()=>{s.isOpenDelayed?k():C()},[s.isOpenDelayed,k,C]),onTriggerLeave:x.useCallback(()=>{h?E():window.clearTimeout(f.current)},[E,h]),onOpen:C,onClose:E,disableHoverableContent:h},n))},km="TooltipTrigger",f4=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xs(km,n),i=vf(km,n),l=ws(n),a=x.useRef(null),s=en(t,a,o.onTriggerChange),u=x.useRef(!1),p=x.useRef(!1),c=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),x.createElement(t4,ge({asChild:!0},l),x.createElement(Tt.button,ge({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:s,onPointerMove:Xe(e.onPointerMove,d=>{d.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Xe(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Xe(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:Xe(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Xe(e.onBlur,o.onClose),onClick:Xe(e.onClick,o.onClose)})))}),d4="TooltipPortal",[y_,h4]=vs(d4,{forceMount:void 0}),Ai="TooltipContent",m4=x.forwardRef((e,t)=>{const n=h4(Ai,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,l=xs(Ai,e.__scopeTooltip);return x.createElement(Ya,{present:r||l.open},l.disableHoverableContent?x.createElement(Cv,ge({side:o},i,{ref:t})):x.createElement(g4,ge({side:o},i,{ref:t})))}),g4=x.forwardRef((e,t)=>{const n=xs(Ai,e.__scopeTooltip),r=vf(Ai,e.__scopeTooltip),o=x.useRef(null),i=en(t,o),[l,a]=x.useState(null),{trigger:s,onClose:u}=n,p=o.current,{onPointerInTransitChange:c}=r,d=x.useCallback(()=>{a(null),c(!1)},[c]),f=x.useCallback((h,m)=>{const w=h.currentTarget,g={x:h.clientX,y:h.clientY},y=b4(g,w.getBoundingClientRect()),v=k4(g,y),C=S4(m.getBoundingClientRect()),E=E4([...v,...C]);a(E),c(!0)},[c]);return x.useEffect(()=>()=>d(),[d]),x.useEffect(()=>{if(s&&p){const h=w=>f(w,p),m=w=>f(w,s);return s.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{s.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[s,p,f,d]),x.useEffect(()=>{if(l){const h=m=>{const w=m.target,g={x:m.clientX,y:m.clientY},y=(s==null?void 0:s.contains(w))||(p==null?void 0:p.contains(w)),v=!C4(g,l);y?d():v&&(d(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[s,p,l,u,d]),x.createElement(Cv,ge({},e,{ref:i}))}),[y4,v4]=vs(wf,{isInside:!1}),Cv=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:l,...a}=e,s=xs(Ai,n),u=ws(n),{onClose:p}=s;return x.useEffect(()=>(document.addEventListener(Ic,p),()=>document.removeEventListener(Ic,p)),[p]),x.useEffect(()=>{if(s.trigger){const c=d=>{const f=d.target;f!=null&&f.contains(s.trigger)&&p()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[s.trigger,p]),x.createElement(JE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c=>c.preventDefault(),onDismiss:p},x.createElement(n4,ge({"data-state":s.stateAttribute},u,a,{ref:t,style:{...a.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)"}}),x.createElement(b1,null,r),x.createElement(y4,{scope:n,isInside:!0},x.createElement(i4,{id:s.contentId,role:"tooltip"},o||r))))}),w4="TooltipArrow",x4=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ws(n);return v4(w4,n).isInside?null:x.createElement(r4,ge({},o,r,{ref:t}))});function b4(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function k4(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function S4(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function C4(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(u-a)*(r-s)/(p-s)+a&&(o=!o)}return o}function E4(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),P4(t)}function P4(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const O4=u4,T4=p4,A4=f4,Ev=m4,$4=x4,bs=A4;function Ui({children:e}){return L.jsx(O4,{children:L.jsx(T4,{children:e})})}Ui.displayName="ToolTip";const Hi=x.forwardRef(({className:e,children:t,sideOffset:n=0,arrowClassName:r,...o},i)=>L.jsx(Ev,{ref:i,sideOffset:n,dir:"auto",className:Tn("opencopilot-text-primary opencopilot-font-medium opencopilot-px-2 opencopilot-bg-accent opencopilot-z-[50000] opencopilot-py-1 opencopilot-overflow-hidden opencopilot-shadow opencopilot-min-w-fit opencopilot-max-w-[15rem] opencopilot-select-none opencopilot-rounded-sm opencopilot-p-0.5 opencopilot-text-xs opencopilot-leading-none","opencopilot-animate-in opencopilot-fade-in-0 opencopilot-slide-in-from-bottom-5 data-[state=closed]:animate-out data-[state=closed]:opencopilot-slide-in-from-top-0",e),...o,children:L.jsxs(L.Fragment,{children:[t,L.jsx($4,{className:Tn("opencopilot-fill-current opencopilot-text-accent opencopilot-animate-in opencopilot-slide-in-from-top-1 opencopilot-ease-out data-[state=closed]:opencopilot-animate-out",r)})]})}));Hi.displayName=Ev.displayName;function xf({text:e,every:t,onFinish:n,shouldStart:r=!0}){const[o,i]=x.useState(""),[l,a]=x.useState(0),[s,u]=x.useState(!1),p=t||1e-5;return x.useEffect(()=>{if(r)if(l{i(e.substring(0,l+1)),a(d=>d+1)},p);return()=>{clearInterval(c)}}else u(!0),typeof n=="function"&&n()},[e,l,p,n,r]),{displayText:o,isComplete:s,text:e}}const Sm=["http","https","mailto","tel"];function _4(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let o=-1;for(;++oo||(o=t.indexOf("#"),o!==-1&&r>o)?t:"javascript:void(0)"}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT - */var R4=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const Pv=_r(R4);function li(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cm(e.position):"start"in e||"end"in e?Cm(e):"line"in e||"column"in e?Fc(e):""}function Fc(e){return Em(e&&e.line)+":"+Em(e&&e.column)}function Cm(e){return Fc(e&&e.start)+"-"+Fc(e&&e.end)}function Em(e){return e&&typeof e=="number"?e:1}class Mt extends Error{constructor(t,n,r){const o=[null,null];let i={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const l=r.indexOf(":");l===-1?o[1]=r:(o[0]=r.slice(0,l),o[1]=r.slice(l+1))}n&&("type"in n||"position"in n?n.position&&(i=n.position):"start"in n||"end"in n?i=n:("line"in n||"column"in n)&&(i.start=n)),this.name=li(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=i.start.line,this.column=i.start.column,this.position=i,this.source=o[0],this.ruleId=o[1],this.file,this.actual,this.expected,this.url,this.note}}Mt.prototype.file="";Mt.prototype.name="";Mt.prototype.reason="";Mt.prototype.message="";Mt.prototype.stack="";Mt.prototype.fatal=null;Mt.prototype.column=null;Mt.prototype.line=null;Mt.prototype.source=null;Mt.prototype.ruleId=null;Mt.prototype.position=null;const rn={basename:L4,dirname:D4,extname:z4,join:N4,sep:"/"};function L4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hi(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.charCodeAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,a=t.length-1;for(;o--;)if(e.charCodeAt(o)===47){if(i){n=o+1;break}}else l<0&&(i=!0,l=o+1),a>-1&&(e.charCodeAt(o)===t.charCodeAt(a--)?a<0&&(r=o):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function D4(e){if(Hi(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function z4(e){Hi(e);let t=e.length,n=-1,r=0,o=-1,i=0,l;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function N4(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function F4(e,t){let n="",r=0,o=-1,i=0,l=-1,a,s;for(;++l<=e.length;){if(l2){if(s=n.lastIndexOf("/"),s!==n.length-1){s<0?(n="",r=0):(n=n.slice(0,s),r=n.length-1-n.lastIndexOf("/")),o=l,i=0;continue}}else if(n.length>0){n="",r=0,o=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,i=0}else a===46&&i>-1?i++:i=-1}return n}function Hi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const j4={cwd:M4};function M4(){return"/"}function jc(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function B4(e){if(typeof e=="string")e=new URL(e);else if(!jc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return U4(e)}function U4(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||Ul.call(t,o)},Rm=function(t,n){Tm&&n.name==="__proto__"?Tm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Lm=function(t,n){if(n==="__proto__")if(Ul.call(t,n)){if(Am)return Am(t,n).value}else return;return t[n]},W4=function e(){var t,n,r,o,i,l,a=arguments[0],s=1,u=arguments.length,p=!1;for(typeof a=="boolean"&&(p=a,a=arguments[1]||{},s=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});sl.length;let s;a&&l.push(o);try{s=e.apply(this,l)}catch(u){const p=u;if(a&&n)throw p;return o(p)}a||(s instanceof Promise?s.then(i,o):s instanceof Error?o(s):i(s))}function o(l,...a){n||(n=!0,t(l,...a))}function i(l){o(null,l)}}const q4=$v().freeze(),Av={}.hasOwnProperty;function $v(){const e=V4(),t=[];let n={},r,o=-1;return i.data=l,i.Parser=void 0,i.Compiler=void 0,i.freeze=a,i.attachers=t,i.use=s,i.parse=u,i.stringify=p,i.run=c,i.runSync=d,i.process=f,i.processSync=h,i;function i(){const m=$v();let w=-1;for(;++w{if(k||!O||!T)E(k);else{const N=i.stringify(O,T);N==null||(K4(N)?T.value=N:T.result=N),E(k,T)}});function E(k,O){k||!O?v(k):y?y(O):w(null,O)}}}function h(m){let w;i.freeze(),hu("processSync",i.Parser),mu("processSync",i.Compiler);const g=Wo(m);return i.process(g,y),Im("processSync","process",w),g;function y(v){w=!0,Om(v)}}}function zm(e,t){return typeof e=="function"&&e.prototype&&(Y4(e.prototype)||t in e.prototype)}function Y4(e){let t;for(t in e)if(Av.call(e,t))return!0;return!1}function hu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function mu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function gu(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Nm(e){if(!Mc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Im(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wo(e){return Q4(e)?e:new Ov(e)}function Q4(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function K4(e){return typeof e=="string"||Pv(e)}const X4={};function Z4(e,t){const n=t||X4,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return _v(e,r,o)}function _v(e,t,n){if(J4(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fm(e.children,t,n)}return Array.isArray(e)?Fm(e,t,n):""}function Fm(e,t,n){const r=[];let o=-1;for(;++oo?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i0?(Ct(e,e.length,0,t),e):t}const jm={}.hasOwnProperty;function Rv(e){const t={};let n=-1;for(;++nl))return;const O=t.events.length;let T=O,N,P;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(N){P=t.events[T][1].end;break}N=!0}for(g(r),k=O;kv;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function y(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function cP(e,t,n){return de(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sa(e){if(e===null||Se(e)||$r(e))return 1;if(ks(e))return 2}function Ss(e,t,n){const r=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c=Object.assign({},e[r][1].end),d=Object.assign({},e[n][1].start);Bm(c,-s),Bm(d,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:Object.assign({},e[r][1].end)},a={type:s>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:d},i={type:s>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:s>1?"strong":"emphasis",start:Object.assign({},l.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},l.start),e[n][1].start=Object.assign({},a.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rt(u,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",i,t]]),u=Rt(u,Ss(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rt(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=Rt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ct(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n0&&ae(k)?de(e,y,"linePrefix",i+1)(k):y(k)}function y(k){return k===null||K(k)?e.check(Hm,m,C)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||K(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),v)}function C(k){return e.exit("codeFenced"),t(k)}function E(k,O,T){let N=0;return P;function P(W){return k.enter("lineEnding"),k.consume(W),k.exit("lineEnding"),_}function _(W){return k.enter("codeFencedFence"),ae(W)?de(k,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):R(W)}function R(W){return W===a?(k.enter("codeFencedFenceSequence"),H(W)):T(W)}function H(W){return W===a?(N++,k.consume(W),H):N>=l?(k.exit("codeFencedFenceSequence"),ae(W)?de(k,q,"whitespace")(W):q(W)):T(W)}function q(W){return W===null||K(W)?(k.exit("codeFencedFence"),O(W)):T(W)}}}function kP(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const yu={name:"codeIndented",tokenize:CP},SP={tokenize:EP,partial:!0};function CP(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),de(e,i,"linePrefix",4+1)(u)}function i(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):K(u)?e.attempt(SP,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||K(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function EP(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):K(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):de(e,i,"linePrefix",4+1)(l)}function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):K(l)?o(l):n(l)}}const PP={name:"codeText",tokenize:AP,resolve:OP,previous:TP};function OP(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Iv(e,t,n,r,o,i,l,a,s){const u=s||Number.POSITIVE_INFINITY;let p=0;return c;function c(g){return g===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(g),e.exit(i),d):g===null||g===32||g===41||ka(g)?n(g):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function d(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===62?(e.exit("chunkString"),e.exit(a),d(g)):g===null||g===60||K(g)?n(g):(e.consume(g),g===92?h:f)}function h(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!p&&(g===null||g===41||Se(g))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(g)):p999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(i),e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):K(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||K(f)||a++>999?(e.exit("chunkString"),p(f)):(e.consume(f),s||(s=!ae(f)),f===92?d:c)}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function jv(e,t,n,r,o,i){let l;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(o),e.consume(d),e.exit(o),l=d===40?41:d,s):n(d)}function s(d){return d===l?(e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):(e.enter(i),u(d))}function u(d){return d===l?(e.exit(i),s(l)):d===null?n(d):K(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),de(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(d))}function p(d){return d===l||d===null||K(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?c:p)}function c(d){return d===l||d===92?(e.consume(d),p):p(d)}}function ai(e,t){let n;return r;function r(o){return K(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ae(o)?de(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}function Zt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const NP={name:"definition",tokenize:FP},IP={tokenize:jP,partial:!0};function FP(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),l(f)}function l(f){return Fv.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return o=Zt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return Se(f)?ai(e,u)(f):u(f)}function u(f){return Iv(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function p(f){return e.attempt(IP,c,c)(f)}function c(f){return ae(f)?de(e,d,"whitespace")(f):d(f)}function d(f){return f===null||K(f)?(e.exit("definition"),r.parser.defined.push(o),t(f)):n(f)}}function jP(e,t,n){return r;function r(a){return Se(a)?ai(e,o)(a):n(a)}function o(a){return jv(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ae(a)?de(e,l,"whitespace")(a):l(a)}function l(a){return a===null||K(a)?t(a):n(a)}}const MP={name:"hardBreakEscape",tokenize:BP};function BP(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return K(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const UP={name:"headingAtx",tokenize:WP,resolve:HP};function HP(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ct(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function WP(e,t,n){let r=0;return o;function o(p){return e.enter("atxHeading"),i(p)}function i(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Se(p)?(e.exit("atxHeadingSequence"),a(p)):n(p)}function a(p){return p===35?(e.enter("atxHeadingSequence"),s(p)):p===null||K(p)?(e.exit("atxHeading"),t(p)):ae(p)?de(e,a,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function s(p){return p===35?(e.consume(p),s):(e.exit("atxHeadingSequence"),a(p))}function u(p){return p===null||p===35||Se(p)?(e.exit("atxHeadingText"),a(p)):(e.consume(p),u)}}const VP=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Vm=["pre","script","style","textarea"],GP={name:"htmlFlow",tokenize:KP,resolveTo:QP,concrete:!0},qP={tokenize:ZP,partial:!0},YP={tokenize:XP,partial:!0};function QP(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function KP(e,t,n){const r=this;let o,i,l,a,s;return u;function u(b){return p(b)}function p(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),c}function c(b){return b===33?(e.consume(b),d):b===47?(e.consume(b),i=!0,m):b===63?(e.consume(b),o=3,r.interrupt?t:S):at(b)?(e.consume(b),l=String.fromCharCode(b),w):n(b)}function d(b){return b===45?(e.consume(b),o=2,f):b===91?(e.consume(b),o=5,a=0,h):at(b)?(e.consume(b),o=4,r.interrupt?t:S):n(b)}function f(b){return b===45?(e.consume(b),r.interrupt?t:S):n(b)}function h(b){const U="CDATA[";return b===U.charCodeAt(a++)?(e.consume(b),a===U.length?r.interrupt?t:R:h):n(b)}function m(b){return at(b)?(e.consume(b),l=String.fromCharCode(b),w):n(b)}function w(b){if(b===null||b===47||b===62||Se(b)){const U=b===47,Y=l.toLowerCase();return!U&&!i&&Vm.includes(Y)?(o=1,r.interrupt?t(b):R(b)):VP.includes(l.toLowerCase())?(o=6,U?(e.consume(b),g):r.interrupt?t(b):R(b)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):i?y(b):v(b))}return b===45||rt(b)?(e.consume(b),l+=String.fromCharCode(b),w):n(b)}function g(b){return b===62?(e.consume(b),r.interrupt?t:R):n(b)}function y(b){return ae(b)?(e.consume(b),y):P(b)}function v(b){return b===47?(e.consume(b),P):b===58||b===95||at(b)?(e.consume(b),C):ae(b)?(e.consume(b),v):P(b)}function C(b){return b===45||b===46||b===58||b===95||rt(b)?(e.consume(b),C):E(b)}function E(b){return b===61?(e.consume(b),k):ae(b)?(e.consume(b),E):v(b)}function k(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),s=b,O):ae(b)?(e.consume(b),k):T(b)}function O(b){return b===s?(e.consume(b),s=null,N):b===null||K(b)?n(b):(e.consume(b),O)}function T(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||Se(b)?E(b):(e.consume(b),T)}function N(b){return b===47||b===62||ae(b)?v(b):n(b)}function P(b){return b===62?(e.consume(b),_):n(b)}function _(b){return b===null||K(b)?R(b):ae(b)?(e.consume(b),_):n(b)}function R(b){return b===45&&o===2?(e.consume(b),Q):b===60&&o===1?(e.consume(b),te):b===62&&o===4?(e.consume(b),X):b===63&&o===3?(e.consume(b),S):b===93&&o===5?(e.consume(b),G):K(b)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(qP,I,H)(b)):b===null||K(b)?(e.exit("htmlFlowData"),H(b)):(e.consume(b),R)}function H(b){return e.check(YP,q,I)(b)}function q(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),W}function W(b){return b===null||K(b)?H(b):(e.enter("htmlFlowData"),R(b))}function Q(b){return b===45?(e.consume(b),S):R(b)}function te(b){return b===47?(e.consume(b),l="",z):R(b)}function z(b){if(b===62){const U=l.toLowerCase();return Vm.includes(U)?(e.consume(b),X):R(b)}return at(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),z):R(b)}function G(b){return b===93?(e.consume(b),S):R(b)}function S(b){return b===62?(e.consume(b),X):b===45&&o===2?(e.consume(b),S):R(b)}function X(b){return b===null||K(b)?(e.exit("htmlFlowData"),I(b)):(e.consume(b),X)}function I(b){return e.exit("htmlFlow"),t(b)}}function XP(e,t,n){const r=this;return o;function o(l){return K(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ZP(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Wi,t,n)}}const JP={name:"htmlText",tokenize:eO};function eO(e,t,n){const r=this;let o,i,l;return a;function a(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),s}function s(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),E):S===63?(e.consume(S),v):at(S)?(e.consume(S),T):n(S)}function u(S){return S===45?(e.consume(S),p):S===91?(e.consume(S),i=0,h):at(S)?(e.consume(S),y):n(S)}function p(S){return S===45?(e.consume(S),f):n(S)}function c(S){return S===null?n(S):S===45?(e.consume(S),d):K(S)?(l=c,te(S)):(e.consume(S),c)}function d(S){return S===45?(e.consume(S),f):c(S)}function f(S){return S===62?Q(S):S===45?d(S):c(S)}function h(S){const X="CDATA[";return S===X.charCodeAt(i++)?(e.consume(S),i===X.length?m:h):n(S)}function m(S){return S===null?n(S):S===93?(e.consume(S),w):K(S)?(l=m,te(S)):(e.consume(S),m)}function w(S){return S===93?(e.consume(S),g):m(S)}function g(S){return S===62?Q(S):S===93?(e.consume(S),g):m(S)}function y(S){return S===null||S===62?Q(S):K(S)?(l=y,te(S)):(e.consume(S),y)}function v(S){return S===null?n(S):S===63?(e.consume(S),C):K(S)?(l=v,te(S)):(e.consume(S),v)}function C(S){return S===62?Q(S):v(S)}function E(S){return at(S)?(e.consume(S),k):n(S)}function k(S){return S===45||rt(S)?(e.consume(S),k):O(S)}function O(S){return K(S)?(l=O,te(S)):ae(S)?(e.consume(S),O):Q(S)}function T(S){return S===45||rt(S)?(e.consume(S),T):S===47||S===62||Se(S)?N(S):n(S)}function N(S){return S===47?(e.consume(S),Q):S===58||S===95||at(S)?(e.consume(S),P):K(S)?(l=N,te(S)):ae(S)?(e.consume(S),N):Q(S)}function P(S){return S===45||S===46||S===58||S===95||rt(S)?(e.consume(S),P):_(S)}function _(S){return S===61?(e.consume(S),R):K(S)?(l=_,te(S)):ae(S)?(e.consume(S),_):N(S)}function R(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),o=S,H):K(S)?(l=R,te(S)):ae(S)?(e.consume(S),R):(e.consume(S),q)}function H(S){return S===o?(e.consume(S),o=void 0,W):S===null?n(S):K(S)?(l=H,te(S)):(e.consume(S),H)}function q(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Se(S)?N(S):(e.consume(S),q)}function W(S){return S===47||S===62||Se(S)?N(S):n(S)}function Q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function te(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),z}function z(S){return ae(S)?de(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):G(S)}function G(S){return e.enter("htmlTextData"),l(S)}}const kf={name:"labelEnd",tokenize:lO,resolveTo:iO,resolveAll:oO},tO={tokenize:aO},nO={tokenize:sO},rO={tokenize:uO};function oO(e){let t=-1;for(;++t=3&&(u===null||K(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===o?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),ae(u)?de(e,a,"whitespace")(u):a(u))}}const pt={name:"list",tokenize:vO,continuation:{tokenize:wO},exit:bO},gO={tokenize:kO,partial:!0},yO={tokenize:xO,partial:!0};function vO(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return a;function a(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Bc(f)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Hl,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Bc(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Wi,r.interrupt?n:p,e.attempt(gO,d,c))}function p(f){return r.containerState.initialBlankLine=!0,i++,d(f)}function c(f){return ae(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),d):n(f)}function d(f){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function wO(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Wi,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,de(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yO,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,de(e,e.attempt(pt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function xO(e,t,n){const r=this;return de(e,o,"listItemIndent",r.containerState.size+1);function o(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function bO(e){e.exit(this.containerState.type)}function kO(e,t,n){const r=this;return de(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function o(i){const l=r.events[r.events.length-1];return!ae(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Gm={name:"setextUnderline",tokenize:CO,resolveTo:SO};function SO(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=l,e.push(["exit",l,t]),e}function CO(e,t,n){const r=this;let o;return i;function i(u){let p=r.events.length,c;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){c=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),o=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ae(u)?de(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||K(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const EO={tokenize:PO};function PO(e){const t=this,n=e.attempt(Wi,r,e.attempt(this.parser.constructs.flowInitial,o,de(e,e.attempt(this.parser.constructs.flow,o,e.attempt(_P,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const OO={resolveAll:Bv()},TO=Mv("string"),AO=Mv("text");function Mv(e){return{tokenize:t,resolveAll:Bv(e==="text"?$O:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,l,a);return l;function l(p){return u(p)?i(p):a(p)}function a(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),s}function s(p){return u(p)?(n.exit("data"),i(p)):(n.consume(p),s)}function u(p){if(p===null)return!0;const c=o[p];let d=-1;if(c)for(;++d-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}function LO(e,t){let n=-1;const r=[];let o;for(;++ne.length){for(;o--;)if(e.charCodeAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,a=t.length-1;for(;o--;)if(e.charCodeAt(o)===47){if(i){n=o+1;break}}else l<0&&(i=!0,l=o+1),a>-1&&(e.charCodeAt(o)===t.charCodeAt(a--)?a<0&&(r=o):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function D4(e){if(Wi(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function z4(e){Wi(e);let t=e.length,n=-1,r=0,o=-1,i=0,l;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function N4(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function F4(e,t){let n="",r=0,o=-1,i=0,l=-1,a,s;for(;++l<=e.length;){if(l2){if(s=n.lastIndexOf("/"),s!==n.length-1){s<0?(n="",r=0):(n=n.slice(0,s),r=n.length-1-n.lastIndexOf("/")),o=l,i=0;continue}}else if(n.length>0){n="",r=0,o=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,i=0}else a===46&&i>-1?i++:i=-1}return n}function Wi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const j4={cwd:M4};function M4(){return"/"}function jc(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function B4(e){if(typeof e=="string")e=new URL(e);else if(!jc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return U4(e)}function U4(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||Hl.call(t,o)},Rm=function(t,n){Tm&&n.name==="__proto__"?Tm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Lm=function(t,n){if(n==="__proto__")if(Hl.call(t,n)){if(Am)return Am(t,n).value}else return;return t[n]},W4=function e(){var t,n,r,o,i,l,a=arguments[0],s=1,u=arguments.length,p=!1;for(typeof a=="boolean"&&(p=a,a=arguments[1]||{},s=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});sl.length;let s;a&&l.push(o);try{s=e.apply(this,l)}catch(u){const p=u;if(a&&n)throw p;return o(p)}a||(s instanceof Promise?s.then(i,o):s instanceof Error?o(s):i(s))}function o(l,...a){n||(n=!0,t(l,...a))}function i(l){o(null,l)}}const q4=$v().freeze(),Av={}.hasOwnProperty;function $v(){const e=V4(),t=[];let n={},r,o=-1;return i.data=l,i.Parser=void 0,i.Compiler=void 0,i.freeze=a,i.attachers=t,i.use=s,i.parse=u,i.stringify=p,i.run=c,i.runSync=d,i.process=f,i.processSync=h,i;function i(){const m=$v();let w=-1;for(;++w{if(k||!O||!T)E(k);else{const N=i.stringify(O,T);N==null||(K4(N)?T.value=N:T.result=N),E(k,T)}});function E(k,O){k||!O?v(k):y?y(O):w(null,O)}}}function h(m){let w;i.freeze(),hu("processSync",i.Parser),mu("processSync",i.Compiler);const g=Wo(m);return i.process(g,y),Im("processSync","process",w),g;function y(v){w=!0,Om(v)}}}function zm(e,t){return typeof e=="function"&&e.prototype&&(Y4(e.prototype)||t in e.prototype)}function Y4(e){let t;for(t in e)if(Av.call(e,t))return!0;return!1}function hu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function mu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function gu(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Nm(e){if(!Mc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Im(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wo(e){return Q4(e)?e:new Ov(e)}function Q4(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function K4(e){return typeof e=="string"||Pv(e)}const X4={};function Z4(e,t){const n=t||X4,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return _v(e,r,o)}function _v(e,t,n){if(J4(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fm(e.children,t,n)}return Array.isArray(e)?Fm(e,t,n):""}function Fm(e,t,n){const r=[];let o=-1;for(;++oo?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i0?(Ct(e,e.length,0,t),e):t}const jm={}.hasOwnProperty;function Rv(e){const t={};let n=-1;for(;++nl))return;const O=t.events.length;let T=O,N,P;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(N){P=t.events[T][1].end;break}N=!0}for(g(r),k=O;kv;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function y(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function cP(e,t,n){return de(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ca(e){if(e===null||Se(e)||$r(e))return 1;if(ks(e))return 2}function Ss(e,t,n){const r=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c=Object.assign({},e[r][1].end),d=Object.assign({},e[n][1].start);Bm(c,-s),Bm(d,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:Object.assign({},e[r][1].end)},a={type:s>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:d},i={type:s>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:s>1?"strong":"emphasis",start:Object.assign({},l.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},l.start),e[n][1].start=Object.assign({},a.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rt(u,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",i,t]]),u=Rt(u,Ss(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rt(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=Rt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ct(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n0&&ae(k)?de(e,y,"linePrefix",i+1)(k):y(k)}function y(k){return k===null||K(k)?e.check(Hm,m,C)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||K(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),v)}function C(k){return e.exit("codeFenced"),t(k)}function E(k,O,T){let N=0;return P;function P(W){return k.enter("lineEnding"),k.consume(W),k.exit("lineEnding"),_}function _(W){return k.enter("codeFencedFence"),ae(W)?de(k,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):R(W)}function R(W){return W===a?(k.enter("codeFencedFenceSequence"),H(W)):T(W)}function H(W){return W===a?(N++,k.consume(W),H):N>=l?(k.exit("codeFencedFenceSequence"),ae(W)?de(k,q,"whitespace")(W):q(W)):T(W)}function q(W){return W===null||K(W)?(k.exit("codeFencedFence"),O(W)):T(W)}}}function kP(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const yu={name:"codeIndented",tokenize:CP},SP={tokenize:EP,partial:!0};function CP(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),de(e,i,"linePrefix",4+1)(u)}function i(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):K(u)?e.attempt(SP,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||K(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function EP(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):K(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):de(e,i,"linePrefix",4+1)(l)}function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):K(l)?o(l):n(l)}}const PP={name:"codeText",tokenize:AP,resolve:OP,previous:TP};function OP(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Iv(e,t,n,r,o,i,l,a,s){const u=s||Number.POSITIVE_INFINITY;let p=0;return c;function c(g){return g===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(g),e.exit(i),d):g===null||g===32||g===41||Sa(g)?n(g):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function d(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===62?(e.exit("chunkString"),e.exit(a),d(g)):g===null||g===60||K(g)?n(g):(e.consume(g),g===92?h:f)}function h(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!p&&(g===null||g===41||Se(g))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(g)):p999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(i),e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):K(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||K(f)||a++>999?(e.exit("chunkString"),p(f)):(e.consume(f),s||(s=!ae(f)),f===92?d:c)}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function jv(e,t,n,r,o,i){let l;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(o),e.consume(d),e.exit(o),l=d===40?41:d,s):n(d)}function s(d){return d===l?(e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):(e.enter(i),u(d))}function u(d){return d===l?(e.exit(i),s(l)):d===null?n(d):K(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),de(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(d))}function p(d){return d===l||d===null||K(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?c:p)}function c(d){return d===l||d===92?(e.consume(d),p):p(d)}}function ai(e,t){let n;return r;function r(o){return K(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ae(o)?de(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}function Zt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const NP={name:"definition",tokenize:FP},IP={tokenize:jP,partial:!0};function FP(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),l(f)}function l(f){return Fv.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return o=Zt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return Se(f)?ai(e,u)(f):u(f)}function u(f){return Iv(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function p(f){return e.attempt(IP,c,c)(f)}function c(f){return ae(f)?de(e,d,"whitespace")(f):d(f)}function d(f){return f===null||K(f)?(e.exit("definition"),r.parser.defined.push(o),t(f)):n(f)}}function jP(e,t,n){return r;function r(a){return Se(a)?ai(e,o)(a):n(a)}function o(a){return jv(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ae(a)?de(e,l,"whitespace")(a):l(a)}function l(a){return a===null||K(a)?t(a):n(a)}}const MP={name:"hardBreakEscape",tokenize:BP};function BP(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return K(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const UP={name:"headingAtx",tokenize:WP,resolve:HP};function HP(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ct(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function WP(e,t,n){let r=0;return o;function o(p){return e.enter("atxHeading"),i(p)}function i(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Se(p)?(e.exit("atxHeadingSequence"),a(p)):n(p)}function a(p){return p===35?(e.enter("atxHeadingSequence"),s(p)):p===null||K(p)?(e.exit("atxHeading"),t(p)):ae(p)?de(e,a,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function s(p){return p===35?(e.consume(p),s):(e.exit("atxHeadingSequence"),a(p))}function u(p){return p===null||p===35||Se(p)?(e.exit("atxHeadingText"),a(p)):(e.consume(p),u)}}const VP=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Vm=["pre","script","style","textarea"],GP={name:"htmlFlow",tokenize:KP,resolveTo:QP,concrete:!0},qP={tokenize:ZP,partial:!0},YP={tokenize:XP,partial:!0};function QP(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function KP(e,t,n){const r=this;let o,i,l,a,s;return u;function u(b){return p(b)}function p(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),c}function c(b){return b===33?(e.consume(b),d):b===47?(e.consume(b),i=!0,m):b===63?(e.consume(b),o=3,r.interrupt?t:S):at(b)?(e.consume(b),l=String.fromCharCode(b),w):n(b)}function d(b){return b===45?(e.consume(b),o=2,f):b===91?(e.consume(b),o=5,a=0,h):at(b)?(e.consume(b),o=4,r.interrupt?t:S):n(b)}function f(b){return b===45?(e.consume(b),r.interrupt?t:S):n(b)}function h(b){const U="CDATA[";return b===U.charCodeAt(a++)?(e.consume(b),a===U.length?r.interrupt?t:R:h):n(b)}function m(b){return at(b)?(e.consume(b),l=String.fromCharCode(b),w):n(b)}function w(b){if(b===null||b===47||b===62||Se(b)){const U=b===47,Y=l.toLowerCase();return!U&&!i&&Vm.includes(Y)?(o=1,r.interrupt?t(b):R(b)):VP.includes(l.toLowerCase())?(o=6,U?(e.consume(b),g):r.interrupt?t(b):R(b)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):i?y(b):v(b))}return b===45||rt(b)?(e.consume(b),l+=String.fromCharCode(b),w):n(b)}function g(b){return b===62?(e.consume(b),r.interrupt?t:R):n(b)}function y(b){return ae(b)?(e.consume(b),y):P(b)}function v(b){return b===47?(e.consume(b),P):b===58||b===95||at(b)?(e.consume(b),C):ae(b)?(e.consume(b),v):P(b)}function C(b){return b===45||b===46||b===58||b===95||rt(b)?(e.consume(b),C):E(b)}function E(b){return b===61?(e.consume(b),k):ae(b)?(e.consume(b),E):v(b)}function k(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),s=b,O):ae(b)?(e.consume(b),k):T(b)}function O(b){return b===s?(e.consume(b),s=null,N):b===null||K(b)?n(b):(e.consume(b),O)}function T(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||Se(b)?E(b):(e.consume(b),T)}function N(b){return b===47||b===62||ae(b)?v(b):n(b)}function P(b){return b===62?(e.consume(b),_):n(b)}function _(b){return b===null||K(b)?R(b):ae(b)?(e.consume(b),_):n(b)}function R(b){return b===45&&o===2?(e.consume(b),Q):b===60&&o===1?(e.consume(b),te):b===62&&o===4?(e.consume(b),X):b===63&&o===3?(e.consume(b),S):b===93&&o===5?(e.consume(b),G):K(b)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(qP,I,H)(b)):b===null||K(b)?(e.exit("htmlFlowData"),H(b)):(e.consume(b),R)}function H(b){return e.check(YP,q,I)(b)}function q(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),W}function W(b){return b===null||K(b)?H(b):(e.enter("htmlFlowData"),R(b))}function Q(b){return b===45?(e.consume(b),S):R(b)}function te(b){return b===47?(e.consume(b),l="",z):R(b)}function z(b){if(b===62){const U=l.toLowerCase();return Vm.includes(U)?(e.consume(b),X):R(b)}return at(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),z):R(b)}function G(b){return b===93?(e.consume(b),S):R(b)}function S(b){return b===62?(e.consume(b),X):b===45&&o===2?(e.consume(b),S):R(b)}function X(b){return b===null||K(b)?(e.exit("htmlFlowData"),I(b)):(e.consume(b),X)}function I(b){return e.exit("htmlFlow"),t(b)}}function XP(e,t,n){const r=this;return o;function o(l){return K(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ZP(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Vi,t,n)}}const JP={name:"htmlText",tokenize:eO};function eO(e,t,n){const r=this;let o,i,l;return a;function a(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),s}function s(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),E):S===63?(e.consume(S),v):at(S)?(e.consume(S),T):n(S)}function u(S){return S===45?(e.consume(S),p):S===91?(e.consume(S),i=0,h):at(S)?(e.consume(S),y):n(S)}function p(S){return S===45?(e.consume(S),f):n(S)}function c(S){return S===null?n(S):S===45?(e.consume(S),d):K(S)?(l=c,te(S)):(e.consume(S),c)}function d(S){return S===45?(e.consume(S),f):c(S)}function f(S){return S===62?Q(S):S===45?d(S):c(S)}function h(S){const X="CDATA[";return S===X.charCodeAt(i++)?(e.consume(S),i===X.length?m:h):n(S)}function m(S){return S===null?n(S):S===93?(e.consume(S),w):K(S)?(l=m,te(S)):(e.consume(S),m)}function w(S){return S===93?(e.consume(S),g):m(S)}function g(S){return S===62?Q(S):S===93?(e.consume(S),g):m(S)}function y(S){return S===null||S===62?Q(S):K(S)?(l=y,te(S)):(e.consume(S),y)}function v(S){return S===null?n(S):S===63?(e.consume(S),C):K(S)?(l=v,te(S)):(e.consume(S),v)}function C(S){return S===62?Q(S):v(S)}function E(S){return at(S)?(e.consume(S),k):n(S)}function k(S){return S===45||rt(S)?(e.consume(S),k):O(S)}function O(S){return K(S)?(l=O,te(S)):ae(S)?(e.consume(S),O):Q(S)}function T(S){return S===45||rt(S)?(e.consume(S),T):S===47||S===62||Se(S)?N(S):n(S)}function N(S){return S===47?(e.consume(S),Q):S===58||S===95||at(S)?(e.consume(S),P):K(S)?(l=N,te(S)):ae(S)?(e.consume(S),N):Q(S)}function P(S){return S===45||S===46||S===58||S===95||rt(S)?(e.consume(S),P):_(S)}function _(S){return S===61?(e.consume(S),R):K(S)?(l=_,te(S)):ae(S)?(e.consume(S),_):N(S)}function R(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),o=S,H):K(S)?(l=R,te(S)):ae(S)?(e.consume(S),R):(e.consume(S),q)}function H(S){return S===o?(e.consume(S),o=void 0,W):S===null?n(S):K(S)?(l=H,te(S)):(e.consume(S),H)}function q(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Se(S)?N(S):(e.consume(S),q)}function W(S){return S===47||S===62||Se(S)?N(S):n(S)}function Q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function te(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),z}function z(S){return ae(S)?de(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):G(S)}function G(S){return e.enter("htmlTextData"),l(S)}}const kf={name:"labelEnd",tokenize:lO,resolveTo:iO,resolveAll:oO},tO={tokenize:aO},nO={tokenize:sO},rO={tokenize:uO};function oO(e){let t=-1;for(;++t=3&&(u===null||K(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===o?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),ae(u)?de(e,a,"whitespace")(u):a(u))}}const pt={name:"list",tokenize:vO,continuation:{tokenize:wO},exit:bO},gO={tokenize:kO,partial:!0},yO={tokenize:xO,partial:!0};function vO(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return a;function a(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Bc(f)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Wl,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Bc(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Vi,r.interrupt?n:p,e.attempt(gO,d,c))}function p(f){return r.containerState.initialBlankLine=!0,i++,d(f)}function c(f){return ae(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),d):n(f)}function d(f){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function wO(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Vi,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,de(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yO,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,de(e,e.attempt(pt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function xO(e,t,n){const r=this;return de(e,o,"listItemIndent",r.containerState.size+1);function o(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function bO(e){e.exit(this.containerState.type)}function kO(e,t,n){const r=this;return de(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function o(i){const l=r.events[r.events.length-1];return!ae(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Gm={name:"setextUnderline",tokenize:CO,resolveTo:SO};function SO(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=l,e.push(["exit",l,t]),e}function CO(e,t,n){const r=this;let o;return i;function i(u){let p=r.events.length,c;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){c=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),o=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ae(u)?de(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||K(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const EO={tokenize:PO};function PO(e){const t=this,n=e.attempt(Vi,r,e.attempt(this.parser.constructs.flowInitial,o,de(e,e.attempt(this.parser.constructs.flow,o,e.attempt(_P,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const OO={resolveAll:Bv()},TO=Mv("string"),AO=Mv("text");function Mv(e){return{tokenize:t,resolveAll:Bv(e==="text"?$O:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,l,a);return l;function l(p){return u(p)?i(p):a(p)}function a(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),s}function s(p){return u(p)?(n.exit("data"),i(p)):(n.consume(p),s)}function u(p){if(p===null)return!0;const c=o[p];let d=-1;if(c)for(;++d-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}function LO(e,t){let n=-1;const r=[];let o;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const qO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Hv(e){return e.replace(qO,YO)}function YO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Uv(n.slice(i?2:1),i?16:10)}return bf(n)||e}const Wv={}.hasOwnProperty,QO=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),KO(n)(GO(WO(n).document().write(VO()(e,t,!0))))};function KO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ee),autolinkProtocol:_,autolinkEmail:_,atxHeading:a(Fe),blockQuote:a(pe),characterEscape:_,characterReference:_,codeFenced:a(J),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(J,s),codeText:a(Ie,s),codeTextData:_,data:_,codeFlowValue:_,definition:a(Be),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(se),hardBreakEscape:a(fe),hardBreakTrailing:a(fe),htmlFlow:a(ze,s),htmlFlowData:_,htmlText:a(ze,s),htmlTextData:_,image:a(hn),label:s,link:a(Ee),listItem:a(dr),listItemValue:h,listOrdered:a(fr,f),listUnordered:a(fr),paragraph:a(yt),reference:Y,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Fe),strong:a(ee),thematicBreak:a($o)},exit:{atxHeading:p(),atxHeadingSequence:O,autolink:p(),autolinkEmail:ie,autolinkProtocol:ye,blockQuote:p(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:B,codeFenced:p(y),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:w,codeFlowValue:R,codeIndented:p(v),codeText:p(te),codeTextData:R,data:R,definition:p(),definitionDestinationString:k,definitionLabelString:C,definitionTitleString:E,emphasis:p(),hardBreakEscape:p(q),hardBreakTrailing:p(q),htmlFlow:p(W),htmlFlowData:R,htmlText:p(Q),htmlTextData:R,image:p(G),label:X,labelText:S,lineEnding:H,link:p(z),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:A,resourceDestinationString:I,resourceTitleString:b,resource:U,setextHeading:p(P),setextHeadingLineSequence:N,setextHeadingText:T,strong:p(),thematicBreak:p()}};Vv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let j={type:"root",children:[]};const Z={stack:[j],tokenStack:[],config:t,enter:u,exit:c,buffer:s,resume:d,setData:i,getData:l},be=[];let ke=-1;for(;++ke<$.length;)if($[ke][1].type==="listOrdered"||$[ke][1].type==="listUnordered")if($[ke][0]==="enter")be.push(ke);else{const Ut=be.pop();ke=o($,Ut,ke)}for(ke=-1;++ke<$.length;){const Ut=t[$[ke][0]];Wv.call(Ut,$[ke][1].type)&&Ut[$[ke][1].type].call(Object.assign({sliceSerialize:$[ke][2].sliceSerialize},Z),$[ke][1])}if(Z.tokenStack.length>0){const Ut=Z.tokenStack[Z.tokenStack.length-1];(Ut[1]||Ym).call(Z,void 0,Ut[0])}for(j.position={start:jn($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:jn($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke{const r=this.data("settings");return QO(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function JO(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(i)}o=i===-2,r.push(l)}return r.join("")}const DO={42:pt,43:pt,45:pt,48:pt,49:pt,50:pt,51:pt,52:pt,53:pt,54:pt,55:pt,56:pt,57:pt,62:Lv},zO={91:NP},NO={[-2]:yu,[-1]:yu,32:yu},IO={35:UP,42:Wl,45:[Gm,Wl],60:GP,61:Gm,95:Wl,96:Wm,126:Wm},FO={38:zv,92:Dv},jO={[-5]:vu,[-4]:vu,[-3]:vu,33:cO,38:zv,42:Uc,60:[dP,JP],91:fO,92:[MP,Dv],93:kf,95:Uc,96:PP},MO={null:[Uc,OO]},BO={null:[42,95]},UO={null:[]},HO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:BO,contentInitial:zO,disable:UO,document:DO,flow:IO,flowInitial:NO,insideSpan:MO,string:FO,text:jO},Symbol.toStringTag,{value:"Module"}));function WO(e){const n=Rv([HO,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(lP),document:o(sP),flow:o(EO),string:o(TO),text:o(AO)};return r;function o(i){return l;function l(a){return _O(r,i,a)}}}const qm=/[\0\t\n\r]/g;function VO(){let e=1,t="",n=!0,r;return o;function o(i,l,a){const s=[];let u,p,c,d,f;for(i=t+i.toString(l),c=0,t="",n&&(i.charCodeAt(0)===65279&&c++,n=void 0);c13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const qO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Hv(e){return e.replace(qO,YO)}function YO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Uv(n.slice(i?2:1),i?16:10)}return bf(n)||e}const Wv={}.hasOwnProperty,QO=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),KO(n)(GO(WO(n).document().write(VO()(e,t,!0))))};function KO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ee),autolinkProtocol:_,autolinkEmail:_,atxHeading:a(Fe),blockQuote:a(pe),characterEscape:_,characterReference:_,codeFenced:a(J),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(J,s),codeText:a(Ie,s),codeTextData:_,data:_,codeFlowValue:_,definition:a(Be),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(se),hardBreakEscape:a(fe),hardBreakTrailing:a(fe),htmlFlow:a(ze,s),htmlFlowData:_,htmlText:a(ze,s),htmlTextData:_,image:a(hn),label:s,link:a(Ee),listItem:a(dr),listItemValue:h,listOrdered:a(fr,f),listUnordered:a(fr),paragraph:a(yt),reference:Y,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Fe),strong:a(ee),thematicBreak:a($o)},exit:{atxHeading:p(),atxHeadingSequence:O,autolink:p(),autolinkEmail:ie,autolinkProtocol:ye,blockQuote:p(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:B,codeFenced:p(y),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:w,codeFlowValue:R,codeIndented:p(v),codeText:p(te),codeTextData:R,data:R,definition:p(),definitionDestinationString:k,definitionLabelString:C,definitionTitleString:E,emphasis:p(),hardBreakEscape:p(q),hardBreakTrailing:p(q),htmlFlow:p(W),htmlFlowData:R,htmlText:p(Q),htmlTextData:R,image:p(G),label:X,labelText:S,lineEnding:H,link:p(z),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:A,resourceDestinationString:I,resourceTitleString:b,resource:U,setextHeading:p(P),setextHeadingLineSequence:N,setextHeadingText:T,strong:p(),thematicBreak:p()}};Vv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let j={type:"root",children:[]};const Z={stack:[j],tokenStack:[],config:t,enter:u,exit:c,buffer:s,resume:d,setData:i,getData:l},be=[];let ke=-1;for(;++ke<$.length;)if($[ke][1].type==="listOrdered"||$[ke][1].type==="listUnordered")if($[ke][0]==="enter")be.push(ke);else{const Ut=be.pop();ke=o($,Ut,ke)}for(ke=-1;++ke<$.length;){const Ut=t[$[ke][0]];Wv.call(Ut,$[ke][1].type)&&Ut[$[ke][1].type].call(Object.assign({sliceSerialize:$[ke][2].sliceSerialize},Z),$[ke][1])}if(Z.tokenStack.length>0){const Ut=Z.tokenStack[Z.tokenStack.length-1];(Ut[1]||Ym).call(Z,void 0,Ut[0])}for(j.position={start:jn($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:jn($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke{const r=this.data("settings");return QO(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function JO(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` `}]}function tT(e,t){const n=t.value?t.value+` `:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,o={};r&&(o.className=["language-"+r]);let i={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function nT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function To(e){const t=[];let n=-1,r=0,o=0;for(;++n55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(l=String.fromCharCode(i,a),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Gv(e,t){const n=String(t.identifier).toUpperCase(),r=To(n.toLowerCase()),o=e.footnoteOrder.indexOf(n);let i;o===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,i=e.footnoteOrder.length):(e.footnoteCounts[n]++,i=o+1);const l=e.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,a);const s={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,s),e.applyData(t,s)}function oT(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const o=String(r);return n[o]={type:"footnoteDefinition",identifier:o,children:[{type:"paragraph",children:t.children}],position:t.position},Gv(e,{type:"footnoteReference",identifier:o,position:t.position})}function iT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lT(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function qv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function aT(e,t){const n=e.definition(t.identifier);if(!n)return qv(e,t);const r={src:To(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)}function sT(e,t){const n={src:To(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function uT(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function cT(e,t){const n=e.definition(t.identifier);if(!n)return qv(e,t);const r={href:To(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function pT(e,t){const n={href:To(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fT(e,t,n){const r=e.all(t),o=n?dT(n):Yv(t),i={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let c;p&&p.type==="element"&&p.tagName==="p"?c=p:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a1}function hT(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o-1?r.offset:null}}}function wT(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Sf(t.children[1]),s=Cf(t.children[t.children.length-1]);a.line&&s.line&&(l.position={start:a,end:s}),o.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function xT(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,a=l?l.length:t.children.length;let s=-1;const u=[];for(;++s0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Xm(t.slice(o),o>0,!1)),i.join("")}function Xm(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Qm||i===Km;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Qm||i===Km;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function ST(e,t){const n={type:"text",value:kT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function CT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ET={blockquote:JO,break:eT,code:tT,delete:nT,emphasis:rT,footnoteReference:Gv,footnote:oT,heading:iT,html:lT,imageReference:aT,image:sT,inlineCode:uT,linkReference:cT,link:pT,listItem:fT,list:hT,paragraph:mT,root:gT,strong:yT,table:wT,tableCell:bT,tableRow:xT,text:ST,thematicBreak:CT,toml:vl,yaml:vl,definition:vl,footnoteDefinition:vl};function vl(){return null}const Ef=function(e){if(e==null)return AT;if(typeof e=="string")return TT(e);if(typeof e=="object")return Array.isArray(e)?PT(e):OT(e);if(typeof e=="function")return Cs(e);throw new Error("Expected function, string, or object as test")};function PT(e){const t=[];let n=-1;for(;++n":""))+")"})}return c;function c(){let d=[],f,h,m;if((!t||o(a,s,u[u.length-1]||null))&&(d=RT(n(a,u)),d[0]===Zm))return d;if(a.children&&d[0]!==_T)for(h=(r?a.children.length:-1)+i,m=u.concat(a);h>-1&&h{const o=eg(r.identifier);o&&!Jm.call(t,o)&&(t[o]=r)}),n;function n(r){const o=eg(r);return o&&Jm.call(t,o)?t[o]:null}}function eg(e){return String(e||"").toUpperCase()}const Ca={}.hasOwnProperty;function zT(e,t){const n=t||{},r=n.allowDangerousHtml||!1,o={};return l.dangerous=r,l.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,l.footnoteLabel=n.footnoteLabel||"Footnotes",l.footnoteLabelTagName=n.footnoteLabelTagName||"h2",l.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},l.footnoteBackLabel=n.footnoteBackLabel||"Back to content",l.unknownHandler=n.unknownHandler,l.passThrough=n.passThrough,l.handlers={...ET,...n.handlers},l.definition=DT(e),l.footnoteById=o,l.footnoteOrder=[],l.footnoteCounts={},l.patch=NT,l.applyData=IT,l.one=a,l.all=s,l.wrap=jT,l.augment=i,Pf(e,"footnoteDefinition",u=>{const p=String(u.identifier).toUpperCase();Ca.call(o,p)||(o[p]=u)}),l;function i(u,p){if(u&&"data"in u&&u.data){const c=u.data;c.hName&&(p.type!=="element"&&(p={type:"element",tagName:"",properties:{},children:[]}),p.tagName=c.hName),p.type==="element"&&c.hProperties&&(p.properties={...p.properties,...c.hProperties}),"children"in p&&p.children&&c.hChildren&&(p.children=c.hChildren)}if(u){const c="type"in u?u:{position:u};LT(c)||(p.position={start:Sf(c),end:Cf(c)})}return p}function l(u,p,c,d){return Array.isArray(c)&&(d=c,c={}),i(u,{type:"element",tagName:p,properties:c||{},children:d||[]})}function a(u,p){return Xv(l,u,p)}function s(u){return Of(l,u)}}function NT(e,t){e.position&&(t.position=vT(e))}function IT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&i&&(n.properties={...n.properties,...i}),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function Xv(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return Ca.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:Of(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):FT(e,t)}function Of(e,t){const n=[];if("children"in t){const r=t.children;let o=-1;for(;++o1}function hT(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o-1?r.offset:null}}}function wT(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Sf(t.children[1]),s=Cf(t.children[t.children.length-1]);a.line&&s.line&&(l.position={start:a,end:s}),o.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function xT(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,a=l?l.length:t.children.length;let s=-1;const u=[];for(;++s0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Xm(t.slice(o),o>0,!1)),i.join("")}function Xm(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Qm||i===Km;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Qm||i===Km;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function ST(e,t){const n={type:"text",value:kT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function CT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ET={blockquote:JO,break:eT,code:tT,delete:nT,emphasis:rT,footnoteReference:Gv,footnote:oT,heading:iT,html:lT,imageReference:aT,image:sT,inlineCode:uT,linkReference:cT,link:pT,listItem:fT,list:hT,paragraph:mT,root:gT,strong:yT,table:wT,tableCell:bT,tableRow:xT,text:ST,thematicBreak:CT,toml:wl,yaml:wl,definition:wl,footnoteDefinition:wl};function wl(){return null}const Ef=function(e){if(e==null)return AT;if(typeof e=="string")return TT(e);if(typeof e=="object")return Array.isArray(e)?PT(e):OT(e);if(typeof e=="function")return Cs(e);throw new Error("Expected function, string, or object as test")};function PT(e){const t=[];let n=-1;for(;++n":""))+")"})}return c;function c(){let d=[],f,h,m;if((!t||o(a,s,u[u.length-1]||null))&&(d=RT(n(a,u)),d[0]===Zm))return d;if(a.children&&d[0]!==_T)for(h=(r?a.children.length:-1)+i,m=u.concat(a);h>-1&&h{const o=eg(r.identifier);o&&!Jm.call(t,o)&&(t[o]=r)}),n;function n(r){const o=eg(r);return o&&Jm.call(t,o)?t[o]:null}}function eg(e){return String(e||"").toUpperCase()}const Ea={}.hasOwnProperty;function zT(e,t){const n=t||{},r=n.allowDangerousHtml||!1,o={};return l.dangerous=r,l.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,l.footnoteLabel=n.footnoteLabel||"Footnotes",l.footnoteLabelTagName=n.footnoteLabelTagName||"h2",l.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},l.footnoteBackLabel=n.footnoteBackLabel||"Back to content",l.unknownHandler=n.unknownHandler,l.passThrough=n.passThrough,l.handlers={...ET,...n.handlers},l.definition=DT(e),l.footnoteById=o,l.footnoteOrder=[],l.footnoteCounts={},l.patch=NT,l.applyData=IT,l.one=a,l.all=s,l.wrap=jT,l.augment=i,Pf(e,"footnoteDefinition",u=>{const p=String(u.identifier).toUpperCase();Ea.call(o,p)||(o[p]=u)}),l;function i(u,p){if(u&&"data"in u&&u.data){const c=u.data;c.hName&&(p.type!=="element"&&(p={type:"element",tagName:"",properties:{},children:[]}),p.tagName=c.hName),p.type==="element"&&c.hProperties&&(p.properties={...p.properties,...c.hProperties}),"children"in p&&p.children&&c.hChildren&&(p.children=c.hChildren)}if(u){const c="type"in u?u:{position:u};LT(c)||(p.position={start:Sf(c),end:Cf(c)})}return p}function l(u,p,c,d){return Array.isArray(c)&&(d=c,c={}),i(u,{type:"element",tagName:p,properties:c||{},children:d||[]})}function a(u,p){return Xv(l,u,p)}function s(u){return Of(l,u)}}function NT(e,t){e.position&&(t.position=vT(e))}function IT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&i&&(n.properties={...n.properties,...i}),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function Xv(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return Ea.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:Of(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):FT(e,t)}function Of(e,t){const n=[];if("children"in t){const r=t.children;let o=-1;for(;++o0&&n.push({type:"text",value:` `}),n}function MT(e){const t=[];let n=-1;for(;++n1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&c.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),s.length>0&&s.push({type:"text",value:" "}),s.push(c)}const u=o[o.length-1];if(u&&u.type==="element"&&u.tagName==="p"){const c=u.children[u.children.length-1];c&&c.type==="text"?c.value+=" ":u.children.push({type:"text",value:" "}),u.children.push(...s)}else o.push(...s);const p={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+l},children:e.wrap(o,!0)};e.patch(r,p),t.push(p)}if(t.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:` `}]}}function Zv(e,t){const n=zT(e,t),r=n.one(e,null),o=MT(n);return o&&r.children.push({type:"text",value:` -`},o),Array.isArray(r)?{type:"root",children:r}:r}const BT=function(e,t){return e&&"run"in e?HT(e,t):WT(e||t)},UT=BT;function HT(e,t){return(n,r,o)=>{e.run(Zv(n,t),r,i=>{o(i)})}}function WT(e){return t=>Zv(t,e)}var Jv={exports:{}},VT="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",GT=VT,qT=GT;function ew(){}function tw(){}tw.resetWarningCache=ew;var YT=function(){function e(r,o,i,l,a,s){if(s!==qT){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:tw,resetWarningCache:ew};return n.PropTypes=n,n};Jv.exports=YT();var QT=Jv.exports;const re=_r(QT);class Vi{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Vi.prototype.property={};Vi.prototype.normal={};Vi.prototype.space=null;function nw(e,t){const n={},r={};let o=-1;for(;++o4&&n.slice(0,4)==="data"&&e3.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ng,o3);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ng.test(i)){let l=i.replace(t3,r3);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Tf}return new o(r,t)}function r3(e){return"-"+e.toLowerCase()}function o3(e){return e.charAt(1).toUpperCase()}const rg={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},i3=nw([iw,ow,sw,uw,ZT],"html"),l3=nw([iw,ow,sw,uw,JT],"svg");function a3(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Pf(t,"element",(n,r,o)=>{const i=o;let l;if(e.allowedElements?l=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(l=e.disallowedElements.includes(n.tagName)),!l&&e.allowElement&&typeof r=="number"&&(l=!e.allowElement(n,r,i)),l&&typeof r=="number")return e.unwrapDisallowed&&n.children?i.children.splice(r,1,...n.children):i.children.splice(r,1),r})}}function s3(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function u3(e){return e.join(" ").trim()}function c3(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var Af={exports:{}},og=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,p3=/\n/g,f3=/^\s*/,d3=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,h3=/^:\s*/,m3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,g3=/^[;\s]*/,y3=/^\s+|\s+$/g,v3=` -`,ig="/",lg="*",yr="",w3="comment",x3="declaration",b3=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(h){var m=h.match(p3);m&&(n+=m.length);var w=h.lastIndexOf(v3);r=~w?h.length-w:r+h.length}function i(){var h={line:n,column:r};return function(m){return m.position=new l(h),u(),m}}function l(h){this.start=h,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(h){var m=new Error(t.source+":"+n+":"+r+": "+h);if(m.reason=h,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function s(h){var m=h.exec(e);if(m){var w=m[0];return o(w),e=e.slice(w.length),m}}function u(){s(f3)}function p(h){var m;for(h=h||[];m=c();)m!==!1&&h.push(m);return h}function c(){var h=i();if(!(ig!=e.charAt(0)||lg!=e.charAt(1))){for(var m=2;yr!=e.charAt(m)&&(lg!=e.charAt(m)||ig!=e.charAt(m+1));)++m;if(m+=2,yr===e.charAt(m-1))return a("End of comment missing");var w=e.slice(2,m-2);return r+=2,o(w),e=e.slice(m),r+=2,h({type:w3,comment:w})}}function d(){var h=i(),m=s(d3);if(m){if(c(),!s(h3))return a("property missing ':'");var w=s(m3),g=h({type:x3,property:ag(m[0].replace(og,yr)),value:w?ag(w[0].replace(og,yr)):yr});return s(g3),g}}function f(){var h=[];p(h);for(var m;m=d();)m!==!1&&(h.push(m),p(h));return h}return u(),f()};function ag(e){return e?e.replace(y3,yr):yr}var k3=b3;function cw(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=k3(e),i=typeof t=="function",l,a,s=0,u=o.length;s0?le.createElement(f,s,c):le.createElement(f,s)}function O3(e){let t=-1;for(;++t for more info)`),delete wl[i]}const t=q4().use(ZO).use(e.remarkPlugins||[]).use(UT,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(a3,e),n=new Ov;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let o=le.createElement(le.Fragment,{},pw({options:e,schema:i3,listDepth:0},r));return e.className&&(o=le.createElement("div",{className:e.className},o)),o}fw.propTypes={children:re.string,className:re.string,allowElement:re.func,allowedElements:re.arrayOf(re.string),disallowedElements:re.arrayOf(re.string),unwrapDisallowed:re.bool,remarkPlugins:re.arrayOf(re.oneOfType([re.object,re.func,re.arrayOf(re.oneOfType([re.bool,re.string,re.object,re.func,re.arrayOf(re.any)]))])),rehypePlugins:re.arrayOf(re.oneOfType([re.object,re.func,re.arrayOf(re.oneOfType([re.bool,re.string,re.object,re.func,re.arrayOf(re.any)]))])),sourcePos:re.bool,rawSourcePos:re.bool,skipHtml:re.bool,includeElementIndex:re.bool,transformLinkUri:re.oneOfType([re.func,re.bool]),linkTarget:re.oneOfType([re.func,re.string]),transformImageUri:re.func,components:re.object};const L3={tokenize:j3,partial:!0},dw={tokenize:M3,partial:!0},hw={tokenize:B3,partial:!0},mw={tokenize:U3,partial:!0},D3={tokenize:H3,partial:!0},gw={tokenize:I3,previous:vw},yw={tokenize:F3,previous:ww},Dn={tokenize:N3,previous:xw},dn={},z3={text:dn};let hr=48;for(;hr<123;)dn[hr]=Dn,hr++,hr===58?hr=65:hr===91&&(hr=97);dn[43]=Dn;dn[45]=Dn;dn[46]=Dn;dn[95]=Dn;dn[72]=[Dn,yw];dn[104]=[Dn,yw];dn[87]=[Dn,gw];dn[119]=[Dn,gw];function N3(e,t,n){const r=this;let o,i;return l;function l(c){return!Gc(c)||!xw.call(r,r.previous)||$f(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Gc(c)?(e.consume(c),a):c===64?(e.consume(c),s):n(c)}function s(c){return c===46?e.check(D3,p,u)(c):c===45||c===95||rt(c)?(i=!0,e.consume(c),s):p(c)}function u(c){return e.consume(c),o=!0,s}function p(c){return i&&o&&at(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function I3(e,t,n){const r=this;return o;function o(l){return l!==87&&l!==119||!vw.call(r,r.previous)||$f(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(L3,e.attempt(dw,e.attempt(hw,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function F3(e,t,n){const r=this;let o="",i=!1;return l;function l(c){return(c===72||c===104)&&ww.call(r,r.previous)&&!$f(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(at(c)&&o.length<5)return o+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const d=o.toLowerCase();if(d==="http"||d==="https")return e.consume(c),s}return n(c)}function s(c){return c===47?(e.consume(c),i?u:(i=!0,s)):n(c)}function u(c){return c===null||ka(c)||Se(c)||$r(c)||ks(c)?n(c):e.attempt(dw,e.attempt(hw,p),n)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function j3(e,t,n){let r=0;return o;function o(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),o):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function M3(e,t,n){let r,o,i;return l;function l(u){return u===46||u===95?e.check(mw,s,a)(u):u===null||Se(u)||$r(u)||u!==45&&ks(u)?s(u):(i=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(o=r,r=void 0),e.consume(u),l}function s(u){return o||r||!i?n(u):t(u)}}function B3(e,t){let n=0,r=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const W3={tokenize:Z3,partial:!0};function V3(){return{document:{91:{tokenize:Q3,continuation:{tokenize:K3},exit:X3}},text:{91:{tokenize:Y3},93:{add:"after",tokenize:G3,resolveTo:q3}}}}function G3(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const s=r.events[o][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return a;function a(s){if(!l||!l._balanced)return n(s);const u=Zt(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function q3(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Y3(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(i>999||c===93&&!l||c===null||c===91||Se(c))return n(c);if(c===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return o.includes(Zt(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Se(c)||(l=!0),i++,e.consume(c),c===92?p:u}function p(c){return c===91||c===92||c===93?(e.consume(c),i++,u):u(c)}}function Q3(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,a;return s;function s(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(h)}function p(h){if(l>999||h===93&&!a||h===null||h===91||Se(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return i=Zt(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Se(h)||(a=!0),l++,e.consume(h),h===92?c:p}function c(h){return h===91||h===92||h===93?(e.consume(h),l++,p):p(h)}function d(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),o.includes(i)||o.push(i),de(e,f,"gfmFootnoteDefinitionWhitespace")):n(h)}function f(h){return t(h)}}function K3(e,t,n){return e.check(Wi,t,e.attempt(W3,t,n))}function X3(e){e.exit("gfmFootnoteDefinition")}function Z3(e,t,n){const r=this;return de(e,o,"gfmFootnoteDefinitionIndent",4+1);function o(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function J3(e){let n=(e||{}).singleTilde;const r={tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(l,a){let s=-1;for(;++s1?s(h):(l.consume(h),c++,f);if(c<2&&!n)return s(h);const w=l.exit("strikethroughSequenceTemporary"),g=Sa(h);return w._open=!g||g===2&&!!m,w._close=!m||m===2&&!!g,a(h)}}}class eA{constructor(){this.map=[]}add(t,n,r){tA(this,t,n,r)}consume(t){if(this.map.sort((i,l)=>i[0]-l[0]),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1])),r.push(this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let o=r.pop();for(;o;)t.push(...o),o=r.pop();this.map.length=0}}function tA(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o-1;){const q=r.events[_][1].type;if(q==="lineEnding"||q==="linePrefix")_--;else break}const R=_>-1?r.events[_][1].type:null,H=R==="tableHead"||R==="tableRow"?k:s;return H===k&&r.parser.lazy[r.now().line]?n(P):H(P)}function s(P){return e.enter("tableHead"),e.enter("tableRow"),u(P)}function u(P){return P===124||(l=!0,i+=1),p(P)}function p(P){return P===null?n(P):K(P)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),f):n(P):ae(P)?de(e,p,"whitespace")(P):(i+=1,l&&(l=!1,o+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),c(P)))}function c(P){return P===null||P===124||Se(P)?(e.exit("data"),p(P)):(e.consume(P),P===92?d:c)}function d(P){return P===92||P===124?(e.consume(P),c):c(P)}function f(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),l=!1,ae(P)?de(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):h(P))}function h(P){return P===45||P===58?w(P):P===124?(l=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),m):E(P)}function m(P){return ae(P)?de(e,w,"whitespace")(P):w(P)}function w(P){return P===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),g):P===45?(i+=1,g(P)):P===null||K(P)?C(P):E(P)}function g(P){return P===45?(e.enter("tableDelimiterFiller"),y(P)):E(P)}function y(P){return P===45?(e.consume(P),y):P===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(P))}function v(P){return ae(P)?de(e,C,"whitespace")(P):C(P)}function C(P){return P===124?h(P):P===null||K(P)?!l||o!==i?E(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):E(P)}function E(P){return n(P)}function k(P){return e.enter("tableRow"),O(P)}function O(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),O):P===null||K(P)?(e.exit("tableRow"),t(P)):ae(P)?de(e,O,"whitespace")(P):(e.enter("data"),T(P))}function T(P){return P===null||P===124||Se(P)?(e.exit("data"),O(P)):(e.consume(P),P===92?N:T)}function N(P){return P===92||P===124?(e.consume(P),T):T(P)}}function iA(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,p,c;const d=new eA;for(;++nn[2]+1){const h=n[2]+1,m=n[3]-n[2]-1;e.add(h,m,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return o!==void 0&&(i.end=Object.assign({},Br(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function ug(e,t,n,r,o){const i=[],l=Br(t.events,n);o&&(o.end=Object.assign({},l),i.push(["exit",o,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function Br(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const lA={tokenize:sA},aA={text:{91:lA}};function sA(e,t,n){const r=this;return o;function o(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),i)}function i(s){return Se(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):n(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(s)}function a(s){return K(s)?t(s):ae(s)?e.check({tokenize:uA},t,n)(s):n(s)}}function uA(e,t,n){return de(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function cA(e){return Rv([z3,V3(),J3(e),rA,aA])}function cg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function pA(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const fA={}.hasOwnProperty,dA=function(e,t,n,r){let o,i;typeof t=="string"||t instanceof RegExp?(i=[[t,n]],o=r):(i=t,o=n),o||(o={});const l=Ef(o.ignore||[]),a=hA(i);let s=-1;for(;++s0?{type:"text",value:O}:void 0),O!==!1&&(w!==E&&v.push({type:"text",value:c.value.slice(w,E)}),Array.isArray(O)?v.push(...O):O&&v.push(O),w=E+C[0].length,y=!0),!h.global)break;C=h.exec(c.value)}return y?(we}const bu="phrasing",ku=["autolink","link","image","label"],mA={transforms:[kA],enter:{literalAutolink:yA,literalAutolinkEmail:Su,literalAutolinkHttp:Su,literalAutolinkWww:Su},exit:{literalAutolink:bA,literalAutolinkEmail:xA,literalAutolinkHttp:vA,literalAutolinkWww:wA}},gA={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:bu,notInConstruct:ku},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:bu,notInConstruct:ku},{character:":",before:"[ps]",after:"\\/",inConstruct:bu,notInConstruct:ku}]};function yA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Su(e){this.config.enter.autolinkProtocol.call(this,e)}function vA(e){this.config.exit.autolinkProtocol.call(this,e)}function wA(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function xA(e){this.config.exit.autolinkEmail.call(this,e)}function bA(e){this.exit(e)}function kA(e){dA(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,SA],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,CA]],{ignore:["link","linkReference"]})}function SA(e,t,n,r,o){let i="";if(!bw(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!EA(n)))return!1;const l=PA(n+r);if(!l[0])return!1;const a={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function CA(e,t,n,r){return!bw(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function EA(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function PA(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=cg(e,"(");let i=cg(e,")");for(;r!==-1&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function bw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||$r(n)||ks(n))&&(!t||n!==47)}function kw(e){return e.label||!e.identifier?e.label||"":Hv(e.identifier)}function OA(e,t,n){const r=t.indexStack,o=e.children||[],i=t.createTracker(n),l=[];let a=-1;for(r.push(-1);++a{e.run(Zv(n,t),r,i=>{o(i)})}}function WT(e){return t=>Zv(t,e)}var Jv={exports:{}},VT="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",GT=VT,qT=GT;function ew(){}function tw(){}tw.resetWarningCache=ew;var YT=function(){function e(r,o,i,l,a,s){if(s!==qT){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:tw,resetWarningCache:ew};return n.PropTypes=n,n};Jv.exports=YT();var QT=Jv.exports;const re=_r(QT);class Gi{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Gi.prototype.property={};Gi.prototype.normal={};Gi.prototype.space=null;function nw(e,t){const n={},r={};let o=-1;for(;++o4&&n.slice(0,4)==="data"&&e3.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ng,o3);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ng.test(i)){let l=i.replace(t3,r3);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Tf}return new o(r,t)}function r3(e){return"-"+e.toLowerCase()}function o3(e){return e.charAt(1).toUpperCase()}const rg={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},i3=nw([iw,ow,sw,uw,ZT],"html"),l3=nw([iw,ow,sw,uw,JT],"svg");function a3(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Pf(t,"element",(n,r,o)=>{const i=o;let l;if(e.allowedElements?l=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(l=e.disallowedElements.includes(n.tagName)),!l&&e.allowElement&&typeof r=="number"&&(l=!e.allowElement(n,r,i)),l&&typeof r=="number")return e.unwrapDisallowed&&n.children?i.children.splice(r,1,...n.children):i.children.splice(r,1),r})}}function s3(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function u3(e){return e.join(" ").trim()}function c3(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var Af={exports:{}},og=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,p3=/\n/g,f3=/^\s*/,d3=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,h3=/^:\s*/,m3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,g3=/^[;\s]*/,y3=/^\s+|\s+$/g,v3=` +`,ig="/",lg="*",yr="",w3="comment",x3="declaration",b3=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(h){var m=h.match(p3);m&&(n+=m.length);var w=h.lastIndexOf(v3);r=~w?h.length-w:r+h.length}function i(){var h={line:n,column:r};return function(m){return m.position=new l(h),u(),m}}function l(h){this.start=h,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(h){var m=new Error(t.source+":"+n+":"+r+": "+h);if(m.reason=h,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function s(h){var m=h.exec(e);if(m){var w=m[0];return o(w),e=e.slice(w.length),m}}function u(){s(f3)}function p(h){var m;for(h=h||[];m=c();)m!==!1&&h.push(m);return h}function c(){var h=i();if(!(ig!=e.charAt(0)||lg!=e.charAt(1))){for(var m=2;yr!=e.charAt(m)&&(lg!=e.charAt(m)||ig!=e.charAt(m+1));)++m;if(m+=2,yr===e.charAt(m-1))return a("End of comment missing");var w=e.slice(2,m-2);return r+=2,o(w),e=e.slice(m),r+=2,h({type:w3,comment:w})}}function d(){var h=i(),m=s(d3);if(m){if(c(),!s(h3))return a("property missing ':'");var w=s(m3),g=h({type:x3,property:ag(m[0].replace(og,yr)),value:w?ag(w[0].replace(og,yr)):yr});return s(g3),g}}function f(){var h=[];p(h);for(var m;m=d();)m!==!1&&(h.push(m),p(h));return h}return u(),f()};function ag(e){return e?e.replace(y3,yr):yr}var k3=b3;function cw(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=k3(e),i=typeof t=="function",l,a,s=0,u=o.length;s0?le.createElement(f,s,c):le.createElement(f,s)}function O3(e){let t=-1;for(;++t for more info)`),delete xl[i]}const t=q4().use(ZO).use(e.remarkPlugins||[]).use(UT,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(a3,e),n=new Ov;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let o=le.createElement(le.Fragment,{},pw({options:e,schema:i3,listDepth:0},r));return e.className&&(o=le.createElement("div",{className:e.className},o)),o}fw.propTypes={children:re.string,className:re.string,allowElement:re.func,allowedElements:re.arrayOf(re.string),disallowedElements:re.arrayOf(re.string),unwrapDisallowed:re.bool,remarkPlugins:re.arrayOf(re.oneOfType([re.object,re.func,re.arrayOf(re.oneOfType([re.bool,re.string,re.object,re.func,re.arrayOf(re.any)]))])),rehypePlugins:re.arrayOf(re.oneOfType([re.object,re.func,re.arrayOf(re.oneOfType([re.bool,re.string,re.object,re.func,re.arrayOf(re.any)]))])),sourcePos:re.bool,rawSourcePos:re.bool,skipHtml:re.bool,includeElementIndex:re.bool,transformLinkUri:re.oneOfType([re.func,re.bool]),linkTarget:re.oneOfType([re.func,re.string]),transformImageUri:re.func,components:re.object};const L3={tokenize:j3,partial:!0},dw={tokenize:M3,partial:!0},hw={tokenize:B3,partial:!0},mw={tokenize:U3,partial:!0},D3={tokenize:H3,partial:!0},gw={tokenize:I3,previous:vw},yw={tokenize:F3,previous:ww},Dn={tokenize:N3,previous:xw},dn={},z3={text:dn};let hr=48;for(;hr<123;)dn[hr]=Dn,hr++,hr===58?hr=65:hr===91&&(hr=97);dn[43]=Dn;dn[45]=Dn;dn[46]=Dn;dn[95]=Dn;dn[72]=[Dn,yw];dn[104]=[Dn,yw];dn[87]=[Dn,gw];dn[119]=[Dn,gw];function N3(e,t,n){const r=this;let o,i;return l;function l(c){return!Gc(c)||!xw.call(r,r.previous)||$f(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Gc(c)?(e.consume(c),a):c===64?(e.consume(c),s):n(c)}function s(c){return c===46?e.check(D3,p,u)(c):c===45||c===95||rt(c)?(i=!0,e.consume(c),s):p(c)}function u(c){return e.consume(c),o=!0,s}function p(c){return i&&o&&at(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function I3(e,t,n){const r=this;return o;function o(l){return l!==87&&l!==119||!vw.call(r,r.previous)||$f(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(L3,e.attempt(dw,e.attempt(hw,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function F3(e,t,n){const r=this;let o="",i=!1;return l;function l(c){return(c===72||c===104)&&ww.call(r,r.previous)&&!$f(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(at(c)&&o.length<5)return o+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const d=o.toLowerCase();if(d==="http"||d==="https")return e.consume(c),s}return n(c)}function s(c){return c===47?(e.consume(c),i?u:(i=!0,s)):n(c)}function u(c){return c===null||Sa(c)||Se(c)||$r(c)||ks(c)?n(c):e.attempt(dw,e.attempt(hw,p),n)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function j3(e,t,n){let r=0;return o;function o(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),o):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function M3(e,t,n){let r,o,i;return l;function l(u){return u===46||u===95?e.check(mw,s,a)(u):u===null||Se(u)||$r(u)||u!==45&&ks(u)?s(u):(i=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(o=r,r=void 0),e.consume(u),l}function s(u){return o||r||!i?n(u):t(u)}}function B3(e,t){let n=0,r=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const W3={tokenize:Z3,partial:!0};function V3(){return{document:{91:{tokenize:Q3,continuation:{tokenize:K3},exit:X3}},text:{91:{tokenize:Y3},93:{add:"after",tokenize:G3,resolveTo:q3}}}}function G3(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const s=r.events[o][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return a;function a(s){if(!l||!l._balanced)return n(s);const u=Zt(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function q3(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Y3(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(i>999||c===93&&!l||c===null||c===91||Se(c))return n(c);if(c===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return o.includes(Zt(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Se(c)||(l=!0),i++,e.consume(c),c===92?p:u}function p(c){return c===91||c===92||c===93?(e.consume(c),i++,u):u(c)}}function Q3(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,a;return s;function s(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(h)}function p(h){if(l>999||h===93&&!a||h===null||h===91||Se(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return i=Zt(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Se(h)||(a=!0),l++,e.consume(h),h===92?c:p}function c(h){return h===91||h===92||h===93?(e.consume(h),l++,p):p(h)}function d(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),o.includes(i)||o.push(i),de(e,f,"gfmFootnoteDefinitionWhitespace")):n(h)}function f(h){return t(h)}}function K3(e,t,n){return e.check(Vi,t,e.attempt(W3,t,n))}function X3(e){e.exit("gfmFootnoteDefinition")}function Z3(e,t,n){const r=this;return de(e,o,"gfmFootnoteDefinitionIndent",4+1);function o(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function J3(e){let n=(e||{}).singleTilde;const r={tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(l,a){let s=-1;for(;++s1?s(h):(l.consume(h),c++,f);if(c<2&&!n)return s(h);const w=l.exit("strikethroughSequenceTemporary"),g=Ca(h);return w._open=!g||g===2&&!!m,w._close=!m||m===2&&!!g,a(h)}}}class eA{constructor(){this.map=[]}add(t,n,r){tA(this,t,n,r)}consume(t){if(this.map.sort((i,l)=>i[0]-l[0]),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1])),r.push(this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let o=r.pop();for(;o;)t.push(...o),o=r.pop();this.map.length=0}}function tA(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o-1;){const q=r.events[_][1].type;if(q==="lineEnding"||q==="linePrefix")_--;else break}const R=_>-1?r.events[_][1].type:null,H=R==="tableHead"||R==="tableRow"?k:s;return H===k&&r.parser.lazy[r.now().line]?n(P):H(P)}function s(P){return e.enter("tableHead"),e.enter("tableRow"),u(P)}function u(P){return P===124||(l=!0,i+=1),p(P)}function p(P){return P===null?n(P):K(P)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),f):n(P):ae(P)?de(e,p,"whitespace")(P):(i+=1,l&&(l=!1,o+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),c(P)))}function c(P){return P===null||P===124||Se(P)?(e.exit("data"),p(P)):(e.consume(P),P===92?d:c)}function d(P){return P===92||P===124?(e.consume(P),c):c(P)}function f(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),l=!1,ae(P)?de(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):h(P))}function h(P){return P===45||P===58?w(P):P===124?(l=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),m):E(P)}function m(P){return ae(P)?de(e,w,"whitespace")(P):w(P)}function w(P){return P===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),g):P===45?(i+=1,g(P)):P===null||K(P)?C(P):E(P)}function g(P){return P===45?(e.enter("tableDelimiterFiller"),y(P)):E(P)}function y(P){return P===45?(e.consume(P),y):P===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(P))}function v(P){return ae(P)?de(e,C,"whitespace")(P):C(P)}function C(P){return P===124?h(P):P===null||K(P)?!l||o!==i?E(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):E(P)}function E(P){return n(P)}function k(P){return e.enter("tableRow"),O(P)}function O(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),O):P===null||K(P)?(e.exit("tableRow"),t(P)):ae(P)?de(e,O,"whitespace")(P):(e.enter("data"),T(P))}function T(P){return P===null||P===124||Se(P)?(e.exit("data"),O(P)):(e.consume(P),P===92?N:T)}function N(P){return P===92||P===124?(e.consume(P),T):T(P)}}function iA(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,p,c;const d=new eA;for(;++nn[2]+1){const h=n[2]+1,m=n[3]-n[2]-1;e.add(h,m,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return o!==void 0&&(i.end=Object.assign({},Br(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function ug(e,t,n,r,o){const i=[],l=Br(t.events,n);o&&(o.end=Object.assign({},l),i.push(["exit",o,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function Br(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const lA={tokenize:sA},aA={text:{91:lA}};function sA(e,t,n){const r=this;return o;function o(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),i)}function i(s){return Se(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):n(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(s)}function a(s){return K(s)?t(s):ae(s)?e.check({tokenize:uA},t,n)(s):n(s)}}function uA(e,t,n){return de(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function cA(e){return Rv([z3,V3(),J3(e),rA,aA])}function cg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function pA(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const fA={}.hasOwnProperty,dA=function(e,t,n,r){let o,i;typeof t=="string"||t instanceof RegExp?(i=[[t,n]],o=r):(i=t,o=n),o||(o={});const l=Ef(o.ignore||[]),a=hA(i);let s=-1;for(;++s0?{type:"text",value:O}:void 0),O!==!1&&(w!==E&&v.push({type:"text",value:c.value.slice(w,E)}),Array.isArray(O)?v.push(...O):O&&v.push(O),w=E+C[0].length,y=!0),!h.global)break;C=h.exec(c.value)}return y?(we}const bu="phrasing",ku=["autolink","link","image","label"],mA={transforms:[kA],enter:{literalAutolink:yA,literalAutolinkEmail:Su,literalAutolinkHttp:Su,literalAutolinkWww:Su},exit:{literalAutolink:bA,literalAutolinkEmail:xA,literalAutolinkHttp:vA,literalAutolinkWww:wA}},gA={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:bu,notInConstruct:ku},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:bu,notInConstruct:ku},{character:":",before:"[ps]",after:"\\/",inConstruct:bu,notInConstruct:ku}]};function yA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Su(e){this.config.enter.autolinkProtocol.call(this,e)}function vA(e){this.config.exit.autolinkProtocol.call(this,e)}function wA(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function xA(e){this.config.exit.autolinkEmail.call(this,e)}function bA(e){this.exit(e)}function kA(e){dA(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,SA],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,CA]],{ignore:["link","linkReference"]})}function SA(e,t,n,r,o){let i="";if(!bw(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!EA(n)))return!1;const l=PA(n+r);if(!l[0])return!1;const a={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function CA(e,t,n,r){return!bw(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function EA(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function PA(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=cg(e,"(");let i=cg(e,")");for(;r!==-1&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function bw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||$r(n)||ks(n))&&(!t||n!==47)}function kw(e){return e.label||!e.identifier?e.label||"":Hv(e.identifier)}function OA(e,t,n){const r=t.indexStack,o=e.children||[],i=t.createTracker(n),l=[];let a=-1;for(r.push(-1);++as&&(s=e[u].length);++wa[w])&&(a[w]=y)}h.push(g)}i[u]=h,l[u]=m}let p=-1;if(typeof n=="object"&&"length"in n)for(;++pa[p]&&(a[p]=g),d[p]=g),c[p]=y}i.splice(1,0,c),l.splice(1,0,d),u=-1;const f=[];for(;++un==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function o$(e){this.exit(e),this.setData("inTable")}function i$(e){this.enter({type:"tableRow",children:[]},e)}function Cu(e){this.exit(e)}function gg(e){this.enter({type:"tableCell",children:[]},e)}function l$(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,a$));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function a$(e,t){return t==="|"?t:e}function s$(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:l,tableRow:a,tableCell:s,inlineCode:d}};function l(f,h,m,w){return u(p(f,m,w),f.align)}function a(f,h,m,w){const g=c(f,m,w),y=u([g]);return y.slice(0,y.indexOf(` -`))}function s(f,h,m,w){const g=m.enter("tableCell"),y=m.enter("phrasing"),v=Pw(f,m,{...w,before:i,after:i});return y(),g(),v}function u(f,h){return JA(f,{align:h,alignDelimiters:r,padding:n,stringLength:o})}function p(f,h,m){const w=f.children;let g=-1;const y=[],v=h.enter("table");for(;++g-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let l=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=n.createTracker(r);a.move(i+" ".repeat(l-i.length)),a.shift(l);const s=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),p);return s(),u;function p(c,d,f){return d?(f?"":" ".repeat(l))+c:(f?i:i+" ".repeat(l-i.length))+c}}const f$={exit:{taskListCheckValueChecked:yg,taskListCheckValueUnchecked:yg,paragraph:h$}},d$={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:m$}};function yg(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function h$(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,l;for(;++i1&&(n+="s"),[e+" "+n+" ago","in "+e+" "+n]}var k$=["秒","分钟","小时","天","周","个月","年"];function S$(e,t){if(t===0)return["刚刚","片刻后"];var n=k$[~~(t/2)];return[e+" "+n+"前",e+" "+n+"后"]}var qc={},Aw=function(e,t){qc[e]=t},C$=function(e){return qc[e]||qc.en_US},Eu=[60,60,24,7,365/7/12,12];function vg(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}function E$(e,t){var n=e<0?1:0;e=Math.abs(e);for(var r=e,o=0;e>=Eu[o]&&o(o===0?9:1)&&(o+=1),t(e,o,r)[n].replace("%s",e.toString())}function P$(e,t){var n=t?vg(t):new Date;return(+n-+vg(e))/1e3}var O$=function(e,t,n){var r=P$(e,n&&n.relativeDate);return E$(r,C$(t))};Aw("en_US",b$);Aw("zh_CN",S$);function T$(e){const t=new Date(e),n=t.getHours(),r=String(t.getMinutes()).padStart(2,"0"),o=n>=12?"PM":"AM";return`${n%12||12}:${r} ${o}`}function A$(){const[e,t]=x.useState(!1),n=async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),t(!0),!0}catch(o){return console.warn("Copy failed",o),t(!1),!1}};return x.useEffect(()=>{if(e){const r=setTimeout(()=>{t(!1)},5e3);return()=>clearTimeout(r)}},[e]),[e,n]}function $$(e){return zr({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}}]})(e)}function _$(e){return zr({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"}}]})(e)}function R$(){return Date.now()}function L$(){var n,r,o,i;const e=p1();return{notify:new Audio((r=(n=e==null?void 0:e.data)==null?void 0:n.sound_effects)==null?void 0:r.response),submit:new Audio((i=(o=e==null?void 0:e.data)==null?void 0:o.sound_effects)==null?void 0:i.submit)}}function wg(e){return typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:e===void 0}function _f(){return Math.random().toString(36).substring(2,15)}function D$(e){return e[e.length-1]}const $w=x.createContext(void 0),z$=({children:e})=>{const[t,n]=x.useState([]),r=L$(),[o,i]=x.useState(!1),[l,a]=x.useState(null),{axiosInstance:s}=u1(),u=Ua(),p=h=>{var w;h.from==="user"?r==null||r.submit.play():(w=r==null?void 0:r.notify)==null||w.play();const m={...h,timestamp:h.timestamp?h.timestamp:R$()};n(g=>[...g,m])},c=async h=>{h.from==="user"&&p(h),a(null),i(!0);try{const{data:m,status:w,statusText:g}=await s.post("/chat/send",{...h,headers:u==null?void 0:u.headers,user:u==null?void 0:u.user});w===200?p({...m,id:_f(),from:"bot"}):a({message:h,reason:g})}catch(m){a({message:h,reason:m==null?void 0:m.message})}finally{i(!1)}};function d(){n([])}const f={messages:t,sendMessage:c,loading:o,failedMessage:l,reset:d};return L.jsx($w.Provider,{value:f,children:e})},$i=()=>{const e=x.useContext($w);if(!e)throw new Error("useChat must be used within a ChatProvider");return e};function _w({error:e}){return L.jsx("img",{className:Tn("opencopilot-h-7 opencopilot-w-7 opencopilot-rounded-lg opencopilot-object-cover opencopilot-aspect-square hover:opencopilot-shadow",e&&"border opencopilot-border-rose-500 opencopilot-shadow-none"),src:"https://cdn.dribbble.com/users/281679/screenshots/14897126/media/f52c47307ac2daa0c727b1840c41d5ab.png?compress=1&resize=1600x1200&vertical=center",alt:"bot's avatar"})}function N$(){var t;const e=Ua();return L.jsxs(Bi,{children:[L.jsx(Ui,{hidden:!(e!=null&&e.user),side:"top",align:"center",children:(t=e==null?void 0:e.user)==null?void 0:t.name}),L.jsx(bs,{asChild:!0,children:L.jsx("div",{className:"opencopilot-rounded-lg opencopilot-shrink-0 opencopilot-bg-accent opencopilot-h-7 opencopilot-w-7 opencopilot-object-cover opencopilot-aspect-square hover:opencopilot-shadow opencopilot-border-primary-light opencopilot-border opencopilot-flex opencopilot-items-center opencopilot-justify-center",children:L.jsx("span",{className:"opencopilot-text-xl opencopilot-text-primary opencopilot-fill-current",children:L.jsx(w$,{})})})})]})}function xg({message:e,timestamp:t,id:n}){var s;const{displayText:r}=xf({text:e,every:1e-4,shouldStart:!0}),[o,i]=A$(),{messages:l}=$i(),a=((s=D$(l))==null?void 0:s.id)===n;return L.jsxs("div",{className:"opencopilot-p-2 group opencopilot-w-full",children:[L.jsxs("div",{className:"opencopilot-flex opencopilot-select-none opencopilot-items-start opencopilot-gap-3 opencopilot-w-full",dir:"auto",children:[L.jsx(_w,{}),L.jsx("div",{className:"opencopilot-space-y-2 opencopilot-flex-1",children:L.jsx("div",{className:"opencopilot-w-fit",children:L.jsx("div",{dir:"auto",children:L.jsx(fw,{remarkPlugins:[v$],className:"opencopilot-prose opencopilot-prose-slate opencopilot-font-medium opencopilot-text-sm opencopilot-prose-sm prose-h1:opencopilot-font-medium prose-h2:opencopilot-font-normal prose-headings:opencopilot-my-1 opencopilot-max-w-full",children:r})})})})]}),a&&L.jsxs("div",{className:"opencopilot-w-full opencopilot-ps-10 opencopilot-flex opencopilot-items-center opencopilot-justify-between",children:[L.jsx("div",{children:t&&L.jsxs("span",{className:"opencopilot-text-xs opencopilot-m-0",children:["Bot · ",O$(t)]})}),L.jsx("button",{className:"opencopilot-text-lg opencopilot-justify-self-end",onClick:()=>i(r),children:o?L.jsx($$,{className:"opencopilot-text-emerald-500"}):L.jsx(_$,{})})]})]})}function I$(){const{displayText:e}=xf({text:"Bot is Thinking..."});return L.jsxs("div",{className:"opencopilot-p-2 opencopilot-flex opencopilot-items-center opencopilot-gap-3 opencopilot-w-full",children:[L.jsx("div",{className:"loading opencopilot-flex-col opencopilot-w-7 opencopilot-flex opencopilot-h-7 opencopilot-bg-accent opencopilot-text-primary opencopilot-rounded-lg opencopilot-shrink-0 opencopilot-mt-auto flex-center",children:L.jsx(WC,{height:"15",width:"15",color:"var(--opencopilot-primary-clr)",visible:!0})}),L.jsx("div",{className:"opencopilot-space-y-2 opencopilot-flex-1",children:L.jsx("div",{className:"mesg_body opencopilot-w-fit opencopilot-whitespace-nowrap opencopilot-max-w-full",children:L.jsx("p",{className:"opencopilot-text-sm opencopilot-lowercase",children:e})})})]})}function F$({content:e,timestamp:t}){return L.jsxs("div",{dir:"auto",className:"opencopilot-w-full opencopilot-overflow-x-auto opencopilot-max-w-full last-of-type:opencopilot-mb-10 opencopilot-bg-accent opencopilot-p-2 opencopilot-flex opencopilot-gap-3 opencopilot-items-center",children:[L.jsx(N$,{}),L.jsx("div",{children:L.jsxs(Bi,{children:[L.jsx(bs,{asChild:!0,children:L.jsx("p",{className:"opencopilot-prose opencopilot-prose-slate opencopilot-font-medium opencopilot-text-sm opencopilot-prose-sm",children:e})}),L.jsx(Ui,{children:L.jsx("span",{children:t&&T$(t)})})]})})]})}function j$({message:e}){const{displayText:t}=xf({text:"Error sending the message.",every:.001});return L.jsx("div",{className:"opencopilot-clear-both opencopilot-w-full opencopilot-p-2",children:L.jsxs("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-gap-3 opencopilot-w-full",children:[L.jsx(_w,{error:!0}),L.jsx("div",{className:"opencopilot-text-rose-500 opencopilot-text-sm",children:t})]})})}const M$=e=>[(n,r)=>{if(e.current){const{scrollWidth:o,scrollHeight:i}=e.current,l=o-e.current.clientWidth,a=i-e.current.clientHeight,s=n/100*l,u=r/100*a;e.current.scrollTo(s,u)}}];function B$(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var U$=x.useLayoutEffect,H$=function(t){var n=x.useRef(t);return U$(function(){n.current=t}),n},bg=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},W$=function(t,n){var r=x.useRef();return x.useCallback(function(o){t.current=o,r.current&&bg(r.current,null),r.current=n,n&&bg(n,o)},[n])},kg={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},V$=function(t){Object.keys(kg).forEach(function(n){t.style.setProperty(n,kg[n],"important")})},Sg=V$,it=null,Cg=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function G$(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),it||(it=document.createElement("textarea"),it.setAttribute("tabindex","-1"),it.setAttribute("aria-hidden","true"),Sg(it)),it.parentNode===null&&document.body.appendChild(it);var o=e.paddingSize,i=e.borderSize,l=e.sizingStyle,a=l.boxSizing;Object.keys(l).forEach(function(d){var f=d;it.style[f]=l[f]}),Sg(it),it.value=t;var s=Cg(it,e);it.value=t,s=Cg(it,e),it.value="x";var u=it.scrollHeight-o,p=u*n;a==="border-box"&&(p=p+o+i),s=Math.max(p,s);var c=u*r;return a==="border-box"&&(c=c+o+i),s=Math.min(c,s),[s,u]}var Eg=function(){},q$=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},Y$=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],Q$=!!document.documentElement.currentStyle,K$=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=q$(Y$,n),o=r.boxSizing;if(o==="")return null;Q$&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),l=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:l}},X$=K$;function Rw(e,t,n){var r=H$(n);x.useLayoutEffect(function(){var o=function(l){return r.current(l)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var Z$=function(t){Rw(window,"resize",t)},J$=function(t){Rw(document.fonts,"loadingdone",t)},e_=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],t_=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,l=t.onChange,a=l===void 0?Eg:l,s=t.onHeightChange,u=s===void 0?Eg:s,p=B$(t,e_),c=p.value!==void 0,d=x.useRef(null),f=W$(d,n),h=x.useRef(0),m=x.useRef(),w=function(){var v=d.current,C=r&&m.current?m.current:X$(v);if(C){m.current=C;var E=G$(C,v.value||v.placeholder||"x",i,o),k=E[0],O=E[1];h.current!==k&&(h.current=k,v.style.setProperty("height",k+"px","important"),u(k,{rowHeight:O}))}},g=function(v){c||w(),a(v)};return x.useLayoutEffect(w),Z$(w),J$(w),x.createElement("textarea",ge({},p,{onChange:g,ref:f}))},n_=x.forwardRef(t_);function r_(e){return zr({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M1 1.91L1.78 1.5L15 7.44899V8.3999L1.78 14.33L1 13.91L2.58311 8L1 1.91ZM3.6118 8.5L2.33037 13.1295L13.5 7.8999L2.33037 2.83859L3.6118 7.43874L9 7.5V8.5H3.6118Z"}}]})(e)}function o_(e){return zr({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M13.1459 11.0499L12.9716 9.05752L15.3462 8.84977C14.4471 7.98322 13.2242 7.4503 11.8769 7.4503C9.11547 7.4503 6.87689 9.68888 6.87689 12.4503C6.87689 15.2117 9.11547 17.4503 11.8769 17.4503C13.6977 17.4503 15.2911 16.4771 16.1654 15.0224L18.1682 15.5231C17.0301 17.8487 14.6405 19.4503 11.8769 19.4503C8.0109 19.4503 4.87689 16.3163 4.87689 12.4503C4.87689 8.58431 8.0109 5.4503 11.8769 5.4503C13.8233 5.4503 15.5842 6.24474 16.853 7.52706L16.6078 4.72412L18.6002 4.5498L19.1231 10.527L13.1459 11.0499Z",fill:"currentColor"}}]})(e)}function i_(e){return zr({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 12h1m8 -9v1m8 8h1m-15.4 -6.4l.7 .7m12.1 -.7l-.7 .7"}},{tag:"path",attr:{d:"M9 16a5 5 0 1 1 6 0a3.5 3.5 0 0 0 -1 3a2 2 0 0 1 -4 0a3.5 3.5 0 0 0 -1 -3"}},{tag:"path",attr:{d:"M9.7 17l4.6 0"}}]})(e)}function l_(){const{data:e}=p1(),{messages:t,sendMessage:n}=$i();return L.jsx(L.Fragment,{children:wg(t)&&!wg(e==null?void 0:e.inital_questions)&&L.jsxs("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-gap-4 opencopilot-justify-between opencopilot-w-full opencopilot-px-4",children:[L.jsx("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-flex-wrap opencopilot-gap-2 opencopilot-flex-1",children:e==null?void 0:e.inital_questions.map((r,o)=>L.jsx("button",{className:"opencopilot-text-xs opencopilot-w-fit opencopilot-font-semibold opencopilot-whitespace-nowrap opencopilot-px-2.5 opencopilot-py-1 opencopilot-rounded-full opencopilot-bg-accent opencopilot-text-primary",onClick:()=>{n({from:"user",content:r,id:_f()})},children:r},o))}),L.jsxs(Bi,{children:[L.jsx(bs,{children:L.jsx("span",{className:"opencopilot-text-xl opencopilot-text-primary opencopilot-mb-auto",children:L.jsx(i_,{})})}),L.jsx(Ui,{asChild:!0,children:L.jsx("span",{className:"opencopilot-text-xs opencopilot-font-medium fade-in-bottom opencopilot-px-2 opencopilot-py-1 opencopilot-mb-3",children:"suggestions"})})]})]})})}function a_(){const[e,t]=x.useState(""),n=x.useRef(null),{sendMessage:r,reset:o,messages:i}=$i(),{loading:l}=$i(),a=e.trim().length>0,s=p=>{const c=p.currentTarget.value;t(c)};function u(){e.trim().length>0&&(t(""),r({from:"user",content:e,id:_f()}))}return L.jsxs("footer",{className:"opencopilot-p-2 opencopilot-flex opencopilot-w-full opencopilot-flex-col opencopilot-gap-2",children:[L.jsx("div",{className:"opencopilot-overflow-y-auto opencopilot-w-full ",children:L.jsx(l_,{})}),L.jsxs("div",{className:"opencopilot-w-full opencopilot-flex opencopilot-items-center opencopilot-ring-[#334155]/60 opencopilot-transition-colors opencopilot-justify-between opencopilot-ring-1 opencopilot-overflow-hidden focus-within:opencopilot-ring-primary opencopilot-gap-2 opencopilot-bg-accent opencopilot-p-2 opencopilot-rounded-2xl",children:[L.jsx("div",{className:"opencopilot-flex-1",children:L.jsx(n_,{dir:"auto",ref:n,autoFocus:!0,onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),u())},disabled:l,maxRows:4,rows:1,value:e,onChange:s,className:"opencopilot-w-full opencopilot-resize-none opencopilot-bg-transparent focus-visible:opencopilot-outline-none opencopilot-border-none focus:opencopilot-outline-none focus:opencopilot-border-none opencopilot-scrollbar-thin opencopilot-leading-tight opencopilot-whitespace-pre-wrap opencopilot-py-1.5 opencopilot-px-4 placeholder:opencopilot-align-middle opencopilot-overflow-auto opencopilot-outline-none opencopilot-text-accent2 opencopilot-text-[14px] placeholder:opencopilot-text-xs opencopilot-font-normal"})}),L.jsxs("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-justify-center opencopilot-gap-2 opencopilot-h-fit opencopilot-px-2 opencopilot-text-lg",children:[L.jsxs(Bi,{children:[L.jsx(bs,{asChild:!0,children:L.jsx("button",{onClick:o,className:"opencopilot-text-xl disabled:opencopilot-opacity-40 disabled:opencopilot-pointer-events-none disabled:opencopilot-cursor-not-allowed opencopilot-text-[#5e5c5e] opencopilot-transition-all",disabled:!(i.length>0),children:L.jsx(o_,{})})}),L.jsx(Ui,{children:"reset chat"})]}),L.jsx("button",{onClick:u,className:"opencopilot-text-xl disabled:opencopilot-opacity-40 disabled:opencopilot-pointer-events-none disabled:opencopilot-cursor-not-allowed opencopilot-text-[#5e5c5e] opencopilot-transition-all",disabled:l||!a,children:L.jsx(r_,{})})]})]})]})}function s_({data:e,render:t,fallback:n}){return e.length===0?n:e.map((r,o)=>t(r,o))}function u_(){const e=x.useRef(null),[t]=M$(e),{messages:n,loading:r,failedMessage:o}=$i(),i=Ua(),l=i==null?void 0:i.initialMessage;return x.useEffect(()=>{t(0,100)},[]),x.useEffect(()=>{t(0,100)},[n,t]),L.jsxs("div",{className:"opencopilot-w-full opencopilot-flex opencopilot-h-full opencopilot-flex-col opencopilot-items-start opencopilot-relative",children:[L.jsx(MC,{}),L.jsx("main",{ref:e,className:"opencopilot-flex-1 opencopilot-w-full opencopilot-overflow-x-hidden opencopilot-shrink-0 opencopilot-overflow-auto opencopilot-scrollbar-thin opencopilot-scroll-smooth",children:L.jsxs("div",{className:"opencopilot-flex opencopilot-h-fit opencopilot-mt-auto opencopilot-flex-col opencopilot-py-2 opencopilot-max-h-full opencopilot-items-center opencopilot-gap-1 last:fade-in-right",children:[l&&L.jsx(xg,{message:l}),L.jsx(s_,{fallback:L.jsx("hr",{}),data:n,render:(a,s)=>{if(a.from==="bot"){if(a.type==="text")return L.jsx(xg,{timestamp:a.timestamp,id:a.id,message:a.response.text},s)}else if(a.from==="user")return L.jsx(F$,{id:a.id,timestamp:a.timestamp,content:a.content},s)}}),r&&L.jsx(I$,{}),o&&L.jsx(j$,{message:o})]})}),L.jsx(a_,{})]})}function c_(){return L.jsx(z$,{children:L.jsx(u_,{})})}const p_=typeof window>"u";function f_({triggerSelector:e}){const[t,n]=B0();return x.useEffect(()=>{if(p_)return;const r=document.querySelector(e);if(r)return r.addEventListener("click",n),()=>r.removeEventListener("click",n);console.warn("The trigger element can't be found, make sure it is present in the DOM")},[e,n]),L.jsx("div",{className:Tn(t&&"!opencopilot-z-[100000] opencopilot-transition-all opencopilot-shadow-lg opencopilot-ease-in sm:opencopilot-w-96 opencopilot-fixed opencopilot-w-screen opencopilot-h-screen opencopilot-top-0 opencopilot-bottom-0 opencopilot-right-0"),children:L.jsx("div",{"data-open":t,className:Tn("opencopilot-font-inter opencopilot-overflow-hidden opencopilot-h-full sm:opencopilot-rounded-xl opencopilot-bg-white","opencopilot-opacity-0 opencopilot-transition-opacity opencopilot-ease",t&&"opencopilot-opacity-100 opencopilot-animate-in opencopilot-fade-in",!t&&"opencopilot-hidden opencopilot-animate-out opencopilot-fade-out"),children:L.jsx(c_,{})})})}function d_({triggerSelector:e,...t}){const n=document.createElement("style");n.innerHTML=ik,document.body.appendChild(n);const r=document.createElement("div");r.id="opencopilot-aicopilot",document.body.appendChild(r),Pu.createRoot(r).render(L.jsx(TS,{options:{...t},children:L.jsx(f_,{triggerSelector:e})}))}window.initAiCoPilot=d_; +`))}function s(f,h,m,w){const g=m.enter("tableCell"),y=m.enter("phrasing"),v=Pw(f,m,{...w,before:i,after:i});return y(),g(),v}function u(f,h){return JA(f,{align:h,alignDelimiters:r,padding:n,stringLength:o})}function p(f,h,m){const w=f.children;let g=-1;const y=[],v=h.enter("table");for(;++g-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let l=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=n.createTracker(r);a.move(i+" ".repeat(l-i.length)),a.shift(l);const s=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),p);return s(),u;function p(c,d,f){return d?(f?"":" ".repeat(l))+c:(f?i:i+" ".repeat(l-i.length))+c}}const f$={exit:{taskListCheckValueChecked:yg,taskListCheckValueUnchecked:yg,paragraph:h$}},d$={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:m$}};function yg(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function h$(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,l;for(;++i1&&(n+="s"),[e+" "+n+" ago","in "+e+" "+n]}var k$=["秒","分钟","小时","天","周","个月","年"];function S$(e,t){if(t===0)return["刚刚","片刻后"];var n=k$[~~(t/2)];return[e+" "+n+"前",e+" "+n+"后"]}var qc={},Aw=function(e,t){qc[e]=t},C$=function(e){return qc[e]||qc.en_US},Eu=[60,60,24,7,365/7/12,12];function vg(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}function E$(e,t){var n=e<0?1:0;e=Math.abs(e);for(var r=e,o=0;e>=Eu[o]&&o(o===0?9:1)&&(o+=1),t(e,o,r)[n].replace("%s",e.toString())}function P$(e,t){var n=t?vg(t):new Date;return(+n-+vg(e))/1e3}var O$=function(e,t,n){var r=P$(e,n&&n.relativeDate);return E$(r,C$(t))};Aw("en_US",b$);Aw("zh_CN",S$);function T$(e){const t=new Date(e),n=t.getHours(),r=String(t.getMinutes()).padStart(2,"0"),o=n>=12?"PM":"AM";return`${n%12||12}:${r} ${o}`}function A$(){const[e,t]=x.useState(!1),n=async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),t(!0),!0}catch(o){return console.warn("Copy failed",o),t(!1),!1}};return x.useEffect(()=>{if(e){const r=setTimeout(()=>{t(!1)},5e3);return()=>clearTimeout(r)}},[e]),[e,n]}function $$(e){return zr({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}}]})(e)}function _$(e){return zr({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"}}]})(e)}function R$(){return Date.now()}function L$(){var n,r,o,i;const e=p1();return{notify:new Audio((r=(n=e==null?void 0:e.data)==null?void 0:n.sound_effects)==null?void 0:r.response),submit:new Audio((i=(o=e==null?void 0:e.data)==null?void 0:o.sound_effects)==null?void 0:i.submit)}}function wg(e){return typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:e===void 0}function _f(){return Math.random().toString(36).substring(2,15)}function D$(e){return e[e.length-1]}const $w=x.createContext(void 0),z$=({children:e})=>{const[t,n]=x.useState([]),r=L$(),[o,i]=x.useState(!1),[l,a]=x.useState(null),{axiosInstance:s}=u1(),u=Ni(),p=h=>{var w;h.from==="user"?r==null||r.submit.play():(w=r==null?void 0:r.notify)==null||w.play();const m={...h,timestamp:h.timestamp?h.timestamp:R$()};n(g=>[...g,m])},c=async h=>{h.from==="user"&&p(h),a(null),i(!0);try{const{data:m,status:w,statusText:g}=await s.post("/chat/send",{...h,headers:u==null?void 0:u.headers,user:u==null?void 0:u.user});w===200?p({...m,id:_f(),from:"bot"}):a({message:h,reason:g})}catch(m){a({message:h,reason:m==null?void 0:m.message})}finally{i(!1)}};function d(){n([])}const f={messages:t,sendMessage:c,loading:o,failedMessage:l,reset:d};return L.jsx($w.Provider,{value:f,children:e})},$i=()=>{const e=x.useContext($w);if(!e)throw new Error("useChat must be used within a ChatProvider");return e};function _w({error:e}){return L.jsx("img",{className:Tn("opencopilot-h-7 opencopilot-w-7 opencopilot-rounded-lg opencopilot-shrink-0 opencopilot-object-cover opencopilot-aspect-square hover:opencopilot-shadow",e&&"border opencopilot-border-rose-500 opencopilot-shadow-none"),src:"https://cdn.dribbble.com/users/281679/screenshots/14897126/media/f52c47307ac2daa0c727b1840c41d5ab.png?compress=1&resize=1600x1200&vertical=center",alt:"bot's avatar"})}function N$(){var t;const e=Ni();return L.jsxs(Ui,{children:[L.jsx(Hi,{hidden:!(e!=null&&e.user),side:"top",align:"center",children:(t=e==null?void 0:e.user)==null?void 0:t.name}),L.jsx(bs,{asChild:!0,children:L.jsx("div",{className:"opencopilot-rounded-lg opencopilot-shrink-0 opencopilot-bg-accent opencopilot-h-7 opencopilot-w-7 opencopilot-object-cover opencopilot-aspect-square hover:opencopilot-shadow opencopilot-border-primary-light opencopilot-border opencopilot-flex opencopilot-items-center opencopilot-justify-center",children:L.jsx("span",{className:"opencopilot-text-xl opencopilot-text-primary opencopilot-fill-current",children:L.jsx(w$,{})})})})]})}function xg({message:e,timestamp:t,id:n}){var s;const{displayText:r}=xf({text:e,every:1e-4,shouldStart:!0}),[o,i]=A$(),{messages:l}=$i(),a=((s=D$(l))==null?void 0:s.id)===n;return L.jsxs("div",{className:"opencopilot-p-2 group opencopilot-w-full opencopilot-shrink-0",children:[L.jsxs("div",{className:"opencopilot-flex opencopilot-select-none opencopilot-items-start opencopilot-gap-3 opencopilot-w-full",dir:"auto",children:[L.jsx(_w,{}),L.jsx("div",{className:"opencopilot-space-y-2 opencopilot-flex-1",children:L.jsx("div",{className:"opencopilot-w-fit",children:L.jsx("div",{dir:"auto",children:L.jsx(fw,{remarkPlugins:[v$],className:"opencopilot-prose opencopilot-prose-slate opencopilot-font-medium opencopilot-text-sm opencopilot-prose-sm prose-h1:opencopilot-font-medium prose-h2:opencopilot-font-normal prose-headings:opencopilot-my-1 opencopilot-max-w-full",children:r})})})})]}),a&&L.jsxs("div",{className:"opencopilot-w-full opencopilot-ps-10 opencopilot-flex opencopilot-items-center opencopilot-justify-between",children:[L.jsx("div",{children:t&&L.jsxs("span",{className:"opencopilot-text-xs opencopilot-m-0",children:["Bot · ",O$(t)]})}),L.jsx("button",{className:"opencopilot-text-lg opencopilot-justify-self-end",onClick:()=>i(r),children:o?L.jsx($$,{className:"opencopilot-text-emerald-500"}):L.jsx(_$,{})})]})]})}function I$(){const{displayText:e}=xf({text:"Bot is Thinking..."});return L.jsxs("div",{className:"opencopilot-p-2 opencopilot-flex opencopilot-items-center opencopilot-shrink-0 opencopilot-gap-3 opencopilot-w-full",children:[L.jsx("div",{className:"loading opencopilot-flex-col opencopilot-w-7 opencopilot-flex opencopilot-h-7 opencopilot-bg-accent opencopilot-text-primary opencopilot-rounded-lg opencopilot-shrink-0 opencopilot-mt-auto flex-center",children:L.jsx(WC,{height:"15",width:"15",color:"var(--opencopilot-primary-clr)",visible:!0})}),L.jsx("div",{className:"opencopilot-space-y-2 opencopilot-flex-1",children:L.jsx("div",{className:"mesg_body opencopilot-w-fit opencopilot-whitespace-nowrap opencopilot-max-w-full",children:L.jsx("p",{className:"opencopilot-text-sm opencopilot-lowercase",children:e})})})]})}function F$({content:e,timestamp:t}){return L.jsxs("div",{dir:"auto",className:"opencopilot-w-full opencopilot-overflow-x-auto opencopilot-shrink-0 opencopilot-max-w-full last-of-type:opencopilot-mb-10 opencopilot-bg-accent opencopilot-p-2 opencopilot-flex opencopilot-gap-3 opencopilot-items-center",children:[L.jsx(N$,{}),L.jsx("div",{children:L.jsxs(Ui,{children:[L.jsx(bs,{asChild:!0,children:L.jsx("p",{className:"opencopilot-prose opencopilot-prose-slate opencopilot-font-medium opencopilot-text-sm opencopilot-prose-sm",children:e})}),L.jsx(Hi,{children:L.jsx("span",{children:t&&T$(t)})})]})})]})}function j$({message:e}){const{displayText:t}=xf({text:"Error sending the message.",every:.001});return L.jsx("div",{className:"opencopilot-clear-both opencopilot-shrink-0 opencopilot-w-full opencopilot-p-2",children:L.jsxs("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-gap-3 opencopilot-w-full",children:[L.jsx(_w,{error:!0}),L.jsx("div",{className:"opencopilot-text-rose-500 opencopilot-text-sm",children:t})]})})}const M$=e=>[(n,r)=>{if(e.current){const{scrollWidth:o,scrollHeight:i}=e.current,l=o-e.current.clientWidth,a=i-e.current.clientHeight,s=n/100*l,u=r/100*a;e.current.scrollTo(s,u)}}];function B$(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var U$=x.useLayoutEffect,H$=function(t){var n=x.useRef(t);return U$(function(){n.current=t}),n},bg=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},W$=function(t,n){var r=x.useRef();return x.useCallback(function(o){t.current=o,r.current&&bg(r.current,null),r.current=n,n&&bg(n,o)},[n])},kg={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},V$=function(t){Object.keys(kg).forEach(function(n){t.style.setProperty(n,kg[n],"important")})},Sg=V$,it=null,Cg=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function G$(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),it||(it=document.createElement("textarea"),it.setAttribute("tabindex","-1"),it.setAttribute("aria-hidden","true"),Sg(it)),it.parentNode===null&&document.body.appendChild(it);var o=e.paddingSize,i=e.borderSize,l=e.sizingStyle,a=l.boxSizing;Object.keys(l).forEach(function(d){var f=d;it.style[f]=l[f]}),Sg(it),it.value=t;var s=Cg(it,e);it.value=t,s=Cg(it,e),it.value="x";var u=it.scrollHeight-o,p=u*n;a==="border-box"&&(p=p+o+i),s=Math.max(p,s);var c=u*r;return a==="border-box"&&(c=c+o+i),s=Math.min(c,s),[s,u]}var Eg=function(){},q$=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},Y$=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],Q$=!!document.documentElement.currentStyle,K$=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=q$(Y$,n),o=r.boxSizing;if(o==="")return null;Q$&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),l=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:l}},X$=K$;function Rw(e,t,n){var r=H$(n);x.useLayoutEffect(function(){var o=function(l){return r.current(l)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var Z$=function(t){Rw(window,"resize",t)},J$=function(t){Rw(document.fonts,"loadingdone",t)},e_=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],t_=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,l=t.onChange,a=l===void 0?Eg:l,s=t.onHeightChange,u=s===void 0?Eg:s,p=B$(t,e_),c=p.value!==void 0,d=x.useRef(null),f=W$(d,n),h=x.useRef(0),m=x.useRef(),w=function(){var v=d.current,C=r&&m.current?m.current:X$(v);if(C){m.current=C;var E=G$(C,v.value||v.placeholder||"x",i,o),k=E[0],O=E[1];h.current!==k&&(h.current=k,v.style.setProperty("height",k+"px","important"),u(k,{rowHeight:O}))}},g=function(v){c||w(),a(v)};return x.useLayoutEffect(w),Z$(w),J$(w),x.createElement("textarea",ge({},p,{onChange:g,ref:f}))},n_=x.forwardRef(t_);function r_(e){return zr({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M1 1.91L1.78 1.5L15 7.44899V8.3999L1.78 14.33L1 13.91L2.58311 8L1 1.91ZM3.6118 8.5L2.33037 13.1295L13.5 7.8999L2.33037 2.83859L3.6118 7.43874L9 7.5V8.5H3.6118Z"}}]})(e)}function o_(e){return zr({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M13.1459 11.0499L12.9716 9.05752L15.3462 8.84977C14.4471 7.98322 13.2242 7.4503 11.8769 7.4503C9.11547 7.4503 6.87689 9.68888 6.87689 12.4503C6.87689 15.2117 9.11547 17.4503 11.8769 17.4503C13.6977 17.4503 15.2911 16.4771 16.1654 15.0224L18.1682 15.5231C17.0301 17.8487 14.6405 19.4503 11.8769 19.4503C8.0109 19.4503 4.87689 16.3163 4.87689 12.4503C4.87689 8.58431 8.0109 5.4503 11.8769 5.4503C13.8233 5.4503 15.5842 6.24474 16.853 7.52706L16.6078 4.72412L18.6002 4.5498L19.1231 10.527L13.1459 11.0499Z",fill:"currentColor"}}]})(e)}function i_(e){return zr({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 12h1m8 -9v1m8 8h1m-15.4 -6.4l.7 .7m12.1 -.7l-.7 .7"}},{tag:"path",attr:{d:"M9 16a5 5 0 1 1 6 0a3.5 3.5 0 0 0 -1 3a2 2 0 0 1 -4 0a3.5 3.5 0 0 0 -1 -3"}},{tag:"path",attr:{d:"M9.7 17l4.6 0"}}]})(e)}function l_(){const{data:e}=p1(),{messages:t,sendMessage:n}=$i();return L.jsx(L.Fragment,{children:wg(t)&&!wg(e==null?void 0:e.inital_questions)&&L.jsxs("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-gap-4 opencopilot-justify-between opencopilot-w-full opencopilot-px-4",children:[L.jsx("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-flex-wrap opencopilot-gap-2 opencopilot-flex-1",children:e==null?void 0:e.inital_questions.map((r,o)=>L.jsx("button",{className:"opencopilot-text-xs opencopilot-w-fit opencopilot-font-semibold opencopilot-whitespace-nowrap opencopilot-px-2.5 opencopilot-py-1 opencopilot-rounded-full opencopilot-bg-accent opencopilot-text-primary",onClick:()=>{n({from:"user",content:r,id:_f()})},children:r},o))}),L.jsxs(Ui,{children:[L.jsx(bs,{children:L.jsx("span",{className:"opencopilot-text-xl opencopilot-text-primary opencopilot-mb-auto",children:L.jsx(i_,{})})}),L.jsx(Hi,{asChild:!0,children:L.jsx("span",{className:"opencopilot-text-xs opencopilot-font-medium fade-in-bottom opencopilot-px-2 opencopilot-py-1 opencopilot-mb-3",children:"suggestions"})})]})]})})}function a_(){const[e,t]=x.useState(""),n=x.useRef(null),{sendMessage:r,reset:o,messages:i}=$i(),{loading:l}=$i(),a=e.trim().length>0,s=p=>{const c=p.currentTarget.value;t(c)};function u(){e.trim().length>0&&(t(""),r({from:"user",content:e,id:_f()}))}return L.jsxs("footer",{className:"opencopilot-p-2 opencopilot-flex opencopilot-w-full opencopilot-flex-col opencopilot-gap-2",children:[L.jsx("div",{className:"opencopilot-overflow-y-auto opencopilot-w-full ",children:L.jsx(l_,{})}),L.jsxs("div",{className:"opencopilot-w-full opencopilot-flex opencopilot-items-center opencopilot-ring-[#334155]/60 opencopilot-transition-colors opencopilot-justify-between opencopilot-ring-1 opencopilot-overflow-hidden focus-within:opencopilot-ring-primary opencopilot-gap-2 opencopilot-bg-accent opencopilot-p-2 opencopilot-rounded-2xl",children:[L.jsx("div",{className:"opencopilot-flex-1",children:L.jsx(n_,{dir:"auto",ref:n,autoFocus:!0,onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),u())},disabled:l,maxRows:4,rows:1,value:e,onChange:s,className:"opencopilot-w-full opencopilot-resize-none opencopilot-bg-transparent focus-visible:opencopilot-outline-none opencopilot-border-none focus:opencopilot-outline-none focus:opencopilot-border-none opencopilot-scrollbar-thin opencopilot-leading-tight opencopilot-whitespace-pre-wrap opencopilot-py-1.5 opencopilot-px-4 placeholder:opencopilot-align-middle opencopilot-overflow-auto opencopilot-outline-none opencopilot-text-accent2 opencopilot-text-[14px] placeholder:opencopilot-text-xs opencopilot-font-normal"})}),L.jsxs("div",{className:"opencopilot-flex opencopilot-items-center opencopilot-justify-center opencopilot-gap-2 opencopilot-h-fit opencopilot-px-2 opencopilot-text-lg",children:[L.jsxs(Ui,{children:[L.jsx(bs,{asChild:!0,children:L.jsx("button",{onClick:o,className:"opencopilot-text-xl disabled:opencopilot-opacity-40 disabled:opencopilot-pointer-events-none disabled:opencopilot-cursor-not-allowed opencopilot-text-[#5e5c5e] opencopilot-transition-all",disabled:!(i.length>0),children:L.jsx(o_,{})})}),L.jsx(Hi,{children:"reset chat"})]}),L.jsx("button",{onClick:u,className:"opencopilot-text-xl disabled:opencopilot-opacity-40 disabled:opencopilot-pointer-events-none disabled:opencopilot-cursor-not-allowed opencopilot-text-[#5e5c5e] opencopilot-transition-all",disabled:l||!a,children:L.jsx(r_,{})})]})]})]})}function s_({data:e,render:t,fallback:n}){return e.length===0?n:e.map((r,o)=>t(r,o))}function u_(){const e=x.useRef(null),[t]=M$(e),{messages:n,loading:r,failedMessage:o}=$i(),i=Ni(),l=i==null?void 0:i.initialMessage;return x.useEffect(()=>{t(0,100)},[]),x.useEffect(()=>{t(0,100)},[n,t]),L.jsxs("div",{className:"opencopilot-w-full opencopilot-flex opencopilot-h-full opencopilot-flex-col opencopilot-items-start opencopilot-relative",children:[L.jsx(MC,{}),L.jsx("main",{ref:e,className:"opencopilot-flex-1 opencopilot-w-full opencopilot-overflow-x-hidden opencopilot-shrink-0 opencopilot-overflow-auto opencopilot-scrollbar-thin opencopilot-scroll-smooth",children:L.jsxs("div",{className:"opencopilot-flex opencopilot-h-fit opencopilot-mt-auto opencopilot-flex-col opencopilot-py-2 opencopilot-max-h-full opencopilot-items-center opencopilot-gap-1 last:fade-in-right",children:[l&&L.jsx(xg,{message:l}),L.jsx(s_,{fallback:L.jsx("hr",{}),data:n,render:(a,s)=>{if(a.from==="bot"){if(a.type==="text")return L.jsx(xg,{timestamp:a.timestamp,id:a.id,message:a.response.text},s)}else if(a.from==="user")return L.jsx(F$,{id:a.id,timestamp:a.timestamp,content:a.content},s)}}),r&&L.jsx(I$,{}),o&&L.jsx(j$,{message:o})]})}),L.jsx(a_,{})]})}function c_(){return L.jsx(z$,{children:L.jsx(u_,{})})}const p_=typeof window>"u";function f_({triggerSelector:e}){const[t,n]=B0();return x.useEffect(()=>{if(p_)return;const r=document.querySelector(e);if(r)return r.addEventListener("click",n),()=>r.removeEventListener("click",n);console.warn("The trigger element can't be found, make sure it is present in the DOM")},[e,n]),L.jsx("div",{className:Tn(t&&"!opencopilot-z-[100000] opencopilot-transition-all opencopilot-shadow-lg opencopilot-ease-in sm:opencopilot-w-96 opencopilot-fixed opencopilot-w-screen opencopilot-h-screen opencopilot-top-0 opencopilot-bottom-0 opencopilot-right-0"),children:L.jsx("div",{"data-open":t,className:Tn("opencopilot-font-inter opencopilot-overflow-hidden opencopilot-h-full sm:opencopilot-rounded-xl opencopilot-bg-white","opencopilot-opacity-0 opencopilot-transition-opacity opencopilot-ease",t&&"opencopilot-opacity-100 opencopilot-animate-in opencopilot-fade-in",!t&&"opencopilot-hidden opencopilot-animate-out opencopilot-fade-out"),children:L.jsx(c_,{})})})}function d_({triggerSelector:e,...t}){const n=document.createElement("style");n.innerHTML=ik,document.body.appendChild(n);const r=document.createElement("div");r.id="opencopilot-aicopilot",document.body.appendChild(r),Pu.createRoot(r).render(L.jsx(TS,{options:{...t},children:L.jsx(f_,{triggerSelector:e})}))}window.initAiCoPilot=d_; diff --git a/backend/routes/api.php b/backend/routes/api.php index f0adb65b5..7ed680081 100644 --- a/backend/routes/api.php +++ b/backend/routes/api.php @@ -26,6 +26,7 @@ Route::get('/copilots', [ChatbotController::class, 'index']); +Route::get('/copilot/{sessions}/c/{id}', [ChatbotController::class, 'sessions']); Route::post('/copilot/swagger', [ChatbotController::class, 'handleSwaggerFile']); Route::get('/copilot/{id}', [ChatbotSettingController::class, 'generalSettings']); Route::delete('/copilot/{id}', [ChatbotSettingController::class, 'deleteBot']); diff --git a/copilot-widget/index.html b/copilot-widget/index.html index b58b31112..33106773b 100644 --- a/copilot-widget/index.html +++ b/copilot-widget/index.html @@ -19,6 +19,7 @@ token: "1RuzS7w5ceGaN6CiK0J7", triggerSelector: "#triggerSelector", apiUrl: "https://cloud.openchat.so/api", + defaultOpen: true, headers: [ { Authorization: "Bearer your_auth_token_goes_here", diff --git a/copilot-widget/lib/contexts/ConfigData.tsx b/copilot-widget/lib/contexts/ConfigData.tsx index 1df3375e3..d717a262b 100644 --- a/copilot-widget/lib/contexts/ConfigData.tsx +++ b/copilot-widget/lib/contexts/ConfigData.tsx @@ -3,7 +3,7 @@ import { ReactNode, createContext, useContext } from "react"; export type ConfigDataContextType = Pick< Options, - "token" | "initialMessage" | "headers" | "apiUrl" | "user" + "token" | "initialMessage" | "headers" | "apiUrl" | "user" | "defaultOpen" >; const ConfigDataContext = createContext( diff --git a/copilot-widget/lib/contexts/Controller.tsx b/copilot-widget/lib/contexts/Controller.tsx index 6592a68ff..cf9944bf2 100644 --- a/copilot-widget/lib/contexts/Controller.tsx +++ b/copilot-widget/lib/contexts/Controller.tsx @@ -54,7 +54,7 @@ const ChatProvider: React.FC<{ children: ReactNode }> = ({ children }) => { "/chat/send", { ...message, - headers: config?.headers || [], + headers: config?.headers, user: config?.user, } ); diff --git a/copilot-widget/lib/contexts/WidgetState.tsx b/copilot-widget/lib/contexts/WidgetState.tsx index 1b00debcd..860ed55fe 100644 --- a/copilot-widget/lib/contexts/WidgetState.tsx +++ b/copilot-widget/lib/contexts/WidgetState.tsx @@ -1,5 +1,6 @@ import { ReactNode, createContext, useContext } from "react"; import useToggle from "../hooks/useToggle"; +import { useConfigData } from "./ConfigData"; const StateContext = createContext | undefined>( undefined @@ -15,6 +16,7 @@ export function useWidgetStateContext(): ReturnType { } export default function WidgetState({ children }: { children: ReactNode }) { - const data = useToggle(false) + const cdata = useConfigData() + const data = useToggle(cdata?.defaultOpen || false) return {children}; } diff --git a/copilot-widget/lib/types/options.ts b/copilot-widget/lib/types/options.ts index a69cb2ea1..53161697e 100644 --- a/copilot-widget/lib/types/options.ts +++ b/copilot-widget/lib/types/options.ts @@ -1,9 +1,10 @@ export type Options = { token: string; - headers?: Record[]; + headers?: Record; initialMessage: string; triggerSelector: string; apiUrl: string; + defaultOpen?: boolean; user?: { name?: string; }; diff --git a/copilot-widget/package.json b/copilot-widget/package.json index a2809a818..5e3b528a3 100644 --- a/copilot-widget/package.json +++ b/copilot-widget/package.json @@ -1,7 +1,7 @@ { "name": "@openchatai/copilot-widget", "private": false, - "version": "1.1.2", + "version": "1.2.0", "type": "module", "scripts": { "dev": "vite", diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/CopilotWidget.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/CopilotWidget.tsx index 3495be2d6..bc44cc9f5 100644 --- a/dashboard/app/(copilot)/copilot/[copilot_id]/CopilotWidget.tsx +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/CopilotWidget.tsx @@ -1,26 +1,39 @@ +import { Button } from '@/components/ui/button'; import { CopilotWidget, Root } from '@openchatai/copilot-widget'; +import { ErrorBoundary } from "react-error-boundary"; export default function Widget({ token }: { token: string }) { - return -
- + return { + return
+
+

Something went wrong

+ +
- + }}> + + +
+ +
+
+
} \ No newline at end of file diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ChatScreen.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ChatScreen.tsx new file mode 100644 index 000000000..50439f158 --- /dev/null +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ChatScreen.tsx @@ -0,0 +1,76 @@ +'use client'; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { useAtomValue } from "jotai"; +import { activeSessionId } from "./atoms"; +import useSWR from "swr"; +import { ChatMessageType, getConversationBySessionId } from "@/data/conversations"; +import Loader from "@/components/ui/Loader"; +import { format } from 'timeago.js'; +import { EmptyBlock } from "@/components/domain/EmptyBlock"; + +function UserMessage({ message, created_at }: ChatMessageType) { + return ( +
+
+

+ {message} +

+ + {format(created_at)} + +
+
+ ); +} +function CopilotMessage({ message, created_at }: ChatMessageType) { + return ( +
+ + C + +
+

+ {message} +

+ {format(created_at)} +
+
+ ); +} +function ChatDivider({ content }: { content: string }) { + return ( +
+ + {content} + +
+ ); +} + +export function ChatScreen() { + const activeid = useAtomValue(activeSessionId); + const { + data: chat, + isLoading + } = useSWR(activeid, getConversationBySessionId) + return ( +
+ { + isLoading && + } + { + chat ? chat?.data.map((c, i) => { + if (c.from_user) { + return + } else if (!c.from_user) { + return + } + }) : +

+ Select a conversation to start chatting +

+
+ } +
+ ); +} diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ConversationAside.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ConversationAside.tsx new file mode 100644 index 000000000..d703e9757 --- /dev/null +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ConversationAside.tsx @@ -0,0 +1,53 @@ +"use client"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { useAtomValue } from "jotai"; +import { Bookmark, CheckCircle, Trash2 } from "lucide-react"; +import { activeSessionId } from "./atoms"; + +export function ConversationAside() { + const activeid = useAtomValue(activeSessionId); + + return ( + activeid && + + ); +} diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ConversationHeader.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ConversationHeader.tsx new file mode 100644 index 000000000..b4b334c74 --- /dev/null +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ConversationHeader.tsx @@ -0,0 +1,12 @@ +import React from "react"; +import { HeaderShell } from "@/components/domain/HeaderShell"; + +export function ConversationHeader() { + return ( + +

+ Conversation +

+
+ ); +} diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ListConverations.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ListConverations.tsx new file mode 100644 index 000000000..b36bd4df5 --- /dev/null +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/ListConverations.tsx @@ -0,0 +1,48 @@ +"use client"; +import { useAtom } from "jotai"; +import { activeSessionId } from "./atoms"; +import { cn } from "@/lib/utils"; +import useSWR from "swr"; +import { useCopilot } from "../../../_context/CopilotProvider"; +import { ConversationType, getSessionsByBotId } from "@/data/conversations"; +import { format } from 'timeago.js'; +function Conversation(props: ConversationType) { + const [activeid, setActiveId] = useAtom(activeSessionId); + const isActive = activeid === props.session_id; + return ( +
  • setActiveId(props.session_id)} + role="button" + className={cn( + "w-full border border-l-[3px] p-4 transition-colors last-of-type:mb-2", + isActive + ? "sticky bottom-0 left-0 top-0 !border-l-primary bg-accent" + : "border-x-transparent bg-white border-border", + )} + > +
    +

    {props.first_message.message}

    +

    {format(props.first_message.created_at)}

    +
    +
  • + ); +} + +export function ListConversations() { + const { + id: copilotId, + } = useCopilot(); + const { + data: conversations + } = useSWR(copilotId + "/conversations", async () => (await getSessionsByBotId(copilotId))?.data) + return ( +
    +
      + {conversations?.map((c, i) => ( + + ))} +
    +
    + ); +} diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/atoms.ts b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/atoms.ts new file mode 100644 index 000000000..56b12ec80 --- /dev/null +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/_parts/atoms.ts @@ -0,0 +1,3 @@ +import { atom } from "jotai"; + +export const activeSessionId = atom(null); diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/layout.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/layout.tsx index 78541a753..db7e2e71f 100644 --- a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/layout.tsx +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/layout.tsx @@ -1,7 +1,5 @@ -import { HeaderShell } from "@/components/domain/HeaderShell"; -import { Button } from "@/components/ui/button"; -import { RefreshCcw } from "lucide-react"; import React from "react"; +import { ListConversations } from "./_parts/ListConverations"; type Props = { children: React.ReactNode; @@ -13,15 +11,15 @@ type Props = { export default function SettingsLayout({ children, params }: Props) { const copilotBase = `/copilot/${params.copilot_id}/conversations`; return ( -
    - -

    - Conversations -

    - -
    +
    +
    +
    +

    + Conversations +

    +
    + +
    {children}
    ); diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/page.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/page.tsx index 5be4efb64..2a1b42451 100644 --- a/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/page.tsx +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/conversations/page.tsx @@ -1,10 +1,18 @@ import React from "react"; +import { ConversationAside } from "./_parts/ConversationAside"; +import { ChatScreen } from "./_parts/ChatScreen"; + +import { ConversationHeader } from "./_parts/ConversationHeader"; + export default function Conversations() { return ( -
    -
    -

    Nothing here Yet

    -

    Work in Progress

    +
    +
    +
    + + +
    +
    ); diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/AddDataSource.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/AddDataSource.tsx index e3fba4340..e58845cef 100644 --- a/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/AddDataSource.tsx +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/AddDataSource.tsx @@ -81,7 +81,7 @@ function AddUrlDataSource() { title: "Data source(s) added successfully", variant: "success" }); - _.delay(() => setDialog(null), 2000) + _.delay(() => setDialog(null), 1000) } else { toast({ title: "Error adding data source(s)", diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/KnowledgeTable.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/KnowledgeTable.tsx index a0bbdf06c..f2fbfa608 100644 --- a/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/KnowledgeTable.tsx +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/knowledge/_parts/KnowledgeTable.tsx @@ -14,7 +14,7 @@ import { HoverCardTrigger, } from "@/components/ui/hover-card"; import { Checkbox } from "@/components/ui/checkbox"; -import { Minus, Trash2, ChevronsUpDown } from "lucide-react"; +import { Minus, Trash2, ChevronsUpDown, RotateCcw, CheckCircle, XCircle, RotateCw } from "lucide-react"; import { ColumnDef, ColumnFiltersState, @@ -29,20 +29,20 @@ import { useReactTable, } from "@tanstack/react-table"; import _ from "lodash"; -import { timeSince } from "@/lib/timesince"; import { Button } from "@/components/ui/button"; import { useAtomValue } from "jotai"; import { searchQueryAtom } from "./searchAtom"; import { EmptyBlock } from "@/components/domain/EmptyBlock"; import useSWR from "swr"; -import { getDataSourcesByBotId } from "@/data/knowledge"; +import { Datasource, getDataSourcesByBotId } from "@/data/knowledge"; import { useCopilot } from "../../../_context/CopilotProvider"; import Link from "next/link"; +import { format } from 'timeago.js' export type DataSources = { id: string; name: string; type: string; - status: string; + status: Datasource['status']; date: Date | number | string; source: string; }; @@ -91,9 +91,20 @@ const columns: ColumnDef[] = [ { accessorKey: "status", header: "Status", - cell: ({ row }) => ( -
    {row.getValue("status")}
    - ), + cell: ({ row }) => { + const status = row.getValue("status").toUpperCase() as DataSources['status']; + switch (status) { + case "PENDING": + return + case "SUCCESS": + case "COMPLETED": + return + case "FAILED": + return + default: + return status; + } + } }, { accessorKey: "type", @@ -103,7 +114,7 @@ const columns: ColumnDef[] = [ { accessorKey: "date", header: "Date", - cell: ({ row }) => {timeSince(row.getValue("date"))} ago, + cell: ({ row }) => {format(row.getValue("date"), 'en-us')}, }, { accessorKey: "source", @@ -123,11 +134,9 @@ export function KnowledgeTable() { const [rowSelection, setRowSelection] = React.useState({}); const { data: dataSources, - isLoading } = useSWR(copilotId + '/data_sources', async () => { const resp = await getDataSourcesByBotId(copilotId); const data: DataSources[] = []; - console.log(resp.data) if (resp.data.web_sources) { resp.data.web_sources.forEach((item) => { data.push({ @@ -154,6 +163,8 @@ export function KnowledgeTable() { } return data + }, { + refreshInterval: 1000 * 10 }) const table = useReactTable({ data: dataSources || [], diff --git a/dashboard/app/(copilot)/copilot/[copilot_id]/page.tsx b/dashboard/app/(copilot)/copilot/[copilot_id]/page.tsx index f66ce418b..5d0fb5101 100644 --- a/dashboard/app/(copilot)/copilot/[copilot_id]/page.tsx +++ b/dashboard/app/(copilot)/copilot/[copilot_id]/page.tsx @@ -55,6 +55,9 @@ function InstallationSection() { Authorization: "Bearer your_auth_token_goes_here", AnyKey: "AnyValue" }, + user:{ + name:"Default User" + } } window.addEventListener("DOMContentLoaded", ()=>initAiCoPilot(options)); // window.onload `} @@ -119,8 +122,8 @@ export default function CopilotPage() {
    -
    -
    +
    +
    Attention @@ -138,7 +141,7 @@ export default function CopilotPage() {
    -
    +
    diff --git a/dashboard/app/globals.css b/dashboard/app/globals.css index 4afe05aa7..b9aa6a64c 100644 --- a/dashboard/app/globals.css +++ b/dashboard/app/globals.css @@ -20,7 +20,7 @@ --primary-foreground: 0 0% 98%; /* */ --accent-alt: 200 27% 96%; - --secondary: 189 28% 95%; + --secondary: 0 0% 96%; --secondary-foreground: 0 0% 9%; --muted: 0 0% 96.1%; diff --git a/dashboard/components/ui/avatar.tsx b/dashboard/components/ui/avatar.tsx index da33cd106..3bc53513a 100644 --- a/dashboard/components/ui/avatar.tsx +++ b/dashboard/components/ui/avatar.tsx @@ -1,24 +1,39 @@ -"use client" +"use client"; -import * as React from "react" -import * as AvatarPrimitive from "@radix-ui/react-avatar" - -import { cn } from "@/lib/utils" +import * as React from "react"; +import * as AvatarPrimitive from "@radix-ui/react-avatar"; +import { cn } from "@/lib/utils"; +import { cva, VariantProps } from "class-variance-authority"; +const avatarVariants = cva( + "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", + { + variants: { + size: { + small: "h-6 w-6", + medium: "h-8 w-8", + large: "h-10 w-10", + xlarge: "h-12 w-12", + xxlarge: "h-14 w-14", + }, + }, + defaultVariants: { + size: "medium", + }, + }, +); const Avatar = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( + React.ComponentPropsWithoutRef & + VariantProps +>(({ className, size, ...props }, ref) => ( -)) -Avatar.displayName = AvatarPrimitive.Root.displayName +)); +Avatar.displayName = AvatarPrimitive.Root.displayName; const AvatarImage = React.forwardRef< React.ElementRef, @@ -29,8 +44,8 @@ const AvatarImage = React.forwardRef< className={cn("aspect-square h-full w-full", className)} {...props} /> -)) -AvatarImage.displayName = AvatarPrimitive.Image.displayName +)); +AvatarImage.displayName = AvatarPrimitive.Image.displayName; const AvatarFallback = React.forwardRef< React.ElementRef, @@ -39,12 +54,12 @@ const AvatarFallback = React.forwardRef< -)) -AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName +)); +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; -export { Avatar, AvatarImage, AvatarFallback } +export { Avatar, AvatarImage, AvatarFallback }; diff --git a/dashboard/components/ui/popover.tsx b/dashboard/components/ui/popover.tsx index be4633085..fe89c979b 100644 --- a/dashboard/components/ui/popover.tsx +++ b/dashboard/components/ui/popover.tsx @@ -11,21 +11,30 @@ const PopoverTrigger = PopoverPrimitive.Trigger; const PopoverContentPrimitive = PopoverPrimitive.Content; const PopoverContent = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( - - - -)); + React.ComponentPropsWithoutRef & { + animated?: boolean; + } +>( + ( + { className, align = "center", animated = true, sideOffset = 4, ...props }, + ref, + ) => ( + + + + ), +); PopoverContent.displayName = PopoverPrimitive.Content.displayName; export { Popover, PopoverTrigger, PopoverContent, PopoverContentPrimitive }; diff --git a/dashboard/data/conversations.ts b/dashboard/data/conversations.ts new file mode 100644 index 000000000..214e2c02a --- /dev/null +++ b/dashboard/data/conversations.ts @@ -0,0 +1,37 @@ +import axios from "axios"; +const instance = axios.create({ + baseURL: "http://localhost:8888/backend/chat", +}); +export type ChatMessageType = { + id: string; + chatbot_id: string; + session_id: string; + message: string; + from_user: boolean; + created_at: string; +}; + +// http://localhost:8888/backend/chat/sessions/:sessionId/chats +export async function getConversationBySessionId(sessionId: string) { + if (!sessionId) return; + return instance.get(`/sessions/${sessionId}/chats`); +} + +export type ConversationType = { + first_message: { + id: number; + chatbot_id: string; + created_at: string; + from_user: boolean; + message: string; + session_id: string; + updated_at: string; + }; + session_id: string; +} + +// http://localhost:8888/backend/chat/b/:bot_id/chat_sessions +export async function getSessionsByBotId(bot_id: string) { + if (!bot_id) return; + return instance.get(`/b/${bot_id}/chat_sessions`); +} \ No newline at end of file diff --git a/dashboard/data/knowledge.ts b/dashboard/data/knowledge.ts index 09942ab93..433054471 100644 --- a/dashboard/data/knowledge.ts +++ b/dashboard/data/knowledge.ts @@ -25,11 +25,11 @@ export async function ingestDataSources(filenames: string[], bot_id: string) { }); } -type Datasource = { +export type Datasource = { chatbot_id: string; id: string; source: string; - status: string; + status: "SUCCESS" | "COMPLETED" | "FAILED" | "PENDING"; updated_at: string; } export async function getDataSourcesByBotId(bot_id: string) { diff --git a/dashboard/package.json b/dashboard/package.json index 87b990161..0ea9a7c28 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -12,7 +12,7 @@ "dependencies": { "@hookform/resolvers": "^3.3.1", "@openchatai/copilot-flows-editor": "^1.5.2", - "@openchatai/copilot-widget": "^1.1.1", + "@openchatai/copilot-widget": "^1.2.0", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-avatar": "^1.0.4", @@ -45,6 +45,7 @@ "react": "^18", "react-dom": "^18", "react-dropzone": "^14.2.3", + "react-error-boundary": "^4.0.11", "react-hook-form": "^7.47.0", "react-hotkeys-hook": "^4.4.1", "react-syntax-highlighter": "^15.5.0", @@ -54,6 +55,7 @@ "swr": "^2.2.4", "tailwind-merge": "^1.14.0", "tailwindcss-animate": "^1.0.7", + "timeago.js": "^4.0.2", "zod": "^3.22.3" }, "devDependencies": { diff --git a/dashboard/pnpm-lock.yaml b/dashboard/pnpm-lock.yaml index 25c3d0df6..70aaa4688 100644 --- a/dashboard/pnpm-lock.yaml +++ b/dashboard/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: ^1.5.2 version: 1.6.0(@radix-ui/react-alert-dialog@1.0.5)(@radix-ui/react-dialog@1.0.5)(@radix-ui/react-tooltip@1.0.7)(react-dom@18.2.0)(react@18.2.0) '@openchatai/copilot-widget': - specifier: ^1.1.1 - version: 1.1.1(react-dom@18.2.0)(react@18.2.0) + specifier: ^1.2.0 + version: 1.2.0(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-accordion': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.2.13)(@types/react@18.2.28)(react-dom@18.2.0)(react@18.2.0) @@ -110,6 +110,9 @@ dependencies: react-dropzone: specifier: ^14.2.3 version: 14.2.3(react@18.2.0) + react-error-boundary: + specifier: ^4.0.11 + version: 4.0.11(react@18.2.0) react-hook-form: specifier: ^7.47.0 version: 7.47.0(react@18.2.0) @@ -137,6 +140,9 @@ dependencies: tailwindcss-animate: specifier: ^1.0.7 version: 1.0.7(tailwindcss@3.3.3) + timeago.js: + specifier: ^4.0.2 + version: 4.0.2 zod: specifier: ^3.22.3 version: 3.22.4 @@ -445,8 +451,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@openchatai/copilot-widget@1.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Khc6k8mhbaNIEwQKI3oU6anAMzQGf7y5GFvJ34uEotoVHpsU6rDO7odq6HBs2Mv23Zmnt1REp1euUaOv30zMFg==} + /@openchatai/copilot-widget@1.2.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-OEpRHjp2hx5+Q2gjkZf0DjQWqnQoLkMSyuXP3vins0n418zn1UR/CDP3nSkiRu0Pm9LZKxP9lu4qziVRlXAmig==} peerDependencies: react: ^18.x react-dom: ^18.x @@ -4150,6 +4156,15 @@ packages: react: 18.2.0 dev: false + /react-error-boundary@4.0.11(react@18.2.0): + resolution: {integrity: sha512-U13ul67aP5DOSPNSCWQ/eO0AQEYzEFkVljULQIjMV0KlffTAhxuDoBKdO0pb/JZ8mDhMKFZ9NZi0BmLGUiNphw==} + peerDependencies: + react: '>=16.13.1' + dependencies: + '@babel/runtime': 7.23.2 + react: 18.2.0 + dev: false + /react-hook-form@7.47.0(react@18.2.0): resolution: {integrity: sha512-F/TroLjTICipmHeFlMrLtNLceO2xr1jU3CyiNla5zdwsGUGu2UOxxR4UyJgLlhMwLW/Wzp4cpJ7CPfgJIeKdSg==} engines: {node: '>=12.22.0'} @@ -4653,6 +4668,10 @@ packages: dependencies: any-promise: 1.3.0 + /timeago.js@4.0.2: + resolution: {integrity: sha512-a7wPxPdVlQL7lqvitHGGRsofhdwtkoSXPGATFuSOA2i1ZNQEPLrGnj68vOp2sOJTCFAQVXPeNMX/GctBaO9L2w==} + dev: false + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} diff --git a/docker-compose.yml b/docker-compose.yml index 32a48f252..8d91e0019 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,9 +5,9 @@ services: build: context: ./backend dockerfile: Dockerfile - image: codebanesr/backend:arm_edge # Add this line + image: codebanesr/backend:latest # Add this line ports: - - 5000:5000 + - 5001:5000 depends_on: - llm-server - mysql @@ -27,7 +27,7 @@ services: build: context: ./llm-server dockerfile: Dockerfile - image: codebanesr/llm-server:arm_edge # Add this line + image: codebanesr/llm-server:latest # Add this line volumes: - shared_data:/app/shared_data networks: @@ -55,7 +55,7 @@ services: build: context: ./workers dockerfile: Dockerfile - image: codebanesr/workers:arm_edge # Add this line + image: codebanesr/workers:latest # Add this line networks: - opencopilot_network volumes: @@ -74,7 +74,7 @@ services: build: context: ./dashboard dockerfile: Dockerfile - image: codebanesr/dashboard:arm_edge # Add this line + image: codebanesr/dashboard:latest # Add this line ports: - 8000:8000 volumes: diff --git a/k8s/backend-deployment.yaml b/k8s/backend-deployment.yaml index 090671e10..49e43dfca 100644 --- a/k8s/backend-deployment.yaml +++ b/k8s/backend-deployment.yaml @@ -37,7 +37,7 @@ spec: value: "3306" - name: DB_USERNAME value: dbuser - image: codebanesr/backend:arm_edge + image: codebanesr/backend:latest name: backend ports: - containerPort: 5000 @@ -47,6 +47,18 @@ spec: volumeMounts: - mountPath: /app/shared_data name: shared-data + + initContainers: + - name: php-migrations + image: codebanesr/backend:latest + command: ["/bin/sh", "-c"] + args: + - | + php artisan cache:clear + php artisan config:cache + php artisan migrate + php artisan key:generate + php artisan storage:link restartPolicy: Always volumes: - name: shared-data diff --git a/k8s/dashboard-deployment.yaml b/k8s/dashboard-deployment.yaml index 788cd6472..4136256d2 100644 --- a/k8s/dashboard-deployment.yaml +++ b/k8s/dashboard-deployment.yaml @@ -26,7 +26,7 @@ spec: io.kompose.service: dashboard spec: containers: - - image: codebanesr/dashboard:arm_edge + - image: codebanesr/dashboard:latest name: dashboard ports: - containerPort: 8000 diff --git a/k8s/llm-server-deployment.yaml b/k8s/llm-server-deployment.yaml index 92f01075f..bec060656 100644 --- a/k8s/llm-server-deployment.yaml +++ b/k8s/llm-server-deployment.yaml @@ -122,7 +122,7 @@ spec: configMapKeyRef: key: STORE name: configmap - image: codebanesr/llm-server:arm_edge + image: codebanesr/llm-server:latest name: llm-server ports: - containerPort: 8002 diff --git a/k8s/workers-deployment.yaml b/k8s/workers-deployment.yaml index b6fce80dc..e075e4b71 100644 --- a/k8s/workers-deployment.yaml +++ b/k8s/workers-deployment.yaml @@ -126,7 +126,7 @@ spec: configMapKeyRef: key: STORE name: configmap - image: codebanesr/workers:arm_edge + image: codebanesr/workers:latest name: workers resources: {} volumeMounts: diff --git a/llm-server/app.py b/llm-server/app.py index 5ea50bb22..bb06c480c 100644 --- a/llm-server/app.py +++ b/llm-server/app.py @@ -1,4 +1,5 @@ from flask import Flask, request, jsonify, Response +from models.repository.chat_history_repo import create_chat_history from routes.workflow.workflow_controller import workflow from routes.uploads.upload_controller import upload_controller from routes._swagger.controller import _swagger @@ -10,6 +11,8 @@ from routes.data_source.data_source_controller import datasource_workflow from dotenv import load_dotenv +from utils.vector_store_setup import init_qdrant_collections + load_dotenv() from opencopilot_db import create_database_schema @@ -23,7 +26,9 @@ app.register_blueprint(datasource_workflow, url_prefix="/data_sources") app.config.from_object(Config) -from routes.root_service import handle_request +from routes.root_service import extract_data, handle_request + +init_qdrant_collections() ## TODO: Implement caching for the swagger file content (no need to load it everytime) @@ -32,6 +37,13 @@ def handle() -> Response: data = request.get_json() try: response = handle_request(data) + create_chat_history(data["bot_id"], data["session_id"], True, data["text"]) + create_chat_history( + data["bot_id"], + data["session_id"], + False, + response["response"] or response["error"], + ) return jsonify(response) except Exception as e: struct_log.exception( diff --git a/llm-server/models/repository/chat_history_repo.py b/llm-server/models/repository/chat_history_repo.py index 47d3d57c3..1a986693b 100644 --- a/llm-server/models/repository/chat_history_repo.py +++ b/llm-server/models/repository/chat_history_repo.py @@ -1,9 +1,12 @@ from datetime import datetime -from typing import Optional, cast, List +from typing import Optional, cast, List, Dict, Union from opencopilot_db import ChatHistory, engine, pdf_data_source_model from sqlalchemy.orm import sessionmaker from datetime import datetime from typing import Optional, Tuple +from sqlalchemy import distinct +from sqlalchemy.orm import class_mapper +from langchain.schema import BaseMessage, AIMessage, HumanMessage Session = sessionmaker(bind=engine) @@ -69,6 +72,18 @@ def get_all_chat_history_by_session_id( return chats +def get_chat_message_as_llm_conversation(session_id: str) -> List[BaseMessage]: + chats = get_all_chat_history_by_session_id(session_id, 100) + conversations: List[BaseMessage] = [] + for chat in chats: + if chat.from_user == True: + conversations.append(HumanMessage(content=chat.message)) + elif chat.from_user == False: + conversations.append(AIMessage(content=chat.message)) + + return conversations + + def get_all_chat_history(limit: int = 10, offset: int = 0) -> List[ChatHistory]: """Retrieves all chat history records. @@ -169,3 +184,60 @@ def get_chat_history_for_retrieval_chain( user_query = None return chat_history + + +def get_unique_sessions_with_first_message_by_bot_id( + bot_id: str, limit: int = 20, offset: int = 0 +) -> List[Dict[str, Union[str, Optional[ChatHistory]]]]: + """ + Retrieve unique session_ids for a given bot_id with pagination, + along with the first message in each session. + + Args: + bot_id (str): The bot_id for which to retrieve session_ids. + limit (int, optional): The maximum number of results to return. Defaults to 20. + offset (int, optional): The number of results to skip from the beginning. Defaults to 0. + session (Session, optional): The SQLAlchemy session. Defaults to None. + + Returns: + List[Dict[str, Union[str, Optional[ChatHistory]]]]: A list of dictionaries containing + unique session_ids and their first messages. + """ + # If a session is not provided, create a new one + session = Session() + + # Use distinct to get unique session_ids + unique_session_ids = ( + session.query(distinct(ChatHistory.session_id)) + .filter_by(chatbot_id=bot_id) + .limit(limit) + .offset(offset) + .all() + ) + + result_list = [] + + for session_id in unique_session_ids: + # Get the first message in each session + first_message = ( + session.query(ChatHistory) + .filter_by(chatbot_id=bot_id, session_id=session_id[0]) + .order_by(ChatHistory.created_at.asc()) + .first() + ) + + # Convert ChatHistory object to a dictionary + if first_message: + first_message_dict = { + column.key: getattr(first_message, column.key) + for column in class_mapper(ChatHistory).mapped_table.columns + } + else: + first_message_dict = None + + # Create a dictionary with session_id and first_message + result_dict = {"session_id": session_id[0], "first_message": first_message_dict} + + result_list.append(result_dict) + + return result_list diff --git a/llm-server/requirements.txt b/llm-server/requirements.txt index eafce4622..3c6e4dbdd 100644 --- a/llm-server/requirements.txt +++ b/llm-server/requirements.txt @@ -77,7 +77,7 @@ openai==0.28.1 openapi-schema-validator==0.6.2 openapi-spec-validator==0.7.1 opencopilot-db==2.0.0 -opencopilot-utils==2.0.0 +opencopilot-utils==2.1.0 opentelemetry-api==1.21.0 opentelemetry-exporter-otlp-proto-common==1.21.0 opentelemetry-exporter-otlp-proto-grpc==1.21.0 diff --git a/llm-server/routes/_swagger/controller.py b/llm-server/routes/_swagger/controller.py index 576ba336f..442708356 100644 --- a/llm-server/routes/_swagger/controller.py +++ b/llm-server/routes/_swagger/controller.py @@ -1,16 +1,9 @@ -from flask import Flask, request, jsonify, Blueprint, request, Response +from flask import request, jsonify, Blueprint, request, Response -import json, yaml, re from bson import ObjectId import routes._swagger.service as swagger_service from utils.db import Database -from qdrant_client import QdrantClient -from qdrant_client.http import models - -import os - -client = QdrantClient(url=os.getenv("QDRANT_URL", "http://qdrant:6333")) db_instance = Database() mongo = db_instance.get_db() @@ -72,10 +65,6 @@ def add_swagger_file(id) -> Response: def add_init_swagger_file(bot_id: str) -> Response: body = request.get_json() swagger_url = body["swagger_url"] - client.create_collection( - collection_name=bot_id, - vectors_config=models.VectorParams(size=1536, distance=models.Distance.COSINE), - ) result = swagger_service.save_swaggerfile_to_mongo(swagger_url, bot_id) return jsonify(result) diff --git a/llm-server/routes/chat/chat_controller.py b/llm-server/routes/chat/chat_controller.py index c5bc981f6..97e275f6f 100644 --- a/llm-server/routes/chat/chat_controller.py +++ b/llm-server/routes/chat/chat_controller.py @@ -1,4 +1,7 @@ -from models.repository.chat_history_repo import get_all_chat_history_by_session_id +from models.repository.chat_history_repo import ( + get_all_chat_history_by_session_id, + get_unique_sessions_with_first_message_by_bot_id, +) from flask import Blueprint, request, jsonify from utils.db import Database from flask import Flask, request, jsonify, Blueprint, request, Response @@ -32,3 +35,17 @@ def get_session_chats(session_id: str) -> Response: ) return jsonify(chats_filtered) + + +# unique_session_ids = get_unique_session_ids(session) + + +@chat_workflow.route("/b//chat_sessions", methods=["GET"]) +def get_chat_sessions(bot_id: str) -> Response: + limit = request.args.get("limit", 20) + offset = request.args.get("offset", 0) + chat_history_sessions = get_unique_sessions_with_first_message_by_bot_id( + bot_id, limit, offset + ) + + return chat_history_sessions diff --git a/llm-server/routes/root_service.py b/llm-server/routes/root_service.py index 1ca8ab96d..83f6bd952 100644 --- a/llm-server/routes/root_service.py +++ b/llm-server/routes/root_service.py @@ -16,12 +16,10 @@ import os from typing import Dict, Any, cast from routes.workflow.utils.router import get_action_type +from utils.chat_models import CHAT_MODELS from utils.db import Database import json -from models.repository.chat_history_repo import ( - create_chat_history, - get_chat_history_for_retrieval_chain, -) +from models.repository.chat_history_repo import get_chat_history_for_retrieval_chain from utils.get_chat_model import get_chat_model from utils.process_app_state import process_state from prance import ResolvingParser @@ -49,6 +47,8 @@ FILE_NOT_FOUND = "File not found" FAILED_TO_CALL_API_ENDPOINT = "Failed to call or map API endpoint" +chat = get_chat_model(CHAT_MODELS.gpt_3_5_turbo) + def handle_request(data: Dict[str, Any]) -> Any: ( @@ -66,7 +66,7 @@ def handle_request(data: Dict[str, Any]) -> Any: check_required_fields(base_prompt, text, swagger_url) swagger_doc = None try: - action = get_action_type(text, bot_id) + action = get_action_type(text, bot_id, session_id) logging.info(f"Triggered action: {action}") if action == ActionType.ASSISTANT_ACTION: current_state = process_state(app, headers) @@ -84,6 +84,7 @@ def handle_request(data: Dict[str, Any]) -> Any: app, swagger_doc, session_id, + bot_id, ) bot_response = hasSingleIntent( @@ -100,21 +101,19 @@ def handle_request(data: Dict[str, Any]) -> Any: swagger_url, app, session_id, + bot_id, ) elif len(bot_response.ids) == 0: - return handle_no_api_call( - swagger_url, session_id, text, bot_response.bot_message - ) + return handle_no_api_call(bot_response.bot_message) - elif ( - action == ActionType.KNOWLEDGE_BASE_QUERY - or action == ActionType.GENERAL_QUERY - ): + elif action == ActionType.KNOWLEDGE_BASE_QUERY: sanitized_question = text.strip().replace("\n", " ") - vector_store = get_vector_store(StoreOptions(namespace=bot_id)) + vector_store = get_vector_store(StoreOptions(namespace="knowledgebase")) mode = "assistant" - chain = getConversationRetrievalChain(vector_store, mode, base_prompt) + chain = getConversationRetrievalChain( + vector_store, mode, base_prompt, bot_id + ) chat_history = get_chat_history_for_retrieval_chain(session_id, limit=40) response = chain( {"question": sanitized_question, "chat_history": chat_history}, @@ -122,18 +121,16 @@ def handle_request(data: Dict[str, Any]) -> Any: ) return {"response": response["answer"]} - # elif action == ActionType.GENERAL_QUERY: - # chat = get_chat_model("gpt-3.5-turbo") + elif action == ActionType.GENERAL_QUERY: + messages = [ + SystemMessage( + content="You are an ai assistant, that answers general queries in <= 3 sentences" + ), + HumanMessage(content=f"Answer the following: {text}"), + ] - # messages = [ - # SystemMessage( - # content="You are an ai assistant, that answers general queries in <= 3 sentences" - # ), - # HumanMessage(content=f"Answer the following: {text}"), - # ] - - # content = chat(messages).content - # return {"response": content} + content = chat(messages).content + return {"response": content} raise action except Exception as e: @@ -188,7 +185,9 @@ def get_qa_prompt_by_mode(mode: str, initial_prompt: Optional[str]) -> str: return initial_prompt if initial_prompt else "" -def getConversationRetrievalChain(vector_store: VectorStore, mode, initial_prompt: str): +def getConversationRetrievalChain( + vector_store: VectorStore, mode, initial_prompt: str, bot_id: str +): llm = get_llm() # template = get_qa_prompt_by_mode(mode, initial_prompt=initial_prompt) @@ -209,7 +208,9 @@ def getConversationRetrievalChain(vector_store: VectorStore, mode, initial_promp chain = ConversationalRetrievalChain.from_llm( llm, chain_type="stuff", - retriever=vector_store.as_retriever(), + retriever=vector_store.as_retriever( + search_kwargs={"filter": {"bot_id": bot_id}} + ), verbose=True, combine_docs_chain_kwargs={"prompt": prompt}, ) @@ -274,6 +275,7 @@ def handle_existing_workflow( app: str, swagger_doc: ResolvingParser, session_id: str, + bot_id: str, ) -> Dict[str, Any]: # use user defined workflows if exists, if not use auto_gen_workflow _workflow = mongo.workflows.find_one( @@ -292,10 +294,6 @@ def handle_existing_workflow( app, ) - create_chat_history(swagger_url, session_id, True, text) - create_chat_history( - swagger_url, session_id, False, output["response"] or output["error"] - ) return output @@ -308,6 +306,7 @@ def handle_api_calls( swagger_url: str, app: str, session_id: str, + bot_id: str, ) -> Dict[str, Any]: _workflow = create_workflow_from_operation_ids(ids, swagger_doc, text) output = run_workflow( @@ -321,21 +320,13 @@ def handle_api_calls( # m_workflow = mongo.auto_gen_workflows.insert_one(_workflow) # add_workflow_data_to_qdrant(m_workflow.inserted_id, _workflow, swagger_url) - create_chat_history(swagger_url, session_id, True, text) - create_chat_history( - swagger_url, session_id, False, output["response"] or output["error"] - ) return output -def handle_no_api_call( - swagger_url: str, session_id: str, text: str, bot_message: str -) -> Dict[str, str]: - create_chat_history(swagger_url, session_id, True, text) - create_chat_history(swagger_url, session_id, False, bot_message) +def handle_no_api_call(bot_message: str) -> Dict[str, str]: return {"response": bot_message} def handle_exception(e: Exception, event: str) -> Dict[str, Any]: struct_log.exception(payload={}, error=str(e), event="/handle_request") - return {"response": None, "error": "An error occured in hand"} + return {"response": None, "error": "An error occured in handle request"} diff --git a/llm-server/routes/workflow/extractors/convert_json_to_text.py b/llm-server/routes/workflow/extractors/convert_json_to_text.py index 187c18eb8..698cd65a6 100644 --- a/llm-server/routes/workflow/extractors/convert_json_to_text.py +++ b/llm-server/routes/workflow/extractors/convert_json_to_text.py @@ -3,16 +3,14 @@ from langchain.schema import HumanMessage, SystemMessage from typing import Any from routes.workflow.extractors.extract_json import extract_json_payload +from utils import get_chat_model +from utils.chat_models import CHAT_MODELS openai_api_key = os.getenv("OPENAI_API_KEY") def convert_json_to_text(user_input: str, api_response: str) -> str: - chat = ChatOpenAI( - openai_api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-3.5-turbo-16k", - temperature=0, - ) + chat = get_chat_model(CHAT_MODELS.gpt_3_5_turbo) messages = [ SystemMessage( diff --git a/llm-server/routes/workflow/extractors/extract_body.py b/llm-server/routes/workflow/extractors/extract_body.py index 7c966b0f8..45cf217d0 100644 --- a/llm-server/routes/workflow/extractors/extract_body.py +++ b/llm-server/routes/workflow/extractors/extract_body.py @@ -1,5 +1,6 @@ import os from langchain.schema import HumanMessage, SystemMessage +from utils.chat_models import CHAT_MODELS from utils.get_chat_model import get_chat_model from opencopilot_utils import get_llm @@ -20,7 +21,7 @@ async def gen_body_from_schema( app: Optional[str], current_state: Optional[str], ) -> Any: - chat = get_chat_model("gpt-3.5-turbo-16k") + chat = get_chat_model(CHAT_MODELS.gpt_3_5_turbo_16k) api_generation_prompt = None if app: module_name = f"integrations.custom_prompts.{app}" diff --git a/llm-server/routes/workflow/extractors/extract_param.py b/llm-server/routes/workflow/extractors/extract_param.py index 1a3b94571..3bdad0d11 100644 --- a/llm-server/routes/workflow/extractors/extract_param.py +++ b/llm-server/routes/workflow/extractors/extract_param.py @@ -1,6 +1,7 @@ import os from langchain.chat_models import ChatOpenAI from routes.workflow.extractors.extract_json import extract_json_payload +from utils.chat_models import CHAT_MODELS from utils.get_chat_model import get_chat_model from opencopilot_utils import get_llm from custom_types.t_json import JsonData @@ -15,7 +16,7 @@ async def gen_params_from_schema( param_schema: str, text: str, prev_resp: str, current_state: Optional[str] ) -> Optional[JsonData]: - chat = get_chat_model("gpt-3.5-turbo-16k") + chat = get_chat_model(CHAT_MODELS.gpt_3_5_turbo_16k) messages = [ SystemMessage( content="You are an intelligent machine learning model that can produce REST API's params / query params in json format, given the json schema, user input, data from previous api calls, and current application state." diff --git a/llm-server/routes/workflow/extractors/transform_api_response.py b/llm-server/routes/workflow/extractors/transform_api_response.py index a32a0eca4..455ae4934 100644 --- a/llm-server/routes/workflow/extractors/transform_api_response.py +++ b/llm-server/routes/workflow/extractors/transform_api_response.py @@ -4,17 +4,15 @@ from typing import Any from routes.workflow.extractors.extract_json import extract_json_payload from routes.lossy_compressors.truncate_json import truncate_json +from utils import get_chat_model +from utils.chat_models import CHAT_MODELS openai_api_key = os.getenv("OPENAI_API_KEY") def transform_api_response_from_schema(server_url: str, responseText: str) -> str: - chat = ChatOpenAI( - openai_api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-3.5-turbo-16k", - temperature=0, - ) + chat = get_chat_model(CHAT_MODELS.gpt_3_5_turbo_16k) responseText = truncate_json(json.loads(responseText)) messages = [ diff --git a/llm-server/routes/workflow/utils/__init__.py b/llm-server/routes/workflow/utils/__init__.py index 0fa4d7854..4f64333d4 100644 --- a/llm-server/routes/workflow/utils/__init__.py +++ b/llm-server/routes/workflow/utils/__init__.py @@ -6,3 +6,4 @@ from .get_swagger_op_by_id import * from .run_openapi_ops import * from .run_workflow import * +from utils.chat_models import * diff --git a/llm-server/routes/workflow/utils/detect_multiple_intents.py b/llm-server/routes/workflow/utils/detect_multiple_intents.py index 352217098..fa9e648ef 100644 --- a/llm-server/routes/workflow/utils/detect_multiple_intents.py +++ b/llm-server/routes/workflow/utils/detect_multiple_intents.py @@ -7,12 +7,16 @@ from langchain.chat_models import ChatOpenAI from langchain.schema import AIMessage, HumanMessage, SystemMessage +from utils.chat_models import CHAT_MODELS from utils.get_chat_model import get_chat_model from routes.workflow.extractors.extract_json import extract_json_payload import os import logging from prance import ResolvingParser -from models.repository.chat_history_repo import get_all_chat_history_by_session_id +from models.repository.chat_history_repo import ( + get_all_chat_history_by_session_id, + get_chat_message_as_llm_conversation, +) from opencopilot_db import ChatHistory logging.basicConfig(level=logging.INFO) @@ -88,42 +92,6 @@ def get_summaries(swagger_doc: ResolvingParser) -> str: return summaries_str -def generate_consolidated_requirement( - user_input: str, session_id: str -) -> Optional[str]: - """Generates a consolidated query from chat history and an AI chat. - - Args: - chat_history: A list of Message objects representing the chat history. - ai_chat: A ChatOpenAI object representing the AI chat. - - Returns: - A consolidated query string. - """ - chat = get_chat_model("gpt-3.5-turbo") - - history = get_all_chat_history_by_session_id(session_id) - if len(history) == 0: - return None - - conversation_str = join_conversations(history) - messages = [ - SystemMessage( - content="You are an AI model designed to generate a standalone prompt. The user message may also contain instructions for you as a bot, like generating some content in this message. You should act accordingly" - ), - HumanMessage( - content="You will receive user input. Based on the conversation and the current user prompt, I want you to convert the user prompt into a standalone prompt if the user prompt references something in conversation history." - ), - HumanMessage( - content="Conversation History: ({}), \n\n Current User input: ({}).".format( - conversation_str, user_input - ), - ), - ] - content = chat(messages).content - return content - - def hasSingleIntent( swagger_doc: ResolvingParser, user_requirement: str, @@ -132,31 +100,40 @@ def hasSingleIntent( app: str, ) -> BotMessage: summaries = get_summaries(swagger_doc) - chat = get_chat_model("gpt-3.5-turbo-16k") - - consolidated_user_requirement = ( - generate_consolidated_requirement(user_requirement, session_id) - or user_requirement - ) + chat = get_chat_model(CHAT_MODELS.gpt_3_5_turbo_16k) messages = [ SystemMessage( - content="You serve as an AI co-pilot tasked with identifying the correct sequence of API calls necessary to execute a user's action. To accomplish the task, you will be provided with information about the existing state of the application. A user input and list of api summaries. If the user is asking you to perform a `CRUD` operation, provide the list of operation ids of api calls needed in the `ids` field of the json. `bot_message` should consist of a straightforward sentence, free from any special characters. Note that the application uses current state as a cache, if you don't find the required information in the cache, you should try to find an api call to fetch that information. Your response MUST be a valid minified json" - ), - current_state - and HumanMessage( - content="Here is the current state of the application: {}".format( - current_state - ) - ), - HumanMessage( - content="Here's a list of api summaries {}.".format(summaries), - ), - HumanMessage( - content="user requirement: {}".format(consolidated_user_requirement) - ), - HumanMessage( - content="""Reply in the following json format ```{ + content="You serve as an AI co-pilot tasked with identifying the correct sequence of API calls necessary to execute a user's action. To accomplish the task, you will be provided with information about the existing state of the application and list of api summaries. If the user is asking you to perform a `CRUD` operation, provide the list of operation ids of api calls needed in the `ids` field of the json. `bot_message` should consist of a straightforward sentence, free from any special characters. Note that the application uses current state as a cache, if you don't find the required information in the cache, you should try to find an api call to fetch that information. Your response MUST be a valid minified json" + ) + ] + + # old conversations go here + prev_conversations = [] + if session_id: + prev_conversations = get_chat_message_as_llm_conversation(session_id) + + if len(prev_conversations) > 0: + messages.extend(prev_conversations) + + if current_state: + messages.extend( + [ + HumanMessage( + content="Here is the current state of the application: {}".format( + current_state + ) + ) + ] + ) + + messages.extend( + [ + HumanMessage( + content="Here's a list of api summaries {}.".format(summaries), + ), + HumanMessage( + content="""Reply in the following json format ```{ "ids": [ "list", "of", @@ -165,11 +142,13 @@ def hasSingleIntent( ], "bot_message": "Bot response here" }```""" - ), - HumanMessage( - content="If the user's question can be answered directly without making API calls, please respond appropriately in the `bot_message` section of the response and leaving the `ids` field empty ([])." - ), - ] + ), + HumanMessage( + content="If the question can be answered directly without making API calls, please respond appropriately in the `bot_message` section of the response and leaving the `ids` field empty ([])." + ), + HumanMessage(content=user_requirement), + ] + ) result = chat([x for x in messages if x is not None]) logging.info( diff --git a/llm-server/routes/workflow/utils/router.py b/llm-server/routes/workflow/utils/router.py index 6623c45a5..ee5be366c 100644 --- a/llm-server/routes/workflow/utils/router.py +++ b/llm-server/routes/workflow/utils/router.py @@ -6,76 +6,79 @@ from opencopilot_utils.get_vector_store import get_vector_store from opencopilot_utils import StoreOptions from custom_types.action_type import ActionType +from models.repository.chat_history_repo import get_chat_message_as_llm_conversation +from utils.chat_models import CHAT_MODELS from utils import get_chat_model from typing import Optional, Tuple, List from langchain.docstore.document import Document from langchain.vectorstores.base import VectorStore -from prance import ResolvingParser +from utils import struct_log -chat = get_chat_model("gpt-3.5-turbo") + +chat = get_chat_model(CHAT_MODELS.gpt_3_5_turbo) def get_relevant_docs(text: str, bot_id: str) -> Optional[str]: try: - score_threshold = float(os.getenv("SCORE_THRESHOLD_KB", 0.75)) - vector_store: VectorStore = get_vector_store(StoreOptions(bot_id)) - result = vector_store.similarity_search_with_relevance_scores( - text, score_threshold=score_threshold + score_threshold = float(os.getenv("SCORE_THRESHOLD_KB", "0.75")) + vector_store: VectorStore = get_vector_store(StoreOptions("knowledgebase")) + + retriever = vector_store.as_retriever( + search_kwargs={ + "k": 5, + "score_threshold": score_threshold, + "filter": {"bot_id": bot_id}, + }, ) + result = retriever.get_relevant_documents(text) + if result and len(result) > 0: - (document, score) = result[0] - return document.page_content + return result[0].page_content return None except Exception as e: - logging.info(f"[Error] {e}") + struct_log.exception(payload=text, error=str(e), event="get_relevant_docs") return None -def classify_text(user_requirement: str, context: str) -> ActionType: +def classify_text(user_requirement: str, context: str, session_id: str) -> ActionType: + prev_conversations = [] + if session_id: + prev_conversations = get_chat_message_as_llm_conversation(session_id) + messages = [ SystemMessage( - content="You are a multi-label classification model. Your reply should only be one of the allowed keywords" - ), - HumanMessage( - content=f""" - You must output one of '{ActionType.ASSISTANT_ACTION.value}', '{ActionType.KNOWLEDGE_BASE_QUERY.value}', '{ActionType.GENERAL_QUERY.value}' based on the following conditions - """ - ), - HumanMessage( - content=f""" - If the user's requirement would require making an API call to a third-party service, return the output as: {ActionType.ASSISTANT_ACTION.value}. - - Actions such as performing tasks, listing items, displaying information, and managing additions/removals are all categorized as assistant actions etc, are all assistant actions - """ - ), - HumanMessage( - content=f""" - If the user's requirement is related to this context ```{context}```, output: {ActionType.KNOWLEDGE_BASE_QUERY.value} - If you are unsure, output: {ActionType.GENERAL_QUERY.value} - """ - ), - HumanMessage( - content="Here's the user input {}".format(user_requirement), - ), + content=f"""You are a classification model, which when given user input can classify it into one of the three types below. If the user asks you to list something, show or delete something. You should output {ActionType.ASSISTANT_ACTION.value} because these require making api calls. {ActionType.KNOWLEDGE_BASE_QUERY.value}""" + ) ] + if len(prev_conversations) > 0: + messages.extend(prev_conversations) + + messages.extend( + [ + HumanMessage( + content=f"Here's the user requirement:```{user_requirement}```, and here's the context: ```{context}```. Now classify the user requirement." + ), + ] + ) + content = chat(messages).content if ActionType.ASSISTANT_ACTION.value in content: return ActionType.ASSISTANT_ACTION - elif ActionType.KNOWLEDGE_BASE_QUERY.value in content: + elif context is not None: return ActionType.KNOWLEDGE_BASE_QUERY return ActionType.GENERAL_QUERY -def get_action_type(user_requirement: str, bot_id: str) -> ActionType: - context = get_relevant_docs(user_requirement, bot_id) or [] +def get_action_type(user_requirement: str, bot_id: str, session_id: str) -> ActionType: + context = get_relevant_docs(user_requirement, bot_id) or None - route = classify_text(user_requirement, context) + route = classify_text(user_requirement, context, session_id) return route diff --git a/llm-server/routes/workflow/utils/run_openapi_ops.py b/llm-server/routes/workflow/utils/run_openapi_ops.py index d4bd48a14..85c99304e 100644 --- a/llm-server/routes/workflow/utils/run_openapi_ops.py +++ b/llm-server/routes/workflow/utils/run_openapi_ops.py @@ -41,7 +41,18 @@ def run_openapi_operations( current_state, ) - api_response = make_api_request(headers=headers, **api_payload.__dict__) + api_response = None + try: + struct_log.info( + payload=api_payload.__dict__, + event="make_api_call" + ) + + api_response = make_api_request(headers=headers, **api_payload.__dict__) + + except Exception as e: + struct_log.exception(error=str(e), event="make api call failed") + return {} # if a custom transformer function is defined for this operationId use that, otherwise forward it to the llm # so we don't necessarily have to defined mappers for all api endpoints @@ -63,16 +74,14 @@ def run_openapi_operations( except Exception as e: struct_log.exception( - payload={ + payload=json.dumps({ text, headers, server_base_url, app, - }, + }), error=str(e), event="/check_workflow_in_store", ) - # At this point we will retry the operation with hierarchical planner - raise e return convert_json_to_text(text, prev_api_response) diff --git a/llm-server/utils/chat_models.py b/llm-server/utils/chat_models.py new file mode 100644 index 000000000..d1c8777ca --- /dev/null +++ b/llm-server/utils/chat_models.py @@ -0,0 +1,14 @@ +from typing import NamedTuple + + +class ChatModels(NamedTuple): + gpt_3_5_turbo: str = "gpt-3.5-turbo" + gpt_3_5_turbo_16k: str = "gpt-3.5-turbo-16k" + claude_2_0: str = "claude-2.0" + mistral_openorca: str = "mistral-openorca" + nous_hermes = "nous-hermes" + llama2: str = "llama2" + xwinlm = "xwinlm" + + +CHAT_MODELS: ChatModels = ChatModels() diff --git a/llm-server/utils/get_chat_model.py b/llm-server/utils/get_chat_model.py index 6afd785e7..071cc4d12 100644 --- a/llm-server/utils/get_chat_model.py +++ b/llm-server/utils/get_chat_model.py @@ -1,28 +1,49 @@ from langchain.chat_models import ChatOpenAI -from langchain.chat_models import ChatOllama - +from langchain.chat_models import ChatOllama, ChatAnthropic +from .chat_models import CHAT_MODELS from typing import Optional import os localip = os.getenv("LOCAL_IP", "localhost") + + def get_chat_model(prop: str) -> ChatOpenAI: - if prop == "gpt-3.5-turbo": + if prop == CHAT_MODELS.gpt_3_5_turbo: return ChatOpenAI( openai_api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-3.5-turbo", + model=CHAT_MODELS.gpt_3_5_turbo, temperature=0, ) - elif prop == "gpt-3.5-turbo-16k": + elif prop == CHAT_MODELS.gpt_3_5_turbo_16k: return ChatOpenAI( openai_api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-3.5-turbo-16k", + model=CHAT_MODELS.gpt_3_5_turbo_16k, + temperature=0, + ) + elif prop == CHAT_MODELS.claude_2_0: + return ChatAnthropic( + anthropic_api_key=os.getenv("CLAUDE_API_KEY", "CLAUDE_API_KEY") + ) + elif prop == CHAT_MODELS.mistral_openorca: + return ChatOllama( + base_url=f"{localip}:11434", + model=CHAT_MODELS.mistral_openorca, + temperature=0, + ) + elif prop == CHAT_MODELS.nous_hermes: + return ChatOllama( + base_url=f"{localip}:11434", + model=CHAT_MODELS.nous_hermes, + temperature=0, + ) + elif prop == CHAT_MODELS.xwinlm: + return ChatOllama( + base_url=f"{localip}:11434", + model=CHAT_MODELS.xwinlm, temperature=0, ) - - elif prop == "mistral-openorca": - return ChatOllama(base_url=f"{localip}:11434", model="mistral-openorca", temperature=0) elif prop == "llama2": return ChatOpenAI(model="llama2", temperature=0) else: diff --git a/llm-server/utils/vector_db/add_workflow.py b/llm-server/utils/vector_db/add_workflow.py index 68368836c..12e22f48a 100644 --- a/llm-server/utils/vector_db/add_workflow.py +++ b/llm-server/utils/vector_db/add_workflow.py @@ -19,4 +19,14 @@ def add_workflow_data_to_qdrant( ) ] embeddings = get_embeddings() - init_vector_store(docs, embeddings, StoreOptions(bot_id)) + init_vector_store( + docs, + embeddings, + StoreOptions( + namespace="swagger", + metadata={ + "bot_id": bot_id + # "swagger_id": workflow_data.get("swagger_id"), + }, + ), + ) diff --git a/llm-server/utils/vector_store_setup.py b/llm-server/utils/vector_store_setup.py new file mode 100644 index 000000000..e14234984 --- /dev/null +++ b/llm-server/utils/vector_store_setup.py @@ -0,0 +1,26 @@ +from qdrant_client import QdrantClient, models +import os +from opencopilot_utils import get_vector_store, StoreOptions + +vector_size = int(os.getenv("VECTOR_SIZE", "1536")) + + +def init_qdrant_collections(): + # refer: from opencopilot_utils import StoreOptions, for list of namespaces to be created on startup + client = QdrantClient(url=os.getenv("QDRANT_URL", "http://qdrant:6333")) + try: + client.create_collection( + "knowledgebase", + vectors_config=models.VectorParams( + size=vector_size, distance=models.Distance.COSINE + ), + ) + + client.create_collection( + "swagger", + vectors_config=models.VectorParams( + size=vector_size, distance=models.Distance.COSINE + ), + ) + except Exception as e: + print(f"Collection already exists, ignoring new collection creation") diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 5fb63ac36..7b3005aa6 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -43,6 +43,16 @@ http { proxy_pass http://llm-server:8002/; } + location /backend/chat/ { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; + add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; + rewrite /backend/chat/(.*) /chat/$1 break; + proxy_pass http://llm-server:8002/; + } + + location /backend/ { proxy_pass http://backend:5000/; } diff --git a/workers/shared/utils/opencopilot_utils/get_vector_store.py b/workers/shared/utils/opencopilot_utils/get_vector_store.py index d0ff0c204..0e263dd37 100644 --- a/workers/shared/utils/opencopilot_utils/get_vector_store.py +++ b/workers/shared/utils/opencopilot_utils/get_vector_store.py @@ -27,9 +27,10 @@ def get_vector_store(options: StoreOptions) -> VectorStore: vector_store = Qdrant( client, collection_name=options.namespace, embeddings=embedding ) + # vector_store = Qdrant.from_documents([], embedding, url='http://localhost:6333', collection=options.namespace) else: raise ValueError("Invalid STORE environment variable value") - return vector_store + return vector_store \ No newline at end of file diff --git a/workers/shared/utils/opencopilot_utils/init_vector_store.py b/workers/shared/utils/opencopilot_utils/init_vector_store.py index 4c8778380..52fa10b6d 100644 --- a/workers/shared/utils/opencopilot_utils/init_vector_store.py +++ b/workers/shared/utils/opencopilot_utils/init_vector_store.py @@ -7,8 +7,11 @@ def init_vector_store(docs: list[Document], embeddings: OpenAIEmbeddings, options: StoreOptions) -> None: store_type = StoreType[os.environ['STORE']] + + for doc in docs: + doc.metadata.update(options.metadata) + if store_type == StoreType.QDRANT: - print("called qdrant.from_documents") Qdrant.from_documents(docs, embeddings, collection_name=options.namespace, url=os.environ['QDRANT_URL']) else: valid_stores = ", ".join(StoreType._member_names()) diff --git a/workers/shared/utils/opencopilot_utils/interfaces.py b/workers/shared/utils/opencopilot_utils/interfaces.py index 68f39e145..46dc973cf 100644 --- a/workers/shared/utils/opencopilot_utils/interfaces.py +++ b/workers/shared/utils/opencopilot_utils/interfaces.py @@ -1,5 +1,8 @@ -from typing import Optional +from typing import Optional, Literal, Dict class StoreOptions: - def __init__(self, namespace: Optional[str] = None): - self.namespace = namespace \ No newline at end of file + ALLOWED_NAMESPACES = Literal["swagger", "knowledgebase"] + + def __init__(self, namespace: ALLOWED_NAMESPACES, metadata: Dict[str, str] = {}): + self.namespace = namespace + self.metadata = metadata \ No newline at end of file diff --git a/workers/shared/utils/setup.py b/workers/shared/utils/setup.py index ab2696ddd..3cf04ac9b 100644 --- a/workers/shared/utils/setup.py +++ b/workers/shared/utils/setup.py @@ -5,7 +5,7 @@ setup( name="opencopilot_utils", - version="2.0.0", + version="2.1.0", packages=find_packages(), install_requires=[ "langchain" diff --git a/workers/tasks/process_markdown.py b/workers/tasks/process_markdown.py index 3ab46ea3d..40e938f4f 100644 --- a/workers/tasks/process_markdown.py +++ b/workers/tasks/process_markdown.py @@ -16,7 +16,7 @@ def process_markdown(file_name: str, bot_id: str): ) docs = text_splitter.split_documents(raw_docs) embeddings = get_embeddings() - init_vector_store(docs, embeddings, StoreOptions(namespace=bot_id)) + init_vector_store(docs, embeddings, StoreOptions(namespace="knowledgebase", metadata={"bot_id": bot_id})) update_pdf_data_source_status(chatbot_id=bot_id, file_name=file_name, status="COMPLETED") except Exception as e: diff --git a/workers/tasks/process_pdfs.py b/workers/tasks/process_pdfs.py index 5faa58551..d3f2974ee 100644 --- a/workers/tasks/process_pdfs.py +++ b/workers/tasks/process_pdfs.py @@ -16,7 +16,7 @@ def process_pdf(file_name: str, bot_id: str): ) docs = text_splitter.split_documents(raw_docs) embeddings = get_embeddings() - init_vector_store(docs, embeddings, StoreOptions(namespace=bot_id)) + init_vector_store(docs, embeddings, StoreOptions(namespace="knowledgebase", metadata={"bot_id": bot_id})) update_pdf_data_source_status(chatbot_id=bot_id, file_name=file_name, status="COMPLETED") except Exception as e: diff --git a/workers/tasks/web_crawl.py b/workers/tasks/web_crawl.py index 97b78c21b..07d63350a 100644 --- a/workers/tasks/web_crawl.py +++ b/workers/tasks/web_crawl.py @@ -83,7 +83,7 @@ def scrape_website_in_bfs(url: str, bot_id: str, unique_urls: Set[str], max_page docs = text_splitter.create_documents([text]) embeddings = get_embeddings() - init_vector_store(docs, embeddings, StoreOptions(namespace=bot_id)) + init_vector_store(docs, embeddings, StoreOptions(namespace="knowledgebase", metadata={"bot_id": bot_id})) update_website_data_source_status_by_url(url=url, status="SUCCESS") if driver is not None: @@ -110,7 +110,7 @@ def web_crawl(url, bot_id: str): print(f"Received: {url}, {bot_id}") create_website_data_source(chatbot_id=bot_id, status="PENDING", url=url) unique_urls: set = set() - scrape_website_in_bfs(url, bot_id, unique_urls, 2) + scrape_website_in_bfs(url, bot_id, unique_urls, 5) except Exception as e: traceback.print_exc()