From 44de816ccff24583b4820561e083260843d322dd Mon Sep 17 00:00:00 2001 From: Miguel Lezama Date: Tue, 19 May 2026 14:28:18 -0300 Subject: [PATCH] Setup wizard: in-chat cards alongside the PHP fallback Adds an in-chat, card-driven first-run setup flow that mirrors the existing PHP wizard (PR #72) and writes to the same two options. The PHP wizard stays as a fallback deep-link surface at `?page=openclawp-setup`; the welcome notice now points at the Chat page so users land in chat-card mode by default. - New `OpenclaWP_Setup_Rest` exposes three REST routes (`GET /setup/state`, `POST /setup/enable-example-agent`, `POST /setup/complete`) gated on `manage_options`. - New `blocks/chat-shared/setup/` builds a single wizard card from declarative step definitions; `ChatSurface` mounts it above the existing card stack while `openclaWPConfig.setupCompleted === false`. - Bootstrap localises `setupCompleted` + `setupRestUrl` for the JS side and registers the new REST class. --- blocks/chat-shared/ChatSurface.jsx | 37 +++- blocks/chat-shared/setup/index.js | 220 ++++++++++++++++++++++ blocks/chat-shared/setup/steps.js | 163 ++++++++++++++++ blocks/chat/build/view.asset.php | 2 +- blocks/chat/build/view.js | 8 +- includes/class-openclawp-bootstrap.php | 9 +- includes/class-openclawp-setup-rest.php | 146 ++++++++++++++ includes/class-openclawp-setup-wizard.php | 8 +- 8 files changed, 581 insertions(+), 12 deletions(-) create mode 100644 blocks/chat-shared/setup/index.js create mode 100644 blocks/chat-shared/setup/steps.js create mode 100644 includes/class-openclawp-setup-rest.php diff --git a/blocks/chat-shared/ChatSurface.jsx b/blocks/chat-shared/ChatSurface.jsx index 472670f..aba9215 100644 --- a/blocks/chat-shared/ChatSurface.jsx +++ b/blocks/chat-shared/ChatSurface.jsx @@ -24,6 +24,7 @@ import { AgentUI } from '@automattic/agenttic-ui'; import '@automattic/agenttic-ui/index.css'; import Card from './Card.jsx'; import { COMMANDS, parseInput } from './commands/index.js'; +import { useSetupWizard } from './setup/index.js'; const SESSION_KEY = 'openclawp:active-session'; @@ -258,13 +259,38 @@ export default function ChatSurface( { agents, defaultAgent, bridgeUrl, nonce, r const handleCardAction = useCallback( ( action ) => { - if ( action && action.command ) { + if ( ! action ) { + return; + } + // Wizard cards attach an inline `onClick`; fall through to the + // command dispatch path otherwise so existing slash-command cards + // keep working untouched. + if ( typeof action.onClick === 'function' ) { + action.onClick(); + return; + } + if ( action.command ) { runCommand( action.command ); } }, [ runCommand ] ); + // First-run setup wizard. Renders a single card above the regular card + // stack until the user finishes or dismisses it. `openclaWPConfig` + // carries the persisted `openclawp_setup_completed` flag plus the + // `/setup` REST surface used to advance through the steps. + const wpConfig = + typeof window !== 'undefined' && window.openclaWPConfig + ? window.openclaWPConfig + : {}; + const setupEnabled = wpConfig.setupCompleted === false; + const setup = useSetupWizard( { + enabled: setupEnabled, + restNamespace, + nonce, + } ); + // Poll for pending tool-call decisions after the assistant finishes // processing. One immediate check + a short follow-up; we deliberately // don't long-poll — decisions are bursty (one per gated tool call) and @@ -340,8 +366,15 @@ export default function ChatSurface( { agents, defaultAgent, bridgeUrl, nonce, r /> ) } - { cardStack.length > 0 && ( + { ( setup.card || cardStack.length > 0 ) && (
+ { setup.card && ( + + ) } { cardStack.map( ( card ) => ( `. + */ +function buildStepCard( step, state, helpers ) { + const kind = step.kindFor ? step.kindFor( state ) : 'info'; + return { + type: 'card', + kind, + title: step.title, + body: step.buildBody( state ), + actions: step.buildActions( state, helpers ), + }; +} + +/** + * POST JSON to a setup route. Returns the parsed response body, or throws + * with the server's error message when the request fails. + * + * @param {string} restNamespace Plugin REST namespace, e.g. `openclawp/v1`. + * @param {string} path Route path under `/setup/`, e.g. `complete`. + * @param {string} nonce WP REST nonce. + * @param {object} body JSON payload. + * @return {Promise} + */ +async function postSetup( restNamespace, path, nonce, body ) { + const url = `/wp-json/${ restNamespace }/setup/${ path }`; + const response = await fetch( url, { + method: 'POST', + credentials: 'same-origin', + headers: { + 'Content-Type': 'application/json', + 'X-WP-Nonce': nonce, + }, + body: JSON.stringify( body || {} ), + } ); + if ( ! response.ok ) { + const payload = await response.json().catch( () => ( {} ) ); + throw new Error( payload.message || `HTTP ${ response.status }` ); + } + return response.json(); +} + +/** + * GET the current setup state. + * + * @param {string} restNamespace + * @param {string} nonce + * @return {Promise} + */ +async function fetchState( restNamespace, nonce ) { + const url = `/wp-json/${ restNamespace }/setup/state`; + const response = await fetch( url, { + credentials: 'same-origin', + headers: { 'X-WP-Nonce': nonce }, + } ); + if ( ! response.ok ) { + throw new Error( `HTTP ${ response.status }` ); + } + return response.json(); +} + +/** + * React hook driving the in-chat setup wizard. + * + * @param {object} args + * @param {boolean} args.enabled When false, the hook is a no-op. + * @param {string} args.restNamespace e.g. `openclawp/v1`. + * @param {string} args.nonce WP REST nonce. + * @param {Function} [args.onDone] Called once the wizard finishes. + * @return {{ card: object|null, visible: boolean, dismiss: Function }} + */ +export function useSetupWizard( { enabled, restNamespace, nonce, onDone } ) { + const [ visible, setVisible ] = useState( Boolean( enabled ) ); + const [ stepId, setStepId ] = useState( FIRST_STEP_ID ); + const [ state, setState ] = useState( { + completed: false, + providers: [], + exampleAgentEnabled: false, + } ); + + const onDoneRef = useRef( onDone ); + useEffect( () => { + onDoneRef.current = onDone; + }, [ onDone ] ); + + // Initial state fetch. We render the welcome card immediately (no network + // data needed) and refresh in the background so the provider step has + // real data by the time the user advances. + useEffect( () => { + if ( ! enabled ) { + return; + } + let cancelled = false; + fetchState( restNamespace, nonce ) + .then( ( data ) => { + if ( cancelled ) { + return; + } + if ( data && data.completed ) { + // Server says we're already done — flip the local flag and + // hide the wizard. This handles the case where another + // admin completed setup in a different tab. + setVisible( false ); + return; + } + setState( ( prev ) => ( { ...prev, ...data } ) ); + } ) + .catch( () => { + // Surface nothing — the welcome card stays usable even without + // the state snapshot. The provider step will retry on entry. + } ); + return () => { + cancelled = true; + }; + }, [ enabled, restNamespace, nonce ] ); + + const refresh = useCallback( async () => { + try { + const data = await fetchState( restNamespace, nonce ); + setState( ( prev ) => ( { ...prev, ...data } ) ); + } catch ( e ) { + // Re-render the same step; the user can click Recheck again. + } + }, [ restNamespace, nonce ] ); + + const advance = useCallback( + async ( nextId ) => { + // Re-fetch state on entry to each step so the provider list / + // example-agent toggle is current. + await refresh(); + setStepId( nextId ); + }, + [ refresh ] + ); + + const setExampleAgent = useCallback( + async ( shouldEnable ) => { + try { + await postSetup( restNamespace, 'enable-example-agent', nonce, { + enabled: Boolean( shouldEnable ), + } ); + setState( ( prev ) => ( { + ...prev, + exampleAgentEnabled: Boolean( shouldEnable ), + } ) ); + } catch ( e ) { + // Best-effort — finish() still flips setup_completed below so + // the wizard doesn't get stuck if this single call fails. + } + }, + [ restNamespace, nonce ] + ); + + const finish = useCallback( async () => { + try { + await postSetup( restNamespace, 'complete', nonce, {} ); + } catch ( e ) { + // Even if the POST fails the local flag below still hides the + // wizard for this session; the welcome notice will reappear on + // the next page load if the option didn't actually save. + } + if ( typeof window !== 'undefined' && window.openclaWPConfig ) { + window.openclaWPConfig.setupCompleted = true; + } + setVisible( false ); + if ( typeof onDoneRef.current === 'function' ) { + onDoneRef.current(); + } + }, [ restNamespace, nonce ] ); + + const helpers = useMemo( + () => ( { + advance, + refresh, + finish, + setExampleAgent, + } ), + [ advance, refresh, finish, setExampleAgent ] + ); + + const card = useMemo( () => { + if ( ! visible ) { + return null; + } + const step = findStep( stepId ); + if ( ! step ) { + return null; + } + return buildStepCard( step, state, helpers ); + }, [ visible, stepId, state, helpers ] ); + + return { card, visible, dismiss: finish }; +} diff --git a/blocks/chat-shared/setup/steps.js b/blocks/chat-shared/setup/steps.js new file mode 100644 index 0000000..7acb64a --- /dev/null +++ b/blocks/chat-shared/setup/steps.js @@ -0,0 +1,163 @@ +/** + * First-run setup wizard — step definitions. + * + * Each step describes one screen of the wizard: + * + * { + * id: string, + * title: string, + * buildBody: (state) => string, // light markdown + * buildActions: (state, helpers) => Array, // see below + * kindFor?: (state) => 'info' | 'success' | 'warning', + * } + * + * Card actions in the wizard use an `onClick` property that + * `ChatSurface.handleCardAction` dispatches when present. This is in addition + * to (not a replacement for) the `command` / `href` properties supported by + * the existing Card primitive — wizard cards just never use those. + * + * `helpers` is the bag passed by `buildSetupCardStack`: + * + * - `advance( id )` — replace the wizard card with the next step. + * - `refresh()` — re-fetch `/setup/state` and re-render. + * - `finish()` — POST `/setup/complete` and close the wizard. + * - `setExampleAgent( bool )` — POST `/setup/enable-example-agent`. + * + * Step IDs map 1:1 to the PHP wizard's `?step=` values so the two surfaces + * stay easy to reason about together. + */ + +export const STEP_WELCOME = 'welcome'; +export const STEP_PROVIDER = 'provider'; +export const STEP_AGENT = 'agent'; + +export const FIRST_STEP_ID = STEP_WELCOME; + +/** + * Format the providers list as a markdown body. Installed providers are + * tagged inline so the warning vs. success case stays visually clear. + * + * @param {Array<{slug:string,label:string,installed:boolean}>} providers Providers list. + * @return {string} Markdown body lines. + */ +function renderProviderList( providers ) { + if ( ! providers || providers.length === 0 ) { + return '_No AI providers detected yet._'; + } + return providers + .map( ( p ) => + p.installed + ? `- **${ p.label }** — installed` + : `- ${ p.label }` + ) + .join( '\n' ); +} + +export const STEPS = [ + { + id: STEP_WELCOME, + title: 'Welcome to openclaWP', + buildBody: () => + 'openclaWP turns your WordPress site into a place where an agent lives, ' + + 'reads your content, talks back, and can be reached from outside ' + + 'WordPress through pluggable connectors. This 3-step wizard gets you ' + + 'to a working chat in under a minute.', + buildActions: ( state, helpers ) => [ + { + label: 'Get started', + variant: 'primary', + onClick: () => helpers.advance( STEP_PROVIDER ), + }, + { + label: 'Skip setup', + variant: 'tertiary', + onClick: () => helpers.finish(), + }, + ], + }, + { + id: STEP_PROVIDER, + title: 'Pick an AI provider', + buildBody: ( state ) => { + const providers = Array.isArray( state.providers ) ? state.providers : []; + const anyInstalled = providers.some( ( p ) => p.installed ); + const intro = + "openclaWP works with any AI provider that registers with the WordPress " + + "AI client. Pick one to continue — if you don't have one installed yet, " + + 'the easiest path is Ollama (runs locally, no API key).'; + const list = renderProviderList( providers ); + const footer = anyInstalled + ? '' + : '\n\n_No AI provider plugin detected yet. Install one and click **Recheck**._'; + return intro + '\n\n' + list + footer; + }, + buildActions: ( state, helpers ) => { + const providers = Array.isArray( state.providers ) ? state.providers : []; + const anyInstalled = providers.some( ( p ) => p.installed ); + + const actions = []; + if ( anyInstalled ) { + actions.push( { + label: 'Continue', + variant: 'primary', + onClick: () => helpers.advance( STEP_AGENT ), + } ); + } else { + // No "Continue" until a provider is installed. Surfacing only + // "Recheck" keeps the wizard honest about the prerequisite + // without us needing a disabled-button affordance. + actions.push( { + label: 'Recheck', + variant: 'primary', + onClick: () => helpers.refresh(), + } ); + } + actions.push( { + label: 'Skip setup', + variant: 'tertiary', + onClick: () => helpers.finish(), + } ); + return actions; + }, + kindFor: ( state ) => { + const providers = Array.isArray( state.providers ) ? state.providers : []; + return providers.some( ( p ) => p.installed ) ? 'info' : 'warning'; + }, + }, + { + id: STEP_AGENT, + title: 'Enable the example agent', + buildBody: () => + "Turn on the bundled example agent so there's something to chat with " + + 'right away. You can register your own agents later via PHP, or via ' + + 'the Agent Files surface.', + buildActions: ( state, helpers ) => [ + { + label: 'Enable example agent & finish', + variant: 'primary', + onClick: async () => { + await helpers.setExampleAgent( true ); + await helpers.finish(); + }, + }, + { + label: 'Finish without example agent', + variant: 'secondary', + onClick: async () => { + await helpers.setExampleAgent( false ); + await helpers.finish(); + }, + }, + ], + }, +]; + +/** + * Look up a step by id. + * + * @param {string} id Step id. + * @return {object|null} + */ +export function findStep( id ) { + return STEPS.find( ( s ) => s.id === id ) || null; +} diff --git a/blocks/chat/build/view.asset.php b/blocks/chat/build/view.asset.php index 278e7e2..9512220 100644 --- a/blocks/chat/build/view.asset.php +++ b/blocks/chat/build/view.asset.php @@ -1 +1 @@ - array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '4074a98b9193a82012f2'); + array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '6166545cc9b8f51ba1f3'); diff --git a/blocks/chat/build/view.js b/blocks/chat/build/view.js index 3c6c04a..f84153f 100644 --- a/blocks/chat/build/view.js +++ b/blocks/chat/build/view.js @@ -1,16 +1,16 @@ -(()=>{"use strict";var e,t,n,i,a={849(e){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},r=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,a=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(a)return a(e,n).value}return e[n]};e.exports=function e(){var t,n,i,a,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h{if("declaration"!==e.type)return;const{property:i,value:a}=e;o?t(i,a,e):a&&(n=n||{},n[i]=a)}),n};const a=i(n(77))}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return a[e].call(n.exports,n,n.exports,r),n.exports}r.m=a,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"==typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"==typeof n.then)return n}var a=Object.create(null);r.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&i&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>o[e]=()=>n[e]);return o.default=()=>n,r.d(a,o),a},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>e+".js?ver="+{222:"1d7b08e3b2d906807a0e",281:"105aed1fcbf7228ea4b4",954:"cc290b77914d31b14d41"}[e],r.miniCssF=e=>{},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i="openclawp:",r.l=(e,t,a,o)=>{if(n[e])n[e].push(t);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(p);var a=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach(e=>e(i)),t)return t(i)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={552:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var a=new Promise((n,a)=>i=e[t]=[n,a]);n.push(i[2]=a);var o=r.p+r.u(t),s=new Error;r.l(o,n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,a,[o,s,l]=n,c=0;if(o.some(t=>0!==e[t])){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);l&&l(r)}for(t&&t(n);cDc,booleanish:()=>Lc,commaOrSpaceSeparated:()=>Vc,commaSeparated:()=>_c,number:()=>Oc,overloadedBoolean:()=>Rc,spaceSeparated:()=>Nc});var l={};r.r(l),r.d(l,{attentionMarkers:()=>dh,contentInitial:()=>oh,disable:()=>hh,document:()=>ah,flow:()=>sh,flowInitial:()=>rh,insideSpan:()=>uh,string:()=>lh,text:()=>ch});const c=window.ReactDOM,u=window.wp.element,d=window.wp.components,h=window.React;var p=r.t(h,2);const f=(e,...t)=>{(function(){var e;return typeof globalThis<"u"&&"window"in globalThis&&"agenttic-client"===(null==(e=globalThis.window)?void 0:e.DEBUG)})()&&console.log(`[agenttic-client] ${e}`,...t)};function m(e){return JSON.stringify(e,null,2)}function g(e,...t){console.log(`[agenttic-client] ${e}`,...t)}window.wp.apiFetch;var y=Object.defineProperty,v=(e,t,n)=>((e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function x(){let e="";for(let t=0;t<8;t++)e+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()));return e}function b(){return x()}function w(e,t){return{type:"text",text:e,...t&&{metadata:t}}}function k(e){return e&&e.parts&&Array.isArray(e.parts)?e.parts.filter(e=>"text"===e.type).map(e=>e.text).join(" "):""}function S(e){if(!e||!e.parts||!Array.isArray(e.parts))return;const t=e.parts.find(e=>"progress"===e.type||"data"===e.type&&"summary"in e.data&&"string"==typeof e.data.summary);return t?{summary:t.data.summary,phase:t.data.phase}:void 0}function C(e){return{type:"data",data:{toolId:e.id,toolName:e.name,description:e.description,inputSchema:e.input_schema},metadata:{}}}function T(e){return{type:"data",data:{name:e.name,label:e.label,description:e.description,category:e.category,input_schema:e.input_schema,output_schema:e.output_schema,meta:e.meta},metadata:{}}}function P(e){return e&&e.parts&&Array.isArray(e.parts)?e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"toolId"in e.data&&"arguments"in e.data):[]}function E(e,t,n,i){return{type:"data",data:{toolCallId:e,toolId:t,result:n},metadata:i?{error:i}:void 0}}function A(e,t){const{contentType:n,...i}=t||{};return{role:"user",parts:[w(e,n?{contentType:n}:void 0)],kind:"message",messageId:b(),metadata:{timestamp:Date.now(),...i}}}function I(e){return{role:"agent",parts:[w(e)],kind:"message",messageId:b(),metadata:{timestamp:Date.now()}}}function M(e){return e&&"object"==typeof e&&"result"in e?{result:e.result,returnToAgent:!1!==e.returnToAgent,agentMessage:e.agentMessage}:{result:e,returnToAgent:!0}}function j(e,t=[]){return{role:"user",kind:"message",parts:[...t,...e],messageId:b(),metadata:{timestamp:Date.now()}}}function D(e,t=""){const n=[],i=t+e;let a="",o=0,r=0;for(;r0&&n.argumentFragments.push(e.content)}processDelta(e){switch(e.type){case"content":this.textContent+=e.content;break;case"tool_name":this.toolCalls.has(e.toolCallIndex)||this.toolCalls.set(e.toolCallIndex,{toolCallId:e.toolCallId,toolName:"",argumentFragments:[]}),this.toolCalls.get(e.toolCallIndex).toolName+=e.content;break;case"tool_argument":this.toolCalls.has(e.toolCallIndex)||this.toolCalls.set(e.toolCallIndex,{toolCallId:e.toolCallId,toolName:"",argumentFragments:[]}),this.toolCalls.get(e.toolCallIndex).argumentFragments.push(e.content)}}getTextContent(){return this.textContent}getCurrentMessage(e="agent"){const t=[];this.textContent&&t.push({type:"text",text:this.textContent});for(const[e,n]of this.toolCalls)if(n.toolName){const e=n.argumentFragments.join("");let i={};if(e)try{i=JSON.parse(e)}catch{i={_raw:e}}t.push({type:"data",data:{toolCallId:n.toolCallId,toolId:n.toolName,arguments:i}})}return{role:e,parts:t,kind:"message",messageId:b()}}reset(){this.textContent="",this.toolCalls.clear()}}function O(e,t,n="request"){throw clearTimeout(t),f("%s failed with error: %O",n,e),e instanceof Error&&(f("Error message: %s",e.message),f("Error stack: %s",e.stack)),e}function N(e,t="request"){if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`)}function _(e,t="request"){const n=new AbortController;return{timeoutId:setTimeout(()=>n.abort(),e),controller:n}}function V(e,t,n,i){f("Request: %s %s",e,t),f("Headers: %o",n),i&&f("Body: %s",m(i))}function F(e,t){if(!t)return e;const n=new AbortController,i=e=>{n.signal.aborted||n.abort(e.reason)};return e.aborted?n.abort(e.reason):e.addEventListener("abort",()=>i(e),{once:!0}),t.aborted?n.abort(t.reason):t.addEventListener("abort",()=>i(t),{once:!0}),n.signal}function B(e,t,n,i){const a={method:"POST",headers:e,body:t,signal:n};return void 0!==i&&(a.credentials=i),a}async function z(e,t,n,i,a,o){const{message:r,sessionId:s,taskId:l,metadata:c}=e,{agentId:u,agentUrl:d,authProvider:h,proxy:p}=t,{isStreaming:m=!1,enableTokenStreaming:g=!1}=n,y=s||o,v=function(e,t){return`${e}/${t}`}(d,u),b=await async function(e,t,n){let i=await async function(e,t){if(!t)return e;try{const n=[];if(t.getAvailableTools){const e=await t.getAvailableTools();if(e.length>0){const t=e.map(C);n.push(...t)}}if(t.getAbilities){const e=await t.getAbilities();if(e.length>0){const t=e.map(T);n.push(...t)}}return 0===n.length?e:{...e,parts:[...e.parts,...n]}}catch(t){return f("Warning: Failed to get tools: %s",t),e}}(e,t);i=function(e,t){if(!t)return e;try{const n=t.getClientContext();if(!n||0===Object.keys(n).length)return e;const i=function(e){return{type:"data",data:{clientContext:e},metadata:{}}}(n);return{...e,parts:[...e.parts,i]}}catch(t){return f("Warning: Failed to get context: %s",t),e}}(i,n);const{metadata:a,...o}=i;return o}(r,i,a),w={id:l,message:b,metadata:c};y&&(w.sessionId=y);const k=function(e,t="message/send",n=!1){const i={jsonrpc:"2.0",id:`req-${x()}`,method:t,params:{id:e.id||`task-${x()}`,...e}};return n&&"message/stream"===t&&(i.tokenStreaming=!0),i}(w,m?"message/stream":"message/send",g&&m),S=await async function(e,t=!1){const n={"Content-Type":"application/json"};if(t&&(n.Accept="text/event-stream"),e){const t=await e();return{...n,...t}}return n}(h,m);return V("POST",v,S,k),{request:k,headers:S,enhancedMessage:b,effectiveSessionId:y,fullAgentUrl:v}}async function U(e,t,n={}){const{request:i,headers:a,fullAgentUrl:o}=e,{timeout:r,credentials:s}=t,{abortSignal:l}=n,{timeoutId:c,controller:u}=_(r,"request"),d=l?F(u.signal,l):u.signal;try{const e=B(a,JSON.stringify(i),d,s);f("Making request to %s with options: %O",o,{method:e.method,headers:e.headers});const t=await fetch(o,e);clearTimeout(c),N(t,"request");const n=await t.json();return f("Response from %s: %d %O",o,t.status,m(n)),function(e,t="request"){if(e.error)throw new Error(`Protocol ${t} error: ${e.error.message}`);if(!e.result)throw new Error(`No result in ${t} response`);return e.result}(n,"request")}catch(e){O(e,c,"request")}}async function*H(e,t,n){const{request:i,headers:a,fullAgentUrl:o}=e,{credentials:r}=t,{streamingTimeout:s=6e4,abortSignal:l,enableTokenStreaming:c=!1}=n,{timeoutId:u,controller:d}=_(s,"streaming request"),h=l?F(d.signal,l):d.signal;try{const e=B(a,JSON.stringify(i),h,r),t=await fetch(o,e);if(clearTimeout(u),function(e,t="streaming request"){if(N(e,t),!e.body)throw new Error(`No response body for ${t}`)}(t,"streaming request"),!t.body)throw new Error("Response body is null - server may not support streaming");const n=c&&!0===i.tokenStreaming;yield*async function*(e,t={}){var n,i,a;const{supportDeltas:o=!1}=t,r=e.getReader(),s=new TextDecoder;let l="";const c=new R;let u=null,d=null;try{for(;;){const{done:e,value:t}=await r.read();if(e)break;const h=s.decode(t,{stream:!0}),{events:p,nextBuffer:m}=D(h,l);if(p&&Array.isArray(p))for(let e=0;e0&&"message/delta"===t.method&&typeof requestAnimationFrame<"u"&&await new Promise(e=>{requestAnimationFrame(()=>e(void 0))}),t.error)throw new Error(`Streaming error: ${t.error.message}`);if(o&&"message/delta"===t.method&&null!=(n=t.params)&&n.delta){const e=t.params.delta;try{let n=!1;L(e)?(c.processToolCallDelta(e),n=!0):"content"===e.deltaType&&(c.processContentDelta(e.content),n=!0),n&&(!u&&t.params.id&&(u=t.params.id),u&&(yield{id:u,status:{state:"working",message:c.getCurrentMessage()},final:!1,text:c.getTextContent()}))}catch(e){f("Failed to process delta: %o",e)}}else if(t.result&&t.result.status){u=t.result.id,d=t.result.status,(c.getTextContent()||c.getCurrentMessage().parts.length>0)&&c.reset();const e=(null==(i=t.result.status)?void 0:i.message)||{role:"agent",parts:[]},n=S(e);yield{id:t.result.id,sessionId:t.result.sessionId,status:t.result.status,final:"completed"===t.result.status.state||"failed"===t.result.status.state||"canceled"===t.result.status.state,text:k(e),progressMessage:null==n?void 0:n.summary,progressPhase:null==n?void 0:n.phase}}else if(t.id&&t.result&&(u=t.result.id,t.result.status)){const e=(null==(a=t.result.status)?void 0:a.message)||{role:"agent",parts:[]},n=S(e);yield{id:t.result.id,sessionId:t.result.sessionId,status:t.result.status,final:"completed"===t.result.status.state||"failed"===t.result.status.state||"canceled"===t.result.status.state,text:k(e),progressMessage:null==n?void 0:n.summary,progressPhase:null==n?void 0:n.phase}}}l=m}}finally{r.releaseLock()}}(t.body,{supportDeltas:n})}catch(e){O(e,u,"streaming request")}}const $=12e4;async function W(e,t,n,i,a){if(e.getAbilities){const o=await e.getAbilities();if(o.length>0)for(const r of o)if(t===r.name.replace(/\//g,"__").replace(/-/g,"_")||t===r.name){if(r.callback)try{const e={...n,...i&&{messageId:i},...a&&{toolCallId:a},...t&&{toolId:t}},o=await r.callback(e);return{result:o,returnToAgent:void 0===(null==o?void 0:o.returnToAgent)||o.returnToAgent,...(null==o?void 0:o.agentMessage)&&{agentMessage:o.agentMessage}}}catch(e){return f("Error executing ability %s: %O",r.name,e),{result:{error:e instanceof Error?e.message:String(e),success:!1},returnToAgent:!0}}if(!r.callback&&e.executeAbility)try{return{result:await e.executeAbility(r.name,n),returnToAgent:!0}}catch(e){return f("Error executing ability %s: %O",r.name,e),{result:{error:e instanceof Error?e.message:String(e),success:!1},returnToAgent:!0}}throw new Error(`Ability ${r.name} has no callback and no handler`)}}if(e.executeTool)return await e.executeTool(t,n,i,a);throw new Error(`No handler found for tool: ${t}. Tool provider must implement executeTool for non-ability tools.`)}const q=new Map;async function K(e,t){if(!e||!t||!e.getAvailableTools)return!1;const n=P(t);if(0===n.length)return!1;try{const t=await e.getAvailableTools();for(const e of n)if(t.some(t=>t.id===e.data.toolId))return!0}catch{return!1}return!1}function Y(e){return e.map(e=>{const t=e.data.toolCallId,n=q.get(t);if(n&&null!==n.resolvedValue){const i=n.resolvedValue;return i.error?E(t,e.data.toolId,void 0,i.error):E(t,e.data.toolId,i)}return e})}async function G(e,t,n){const i=[],a=[];let o=!1;for(const r of e){const{toolCallId:e,toolId:s,arguments:l}=r.data;try{const r=await W(t,s,l,n,e),{result:c,returnToAgent:u,agentMessage:d}=M(r);u&&(o=!0),d&&a.push(I(d)),i.push(E(e,s,c))}catch(t){o=!0,i.push(E(e,s,void 0,t instanceof Error?t.message:String(t)))}}return{results:i,shouldReturnToAgent:o,agentMessages:a}}function X(e){const t=[];for(const n of e)for(const e of n.parts)"text"===e.type?t.push({type:"data",data:{role:n.role,text:e.text}}):("data"===e.type||"file"===e.type)&&t.push(e);return t}async function J(e,t,n,i,a,o,r){const s=await z({message:t,taskId:e,sessionId:void 0},n,{isStreaming:!1},i,a,o);return await U(s,n,{abortSignal:r})}async function Z(e,t,n,i,a,o,r,s,l=[]){const c={message:t,taskId:e,sessionId:o},u=s||{isStreaming:!0};return Q(H(await z(c,n,{...u},i,a,o),n,{...u,abortSignal:r}),i,a,n,o,!0,l,r,u)}async function*Q(e,t,n,i,a,o=!0,r=[],s,l){var c,u,d,h,p,m,g,y,v,x,w,S;for await(const C of e){if(C.sessionId&&!a&&(a=C.sessionId),yield C,"running"===C.status.state&&C.status.message&&t&&await K(t,C.status.message)){const e=P(C.status.message);for(const n of e){const{toolCallId:e,toolId:i,arguments:a}=n.data;W(t,i,a,null==(u=null==(c=C.status)?void 0:c.message)?void 0:u.messageId,e).catch(e=>{f("Tool execution failed for %s: %O",i,e)})}yield{id:C.id,status:{state:"running",message:{role:"agent",kind:"message",parts:e,messageId:b()}},final:!1,text:""}}if("input-required"===C.status.state&&C.status.message&&t){const e=P(C.status.message);if(e.length>0){const c=[];let u=!1;const T=[],A=[];for(const n of e){const{toolCallId:e,toolId:i,arguments:a}=n.data;try{const n=await W(t,i,a,null==(h=null==(d=C.status)?void 0:d.message)?void 0:h.messageId,e),{result:o,returnToAgent:r,agentMessage:s}=M(n);if(r&&(u=!0),s&&A.push(I(s)),o.result instanceof Promise){const t=o.result,n={promise:t,resolvedValue:null};q.set(e,n),t.then(e=>{n.resolvedValue=e}).catch(t=>{f("Promise rejected for tool call %s: %O",e,t),n.resolvedValue={error:t instanceof Error?t.message:String(t)}})}const l=E(e,i,o);c.push(l),T.push(l)}catch(t){const n=E(e,i,void 0,t instanceof Error?t.message:String(t));c.push(n),T.push(n)}}if(r.push(C.status.message),c.length>0&&r.push({role:"agent",kind:"message",parts:c,messageId:b()}),u){const e=j([],X(r));yield{id:C.id,status:{state:"working",message:e},final:!1,text:""};const c=await Z(C.id,e,i,t,n,a,s,l,r);let u=null;for await(const e of c)e.final?u=e:yield e;if(!u)throw new Error("Continue task stream ended without final result");let d=null!=(p=u.status)&&p.message?P(u.status.message):[],h=u;if(d.length>0)for(yield{...u,final:!1,text:k((null==(m=u.status)?void 0:m.message)||{parts:[],messageId:b()})};d.length>0;){null!=(g=h.status)&&g.message&&r.push(h.status.message);const{results:e,shouldReturnToAgent:c}=await G(d,t,null==(v=null==(y=h.status)?void 0:y.message)?void 0:v.messageId);if(e.length>0&&(yield{id:h.id,status:{state:"working",message:{role:"agent",kind:"message",parts:e,messageId:b()}},final:!1,text:""}),!c)break;{const c=j(e,o?X(r):[]),u=await Z(h.id,c,i,t,n,a,s,l,r);let p=null;for await(const e of u)e.final?p=e:yield e;if(!p)throw new Error("Continue task stream ended without final result");h=p,d=null!=(x=h.status)&&x.message?P(h.status.message):[],d.length>0&&(yield{id:h.id,status:h.status,final:!1,text:k((null==(w=h.status)?void 0:w.message)||{parts:[],messageId:b()})})}}yield{...h,final:!0,text:k((null==(S=h.status)?void 0:S.message)||{parts:[],messageId:b()})}}else{const e={...C.status.message,parts:T},t={...C,status:{...C.status,message:e},final:0===A.length,text:k(e)};if(yield t,A.length>0){const e=A.map(e=>k(e)).join(" "),n=I(e);yield{id:t.id,status:{state:"completed",message:n},final:!0,text:e}}}}}}}function ee(e){const t=[];if(e.content){const n={type:"text",text:e.content};t.push(n)}const n=e.context;if(n&&!Array.isArray(n)&&Array.isArray(n.file_parts))for(const e of n.file_parts)if(null!=e&&e.uri){const n={type:"file",file:{name:"image",uri:e.uri},metadata:e.id?{id:e.id}:void 0};t.push(n)}if(n&&!Array.isArray(n)){const e=n,i=e.flags&&"object"==typeof e.flags&&null!==e.flags,a=Array.isArray(e.sources)&&e.sources.length>0;if(i||a){const n={};i&&(n.flags=e.flags),a&&(n.sources=e.sources),t.push({type:"data",data:n})}}const i="user"===e.role?"user":"agent",a=e.ts?1e3*e.ts:new Date(e.created_at.replace(" ","T")+"Z").getTime();return{role:i,kind:"message",parts:t,messageId:b(),metadata:{timestamp:a,serverId:e.message_id,chatId:e.chat_id}}}class te extends Error{constructor(e,t,n){super(e),this.statusCode=t,this.details=n,this.name="ServerConversationError"}}const ne="https://public-api.wordpress.com";async function ie(e,t,n=1,i=50,a=!1){const{botId:o,apiBaseUrl:r=ne,authProvider:s}=t;if(!e||!o)throw new Error("chatId and botId are required to load conversation from server");const l=Math.max(1,Math.min(n,100)),c=Math.max(1,Math.min(i,100)),u=new URL(`${r}/wpcom/v2/odie/chat/${encodeURIComponent(o)}/${encodeURIComponent(e)}`);u.searchParams.set("page_number",l.toString()),u.searchParams.set("items_per_page",c.toString()),f("Loading conversation from server: %s (page %d)",e,l);try{const e={"Content-Type":"application/json"};if(s){const t=await s();Object.assign(e,t)}const t=await fetch(u.toString(),{method:"GET",headers:e});if(!t.ok){const e=await t.text();let n=`Failed to load conversation from server: ${t.status} ${t.statusText}`;try{const t=JSON.parse(e);t.message&&(n=t.message)}catch{}const i=new te(n,t.status,e);throw f("Failed to load conversation from server: %O",i),i}const n=function(e,t=!1){var n,i,a,o,r,s;const l=e.messages.filter(e=>"tool_call"!==e.role&&("tool_result"!==e.role||!(!t||function(e){if("tool_call"!==e.role&&"tool_result"!==e.role)return!1;try{return"wpcom__think"===JSON.parse(e.content).tool_id}catch{return!1}}(e)))).map(ee);return{messages:l,pagination:{currentPage:(null==(n=e.metadata)?void 0:n.current_page)??1,itemsPerPage:(null==(i=e.metadata)?void 0:i.items_per_page)??10,totalPages:(null==(a=e.metadata)?void 0:a.total_pages)??1,totalMessages:(null==(o=e.metadata)?void 0:o.total_messages)??l.length,hasMore:((null==(r=e.metadata)?void 0:r.current_page)??1)<((null==(s=e.metadata)?void 0:s.total_pages)??1)},chatId:e.chat_id,sessionId:e.session_id}}(await t.json(),a);return f("Loaded %d messages from server (page %d/%d)",n.messages.length,n.pagination.currentPage,n.pagination.totalPages),n}catch(e){if(e instanceof te)throw e;const t=new te(`Network error loading conversation: ${e.message}`,void 0,e);throw f("Network error loading conversation: %O",e),t}}const ae="a8c_agenttic_conversation_history";function oe(e){var t,n;const i=e.parts.filter(e=>"text"===e.type),a=i.map(e=>e.text).join("\n"),o=i.some(e=>{var t;return"context"===(null==(t=e.metadata)?void 0:t.contentType)})?"context":void 0,r=e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"arguments"in e.data).map(e=>({toolCallId:e.data.toolCallId,toolId:e.data.toolId,arguments:e.data.arguments})),s=e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"result"in e.data).map(e=>({toolCallId:e.data.toolCallId,result:e.data.result,error:e.data.error})),l=e.parts.filter(e=>"file"===e.type).map(e=>({name:e.file.name,mimeType:e.file.mimeType,uri:e.file.uri}));let c;for(const t of e.parts){if("data"!==t.type||!t.data||"object"!=typeof t.data||"toolCallId"in t.data)continue;const e=t.data,n=e.flags;if(n&&"object"==typeof n&&null!==n&&"forward_to_human_support"in n){c={flags:n,..."sources"in e&&{sources:e.sources}};break}}const u=r.length>0||s.length>0?"agent":e.role,d=(null==(t=e.metadata)?void 0:t.timestamp)??Date.now(),h=(null==(n=e.metadata)?void 0:n.archived)??void 0;return{role:u,content:a||"(No text content)",timestamp:d,...void 0!==h&&{archived:h},...o&&{contentType:o},...l.length>0&&{files:l},...r.length>0&&{toolCalls:r},...s.length>0&&{toolResults:s},...c&&{agentMessageData:c}}}function re(e){const t=[];if(e.content&&"(No text content)"!==e.content&&t.push({type:"text",text:e.content,...e.contentType&&{metadata:{contentType:e.contentType}}}),e.files)for(const n of e.files)t.push({type:"file",file:{name:n.name,mimeType:n.mimeType,uri:n.uri}});if(e.toolCalls)for(const n of e.toolCalls)t.push({type:"data",data:{toolCallId:n.toolCallId,toolId:n.toolId,arguments:n.arguments}});if(e.toolResults)for(const n of e.toolResults)t.push({type:"data",data:{toolCallId:n.toolCallId,result:n.result,...n.error&&{error:n.error}}});if(e.agentMessageData){const n={};void 0!==e.agentMessageData.flags&&(n.flags=e.agentMessageData.flags),"sources"in e.agentMessageData&&(n.sources=e.agentMessageData.sources??null),Object.keys(n).length>0&&t.push({type:"data",data:n})}return{role:e.role,kind:"message",parts:t,messageId:b(),metadata:{timestamp:e.timestamp,...void 0!==e.archived&&{archived:e.archived}}}}const se=new Map;function le(e){const t=e.parts.filter(e=>"text"===e.type||"data"!==e.type||(!("role"in e.data)||!("text"in e.data))&&!!("toolCallId"in e.data&&"arguments"in e.data||"flags"in e.data&&e.data.flags&&"object"==typeof e.data.flags&&"forward_to_human_support"in e.data.flags||"sources"in e.data&&Array.isArray(e.data.sources)&&e.data.sources.length>0||"toolCallId"in e.data&&"result"in e.data));return{...e,parts:t,metadata:e.metadata||{timestamp:Date.now()}}}function ce(e){const t=[];for(const n of e)for(const e of n.parts)if("text"===e.type)t.push({type:"data",data:{role:n.role,text:e.text}});else if("file"===e.type)t.push(e);else if("data"===e.type){if("role"in e.data&&"text"in e.data)continue;if("toolCallId"in e.data&&"arguments"in e.data){t.push(e);continue}if("toolCallId"in e.data&&"result"in e.data){t.push(e);continue}}return t}function ue(e,t=[],n=[]){const i=ce(t),a=n.map(e=>{const t="string"==typeof e?e:e.url,n="object"==typeof e?e.metadata:void 0,i=(null==n?void 0:n.fileType)||"image/jpeg";return{type:"file",file:{name:(null==n?void 0:n.fileName)||"image",mimeType:i,uri:t},metadata:n}});return{role:"user",parts:[...i,{type:"text",text:e},...a],kind:"message",messageId:b(),metadata:{timestamp:Date.now()}}}function de(e){return null!=e&&e.parts?e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"result"in e.data):[]}function he(e,t){if(typeof localStorage>"u")g("localStorage not available, cannot update session ID");else try{const n=localStorage.getItem(e);if(n){const i=JSON.parse(n),a=i.sessionId;i.sessionId=t,localStorage.setItem(e,JSON.stringify(i)),g("Updated localStorage[%s] session ID: %s -> %s",e,a,t)}else{const n={sessionId:t,timestamp:Date.now()};localStorage.setItem(e,JSON.stringify(n)),g("Created new session in localStorage[%s]: %s",e,t)}}catch(e){g("Failed to update localStorage sessionId to %s: %O",t,e)}}const pe=function(){const e=new Map;async function t(t,n){const i=e.get(t);if(null!=i&&i.sessionId)try{await async function(e,t,n){const i=n||e;if(se.set(i,[...t]),se.size>50){const e=se.keys().next().value;e&&se.delete(e)}if(!(typeof sessionStorage>"u"))try{const e={storageKey:i,messages:t.map(oe),lastUpdated:Date.now()};sessionStorage.setItem(`${ae}_${i}`,JSON.stringify(e))}catch(e){f("Failed to store conversation in sessionStorage for key %s: %O",i,e)}}(i.sessionId,n,i.conversationStorageKey)}catch(e){g(`Failed to persist conversation history for agent ${t}:`,e)}}return{async createAgent(t,n){if(e.has(t))return e.get(t).client;const i=function(e){const{agentId:t,agentUrl:n,authProvider:i,defaultSessionId:a,timeout:o=$,toolProvider:r,contextProvider:s,enableStreaming:l=!1,credentials:c}=e,u={agentId:t,agentUrl:n,authProvider:i,timeout:o,credentials:c};return{async sendMessage(e){var t,n;const{abortSignal:i}=e,o=e.sessionId||a||void 0,l=[];l.push(e.message);const c=await z(e,u,{isStreaming:!1},r,s,o);let d=await U(c,u,{abortSignal:i});const h=[],p=[];for(;d.status.message&&r;){const e=P(d.status.message);if(0===e.length)break;h.push(...e);const t=[];let n=!1;for(const i of e){const{toolCallId:e,toolId:a,arguments:o}=i.data;try{const i=await W(r,a,o),{result:s,returnToAgent:l,agentMessage:c}=M(i);l&&(n=!0),c&&p.push(I(c));const u=E(e,a,s);t.push(u),h.push(u)}catch(n){const i=E(e,a,void 0,n instanceof Error?n.message:String(n));t.push(i),h.push(i)}}if(l.push(d.status.message),!n)break;{const e=j(t);d=await J(d.id,e,u,r,s,o,i)}}if(h.length>0&&null!=(t=d.status)&&t.message){const e={...d.status.message,parts:h};d={...d,status:{...d.status,message:e}}}if(p.length>0){const e=p.map(e=>k(e)).join(" "),t=I(e);return{...d,text:e,agentMessage:t}}return{...d,text:k((null==(n=d.status)?void 0:n.message)||{parts:[],messageId:b()})}},async*sendMessageStream(e){const{withHistory:t=!0,abortSignal:n,enableStreaming:i}=e,c=e.sessionId||a||void 0,d=i??l,h=[];h.push(e.message);const p=H(await z(e,u,{isStreaming:!0,enableTokenStreaming:d},r,s,c),u,{enableTokenStreaming:d,streamingTimeout:o,abortSignal:n});yield*Q(p,r,s,u,c,t,h,n,{isStreaming:!0,enableTokenStreaming:d,streamingTimeout:o})},async continueTask(e,t,n){var i;const a=A(t);let o=await J(e,a,u,r,s,n);for(;"input-required"===o.status.state&&o.status.message&&r;){const e=P(o.status.message);if(0===e.length)break;const{results:t,shouldReturnToAgent:i}=await G(e,r);if(!i)break;{const e=j(t);o=await J(o.id,e,u,r,s,n)}}return{...o,text:k((null==(i=o.status)?void 0:i.message)||{parts:[],messageId:b()})}},async getTask(){throw new Error("getTask not implemented yet")},async cancelTask(){throw new Error("cancelTask not implemented yet")}}}(n),a=n.sessionId||null,o=n.conversationStorageKey,r=n.sessionIdStorageKey,s={odieBotId:n.odieBotId,authProvider:n.authProvider};let l=[];if(a)try{l=(await async function(e,t,n){return null!=n&&n.odieBotId?async function(e,t){const{odieBotId:n,authProvider:i}=t;if(!n)throw new Error("odieBotId is required for server storage");const a=ne;try{const t=await ie(e,{botId:n,apiBaseUrl:a,authProvider:i},1,50);return f("Loaded conversation from server: %s (%d messages, page %d/%d)",e,t.messages.length,t.pagination.currentPage,t.pagination.totalPages),{messages:t.messages,pagination:t.pagination}}catch(e){throw f("Failed to load conversation from server: %O",e),e}}(e,n):async function(e,t){const n=t||e;if(se.has(n))return{messages:[...se.get(n)]};if(typeof sessionStorage>"u")return{messages:[]};try{const e=sessionStorage.getItem(`${ae}_${n}`);if(e){const t=JSON.parse(e).messages.map(re);return se.set(n,t),{messages:[...t]}}}catch(e){f("Failed to load conversation from sessionStorage for key %s: %O",n,e)}return{messages:[]}}(e,t)}(a,o,s)).messages}catch(e){g(`Failed to load conversation history for agent ${t} with session ${a}:`,e)}const c={client:i,sessionId:a,conversationStorageKey:o,sessionIdStorageKey:r,storageConfig:s,conversationHistory:l,currentAbortController:null};return e.set(t,c),i},getAgent(t){const n=e.get(t);return(null==n?void 0:n.client)||null},hasAgent:t=>e.has(t),removeAgent:t=>e.delete(t),async sendMessage(n,i,a={}){var o;const r=e.get(n);if(!r)throw new Error(`Agent with key "${n}" not found`);const{withHistory:s=!0,sessionId:l,...c}=a,{client:u,conversationHistory:d}=r,h=a.message||ue(i,d,a.imageUrls),p=await u.sendMessage({message:h,withHistory:s,sessionId:l||r.sessionId||void 0,...c});if(p.sessionId){const e=r.sessionId;r.sessionId=p.sessionId,e&&p.sessionId&&e!==p.sessionId&&r.sessionIdStorageKey&&(g("Session ID changed from %s to %s, updating localStorage",e,p.sessionId),he(r.sessionIdStorageKey,p.sessionId))}let f=null;if(null!=(o=p.status)&&o.message){const e=p.status.message.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&("arguments"in e.data||"result"in e.data)),t=p.status.message.parts.filter(e=>"text"===e.type);f={role:"agent",kind:"message",parts:[...e,...t],messageId:b(),metadata:{timestamp:Date.now()}}}const m=[...d,A(i),...f?[le(f)]:[]];let y=m;if(p.agentMessage){const e=le(p.agentMessage);y=[...m,e]}return r.conversationHistory=y,s&&await t(n,y),p},async*sendMessageStream(n,i,a={}){var o,r,s,l,c,u;const d=e.get(n);if(!d)throw new Error(`Agent with key "${n}" not found`);const{withHistory:h=!0,abortSignal:p,metadata:f,sessionId:m,message:y,...v}=a,{client:x}=d,w=f?(({contentType:e,...t})=>t)(f):void 0,k=new AbortController;d.currentAbortController=k,p&&p.addEventListener("abort",()=>k.abort());let S=[...d.conversationHistory],C=[];const T=await async function(e){const t=[];for(const n of e)if(n.parts&&Array.isArray(n.parts))if(n.parts.some(e=>"data"===e.type&&"toolCallId"in e.data&&"result"in e.data)){const e=Y(n.parts);t.push({...n,parts:e})}else t.push(n);else t.push(n);return q.clear(),t}(S);let E;if(d.conversationHistory=T,S=T,h&&await t(n,T),y){const e=ce(T);E={...y,parts:[...e,...y.parts]}}else E=ue(i,T,a.imageUrls);if(a.metadata&&!y){const{contentType:e,...t}=a.metadata;if(e){const t=E.parts[E.parts.length-1];t&&"text"===t.type&&(t.metadata={...t.metadata,contentType:e})}Object.keys(t).length>0&&(E.metadata={...E.metadata,...t})}const I=y||A(i,a.metadata);if(a.imageUrls&&a.imageUrls.length>0){const e=a.imageUrls.map(e=>{const t="string"==typeof e?e:e.url,n="string"==typeof e?void 0:e.metadata,i=(null==n?void 0:n.fileType)||"image/jpeg";return{type:"file",file:{name:(null==n?void 0:n.fileName)||"image",mimeType:i,uri:t},metadata:n}});I.parts.push(...e)}S=[...S,I],d.conversationHistory=S,h&&await t(n,S);for await(const e of x.sendMessageStream({message:E,withHistory:h,sessionId:m||d.sessionId||void 0,abortSignal:k.signal,...v,...w&&Object.keys(w).length>0&&{metadata:w}})){if(e.sessionId){const t=d.sessionId;d.sessionId=e.sessionId,e.sessionId&&t!==e.sessionId&&d.sessionIdStorageKey&&(g("Session ID %s, updating localStorage",t?`changed from ${t} to ${e.sessionId}`:`received: ${e.sessionId}`),he(d.sessionIdStorageKey,e.sessionId))}if("input-required"===(null==(o=e.status)?void 0:o.state)&&null!=(r=e.status)&&r.message){C=P(e.status.message).map(e=>e.data.toolCallId);const i=le(e.status.message);S=[...S,i],d.conversationHistory=S,h&&await t(n,S)}if("working"===(null==(s=e.status)?void 0:s.state)&&null!=(l=e.status)&&l.message&&!e.final){const i=de(e.status.message).filter(e=>C.includes(e.data.toolCallId));if(i.length>0){const e={role:"agent",kind:"message",parts:i,messageId:b()};S=[...S,le(e)],d.conversationHistory=S,h&&await t(n,S)}}if(e.final&&"input-required"!==(null==(c=e.status)?void 0:c.state)){C=[];let i=null;null!=(u=e.status)&&u.message&&(i=le(e.status.message),S=[...S,i],d.conversationHistory=S,h&&await t(n,S))}yield e}d.currentAbortController=null},async*sendToolResult(t,n,i,a,o={}){const r=e.get(t);if(!r)throw new Error(`Agent with key "${t}" not found`);r.conversationHistory=r.conversationHistory.map(e=>({...e,parts:e.parts.filter(e=>!(e=>{var t;return"data"===e.type&&(null==(t=e.data)?void 0:t.toolCallId)===n&&"result"in e.data})(e))})).filter(e=>e.parts.length>0),yield*this.sendMessageStream(t,"",{...o,message:{role:"user",kind:"message",parts:[E(n,i,a)],messageId:b()}})},async resetConversation(t){const n=e.get(t);if(!n)throw new Error(`Agent with key "${t}" not found`);n.conversationHistory=[],n.sessionId&&await async function(e,t){const n=t||e;if(se.delete(n),!(typeof sessionStorage>"u"))try{sessionStorage.removeItem(`${ae}_${n}`)}catch(e){f("Failed to clear conversation from sessionStorage for key %s: %O",n,e)}}(n.sessionId,n.conversationStorageKey)},async replaceMessages(n,i){const a=e.get(n);if(!a)throw new Error(`Agent with key "${n}" not found`);a.conversationHistory=[...i],a.sessionId&&await t(n,i)},getConversationHistory(t){const n=e.get(t);if(!n)throw new Error(`Agent with key "${t}" not found`);return[...n.conversationHistory]},updateSessionId(t,n){const i=e.get(t);if(!i)throw new Error(`Agent with key "${t}" not found`);i.sessionId=n,i.sessionIdStorageKey&&he(i.sessionIdStorageKey,n)},abortCurrentRequest(t){const n=e.get(t);if(!n)throw new Error(`Agent with key "${t}" not found`);n.currentAbortController&&(n.currentAbortController.abort(),n.currentAbortController=null)},clear(){e.clear()}}}();function fe(){return pe}const me=e=>[...e].sort((e,t)=>e.timestamp-t.timestamp),ge=(e,t="40%")=>({type:"component",component:()=>h.createElement("img",{src:e,alt:"Uploaded image",style:{maxWidth:t,height:"auto",borderRadius:"8px",marginTop:"8px",marginRight:"8px",display:"inline-block"}})}),ye=(e,t=[])=>{var n,i;if(e.parts.some(e=>{if("data"===e.type){const t=e.data;return t.toolCallId||t.toolId||t.result}return!1}))return null;const a=e.parts.map(e=>{var t;if("text"===e.type)return{type:(null==(t=e.metadata)?void 0:t.contentType)||"text",text:e.text};if("file"===e.type){const t=e.file.uri||(e.file.mimeType&&e.file.bytes?`data:${e.file.mimeType};base64,${e.file.bytes}`:void 0);if(t)return ge(t)}if("data"===e.type){const t=e.data;return t.component&&t.componentProps?{type:"component",component:t.component,componentProps:t.componentProps}:t.flags&&"object"==typeof t.flags&&"forward_to_human_support"in t.flags||Array.isArray(t.sources)&&t.sources.length>0?{type:"data",data:t}:{type:"text",text:JSON.stringify(t)}}return{type:"text",text:"[Unsupported content]"}}),o=(null==(n=e.metadata)?void 0:n.timestamp)??Date.now(),r={id:e.messageId,role:"agent"===e.role?"agent":"user",content:a,timestamp:o,archived:!(null==(i=e.metadata)||!i.archived),showIcon:"agent"===e.role,icon:"agent"===e.role?"assistant":void 0};if("agent"===e.role&&t.length>0){const e=function(e,t){return t.flatMap(t=>"function"==typeof t.actions?t.actions(e):t.actions).filter(t=>!(t.condition&&!t.condition(e))).map(e=>"component"===e.type?{type:"component",id:e.id,label:e.label,component:e.component,componentProps:e.componentProps,order:e.order}:{id:e.id,label:e.label,icon:e.icon,onClick:e.onClick,tooltip:e.tooltip,disabled:e.disabled||!1,pressed:e.pressed,showLabel:e.showLabel,order:e.order}).sort((e,t)=>(e.order??1/0)-(t.order??1/0))}(r,t);e.length>0&&(r.actions=e)}return r};const ve=window.ReactJSXRuntime,xe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],be=(()=>new Set(xe))(),we=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},Se={...ke,transform:e=>we(0,1,e)},Ce={...ke,default:1},Te=e=>Math.round(1e5*e)/1e5,Pe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Ee=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ae=(e,t)=>n=>Boolean("string"==typeof n&&Ee.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ie=(e,t,n)=>i=>{if("string"!=typeof i)return i;const[a,o,r,s]=i.match(Pe);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==s?parseFloat(s):1}},Me={...ke,transform:e=>Math.round((e=>we(0,255,e))(e))},je={test:Ae("rgb","red"),parse:Ie("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Me.transform(e)+", "+Me.transform(t)+", "+Me.transform(n)+", "+Te(Se.transform(i))+")"},De={test:Ae("#"),parse:function(e){let t="",n="",i="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}},transform:je.transform},Le=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Re=Le("deg"),Oe=Le("%"),Ne=Le("px"),_e=Le("vh"),Ve=Le("vw"),Fe=(()=>({...Oe,parse:e=>Oe.parse(e)/100,transform:e=>Oe.transform(100*e)}))(),Be={test:Ae("hsl","hue"),parse:Ie("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Oe.transform(Te(t))+", "+Oe.transform(Te(n))+", "+Te(Se.transform(i))+")"},ze={test:e=>je.test(e)||De.test(e)||Be.test(e),parse:e=>je.test(e)?je.parse(e):Be.test(e)?Be.parse(e):De.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?je.transform(e):Be.transform(e),getAnimatableNone:e=>{const t=ze.parse(e);return t.alpha=0,ze.transform(t)}},Ue=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,He="number",$e="color",We=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function qe(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},a=[];let o=0;const r=t.replace(We,e=>(ze.test(e)?(i.color.push(o),a.push($e),n.push(ze.parse(e))):e.startsWith("var(")?(i.var.push(o),a.push("var"),n.push(e)):(i.number.push(o),a.push(He),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:a}}function Ke({split:e,types:t}){const n=e.length;return i=>{let a="";for(let o=0;o0},parse:function(e){return qe(e).values},createTransformer:function(e){return Ke(qe(e))},getAnimatableNone:function(e){const t=qe(e);return Ke(t)(t.values.map((e,n)=>((e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:ze.test(n)?ze.getAnimatableNone(n):n;var n})(e,t.split[n])))}},Ge=new Set(["brightness","contrast","saturate","opacity"]);function Xe(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[i]=n.match(Pe)||[];if(!i)return e;const a=n.replace(i,"");let o=Ge.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+a+")"}const Je=/\b([a-z-]*)\(.*?\)/gu,Ze={...Ye,getAnimatableNone:e=>{const t=e.match(Je);return t?t.map(Xe).join(" "):e}},Qe={...Ye,getAnimatableNone:e=>{const t=Ye.parse(e);return Ye.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},et={...ke,transform:Math.round},tt={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,rotate:Re,rotateX:Re,rotateY:Re,rotateZ:Re,scale:Ce,scaleX:Ce,scaleY:Ce,scaleZ:Ce,skew:Re,skewX:Re,skewY:Re,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Se,originX:Fe,originY:Fe,originZ:Ne,zIndex:et,fillOpacity:Se,strokeOpacity:Se,numOctaves:et},nt={...tt,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:Ze,WebkitFilter:Ze,mask:Qe,WebkitMask:Qe},it=e=>nt[e],at=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ot=e=>Boolean(e&&e.getVelocity),rt=new Set(["width","height","top","left","right","bottom",...xe]),st=e=>t=>t.test(e),lt=[ke,Ne,Oe,Re,Ve,_e,{test:e=>"auto"===e,parse:e=>e}],ct=e=>lt.find(st(e)),ut=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),dt=e=>t=>"string"==typeof t&&t.startsWith(e),ht=dt("--"),pt=dt("var(--"),ft=e=>!!pt(e)&&mt.test(e.split("/*")[0].trim()),mt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function gt(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const yt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vt(e,t,n=1){const[i,a]=function(e){const t=yt.exec(e);if(!t)return[,];const[,n,i,a]=t;return[`--${n??i}`,a]}(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const e=o.trim();return ut(e)?parseFloat(e):e}return ft(a)?vt(a,t,n+1):a}const xt=e=>180*e/Math.PI,bt=e=>{const t=xt(Math.atan2(e[1],e[0]));return kt(t)},wt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bt,rotateZ:bt,skewX:e=>xt(Math.atan(e[1])),skewY:e=>xt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kt=e=>((e%=360)<0&&(e+=360),e),St=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ct=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Tt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:St,scaleY:Ct,scale:e=>(St(e)+Ct(e))/2,rotateX:e=>kt(xt(Math.atan2(e[6],e[5]))),rotateY:e=>kt(xt(Math.atan2(-e[2],e[0]))),rotateZ:bt,rotate:bt,skewX:e=>xt(Math.atan(e[4])),skewY:e=>xt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Pt(e){return e.includes("scale")?1:0}function Et(e,t){if(!e||"none"===e)return Pt(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,a;if(n)i=Tt,a=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=wt,a=t}if(!a)return Pt(t);const o=i[t],r=a[1].split(",").map(At);return"function"==typeof o?o(r):r[o]}function At(e){return parseFloat(e.trim())}const It=e=>e===ke||e===Ne,Mt=new Set(["x","y","z"]),jt=xe.filter(e=>!Mt.has(e)),Dt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:i})=>{const a=e.max-e.min;return"border-box"===i?a:a-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:i})=>{const a=e.max-e.min;return"border-box"===i?a:a-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Et(t,"x"),y:(e,{transform:t})=>Et(t,"y")};Dt.translateX=Dt.x,Dt.translateY=Dt.y;const Lt=e=>e,Rt={},Ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Nt={value:null,addProjectionMetrics:null};function _t(e,t){let n=!1,i=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ot.reduce((e,n)=>(e[n]=function(e,t){let n=new Set,i=new Set,a=!1,o=!1;const r=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){r.has(t)&&(u.schedule(t),e()),l++,t(s)}const u={schedule:(e,t=!1,o=!1)=>{const s=o&&a?n:i;return t&&r.add(e),s.add(e),e},cancel:e=>{i.delete(e),r.delete(e)},process:e=>{if(s=e,a)return void(o=!0);a=!0;const r=n;n=i,i=r,n.forEach(c),t&&Nt.value&&Nt.value.frameloop[t].push(l),l=0,n.clear(),a=!1,o&&(o=!1,u.process(e))}};return u}(o,t?n:void 0),e),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:f}=r,m=()=>{const o=Rt.useManualTiming,r=o?a.timestamp:performance.now();n=!1,o||(a.delta=i?1e3/60:Math.max(Math.min(r-a.timestamp,40),1)),a.timestamp=r,a.isProcessing=!0,s.process(a),l.process(a),c.process(a),u.process(a),d.process(a),h.process(a),p.process(a),f.process(a),a.isProcessing=!1,n&&t&&(i=!1,e(m))};return{schedule:Ot.reduce((t,o)=>{const s=r[o];return t[o]=(t,o=!1,r=!1)=>(n||(n=!0,i=!0,a.isProcessing||e(m)),s.schedule(t,o,r)),t},{}),cancel:e=>{for(let t=0;te.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return jt.forEach(n=>{const i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}$t=!1,Ht=!1,Ut.forEach(e=>e.complete(Wt)),Ut.clear()}function Kt(){Ut.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($t=!0)})}class Yt{constructor(e,t,n,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ut.add(this),Ht||(Ht=!0,Vt.read(Kt),Vt.resolveKeyframes(qt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:i}=this;if(null===e[0]){const a=i?.get(),o=e[e.length-1];if(void 0!==a)e[0]=a;else if(n&&t){const i=n.readValue(t,o);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=o),i&&void 0===a&&i.set(e[0])}!function(e){for(let t=1;t/^0[^.\s]+$/u.test(e);function Xt(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||Gt(e)}const Jt=new Set([Ze,Qe]);function Zt(e,t){let n=it(e);return Jt.has(n)||(n=Ye),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Qt=new Set(["auto","none","0"]);class en extends Yt{constructor(e,t,n,i,a){super(e,t,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const tn=e=>1e3*e,nn=e=>e/1e3;function an(e,t){-1===e.indexOf(t)&&e.push(t)}function on(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class rn{constructor(){this.subscriptions=[]}add(e){return an(this.subscriptions,e),()=>on(this.subscriptions,e)}notify(e,t,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let a=0;ae.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}function ln(e){let t;return()=>(void 0===t&&(t=e()),t)}const cn={};function un(e,t){const n=ln(e);return()=>cn[t]??n()}const dn=un(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),hn=e=>null!==e;function pn(e,{repeat:t,repeatType:n="loop"},i,a=1){const o=e.filter(hn),r=a<0||t&&"loop"!==n&&t%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}class fn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const mn={layout:0,mainThread:0,waapi:0},gn=e=>Array.isArray(e)&&"number"==typeof e[0],yn=un(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),vn=(e,t,n=10)=>{let i="";const a=Math.max(Math.round(t/n),2);for(let t=0;t`cubic-bezier(${e}, ${t}, ${n}, ${i})`,bn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xn([0,.65,.55,1]),circOut:xn([.55,0,1,.45]),backIn:xn([.31,.01,.66,-.59]),backOut:xn([.33,1.53,.69,.99])};function wn(e,t){return e?"function"==typeof e?yn()?vn(e,t):"ease-out":gn(e)?xn(e):Array.isArray(e)?e.map(e=>wn(e,t)||bn.easeOut):bn[e]:void 0}function kn(e,t,n,{delay:i=0,duration:a=300,repeat:o=0,repeatType:r="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=wn(s,a);Array.isArray(d)&&(u.easing=d),Nt.value&&mn.waapi++;const h={delay:i,duration:a,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};c&&(h.pseudoElement=c);const p=e.animate(u,h);return Nt.value&&p.finished.finally(()=>{mn.waapi--}),p}function Sn(e){return"function"==typeof e&&"applyToOptions"in e}class Cn extends fn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:r,onComplete:s}=e;this.isPseudoElement=Boolean(a),this.allowFlatten=o,this.options=e,e.type;const l=function({type:e,...t}){return Sn(e)&&yn()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=kn(t,n,i,l,a),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const e=pn(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(e),sn(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return nn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+nn(e)}get time(){return nn(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=tn(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&dn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Lt):i(this)}}const Tn=new Set(["opacity","clipPath","filter","transform"]),{schedule:Pn,cancel:En}=_t(queueMicrotask,!1);let An;function In(){An=void 0}const Mn={now:()=>(void 0===An&&Mn.set(Bt.isProcessing||Rt.useManualTiming?Bt.timestamp:performance.now()),An),set:e=>{An=e,queueMicrotask(In)}};function jn(e,t){return t?e*(1e3/t):0}const Dn={current:void 0};class Ln{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=Mn.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Mn.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new rn);const n=this.events[e].add(t);return"change"===e?()=>{n(),Vt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Dn.current&&Dn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Mn.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return jn(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rn(e,t){return new Ln(e,t)}const On=[...lt,ze,Ye],Nn=new WeakMap;function Vn(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Fn(e){return"string"==typeof e||Array.isArray(e)}const Bn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],zn=["initial",...Bn];function Un(e){return Vn(e.animate)||zn.some(t=>Fn(e[t]))}function Hn(e){return Boolean(Un(e)||e.variants)}const $n={current:null},Wn={current:!1},qn="undefined"!=typeof window;function Kn(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Yn(e,t,n,i){if("function"==typeof t){const[a,o]=Kn(i);t=t(void 0!==n?n:e.custom,a,o)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[a,o]=Kn(i);t=t(void 0!==n?n:e.custom,a,o)}return t}const Gn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xn={};function Jn(e){Xn=e}class Zn{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:r},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Yt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Mn.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Wn.current||function(){if(Wn.current=!0,qn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$n.current=e.matches;e.addEventListener("change",t),t()}else $n.current=!1}(),this.shouldReduceMotion=$n.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ft(this.notifyUpdate),Ft(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Tn.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:a,ease:o,duration:r}=t.accelerate,s=new Cn({element:this.current,name:e,keyframes:i,times:a,ease:o,duration:tn(r)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=be.has(e);n&&this.onBindTransform&&this.onBindTransform();const i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Vt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Xn){const t=Xn[e];if(!t)continue;const{isEnabled:n,Feature:i}=t;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Rn(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(ut(n)||Gt(n))?n=parseFloat(n):(i=n,!On.find(st(i))&&Ye.test(t)&&(n=Zt(e,t))),this.setBaseTarget(e,ot(n)?n.get():n)),ot(n)?n.get():n;var i}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let n;if("string"==typeof t||"object"==typeof t){const i=Yn(this.props,t,this.presenceContext?.custom);i&&(n=i[e])}if(t&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||ot(i)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new rn),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Pn.render(this.render)}}class Qn extends Zn{constructor(){super(...arguments),this.KeyframeResolver=en}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ot(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function ei(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ti=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ni={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ii=xe.length;function ai(e,t,n){const{style:i,vars:a,transformOrigin:o}=e;let r=!1,s=!1;for(const e in t){const n=t[e];if(be.has(e))r=!0;else if(ht(e))a[e]=n;else{const t=ti(n,tt[e]);e.startsWith("origin")?(s=!0,o[e]=t):i[e]=t}}if(t.transform||(r||n?i.transform=function(e,t,n){let i="",a=!0;for(let o=0;o"string"==typeof e&&"svg"===e.toLowerCase();function di(e,{style:t,vars:n},i,a){const o=e.style;let r;for(r in t)o[r]=t[r];for(r in a?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}function hi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const pi={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Ne.test(e))return e;e=parseFloat(e)}return`${hi(e,t.target.x)}% ${hi(e,t.target.y)}%`}},fi=(e,t,n)=>e+(t-e)*n,mi={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,a=Ye.parse(e);if(a.length>5)return i;const o=Ye.createTransformer(e),r="number"!=typeof a[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;a[0+r]/=s,a[1+r]/=l;const c=fi(s,l,.5);return"number"==typeof a[2+r]&&(a[2+r]/=c),"number"==typeof a[3+r]&&(a[3+r]/=c),o(a)}},gi={borderRadius:{...pi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pi,borderTopRightRadius:pi,borderBottomLeftRadius:pi,borderBottomRightRadius:pi,boxShadow:mi};function yi(e,{layout:t,layoutId:n}){return be.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!gi[e]||"opacity"===e)}function vi(e,t,n){const i=e.style,a=t?.style,o={};if(!i)return o;for(const t in i)(ot(i[t])||a&&ot(a[t])||yi(t,e)||void 0!==n?.getValue(t)?.liveStyle)&&(o[t]=i[t]);return o}function xi(e,t,n){const i=vi(e,t,n);for(const n in e)(ot(e[n])||ot(t[n]))&&(i[-1!==xe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return i}class bi extends Qn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=at}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(be.has(t)){const e=it(t);return e&&e.default||0}return t=ci.has(t)?t:ei(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return xi(e,t,n)}build(e,t,n){li(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,i){!function(e,t,n,i){di(e,t,void 0,i);for(const n in t.attrs)e.setAttribute(ci.has(n)?n:ei(n),t.attrs[n])}(e,t,0,i)}mount(e){this.isSVGTag=ui(e.tagName),super.mount(e)}}function wi({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function ki(e){return void 0===e||1===e}function Si({scale:e,scaleX:t,scaleY:n}){return!ki(e)||!ki(t)||!ki(n)}function Ci(e){return Si(e)||Ti(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ti(e){return Pi(e.x)||Pi(e.y)}function Pi(e){return e&&"0%"!==e}function Ei(e,t,n){return n+t*(e-n)}function Ai(e,t,n,i,a){return void 0!==a&&(e=Ei(e,a,i)),Ei(e,n,i)+t}function Ii(e,t=0,n=1,i,a){e.min=Ai(e.min,t,n,i,a),e.max=Ai(e.max,t,n,i,a)}function Mi(e,{x:t,y:n}){Ii(e.x,t.translate,t.scale,t.originPoint),Ii(e.y,n.translate,n.scale,n.originPoint)}const ji=.999999999999,Di=1.0000000000001;function Li(e,t){e.min+=t,e.max+=t}function Ri(e,t,n,i,a=.5){Ii(e,t,n,fi(e.min,e.max,a),i)}function Oi(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function Ni(e,t,n){const i=n??e;Ri(e.x,Oi(t.x,i.x),t.scaleX,t.scale,t.originX),Ri(e.y,Oi(t.y,i.y),t.scaleY,t.scale,t.originY)}function _i(e,t){return wi(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}class Vi extends Qn{constructor(){super(...arguments),this.type="html",this.renderInstance=di}readValueFromInstance(e,t){if(be.has(t))return this.projection?.isProjecting?Pt(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Et(n,t)})(e,t);{const i=(n=e,window.getComputedStyle(n)),a=(ht(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof a?a.trim():a}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return _i(e,t)}build(e,t,n){ai(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return vi(e,t,n)}}const Fi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bi(e){return"string"==typeof e&&!e.includes("-")&&!!(Fi.indexOf(e)>-1||/[A-Z]/u.test(e))}const zi=(e,t)=>t.isSVG??Bi(e)?new bi(t):new Vi(t,{allowProjection:e!==h.Fragment}),Ui=(0,h.createContext)({}),Hi=(0,h.createContext)({strict:!1}),$i=(0,h.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Wi=(0,h.createContext)({});function qi(e){return Array.isArray(e)?e.join(" "):e}function Ki(e,t,n){for(const i in t)ot(t[i])||yi(i,n)||(e[i]=t[i])}function Yi(e,t){const n={},i=function(e,t){const n={};return Ki(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,h.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return ai(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function Gi(e,t,n,i){const a=(0,h.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return li(n,t,ui(i),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};Ki(t,e.style,e),a.style={...t,...a.style}}return a}const Xi=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ji(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Xi.has(e)}let Zi=e=>!Ji(e);try{"function"==typeof(Qi=require("@emotion/is-prop-valid").default)&&(Zi=e=>e.startsWith("on")?!Ji(e):Qi(e))}catch{}var Qi;function ea(e,t,n,{latestValues:i},a,o=!1,r){const s=(r??Bi(e)?Gi:Yi)(t,i,a,e),l=function(e,t,n){const i={};for(const a in e)"values"===a&&"object"==typeof e.values||ot(e[a])||(Zi(a)||!0===n&&Ji(a)||!t&&!Ji(a)||e.draggable&&a.startsWith("onDrag"))&&(i[a]=e[a]);return i}(t,"string"==typeof e,o),c=e!==h.Fragment?{...l,...s,ref:n}:{},{children:u}=t,d=(0,h.useMemo)(()=>ot(u)?u.get():u,[u]);return(0,h.createElement)(e,{...c,children:d})}function ta(e){return ot(e)?e.get():e}const na=(0,h.createContext)(null);function ia(e){const t=(0,h.useRef)(null);return null===t.current&&(t.current=e()),t.current}function aa(e,t,n,i){const a={},o=i(e,{});for(const e in o)a[e]=ta(o[e]);let{initial:r,animate:s}=e;const l=Un(e),c=Hn(e);t&&c&&!l&&!1!==e.inherit&&(void 0===r&&(r=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const d=u?s:r;if(d&&"boolean"!=typeof d&&!Vn(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n(t,n)=>{const i=(0,h.useContext)(Wi),a=(0,h.useContext)(na),o=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,a){return{latestValues:aa(n,i,a,e),renderState:t()}}(e,t,i,a);return n?o():ia(o)},ra=oa({scrapeMotionValuesFromProps:vi,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})}),sa=oa({scrapeMotionValuesFromProps:xi,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}})}),la={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let ca=!1;function ua(){return function(){if(ca)return;const e={};for(const t in la)e[t]={isEnabled:e=>la[t].some(t=>!!e[t])};Jn(e),ca=!0}(),Xn}const da=Symbol.for("motionComponentSymbol");function ha(e,t,n){const i=(0,h.useRef)(n);(0,h.useInsertionEffect)(()=>{i.current=n});const a=(0,h.useRef)(null);return(0,h.useCallback)(n=>{n&&e.onMount?.(n);const o=i.current;if("function"==typeof o)if(n){const e=o(n);"function"==typeof e&&(a.current=e)}else a.current?(a.current(),a.current=null):o(n);else o&&(o.current=n);t&&(n?t.mount(n):t.unmount())},[t])}const pa="data-"+ei("framerAppearId"),fa=(0,h.createContext)({});function ma(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const ga="undefined"!=typeof window?h.useLayoutEffect:h.useEffect;function ya(e,t,n,i,a,o){const{visualElement:r}=(0,h.useContext)(Wi),s=(0,h.useContext)(Hi),l=(0,h.useContext)(na),c=(0,h.useContext)($i),u=c.reducedMotion,d=c.skipAnimations,p=(0,h.useRef)(null),f=(0,h.useRef)(!1);i=i||s.renderer,!p.current&&i&&(p.current=i(e,{visualState:t,parent:r,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:d,isSVG:o}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,g=(0,h.useContext)(fa);!m||m.projection||!a||"html"!==m.type&&"svg"!==m.type||function(e,t,n,i){const{layoutId:a,layout:o,drag:r,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:va(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:Boolean(r)||s&&ma(s),visualElement:e,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,n,a,g);const y=(0,h.useRef)(!1);(0,h.useInsertionEffect)(()=>{m&&y.current&&m.update(n,l)});const v=n[pa],x=(0,h.useRef)(Boolean(v)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return ga(()=>{f.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),(0,h.useEffect)(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),x.current=!1),m.enteringChildren=void 0)}),m}function va(e){if(e)return!1!==e.options.allowProjection?e.projection:va(e.parent)}function xa(e,{forwardMotionProps:t=!1,type:n}={},i,a){i&&function(e){const t=ua();for(const n in e)t[n]={...t[n],...e[n]};Jn(t)}(i);const o=n?"svg"===n:Bi(e),r=o?sa:ra;function s(n,i){let s;const l={...(0,h.useContext)($i),...n,layoutId:ba(n)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Un(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Fn(t)?t:void 0,animate:Fn(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,h.useContext)(Wi));return(0,h.useMemo)(()=>({initial:t,animate:n}),[qi(t),qi(n)])}(n),d=r(n,c);if(!c&&"undefined"!=typeof window){(0,h.useContext)(Hi).strict;const t=function(e){const t=ua(),{drag:n,layout:i}=t;if(!n&&!i)return{};const a={...n,...i};return{MeasureLayout:n?.isEnabled(e)||i?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}(l);s=t.MeasureLayout,u.visualElement=ya(e,d,l,a,t.ProjectionNode,o)}return(0,ve.jsxs)(Wi.Provider,{value:u,children:[s&&u.visualElement?(0,ve.jsx)(s,{visualElement:u.visualElement,...l}):null,ea(e,n,ha(d,u.visualElement,i),d,c,t,o)]})}s.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const l=(0,h.forwardRef)(s);return l[da]=e,l}function ba({layoutId:e}){const t=(0,h.useContext)(Ui).id;return t&&void 0!==e?t+"-"+e:e}function wa(e,t){if("undefined"==typeof Proxy)return xa;const n=new Map,i=(n,i)=>xa(n,i,e,t);return new Proxy((e,t)=>i(e,t),{get:(a,o)=>"create"===o?i:(n.has(o)||n.set(o,xa(o,void 0,e,t)),n.get(o))})}class ka{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Sa(e,t,n){const i=e.getProps();return Yn(i,t,void 0!==n?n:i.custom,e)}function Ca(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function Ta(e,t){const n=e?.[t]??e?.default??e;return n!==e?Ca(n,e):n}const Pa=e=>Array.isArray(e);function Ea(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Rn(n))}function Aa(e){return Pa(e)?e[e.length-1]||0:e}function Ia(e,t){const n=e.getValue("willChange");if(i=n,Boolean(ot(i)&&i.add))return n.add(t);if(!n&&Rt.WillChange){const n=new Rt.WillChange("auto");e.addValue("willChange",n),n.add(t)}var i}function Ma(e){return e.props[pa]}const ja=(e,t)=>n=>t(e(n)),Da=(...e)=>e.reduce(ja);function La(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ra(e,t){return n=>n>0?t:e}const Oa=(e,t,n)=>{const i=e*e,a=n*(t*t-i)+i;return a<0?0:Math.sqrt(a)},Na=[De,je,Be];function _a(e){const t=(n=e,Na.find(e=>e.test(n)));var n;if(Boolean(t),!Boolean(t))return!1;let i=t.parse(e);return t===Be&&(i=function({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,n/=100;let a=0,o=0,r=0;if(t/=100){const i=n<.5?n*(1+t):n+t-n*t,s=2*n-i;a=La(s,i,e+1/3),o=La(s,i,e),r=La(s,i,e-1/3)}else a=o=r=n;return{red:Math.round(255*a),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Va=(e,t)=>{const n=_a(e),i=_a(t);if(!n||!i)return Ra(e,t);const a={...n};return e=>(a.red=Oa(n.red,i.red,e),a.green=Oa(n.green,i.green,e),a.blue=Oa(n.blue,i.blue,e),a.alpha=fi(n.alpha,i.alpha,e),je.transform(a))},Fa=new Set(["none","hidden"]);function Ba(e,t){return n=>fi(e,t,n)}function za(e){return"number"==typeof e?Ba:"string"==typeof e?ft(e)?Ra:ze.test(e)?Va:$a:Array.isArray(e)?Ua:"object"==typeof e?ze.test(e)?Va:Ha:Ra}function Ua(e,t){const n=[...e],i=n.length,a=e.map((e,n)=>za(e)(e,t[n]));return e=>{for(let t=0;t{for(const t in i)n[t]=i[t](e);return n}}const $a=(e,t)=>{const n=Ye.createTransformer(t),i=qe(e),a=qe(t);return i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length?Fa.has(e)&&!a.values.length||Fa.has(t)&&!i.values.length?function(e,t){return Fa.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Da(Ua(function(e,t){const n=[],i={color:0,var:0,number:0};for(let a=0;a{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>Vt.update(t,e),stop:()=>Ft(t),now:()=>Bt.isProcessing?Bt.timestamp:Mn.now()}},Ka=2e4;function Ya(e){let t=0,n=e.next(t);for(;!n.done&&t=Ka?1/0:t}function Ga(e,t=100,n){const i=n({...e,keyframes:[0,t]}),a=Math.min(Ya(i),Ka);return{type:"keyframes",ease:e=>i.next(a*e).value/t,duration:nn(a)}}const Xa=.01,Ja=2,Za=.005,Qa=.5;function eo(e,t){return e*Math.sqrt(1-t*t)}const to=["duration","bounce"],no=["stiffness","damping","mass"];function io(e,t){return t.some(t=>void 0!==e[t])}function ao(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:a}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],s={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!io(e,no)&&io(e,to))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(1.2*n),a=i*i,o=2*we(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:1,stiffness:a,damping:o}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:i=1}){let a,o;tn(10);let r=1-t;r=we(.05,1,r),e=we(.01,10,nn(e)),r<1?(a=t=>{const i=t*r,a=i*e;return.001-(i-n)/eo(t,r)*Math.exp(-a)},o=t=>{const i=t*r*e,o=i*n+n,s=Math.pow(r,2)*Math.pow(t,2)*e,l=Math.exp(-i),c=eo(Math.pow(t,2),r);return(.001-a(t)>0?-1:1)*((o-s)*l)/c}):(a=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let i=n;for(let n=1;n<12;n++)i-=e(i)/t(i);return i}(a,o,5/e);if(e=tn(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*i;return{stiffness:t,damping:2*r*Math.sqrt(i*t),duration:e}}}({...e,velocity:0});t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-nn(n.velocity||0)}),f=h||0,m=c/(2*Math.sqrt(l*u)),g=r-o,y=nn(Math.sqrt(l/u)),v=Math.abs(g)<5;let x,b,w,k,S,C;if(i||(i=v?Xa:Ja),a||(a=v?Za:Qa),m<1)w=eo(y,m),k=(f+m*y*g)/w,x=e=>{const t=Math.exp(-m*y*e);return r-t*(k*Math.sin(w*e)+g*Math.cos(w*e))},S=m*y*k+g*w,C=m*y*g-k*w,b=e=>Math.exp(-m*y*e)*(S*Math.sin(w*e)+C*Math.cos(w*e));else if(1===m){x=e=>r-Math.exp(-y*e)*(g+(f+y*g)*e);const e=f+y*g;b=t=>Math.exp(-y*t)*(y*e*t-f)}else{const e=y*Math.sqrt(m*m-1);x=t=>{const n=Math.exp(-m*y*t),i=Math.min(e*t,300);return r-n*((f+m*y*g)*Math.sinh(i)+e*g*Math.cosh(i))/e};const t=(f+m*y*g)/e,n=m*y*t-g*e,i=m*y*g-t*e;b=t=>{const a=Math.exp(-m*y*t),o=Math.min(e*t,300);return a*(n*Math.sinh(o)+i*Math.cosh(o))}}const T={calculatedDuration:p&&d||null,velocity:e=>tn(b(e)),next:e=>{if(!p&&m<1){const t=Math.exp(-m*y*e),n=Math.sin(w*e),o=Math.cos(w*e),l=r-t*(k*n+g*o),c=tn(t*(S*n+C*o));return s.done=Math.abs(c)<=i&&Math.abs(r-l)<=a,s.value=s.done?r:l,s}const t=x(e);if(p)s.done=e>=d;else{const n=tn(b(e));s.done=Math.abs(n)<=i&&Math.abs(r-t)<=a}return s.value=s.done?r:t,s},toString:()=>{const e=Math.min(Ya(T),Ka),t=vn(t=>T.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return T}function oo(e,t,n){const i=Math.max(t-5,0);return jn(n-e(i),t-i)}function ro({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:r,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)-f*Math.exp(-e/i),v=e=>g+y(e),x=e=>{const t=y(e),n=v(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let b,w;const k=e=>{var t;t=h.value,(void 0!==s&&tl)&&(b=e,w=ao({keyframes:[h.value,p(h.value)],velocity:oo(v,e,h.value),damping:a,stiffness:o,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==b||(t=!0,x(e),k(e)),void 0!==b&&e>=b?w.next(e-b):(!t&&x(e),h)}}}ao.applyToOptions=e=>{const t=Ga(e,100,ao);return e.ease=t.ease,e.duration=tn(t.duration),e.type="keyframes",e};const so=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function lo(e,t,n,i){if(e===t&&n===i)return Lt;return a=>0===a||1===a?a:so(function(e,t,n,i,a){let o,r,s=0;do{r=t+(n-t)/2,o=so(r,i,a)-e,o>0?n=r:t=r}while(Math.abs(o)>1e-7&&++s<12);return r}(a,0,1,e,n),t,i)}const co=lo(.42,0,1,1),uo=lo(0,0,.58,1),ho=lo(.42,0,.58,1),po=e=>Array.isArray(e)&&"number"!=typeof e[0],fo=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mo=e=>t=>1-e(1-t),go=lo(.33,1.53,.69,.99),yo=mo(go),vo=fo(yo),xo=e=>e>=1?1:(e*=2)<1?.5*yo(e):.5*(2-Math.pow(2,-10*(e-1))),bo=e=>1-Math.sin(Math.acos(e)),wo=mo(bo),ko=fo(bo),So={linear:Lt,easeIn:co,easeInOut:ho,easeOut:uo,circIn:bo,circInOut:ko,circOut:wo,backIn:yo,backInOut:vo,backOut:go,anticipate:xo},Co=e=>{if(gn(e)){e.length;const[t,n,i,a]=e;return lo(t,n,i,a)}return"string"==typeof e?So[e]:e},To=(e,t,n)=>{const i=t-e;return 0===i?1:(n-e)/i};function Po(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const a=To(0,t,i);e.push(fi(n,1,a))}}function Eo(e){const t=[0];return Po(t,e.length-1),t}function Ao({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const a=po(i)?i.map(Co):Co(i),o={done:!1,value:t[0]},r=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Eo(t),e),s=function(e,t,{clamp:n=!0,ease:i,mixer:a}={}){const o=e.length;if(t.length,1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];const r=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const i=[],a=n||Rt.mix||Wa,o=e.length-1;for(let n=0;n{if(r&&n1)for(;ic(we(e[0],e[o-1],t)):c}(r,t,{ease:Array.isArray(a)?a:(l=t,c=a,l.map(()=>c||ho).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}const Io={decay:ro,inertia:ro,tween:Ao,keyframes:Ao,spring:ao};function Mo(e){"string"==typeof e.type&&(e.type=Io[e.type])}const jo=e=>e/100;class Do extends fn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==Mn.now()&&this.tick(Mn.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},mn.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Mo(e);const{type:t=Ao,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:r}=e;const s=t||Ao;s!==Ao&&"number"!=typeof r[0]&&(this.mixKeyframes=Da(jo,Wa(r[0],r[1])),r=[0,100]);const l=s({...e,keyframes:r});"mirror"===a&&(this.mirroredGenerator=s({...e,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Ya(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:d,repeatDelay:h,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,b=n;if(u){const e=Math.min(this.currentTime,i)/r;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,u+1),Boolean(t%2)&&("reverse"===d?(n=1-n,h&&(n-=h/r)):"mirror"===d&&(b=o)),x=we(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=b.next(x),a&&!y&&(v.value=a(v.value));let{done:w}=v;y||null===s||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&p!==ro&&(v.value=pn(c,this.options,m,this.speed)),f&&f(v.value),k&&this.finish(),v}then(e,t){return this.finished.then(e,t)}get duration(){return nn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+nn(e)}get time(){return nn(this.currentTime)}set time(e){e=tn(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;return e<=0?this.options.velocity||0:this.generator.velocity?this.generator.velocity(e):oo(e=>this.generator.next(e).value,e,this.generator.next(e).value)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Mn.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=nn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=qa,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Mn.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,mn.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const Lo={anticipate:xo,backInOut:vo,circInOut:ko};class Ro extends Cn{constructor(e){var t;"string"==typeof(t=e).ease&&t.ease in Lo&&(t.ease=Lo[t.ease]),Mo(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:i,element:a,...o}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const r=new Do({...o,autoplay:!1}),s=Math.max(10,Mn.now()-this.startTime),l=we(0,10,s-10),c=r.sample(s).value,{name:u}=this.options;a&&u&&sn(a,u,c),t.setWithVelocity(r.sample(Math.max(0,s-l)).value,c,l),r.stop()}}const Oo=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Ye.test(e)&&"0"!==e||e.startsWith("url(")));function No(e){e.duration=0,e.type="keyframes"}const _o=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,Vo=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Fo=ln(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Bo extends fn{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:r,name:s,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Mn.now();const d={autoplay:e,delay:t,type:n,repeat:i,repeatDelay:a,repeatType:o,name:s,motionValue:l,element:c,...u},h=c?.KeyframeResolver||Yt;this.keyframeResolver=new h(r,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:r,delay:s,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Mn.now();let u=!0;(function(e,t,n,i){const a=e[0];if(null===a)return!1;if("display"===t||"visibility"===t)return!0;const o=e[e.length-1],r=Oo(a,t),s=Oo(o,t);return!(!r||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},h=u&&!l&&function(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:a,damping:o,type:r,keyframes:s}=e,l=t?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Fo()&&n&&(Tn.has(n)||Vo.has(n)&&function(e){for(let t=0;t{this.notifyFinished()}).catch(Lt),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Wt=!0,Kt(),qt(),Wt=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const zo={type:"spring",stiffness:500,damping:25,restSpeed:10},Uo={type:"keyframes",duration:.8},Ho={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$o=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),Wo=(e,t,n,i={},a,o)=>r=>{const s=Ta(i,e)||{},l=s.delay||i.delay||0;let{elapsed:c=0}=i;c-=tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{r(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:o?void 0:a};(function(e){for(const t in e)if(!$o.has(t))return!0;return!1})(s)||Object.assign(u,((e,{keyframes:t})=>t.length>2?Uo:be.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:zo:Ho)(e,u)),u.duration&&(u.duration=tn(u.duration)),u.repeatDelay&&(u.repeatDelay=tn(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(No(u),0===u.delay&&(d=!0)),(Rt.instantAnimations||Rt.skipAnimations||a?.shouldSkipAnimations)&&(d=!0,No(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!o&&void 0!==t.get()){const e=pn(u.keyframes,s);if(void 0!==e)return void Vt.update(()=>{u.onUpdate(e),u.onComplete()})}return s.isSync?new Do(u):new Bo(u)};function qo({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,i}function Ko(e,t,{delay:n=0,transitionOverride:i,type:a}={}){let{transition:o,transitionEnd:r,...s}=t;const l=e.getDefaultTransition();o=o?Ca(o,l):l;const c=o?.reduceMotion;i&&(o=i);const u=[],d=a&&e.animationState&&e.animationState.getState()[a];for(const t in s){const i=e.getValue(t,e.latestValues[t]??null),a=s[t];if(void 0===a||d&&qo(d,t))continue;const r={delay:n,...Ta(o||{},t)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(a)&&a===l&&!r.velocity){Vt.update(()=>i.set(a));continue}let h=!1;if(window.MotionHandoffAnimation){const n=Ma(e);if(n){const e=window.MotionHandoffAnimation(n,t,Vt);null!==e&&(r.startTime=e,h=!0)}}Ia(e,t);const p=c??e.shouldReduceMotion;i.start(Wo(t,i,a,p&&rt.has(t)?{type:!1}:r,e,h));const f=i.animation;f&&u.push(f)}if(r){const t=()=>Vt.update(()=>{r&&function(e,t){const n=Sa(e,t);let{transitionEnd:i={},transition:a={},...o}=n||{};o={...o,...i};for(const t in o)Ea(e,t,Aa(o[t]))}(e,r)});u.length?Promise.all(u).then(t):t()}return u}function Yo(e,t,n,i=0,a=1){const o=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),r=e.size,s=(r-1)*i;return"function"==typeof n?n(o,r):1===a?o*i:s-o*i}function Go(e,t,n={}){const i=Sa(e,t,"exit"===n.type?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(Ko(e,i,n)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:s}=a;return function(e,t,n=0,i=0,a=0,o=1,r){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(Go(l,t,{...r,delay:n+("function"==typeof i?0:i)+Yo(e.variantChildren,l,i,a,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,i,o,r,s,n)}:()=>Promise.resolve(),{when:s}=a;if(s){const[e,t]="beforeChildren"===s?[o,r]:[r,o];return e().then(()=>t())}return Promise.all([o(),r(n.delay)])}const Xo=zn.length;function Jo(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Jo(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;nPromise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let i;if(e.notify("AnimationStart",t),Array.isArray(t)){const a=t.map(t=>Go(e,t,n));i=Promise.all(a)}else if("string"==typeof t)i=Go(e,t,n);else{const a="function"==typeof t?Sa(e,t,n.custom):t;i=Promise.all(Ko(e,a,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=ar(),i=!0,a=!1;const o=t=>(n,i)=>{const a=Sa(e,i,"exit"===t?e.presenceContext?.custom:void 0);if(a){const{transition:e,transitionEnd:t,...i}=a;n={...n,...i,...t}}return n};function r(r){const{props:s}=e,l=Jo(e.parent)||{},c=[],u=new Set;let d={},h=1/0;for(let t=0;th&&g,w=!1;const k=Array.isArray(m)?m:[m];let S=k.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:C={}}=f,T={...C,...S},P=t=>{b=!0,u.has(t)&&(w=!0,u.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in T){const t=S[e],n=C[e];if(d.hasOwnProperty(e))continue;let i=!1;i=Pa(t)&&Pa(n)?!Zo(t,n):t!==n,i?null!=t?P(e):u.add(e):void 0!==t&&u.has(e)?P(e):f.protectedKeys[e]=!0}f.prevProp=m,f.prevResolvedValues=S,f.isActive&&(d={...d,...S}),(i||a)&&e.blockInitialAnimation&&(b=!1);const E=v&&x;b&&(!E||w)&&c.push(...k.map(t=>{const n={type:p};if("string"==typeof t&&(i||a)&&!E&&e.manuallyAnimateOnMount&&e.parent){const{parent:i}=e,a=Sa(i,t);if(i.enteringChildren&&a){const{delayChildren:t}=a.transition||{};n.delay=Yo(i.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof s.initial){const n=Sa(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{const i=e.getBaseTarget(n),a=e.getValue(n);a&&(a.liveStyle=!0),t[n]=i??null}),c.push({animation:t})}let p=Boolean(c.length);return!i||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),i=!1,a=!1,p?t(c):Promise.resolve()}return{animateChanges:r,setActive:function(t,i){if(n[t].isActive===i)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,i)),n[t].isActive=i;const a=r(t);for(const e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=ar(),a=!0}}}function nr(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Zo(t,e)}function ir(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ar(){return{animate:ir(!0),whileInView:ir(),whileHover:ir(),whileTap:ir(),whileDrag:ir(),whileFocus:ir(),exit:ir()}}let or=0;const rr={animation:{Feature:class extends ka{constructor(e){super(e),e.animationState||(e.animationState=tr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Vn(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ka{constructor(){super(...arguments),this.id=or++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&!1===n){if(this.isExitComplete){const{initial:e,custom:t}=this.node.getProps();if("string"==typeof e){const n=Sa(this.node,e,t);if(n){const{transition:e,transitionEnd:t,...i}=n;for(const e in i)this.node.getValue(e)?.jump(i[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}},sr={x:!1,y:!1};function lr(){return sr.x||sr.y}function cr(e){return[e("x"),e("y")]}function ur(e){return e.max-e.min}function dr(e,t,n,i=.5){e.origin=i,e.originPoint=fi(t.min,t.max,e.origin),e.scale=ur(n)/ur(t),e.translate=fi(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function hr(e,t,n,i){dr(e.x,t.x,n.x,i?i.originX:void 0),dr(e.y,t.y,n.y,i?i.originY:void 0)}function pr(e,t,n,i=0){const a=i?fi(n.min,n.max,i):n.min;e.min=a+t.min,e.max=e.min+ur(t)}function fr(e,t,n,i=0){const a=i?fi(n.min,n.max,i):n.min;e.min=t.min-a,e.max=e.min+ur(t)}function mr(e,t,n,i){fr(e.x,t.x,n.x,i?.x),fr(e.y,t.y,n.y,i?.y)}const gr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),yr=new Set(["INPUT","SELECT","TEXTAREA"]);function vr(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function xr(e){return"object"==typeof e&&null!==e}function br(e){return xr(e)&&"ownerSVGElement"in e}function wr(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let i=document;t&&(i=t.current);const a=n?.[e]??i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(e=>null!=e)}const kr=new WeakMap;let Sr;const Cr=(e,t,n)=>(i,a)=>a&&a[0]?a[0][e+"Size"]:br(i)&&"getBBox"in i?i.getBBox()[t]:i[n],Tr=Cr("inline","width","offsetWidth"),Pr=Cr("block","height","offsetHeight");function Er({target:e,borderBoxSize:t}){kr.get(e)?.forEach(n=>{n(e,{get width(){return Tr(e,t)},get height(){return Pr(e,t)}})})}function Ar(e){e.forEach(Er)}const Ir=new Set;let Mr;function jr(e,t){return"function"==typeof e?(n=e,Ir.add(n),Mr||(Mr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ir.forEach(t=>t(e))},window.addEventListener("resize",Mr)),()=>{Ir.delete(n),Ir.size||"function"!=typeof Mr||(window.removeEventListener("resize",Mr),Mr=void 0)}):function(e,t){Sr||"undefined"!=typeof ResizeObserver&&(Sr=new ResizeObserver(Ar));const n=wr(e);return n.forEach(e=>{let n=kr.get(e);n||(n=new Set,kr.set(e,n)),n.add(t),Sr?.observe(e)}),()=>{n.forEach(e=>{const n=kr.get(e);n?.delete(t),n?.size||Sr?.unobserve(e)})}}(e,t);var n}const Dr=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Lr(e){return{point:{x:e.pageX,y:e.pageY}}}function Rr(e,t,n,i){return vr(e,t,(e=>t=>Dr(t)&&e(t,Lr(t)))(n),i)}const Or=({current:e})=>e?e.ownerDocument.defaultView:null,Nr=(e,t)=>Math.abs(e-t),_r=new Set(["auto","scroll"]);class Vr{constructor(e,t,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Fr(this.lastRawMoveEventInfo,this.transformPagePoint));const e=zr(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Nr(e.x,t.x),i=Nr(e.y,t.y);return Math.sqrt(n**2+i**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:i}=e,{timestamp:a}=Bt;this.history.push({...i,timestamp:a});const{onStart:o,onMove:r}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Fr(t,this.transformPagePoint),Vt.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:a}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||a&&a(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=zr("pointercancel"===e.type?this.lastMoveEventInfo:Fr(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),i&&i(e,o)},!Dr(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const s=Fr(Lr(e),this.transformPagePoint),{point:l}=s,{timestamp:c}=Bt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=t;u&&u(e,zr(s,this.history)),this.removeListeners=Da(Rr(this.contextWindow,"pointermove",this.handlePointerMove),Rr(this.contextWindow,"pointerup",this.handlePointerUp),Rr(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(_r.has(e.overflowX)||_r.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a=i.x-t.x,o=i.y-t.y;0===a&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=a,this.history[0].y-=o),this.scrollPositions.set(e,i),Vt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ft(this.updatePoint)}}function Fr(e,t){return t?{point:t(e.point)}:e}function Br(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zr({point:e},t){return{point:e,delta:Br(e,Hr(t)),offset:Br(e,Ur(t)),velocity:$r(t,.1)}}function Ur(e){return e[0]}function Hr(e){return e[e.length-1]}function $r(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const a=Hr(e);for(;n>=0&&(i=e[n],!(a.timestamp-i.timestamp>tn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&a.timestamp-i.timestamp>2*tn(t)&&(i=e[1]);const o=nn(a.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(a.x-i.x)/o,y:(a.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Wr(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function qr(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min{t&&this.snapToCursor(Lr(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?sr[o]?null:(sr[o]=!0,()=>{sr[o]=!1}):sr.x||sr.y?null:(sr.x=sr.y=!0,()=>{sr.x=sr.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cr(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Oe.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[e];i&&(t=ur(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),a&&Vt.update(()=>a(e,t),!1,!0),Ia(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:a,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=t;if(i&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(r),void(null!==this.currentDirection&&a&&a(this.currentDirection));this.updateAxis("x",t.point,r),this.updateAxis("y",t.point,r),this.visualElement.render(),o&&Vt.update(()=>o(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:a,distanceThreshold:n,contextWindow:Or(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Vt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:i}=this.getProps();if(!n||!Qr(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,{min:t,max:n},i){return void 0!==t&&en&&(e=i?fi(n,e,i.max):Math.min(e,n)),e}(o,this.constraints[e],this.elastic[e])),a.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&ma(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:i,right:a}){return{x:Wr(e.x,n,a),y:Wr(e.y,t,i)}}(n.layoutBox,e),this.elastic=function(e=Kr){return!1===e?e=0:!0===e&&(e=Kr),{x:Yr(e,"left","right"),y:Yr(e,"top","bottom")}}(t),i!==this.constraints&&!ma(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&cr(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ma(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=function(e,t,n){const i=_i(e,n),{scroll:a}=t;return a&&(Li(i.x,a.offset.x),Li(i.y,a.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(e,t){return{x:qr(e.x,t.x),y:qr(e.y,t.y)}}(i.layout.layoutBox,a);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=wi(e))}return o}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),s=this.constraints||{},l=cr(r=>{if(!Qr(r,t,this.currentDirection))return;let l=s&&s[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,d={type:"inertia",velocity:n?e[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Ia(this.visualElement,e),n.start(Wo(e,n,0,t,this.visualElement,!1))}stopAnimation(){cr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){cr(t=>{const{drag:n}=this.getProps();if(!Qr(t,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(t);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[t],r=a.get()||0;a.set(e[t]-fi(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ma(t)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};cr(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();i[e]=function(e,t){let n=.5;const i=ur(e),a=ur(t);return a>i?n=To(t.min,t.max-i,e.min):i>a&&(n=To(e.min,e.max-a,t.min)),we(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),cr(t=>{if(!Qr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:a,max:o}=this.constraints[t];n.set(fi(a,o,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Xr.set(this.visualElement,this);const e=this.visualElement.current,t=Rr(e,"pointerdown",t=>{const{drag:n,dragListener:i=!0}=this.getProps(),a=t.target,o=a!==e&&function(e){return yr.has(e.tagName)||!0===e.isContentEditable}(a);n&&i&&!o&&this.start(t)});let n;const i=()=>{const{dragConstraints:t}=this.getProps();ma(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const i=jr(e,Zr(n)),a=jr(t,Zr(n));return()=>{i(),a()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,o=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Vt.read(i);const r=vr(window,"resize",()=>this.scalePositionWithinConstraints()),s=a.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(cr(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{r(),t(),o(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=Kr,dragMomentum:r=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:r}}}function Zr(e){let t=!0;return()=>{t?t=!1:e()}}function Qr(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const es=e=>(t,n)=>{e&&Vt.update(()=>e(t,n),!1,!0)},ts={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ns(e=!0){const t=(0,h.useContext)(na);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:i,register:a}=t,o=(0,h.useId)();(0,h.useEffect)(()=>{if(e)return a(o)},[e]);const r=(0,h.useCallback)(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,r]:[!0]}let is=!1;class as extends h.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;a&&(t.group&&t.group.add(a),n&&n.register&&i&&n.register(a),is&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ts.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:i,isPresent:a}=this.props,{projection:o}=n;return o?(o.isPresent=a,e.layoutDependency!==t&&o.setOptions({...o.options,layoutDependency:t}),is=!0,i||e.layoutDependency!==t||void 0===t||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Vt.postRender(()=>{const e=o.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Pn.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:i}=e;is=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function os(e){const[t,n]=ns(),i=(0,h.useContext)(Ui);return(0,ve.jsx)(as,{...e,layoutGroup:i,switchLayoutGroup:(0,h.useContext)(fa),isPresent:t,safeToRemove:n})}function rs(e,t,n){const i=ot(e)?e:Rn(e);return i.start(Wo("",i,t,n)),i.animation}function ss(e){return br(e)&&"svg"===e.tagName}const ls=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],cs=ls.length,us=e=>"string"==typeof e?parseFloat(e):e,ds=e=>"number"==typeof e||Ne.test(e);function hs(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const ps=ms(0,.5,wo),fs=ms(.5,.95,Lt);function ms(e,t,n){return i=>it?1:n(To(e,t,i))}function gs(e,t){e.min=t.min,e.max=t.max}function ys(e,t){gs(e.x,t.x),gs(e.y,t.y)}function vs(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xs(e,t,n,i,a){return e=Ei(e-=t,1/n,i),void 0!==a&&(e=Ei(e,1/a,i)),e}function bs(e,t,[n,i,a],o,r){!function(e,t=0,n=1,i=.5,a,o=e,r=e){if(Oe.test(t)&&(t=parseFloat(t),t=fi(r.min,r.max,t/100)-r.min),"number"!=typeof t)return;let s=fi(o.min,o.max,i);e===o&&(s-=t),e.min=xs(e.min,t,n,s,a),e.max=xs(e.max,t,n,s,a)}(e,t[n],t[i],t[a],t.scale,o,r)}const ws=["x","scaleX","originX"],ks=["y","scaleY","originY"];function Ss(e,t,n,i){bs(e.x,t,ws,n?n.x:void 0,i?i.x:void 0),bs(e.y,t,ks,n?n.y:void 0,i?i.y:void 0)}function Cs(e){return 0===e.translate&&1===e.scale}function Ts(e){return Cs(e.x)&&Cs(e.y)}function Ps(e,t){return e.min===t.min&&e.max===t.max}function Es(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function As(e,t){return Es(e.x,t.x)&&Es(e.y,t.y)}function Is(e){return ur(e.x)/ur(e.y)}function Ms(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class js{constructor(){this.members=[]}add(e){an(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(on(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(on(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent&&!1!==e.instance?.isConnected)return this.promote(e),!0}return!1}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:a}=e.options;void 0!==i&&i===a||(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ds=(e,t)=>e.depth-t.depth;class Ls{constructor(){this.children=[],this.isDirty=!1}add(e){an(this.children,e),this.isDirty=!0}remove(e){on(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ds),this.isDirty=!1,this.children.forEach(e)}}const Rs={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Os=["","X","Y","Z"];let Ns=0;function _s(e,t,n,i){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),i&&(i[e]=0))}function Vs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ma(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Vt,!(t||i))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&Vs(i)}function Fs({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:a}){return class{constructor(e={},n=t?.()){this.id=Ns++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Nt.value&&(Rs.nodes=Rs.calculatedTargetDeltas=Rs.calculatedProjections=0),this.nodes.forEach(Us),this.nodes.forEach(Js),this.nodes.forEach(Zs),this.nodes.forEach(Hs),Nt.addProjectionMetrics&&Nt.addProjectionMetrics(Rs)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;Vt.read(()=>{i=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==i&&(i=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Mn.now(),i=({timestamp:a})=>{const o=a-n;o>=t&&(Ft(i),e(o-t))};return Vt.setup(i,!0),()=>Ft(i)}(a,250),ts.hasAnimatedSinceResize&&(ts.hasAnimatedSinceResize=!1,this.nodes.forEach(Xs)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||al,{onLayoutAnimationStart:r,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!As(this.targetLayout,i),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...Ta(o,"layout"),onPlay:r,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c)}else t||Xs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ft(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Qs),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Vs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ur(this.snapshot.measuredBox.x)||ur(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eji&&(t.x=1),t.yji&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,t),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:s}=e;s?(this.projectionDelta&&this.prevProjectionDelta?(vs(this.prevProjectionDelta.x,this.projectionDelta.x),vs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),hr(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Ms(this.projectionDelta.x,this.prevProjectionDelta.x)&&Ms(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",s)),Nt.value&&Rs.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,i=n?n.latestValues:{},a={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const r={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(s&&!c&&!0===this.options.crossfade&&!this.path.some(il));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,p,f,m,g;tl(o.x,e.x,n),tl(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mr(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),p=this.relativeTarget,f=this.relativeTargetOrigin,m=r,g=n,nl(p.x,f.x,m.x,g),nl(p.y,f.y,m.y,g),d&&(l=this.relativeTarget,h=d,Ps(l.x,h.x)&&Ps(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ys(d,this.relativeTarget)),s&&(this.animationValues=a,function(e,t,n,i,a,o){a?(e.opacity=fi(0,n.opacity??1,ps(i)),e.opacityExit=fi(t.opacity??1,0,fs(i))):o&&(e.opacity=fi(t.opacity??1,n.opacity??1,i));for(let a=0;a{ts.hasAnimatedSinceResize=!0,mn.layout++,this.motionValue||(this.motionValue=Rn(0)),this.motionValue.jump(0,!1),this.currentAnimation=rs(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{mn.layout--},onComplete:()=>{mn.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:i,latestValues:a}=e;if(t&&n&&i){if(this!==e&&this.layout&&i&&ll(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=ur(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const i=ur(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+i}ys(t,n),Ni(t,a),hr(this.projectionDeltaWithTransform,this.layoutCorrected,t,a)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new js),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){const{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const i={};n.z&&_s("z",e,i,this.animationValues);for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(Ws),this.root.sharedNodes.clear()}}}function Bs(e){e.updateLayout()}function zs(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if("size"===a)cr(e=>{const i=o?t.measuredBox[e]:t.layoutBox[e],a=ur(i);i.min=n[e].min,i.max=i.min+a});else if("x"===a||"y"===a){const e="x"===a?"y":"x";gs(o?t.measuredBox[e]:t.layoutBox[e],n[e])}else ll(a,t.layoutBox,n)&&cr(i=>{const a=o?t.measuredBox[i]:t.layoutBox[i],r=ur(n[i]);a.max=a.min+r,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};hr(r,n,t.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?hr(s,e.applyTransform(i,!0),t.measuredBox):hr(s,n,t.layoutBox);const l=!Ts(r);let c=!1;if(!e.resumeFrom){const i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:a,layout:o}=i;if(a&&o){const r=e.options.layoutAnchor||void 0,s={x:{min:0,max:0},y:{min:0,max:0}};mr(s,t.layoutBox,a.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};mr(l,n,o.layoutBox,r),As(s,l)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=s,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:s,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Us(e){Nt.value&&Rs.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Hs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $s(e){e.clearSnapshot()}function Ws(e){e.clearMeasurements()}function qs(e){e.isLayoutDirty=!0,e.updateLayout()}function Ks(e){e.isLayoutDirty=!1}function Ys(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Gs(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Xs(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Js(e){e.resolveTargetDelta()}function Zs(e){e.calcProjection()}function Qs(e){e.resetSkewAndRotation()}function el(e){e.removeLeadSnapshot()}function tl(e,t,n){e.translate=fi(t.translate,0,n),e.scale=fi(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nl(e,t,n,i){e.min=fi(t.min,n.min,i),e.max=fi(t.max,n.max,i)}function il(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const al={duration:.45,ease:[.4,0,.1,1]},ol=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rl=ol("applewebkit/")&&!ol("chrome/")?Math.round:Lt;function sl(e){e.min=rl(e.min),e.max=rl(e.max)}function ll(e,t,n){return"position"===e||"preserve-aspect"===e&&(i=Is(t),a=Is(n),!(Math.abs(i-a)<=.2));var i,a}function cl(e){return e!==e.root&&e.scroll?.wasRoot}const ul=Fs({attachResizeListener:(e,t)=>vr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),dl={current:void 0},hl=Fs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dl.current){const e=new ul({});e.mount(window),e.setOptions({layoutScroll:!0}),dl.current=e}return dl.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),pl={pan:{Feature:class extends ka{constructor(){super(...arguments),this.removePointerDownListener=Lt}onPointerDown(e){this.session=new Vr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Or(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:es(e),onStart:es(t),onMove:es(n),onEnd:(e,t)=>{delete this.session,i&&Vt.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=Rr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ka{constructor(e){super(e),this.removeGroupControls=Lt,this.removeListeners=Lt,this.controls=new Jr(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Lt}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:hl,MeasureLayout:os}};function fl(e,t){const n=wr(e),i=new AbortController;return[n,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function ml(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===n);const a=i["onHover"+n];a&&Vt.postRender(()=>a(t,Lr(t)))}function gl(e){return xr(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const yl=(e,t)=>!!t&&(e===t||yl(e,t.parentElement)),vl=new WeakSet;function xl(e){return t=>{"Enter"===t.key&&e(t)}}function bl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function wl(e){return Dr(e)&&!lr()}const kl=new WeakSet;function Sl(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===n);const a=i["onTap"+("End"===n?"":n)];a&&Vt.postRender(()=>a(t,Lr(t)))}const Cl=new WeakMap,Tl=new WeakMap,Pl=e=>{const t=Cl.get(e.target);t&&t(e)},El=e=>{e.forEach(Pl)};const Al={some:0,all:1},Il=wa({...rr,...{inView:{Feature:class extends ka{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:i="some",once:a}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Al[i]};this.stopObserver=function(e,t,n){const i=function({root:e,...t}){const n=e||document;Tl.has(n)||Tl.set(n,{});const i=Tl.get(n),a=JSON.stringify(t);return i[a]||(i[a]=new IntersectionObserver(El,{root:e,...t})),i[a]}(t);return Cl.set(e,n),i.observe(e),()=>{Cl.delete(e),i.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,a&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=t?n:i;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends ka{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=function(e,t,n={}){const[i,a,o]=fl(e,n),r=e=>{const i=e.currentTarget;if(!wl(e))return;if(kl.has(e))return;vl.add(i),n.stopPropagation&&kl.add(e);const o=t(i,e),r=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),vl.has(i)&&vl.delete(i),wl(e)&&"function"==typeof o&&o(e,{success:t})},s=e=>{r(e,i===window||i===document||n.useGlobalTarget||yl(i,e.target))},l=e=>{r(e,!1)};window.addEventListener("pointerup",s,a),window.addEventListener("pointercancel",l,a)};return i.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",r,a),gl(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const i=xl(()=>{if(vl.has(n))return;bl(n,"down");const e=xl(()=>{bl(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>bl(n,"cancel"),t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)})(e,a)),t=e,gr.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),o}(e,(e,t)=>(Sl(this.node,t,"Start"),(e,{success:t})=>Sl(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ka{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Da(vr(this.node.current,"focus",()=>this.onFocus()),vr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ka{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[i,a,o]=fl(e,n);return i.forEach(e=>{let n,i=!1,o=!1;const r=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{i=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),o&&(o=!1,r(e))},l=e=>{"touch"!==e.pointerType&&(i?o=!0:r(e))};e.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||lr())return;o=!1;const r=t(e,i);"function"==typeof r&&(n=r,e.addEventListener("pointerleave",l,a))},a),e.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",s,a),window.addEventListener("pointercancel",s,a)},a)}),o}(e,(e,t)=>(ml(this.node,t,"Start"),e=>ml(this.node,e,"End"))))}unmount(){}}}},...pl,layout:{ProjectionNode:hl,MeasureLayout:os}},zi);function Ml(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class jl extends h.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(gl(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=gl(e)&&e.offsetWidth||0,i=gl(e)&&e.offsetHeight||0,a=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=n-o.width-o.left,o.bottom=i-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Dl({children:e,isPresent:t,anchorX:n,anchorY:i,root:a,pop:o}){const r=(0,h.useId)(),s=(0,h.useRef)(null),l=(0,h.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=(0,h.useContext)($i),u=e.props?.ref??e?.ref,d=function(...e){return h.useCallback(function(...e){return t=>{let n=!1;const i=e.map(e=>{const i=Ml(e,t);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let t=0;t{const{width:e,height:u,top:d,left:h,right:p,bottom:f}=l.current;if(t||!1===o||!s.current||!e||!u)return;const m="left"===n?`left: ${h}`:`right: ${p}`,g="bottom"===i?`bottom: ${f}`:`top: ${d}`;s.current.dataset.motionPopId=r;const y=document.createElement("style");c&&(y.nonce=c);const v=a??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${u}px !important;\n ${m}px !important;\n ${g}px !important;\n }\n `),()=>{s.current?.removeAttribute("data-motion-pop-id"),v.contains(y)&&v.removeChild(y)}},[t]),(0,ve.jsx)(jl,{isPresent:t,childRef:s,sizeRef:l,pop:o,children:!1===o?e:h.cloneElement(e,{ref:d})})}const Ll=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:a,presenceAffectsLayout:o,mode:r,anchorX:s,anchorY:l,root:c})=>{const u=ia(Rl),d=(0,h.useId)();let p=!0,f=(0,h.useMemo)(()=>(p=!1,{id:d,initial:t,isPresent:n,custom:a,onExitComplete:e=>{u.set(e,!0);for(const e of u.values())if(!e)return;i&&i()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,i]);return o&&p&&(f={...f}),(0,h.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),h.useEffect(()=>{!n&&!u.size&&i&&i()},[n]),e=(0,ve.jsx)(Dl,{pop:"popLayout"===r,isPresent:n,anchorX:s,anchorY:l,root:c,children:e}),(0,ve.jsx)(na.Provider,{value:f,children:e})};function Rl(){return new Map}const Ol=e=>e.key||"";function Nl(e){const t=[];return h.Children.forEach(e,e=>{(0,h.isValidElement)(e)&&t.push(e)}),t}const _l=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:o="sync",propagate:r=!1,anchorX:s="left",anchorY:l="top",root:c})=>{const[u,d]=ns(r),p=(0,h.useMemo)(()=>Nl(e),[e]),f=r&&!u?[]:p.map(Ol),m=(0,h.useRef)(!0),g=(0,h.useRef)(p),y=ia(()=>new Map),v=(0,h.useRef)(new Set),[x,b]=(0,h.useState)(p),[w,k]=(0,h.useState)(p);ga(()=>{m.current=!1,g.current=p;for(let e=0;e{const h=Ol(e),x=!(r&&!u)&&(p===w||f.includes(h));return(0,ve.jsx)(Ll,{isPresent:x,initial:!(m.current&&!n)&&void 0,custom:t,presenceAffectsLayout:a,mode:o,root:c,onExitComplete:x?void 0:()=>{if(v.current.has(h))return;if(!y.has(h))return;v.current.add(h),y.set(h,!0);let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(C?.(),k(g.current),r&&d?.(),i&&i())},anchorX:s,anchorY:l,children:e},h)})})};function Vl(e){const t=ia(()=>Rn(e)),{isStatic:n}=(0,h.useContext)($i);if(n){const[,n]=(0,h.useState)(e);(0,h.useEffect)(()=>t.on("change",n),[])}return t}class Fl{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(n=>{n.start(e.nativeEvent||e,t)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}}const Bl=()=>new Fl;class zl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;nt.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Ul(this.animations,"duration")}get iterationDuration(){return Ul(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Ul(e,t){let n=0;for(let i=0;in&&(n=a)}return n}class Hl extends zl{then(e,t){return this.finished.finally(e).then(()=>{})}}function $l(e,t){return po(e)?e[((e,t,n)=>{const i=t-0;return((n-0)%i+i)%i+0})(0,e.length,t)]:e}function Wl(e){return"object"==typeof e&&!Array.isArray(e)}function ql(e,t,n,i){return null==e?[]:"string"==typeof e&&Wl(t)?wr(e,n,i):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>null!=e):[e]}function Kl(e,t,n){return e*(t+1)}function Yl(e,t,n,i){return"number"==typeof t?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):"<"===t?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):i.get(t)??e}function Gl(e,t,n,i,a,o){!function(e,t,n){for(let i=0;it&&a.at"number"==typeof e,ic=e=>e.every(nc);class ac extends Zn{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,t){if(function(e,t){return e in t}(t,e)){const n=e[t];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}}function oc(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=br(e)&&!ss(e)?new bi(t):new Vi(t);n.mount(e),Nn.set(e,n)}function rc(e){const t=new ac({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),Nn.set(e,t)}function sc(e,t,n,i){const a=[];if(function(e,t){return ot(e)||"number"==typeof e||"string"==typeof e&&!Wl(t)}(e,t))a.push(rs(e,Wl(t)&&t.default||t,n&&n.default||n));else{if(null==e)return a;const o=ql(e,t,i),r=o.length;Boolean(r);for(let e=0;e{const l=ec(e),{delay:c=0,times:u=Eo(l),type:p=t.type||"keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:x=t.ease||"easeOut",duration:b}=n;const w="function"==typeof c?c(r,s):c,k=l.length,S=Sn(p)?p:a?.[p||"keyframes"];if(k<=2&&S){let e=100;if(2===k&&ic(l)){const t=l[1]-l[0];e=Math.abs(t)}const n={...t,...v};void 0!==b&&(n.duration=tn(b));const i=Ga(n,e,S);x=i.ease,b=i.duration}b??(b=o);const C=d+w;1===u.length&&0===u[0]&&(u[1]=1);const T=u.length-l.length;if(T>0&&Po(u,T),1===l.length&&l.unshift(null),f){b=Kl(b,f);const e=[...l],t=[...u];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let i=0;i{for(const a in e){const o=e[a];o.sort(Jl);const s=[],l=[],c=[];for(let e=0;e{if(Array.isArray(e)&&"function"==typeof e[0]){const t=e[0],n=Rn(0);return n.on("change",t),1===e.length?[n,[0,1]]:2===e.length?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:ao});return a.forEach(({keyframes:e,transition:t},n)=>{i.push(...sc(n,e,t))}),i}(e,void 0!==n?{reduceMotion:n,...s}:s,t)}else{const{onComplete:s,...l}=a||{};"function"==typeof s&&(o=s),r=sc(e,i,void 0!==n?{reduceMotion:n,...l}:l,t)}var s;const l=new Hl(r);return o&&l.finished.then(o),t&&(t.animations.push(l),l.finished.then(()=>{on(t.animations,l)})),l}}(),cc=window.wp.i18n;function uc(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var dc=Symbol.for("react.lazy"),hc=p[" use ".trim().toString()];function pc(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===dc&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t;var t}function fc(e){const t=gc(e),n=h.forwardRef((e,n)=>{let{children:i,...a}=e;pc(i)&&"function"==typeof hc&&(i=hc(i._payload));const o=h.Children.toArray(i),r=o.find(vc);if(r){const e=r.props.children,i=o.map(t=>t===r?h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null:t);return(0,ve.jsx)(t,{...a,ref:n,children:h.isValidElement(e)?h.cloneElement(e,void 0,i):null})}return(0,ve.jsx)(t,{...a,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}var mc=fc("Slot");function gc(e){const t=h.forwardRef((e,t)=>{let{children:n,...i}=e;if(pc(n)&&"function"==typeof hc&&(n=hc(n._payload)),h.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),a=function(e,t){const n={...t};for(const i in t){const a=e[i],o=t[i];/^on[A-Z]/.test(i)?a&&o?n[i]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(n[i]=a):"style"===i?n[i]={...a,...o}:"className"===i&&(n[i]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==h.Fragment&&(a.ref=t?function(...e){return t=>{let n=!1;const i=e.map(e=>{const i=uc(e,t);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let t=0;t1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yc=Symbol("radix.slottable");function vc(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===yc}function xc(){}function bc(){}const wc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kc=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sc={};function Cc(e,t){return((t||Sc).jsx?kc:wc).test(e)}const Tc=/[ \t\n\f\r]/g;function Pc(e){return""===e.replace(Tc,"")}class Ec{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Ac(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new Ec(n,i,t)}function Ic(e){return e.toLowerCase()}Ec.prototype.normal={},Ec.prototype.property={},Ec.prototype.space=void 0;class Mc{constructor(e,t){this.attribute=t,this.property=e}}Mc.prototype.attribute="",Mc.prototype.booleanish=!1,Mc.prototype.boolean=!1,Mc.prototype.commaOrSpaceSeparated=!1,Mc.prototype.commaSeparated=!1,Mc.prototype.defined=!1,Mc.prototype.mustUseProperty=!1,Mc.prototype.number=!1,Mc.prototype.overloadedBoolean=!1,Mc.prototype.property="",Mc.prototype.spaceSeparated=!1,Mc.prototype.space=void 0;let jc=0;const Dc=Fc(),Lc=Fc(),Rc=Fc(),Oc=Fc(),Nc=Fc(),_c=Fc(),Vc=Fc();function Fc(){return 2**++jc}const Bc=Object.keys(s);class zc extends Mc{constructor(e,t,n,i){let a=-1;if(super(e,t),Uc(this,"space",i),"number"==typeof n)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Wc(e,t){return t in e?e[t]:t}function qc(e,t){return Wc(e,t.toLowerCase())}const Kc=Hc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_c,acceptCharset:Nc,accessKey:Nc,action:null,allow:null,allowFullScreen:Dc,allowPaymentRequest:Dc,allowUserMedia:Dc,alt:null,as:null,async:Dc,autoCapitalize:null,autoComplete:Nc,autoFocus:Dc,autoPlay:Dc,blocking:Nc,capture:null,charSet:null,checked:Dc,cite:null,className:Nc,cols:Oc,colSpan:null,content:null,contentEditable:Lc,controls:Dc,controlsList:Nc,coords:Oc|_c,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Dc,defer:Dc,dir:null,dirName:null,disabled:Dc,download:Rc,draggable:Lc,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Dc,formTarget:null,headers:Nc,height:Oc,hidden:Rc,high:Oc,href:null,hrefLang:null,htmlFor:Nc,httpEquiv:Nc,id:null,imageSizes:null,imageSrcSet:null,inert:Dc,inputMode:null,integrity:null,is:null,isMap:Dc,itemId:null,itemProp:Nc,itemRef:Nc,itemScope:Dc,itemType:Nc,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Dc,low:Oc,manifest:null,max:null,maxLength:Oc,media:null,method:null,min:null,minLength:Oc,multiple:Dc,muted:Dc,name:null,nonce:null,noModule:Dc,noValidate:Dc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Dc,optimum:Oc,pattern:null,ping:Nc,placeholder:null,playsInline:Dc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Dc,referrerPolicy:null,rel:Nc,required:Dc,reversed:Dc,rows:Oc,rowSpan:Oc,sandbox:Nc,scope:null,scoped:Dc,seamless:Dc,selected:Dc,shadowRootClonable:Dc,shadowRootDelegatesFocus:Dc,shadowRootMode:null,shape:null,size:Oc,sizes:null,slot:null,span:Oc,spellCheck:Lc,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oc,step:null,style:null,tabIndex:Oc,target:null,title:null,translate:null,type:null,typeMustMatch:Dc,useMap:null,value:Lc,width:Oc,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nc,axis:null,background:null,bgColor:null,border:Oc,borderColor:null,bottomMargin:Oc,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Dc,declare:Dc,event:null,face:null,frame:null,frameBorder:null,hSpace:Oc,leftMargin:Oc,link:null,longDesc:null,lowSrc:null,marginHeight:Oc,marginWidth:Oc,noResize:Dc,noHref:Dc,noShade:Dc,noWrap:Dc,object:null,profile:null,prompt:null,rev:null,rightMargin:Oc,rules:null,scheme:null,scrolling:Lc,standby:null,summary:null,text:null,topMargin:Oc,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oc,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Dc,disableRemotePlayback:Dc,prefix:null,property:null,results:Oc,security:null,unselectable:null},space:"html",transform:qc}),Yc=Hc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Vc,accentHeight:Oc,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oc,amplitude:Oc,arabicForm:null,ascent:Oc,attributeName:null,attributeType:null,azimuth:Oc,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oc,by:null,calcMode:null,capHeight:Oc,className:Nc,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oc,diffuseConstant:Oc,direction:null,display:null,dur:null,divisor:Oc,dominantBaseline:null,download:Dc,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oc,enableBackground:null,end:null,event:null,exponent:Oc,externalResourcesRequired:null,fill:null,fillOpacity:Oc,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_c,g2:_c,glyphName:_c,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oc,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oc,horizOriginX:Oc,horizOriginY:Oc,id:null,ideographic:Oc,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oc,k:Oc,k1:Oc,k2:Oc,k3:Oc,k4:Oc,kernelMatrix:Vc,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oc,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oc,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oc,overlineThickness:Oc,paintOrder:null,panose1:null,path:null,pathLength:Oc,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nc,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oc,pointsAtY:Oc,pointsAtZ:Oc,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vc,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vc,rev:Vc,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vc,requiredFeatures:Vc,requiredFonts:Vc,requiredFormats:Vc,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oc,specularExponent:Oc,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oc,strikethroughThickness:Oc,string:null,stroke:null,strokeDashArray:Vc,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oc,strokeOpacity:Oc,strokeWidth:null,style:null,surfaceScale:Oc,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vc,tabIndex:Oc,tableValues:null,target:null,targetX:Oc,targetY:Oc,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vc,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oc,underlineThickness:Oc,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oc,values:null,vAlphabetic:Oc,vMathematical:Oc,vectorEffect:null,vHanging:Oc,vIdeographic:Oc,version:null,vertAdvY:Oc,vertOriginX:Oc,vertOriginY:Oc,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oc,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Wc}),Gc=Hc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Xc=Hc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qc}),Jc=Hc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Zc=Ac([$c,Kc,Gc,Xc,Jc],"html"),Qc=Ac([$c,Yc,Gc,Xc,Jc],"svg"),eu=/[A-Z]/g,tu=/-[a-z]/g,nu=/^data[-\w.:]+$/i;function iu(e){return"-"+e.toLowerCase()}function au(e){return e.charAt(1).toUpperCase()}const ou={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"};var ru=r(229);const su=cu("end"),lu=cu("start");function cu(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function uu(e){return e&&"object"==typeof e?"position"in e||"type"in e?hu(e.position):"start"in e||"end"in e?hu(e):"line"in e||"column"in e?du(e):"":""}function du(e){return pu(e&&e.line)+":"+pu(e&&e.column)}function hu(e){return du(e&&e.start)+"-"+du(e&&e.end)}function pu(e){return e&&"number"==typeof e?e:1}class fu extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let i="",a={},o=!1;if(t&&(a="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?i=e:!a.cause&&e&&(o=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?a.ruleId=n:(a.source=n.slice(0,e),a.ruleId=n.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){const e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}const r=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=r?r.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=r?r.line:void 0,this.name=uu(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fu.prototype.file="",fu.prototype.name="",fu.prototype.reason="",fu.prototype.message="",fu.prototype.stack="",fu.prototype.column=void 0,fu.prototype.line=void 0,fu.prototype.ancestors=void 0,fu.prototype.cause=void 0,fu.prototype.fatal=void 0,fu.prototype.place=void 0,fu.prototype.ruleId=void 0,fu.prototype.source=void 0;const mu={}.hasOwnProperty,gu=new Map,yu=/[A-Z]/g,vu=new Set(["table","tbody","thead","tfoot","tr"]),xu=new Set(["td","th"]),bu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wu(e,t,n){return"element"===t.type?function(e,t,n){const i=e.schema;let a=i;"svg"===t.tagName.toLowerCase()&&"html"===i.space&&(a=Qc,e.schema=a),e.ancestors.push(t);const o=Pu(e,t.tagName,!1),r=function(e,t){const n={};let i,a;for(a in t.properties)if("children"!==a&&mu.call(t.properties,a)){const o=Tu(e,a,t.properties[a]);if(o){const[a,r]=o;e.tableCellAlignToStyle&&"align"===a&&"string"==typeof r&&xu.has(t.tagName)?i=r:n[a]=r}}return i&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=i),n}(e,t);let s=Cu(e,t);return vu.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&Pc(t.value):Pc(t));var t})),ku(e,r,o,t),Su(r,s),e.ancestors.pop(),e.schema=i,e.create(t,o,r,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Eu(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const i=e.schema;let a=i;"svg"===t.name&&"html"===i.space&&(a=Qc,e.schema=a),e.ancestors.push(t);const o=null===t.name?e.Fragment:Pu(e,t.name,!0),r=function(e,t){const n={};for(const i of t.attributes)if("mdxJsxExpressionAttribute"===i.type)if(i.data&&i.data.estree&&e.evaluater){const t=i.data.estree.body[0];xc(t.type);const a=t.expression;xc(a.type);const o=a.properties[0];xc(o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Eu(e,t.position);else{const a=i.name;let o;if(i.value&&"object"==typeof i.value)if(i.value.data&&i.value.data.estree&&e.evaluater){const t=i.value.data.estree.body[0];xc(t.type),o=e.evaluater.evaluateExpression(t.expression)}else Eu(e,t.position);else o=null===i.value||i.value;n[a]=o}return n}(e,t),s=Cu(e,t);return ku(e,r,o,t),Su(r,s),e.ancestors.pop(),e.schema=i,e.create(t,o,r,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Eu(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const i={};return Su(i,Cu(e,t)),e.create(t,e.Fragment,i,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function ku(e,t,n,i){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Su(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Cu(e,t){const n=[];let i=-1;const a=e.passKeys?new Map:gu;for(;++i4&&"data"===n.slice(0,4)&&nu.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(tu,au);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!tu.test(e)){let n=e.replace(eu,iu);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}a=zc}return new a(i,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===i.property){let t="object"==typeof n?n:function(e,t){try{return ru(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,i=new fu("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=bu+"#cannot-parse-style-attribute",i}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)mu.call(e,n)&&(t[Au(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&i.space?ou[i.property]||i.property:i.attribute,n]}}function Pu(e,t,n){let i;if(n)if(t.includes(".")){const e=t.split(".");let n,a=-1;for(;++aa?0:a+t:t>a?a:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);r0?(Ru(e,e.length,0,t),e):t}class Nu{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const i=t||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&_u(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),_u(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_u(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e-1&&e.test(String.fromCharCode(t))}}function nd(e,t,n,i){const a=i?i-1:Number.POSITIVE_INFINITY;let o=0;return function(i){return Zu(i)?(e.enter(n),r(i)):t(i)};function r(i){return Zu(i)&&o++o))return;const n=t.events.length;let a,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(a){s=t.events[l][1].end;break}a=!0}for(y(r),e=n;ei;){const i=n[a];t.containerState=i[1],i[0].exit.call(t,e)}n.length=i}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}},od={tokenize:function(e,t,n){return nd(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},rd={partial:!0,tokenize:function(e,t,n){return function(t){return Zu(t)?nd(e,i,"linePrefix")(t):i(t)};function i(e){return null===e||Xu(e)?t(e):n(e)}}},sd={resolve:function(e){return Vu(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(t)};function i(t){return null===t?a(t):Xu(t)?e.check(ld,o,a)(t):(e.consume(t),i)}function a(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}},ld={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),nd(e,a,"linePrefix")};function a(a){if(null===a||Xu(a))return n(a);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(i.parser.constructs.flow,n,t)(a)}}},cd={tokenize:function(e){const t=this,n=e.attempt(rd,function(i){if(null!==i)return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(i)},e.attempt(this.parser.constructs.flowInitial,i,nd(e,e.attempt(this.parser.constructs.flow,i,e.attempt(sd,i)),"linePrefix")));return n;function i(i){if(null!==i)return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(i)}}},ud={resolveAll:fd()},dd=pd("string"),hd=pd("text");function pd(e){return{resolveAll:fd("text"===e?md:void 0),tokenize:function(t){const n=this,i=this.parser.constructs[e],a=t.attempt(i,o,r);return o;function o(e){return l(e)?a(e):r(e)}function r(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=i[e];let a=-1;if(t)for(;++a=3&&(null===o||Xu(o))?(e.exit("thematicBreak"),t(o)):n(o)}function r(t){return t===i?(e.consume(t),a++,r):(e.exit("thematicBreakSequence"),Zu(t)?nd(e,o,"whitespace")(t):o(t))}}},yd={continuation:{tokenize:function(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(rd,function(n){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,nd(e,t,"listItemIndent",i.containerState.size+1)(n)},function(n){return i.containerState.furtherBlankLines||!Zu(n)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(n)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(xd,t,a)(n))});function a(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,nd(e,e.attempt(yd,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const i=this,a=i.events[i.events.length-1];let o=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,r=0;return function(t){const a=i.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!i.containerState.marker||t===i.containerState.marker:Ku(t)){if(i.containerState.type||(i.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(gd,n,l)(t):l(t);if(!i.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return Ku(t)&&++r<10?(e.consume(t),s):(!i.interrupt||r<2)&&(i.containerState.marker?t===i.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||t,e.check(rd,i.interrupt?n:c,e.attempt(vd,d,u))}function c(e){return i.containerState.initialBlankLine=!0,o++,d(e)}function u(t){return Zu(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},vd={partial:!0,tokenize:function(e,t,n){const i=this;return nd(e,function(e){const a=i.events[i.events.length-1];return!Zu(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):n(e)},"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},xd={partial:!0,tokenize:function(e,t,n){const i=this;return nd(e,function(e){const a=i.events[i.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(e):n(e)},"listItemIndent",i.containerState.size+1)}},bd={continuation:{tokenize:function(e,t,n){const i=this;return function(t){return Zu(t)?nd(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(i){return e.attempt(bd,t,n)(i)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const i=this;return function(t){if(62===t){const n=i.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return n(t)};function a(n){return Zu(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function wd(e,t,n,i,a,o,r,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(i),e.enter(a),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||qu(t)?n(t):(e.enter(i),e.enter(r),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(a),e.exit(i),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||Xu(t)?n(t):(e.consume(t),92===t?p:h)}function p(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function f(a){return u||null!==a&&41!==a&&!Ju(a)?u999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(d):93===d?(e.exit(o),e.enter(a),e.consume(d),e.exit(a),e.exit(i),t):Xu(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||Xu(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!Zu(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Sd(e,t,n,i,a,o){let r;return function(t){return 34===t||39===t||40===t?(e.enter(i),e.enter(a),e.consume(t),e.exit(a),r=40===t?41:t,s):n(t)};function s(n){return n===r?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),t):(e.enter(o),l(n))}function l(t){return t===r?(e.exit(o),s(r)):null===t?n(t):Xu(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),nd(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===r||null===t||Xu(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===r||92===t?(e.consume(t),c):c(t)}}function Cd(e,t){let n;return function i(a){return Xu(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,i):Zu(a)?nd(e,i,n?"linePrefix":"lineSuffix")(a):t(a)}}function Td(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pd={name:"definition",tokenize:function(e,t,n){const i=this;let a;return function(t){return e.enter("definition"),function(t){return kd.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return a=Td(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),r):n(t)}function r(t){return Ju(t)?Cd(e,s)(t):s(t)}function s(t){return wd(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Ed,c,c)(t)}function c(t){return Zu(t)?nd(e,u,"whitespace")(t):u(t)}function u(o){return null===o||Xu(o)?(e.exit("definition"),i.parser.defined.push(a),t(o)):n(o)}}},Ed={partial:!0,tokenize:function(e,t,n){return function(t){return Ju(t)?Cd(e,i)(t):n(t)};function i(t){return Sd(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return Zu(t)?nd(e,o,"whitespace")(t):o(t)}function o(e){return null===e||Xu(e)?t(e):n(e)}}},Ad={name:"codeIndented",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("codeIndented"),nd(e,a,"linePrefix",5)(t)};function a(e){const t=i.events[i.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?s(t):Xu(t)?e.attempt(Id,o,s)(t):(e.enter("codeFlowValue"),r(t))}function r(t){return null===t||Xu(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),r)}function s(n){return e.exit("codeIndented"),t(n)}}},Id={partial:!0,tokenize:function(e,t,n){const i=this;return a;function a(t){return i.parser.lazy[i.now().line]?n(t):Xu(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):nd(e,o,"linePrefix",5)(t)}function o(e){const o=i.events[i.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):Xu(e)?a(e):n(e)}}},Md={name:"headingAtx",resolve:function(e,t){let n,i,a=e.length-2,o=3;return"whitespace"===e[o][1].type&&(o+=2),a-2>o&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(o===a-1||a-4>o&&"whitespace"===e[a-2][1].type)&&(a-=o+1===a?2:4),a>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[a][1].end},i={type:"chunkText",start:e[o][1].start,end:e[a][1].end,contentType:"text"},Ru(e,o,a-o+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e},tokenize:function(e,t,n){let i=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),a(t)}(t)};function a(t){return 35===t&&i++<6?(e.consume(t),a):null===t||Ju(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),r(n)):null===n||Xu(n)?(e.exit("atxHeading"),t(n)):Zu(n)?nd(e,o,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function r(t){return 35===t?(e.consume(t),r):(e.exit("atxHeadingSequence"),o(t))}function s(t){return null===t||35===t||Ju(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),s)}}},jd={name:"setextUnderline",resolveTo:function(e,t){let n,i,a,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(i=o)}else"content"===e[o][1].type&&e.splice(o,1),a||"definition"!==e[o][1].type||(a=o);const r={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",r,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=r,e.push(["exit",r,t]),e},tokenize:function(e,t,n){const i=this;let a;return function(t){let r,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){r="paragraph"===i.events[s][1].type;break}return i.parser.lazy[i.now().line]||!i.interrupt&&!r?n(t):(e.enter("setextHeadingLine"),a=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t))};function o(t){return t===a?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),Zu(t)?nd(e,r,"lineSuffix")(t):r(t))}function r(i){return null===i||Xu(i)?(e.exit("setextHeadingLine"),t(i)):n(i)}}},Dd=["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"],Ld=["pre","script","style","textarea"],Rd={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},tokenize:function(e,t,n){const i=this;let a,o,r,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),o=!0,p):63===s?(e.consume(s),a=3,i.interrupt?t:R):Hu(s)?(e.consume(s),r=String.fromCharCode(s),f):n(s)}function u(o){return 45===o?(e.consume(o),a=2,d):91===o?(e.consume(o),a=5,s=0,h):Hu(o)?(e.consume(o),a=4,i.interrupt?t:R):n(o)}function d(a){return 45===a?(e.consume(a),i.interrupt?t:R):n(a)}function h(a){return a==="CDATA[".charCodeAt(s++)?(e.consume(a),6===s?i.interrupt?t:P:h):n(a)}function p(t){return Hu(t)?(e.consume(t),r=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||Ju(s)){const l=47===s,c=r.toLowerCase();return l||o||!Ld.includes(c)?Dd.includes(r.toLowerCase())?(a=6,l?(e.consume(s),m):i.interrupt?t(s):P(s)):(a=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(s):o?g(s):y(s)):(a=1,i.interrupt?t(s):P(s))}return 45===s||$u(s)?(e.consume(s),r+=String.fromCharCode(s),f):n(s)}function m(a){return 62===a?(e.consume(a),i.interrupt?t:P):n(a)}function g(t){return Zu(t)?(e.consume(t),g):C(t)}function y(t){return 47===t?(e.consume(t),C):58===t||95===t||Hu(t)?(e.consume(t),v):Zu(t)?(e.consume(t),y):C(t)}function v(t){return 45===t||46===t||58===t||95===t||$u(t)?(e.consume(t),v):x(t)}function x(t){return 61===t?(e.consume(t),b):Zu(t)?(e.consume(t),x):y(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):Zu(t)?(e.consume(t),b):k(t)}function w(t){return t===l?(e.consume(t),l=null,S):null===t||Xu(t)?n(t):(e.consume(t),w)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Ju(t)?x(t):(e.consume(t),k)}function S(e){return 47===e||62===e||Zu(e)?y(e):n(e)}function C(t){return 62===t?(e.consume(t),T):n(t)}function T(t){return null===t||Xu(t)?P(t):Zu(t)?(e.consume(t),T):n(t)}function P(t){return 45===t&&2===a?(e.consume(t),M):60===t&&1===a?(e.consume(t),j):62===t&&4===a?(e.consume(t),O):63===t&&3===a?(e.consume(t),R):93===t&&5===a?(e.consume(t),L):!Xu(t)||6!==a&&7!==a?null===t||Xu(t)?(e.exit("htmlFlowData"),E(t)):(e.consume(t),P):(e.exit("htmlFlowData"),e.check(Od,N,E)(t))}function E(t){return e.check(Nd,A,N)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return null===t||Xu(t)?E(t):(e.enter("htmlFlowData"),P(t))}function M(t){return 45===t?(e.consume(t),R):P(t)}function j(t){return 47===t?(e.consume(t),r="",D):P(t)}function D(t){if(62===t){const n=r.toLowerCase();return Ld.includes(n)?(e.consume(t),O):P(t)}return Hu(t)&&r.length<8?(e.consume(t),r+=String.fromCharCode(t),D):P(t)}function L(t){return 93===t?(e.consume(t),R):P(t)}function R(t){return 62===t?(e.consume(t),O):45===t&&2===a?(e.consume(t),R):P(t)}function O(t){return null===t||Xu(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),O)}function N(n){return e.exit("htmlFlow"),t(n)}}},Od={partial:!0,tokenize:function(e,t,n){return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(rd,t,n)}}},Nd={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return Xu(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):n(t)};function a(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},_d={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a)};function a(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},Vd={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const i=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r};function r(t){return e.enter("codeFencedFence"),Zu(t)?nd(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===o?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===o?(a++,e.consume(t),c):a>=s?(e.exit("codeFencedFenceSequence"),Zu(t)?nd(e,u,"whitespace")(t):u(t)):n(t)}function u(i){return null===i||Xu(i)?(e.exit("codeFencedFence"),t(i)):n(i)}}};let o,r=0,s=0;return function(t){return function(t){const n=i.events[i.events.length-1];return r=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===o?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),Zu(t)?nd(e,c,"whitespace")(t):c(t))}function c(n){return null===n||Xu(n)?(e.exit("codeFencedFence"),i.interrupt?t(n):e.check(_d,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||Xu(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):Zu(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),nd(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),u)}function d(t){return null===t||Xu(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(t))}function h(t){return null===t||Xu(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===o?n(t):(e.consume(t),h)}function p(t){return e.attempt(a,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return r>0&&Zu(t)?nd(e,g,"linePrefix",r+1)(t):g(t)}function g(t){return null===t||Xu(t)?e.check(_d,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||Xu(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}}},Fd=document.createElement("i");function Bd(e){const t="&"+e+";";Fd.innerHTML=t;const n=Fd.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const zd={name:"characterReference",tokenize:function(e,t,n){const i=this;let a,o,r=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),a=31,o=$u,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Yu,c):(e.enter("characterReferenceValue"),a=7,o=Ku,c(t))}function c(s){if(59===s&&r){const a=e.exit("characterReferenceValue");return o!==$u||Bd(i.sliceSerialize(a))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return o(s)&&r++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},h={...e[u][1].start};Zd(d,-s),Zd(h,s),o={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},r={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:h},a={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},i={type:s>1?"strong":"emphasis",start:{...o.start},end:{...r.end}},e[n][1].end={...o.start},e[u][1].start={...r.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Ou(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Ou(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),l=Ou(l,$d(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=Ou(l,[["exit",a,t],["enter",r,t],["exit",r,t],["exit",i,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=Ou(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,Ru(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u-1){const e=r[0];"string"==typeof e?r[0]=e.slice(i):r.shift()}o>0&&r.push(e[a].slice(0,o))}return r}(r,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:a,offset:o}=i;return{_bufferIndex:e,_index:t,line:n,column:a,offset:o}}function m(e){l=void 0,d=e,h=h(e)}function g(e,t){t.restore()}function y(e,t){return function(n,a,o){let r,d,h,p;return Array.isArray(n)?g(n):"tokenize"in n?g([n]):(m=n,function(e){const t=null!==e&&m[e],n=null!==e&&m.null;return g([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});var m;function g(e){return r=e,d=0,0===e.length?o:y(e[d])}function y(e){return function(n){return p=function(){const e=f(),t=u.previous,n=u.currentConstruct,a=u.events.length,o=Array.from(s);return{from:a,restore:function(){i=e,u.previous=t,u.currentConstruct=n,u.events.length=a,s=o,x()}}}(),h=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?b():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,v,b)(n)}}function v(t){return l=!0,e(h,p),a}function b(e){return l=!0,p.restore(),++d13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const gh=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yh(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return mh(n.slice(t?2:1),t?16:10)}return Bd(n)||e}const vh={}.hasOwnProperty;function xh(e,t,n){return t&&"object"==typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(v),autolinkProtocol:u,autolinkEmail:u,atxHeading:a(m),blockQuote:a(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:a(f),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(f,o),codeText:a(function(){return{type:"inlineCode",value:""}},o),codeTextData:u,data:u,codeFlowValue:u,definition:a(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:a(g),hardBreakTrailing:a(g),htmlFlow:a(y,o),htmlFlowData:u,htmlText:a(y,o),htmlTextData:u,image:a(function(){return{type:"image",title:null,url:"",alt:null}}),label:o,link:a(v),listItem:a(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:a(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:a(x),paragraph:a(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(m),strong:a(function(){return{type:"strong",children:[]}}),thematicBreak:a(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:s(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let i;n?(i=mh(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):i=Bd(t);this.stack[this.stack.length-1].value+=i},characterReference:function(e){this.stack.pop().position.end=bh(e.end)},codeFenced:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:s(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Td(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(h),hardBreakTrailing:s(h),htmlFlow:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:s(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(gh,yh)}(t),n.identifier=Td(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak)return n.children[n.children.length-1].position.end=bh(e.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),d.call(this,e))},link:s(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Td(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:s(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:s(),thematicBreak:s()}};wh(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let a={type:"root",children:[]};const s={stack:[a],tokenStack:[],config:t,enter:r,exit:l,buffer:o,resume:c,data:n},u=[];let d=-1;for(;++d0){const e=s.tokenStack[s.tokenStack.length-1];(e[1]||Sh).call(s,void 0,e[0])}for(a.position={start:bh(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:bh(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Th[e](t)},Eh=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),i=a=>{if(e.has(a))return e.get(a);const[o,r]=t[a];switch(o){case 0:case-1:return n(r,a);case 1:{const e=n([],a);for(const t of r)e.push(i(t));return e}case 2:{const e=n({},a);for(const[t,n]of r)e[i(t)]=i(n);return e}case 3:return n(new Date(r),a);case 4:{const{source:e,flags:t}=r;return n(new RegExp(e,t),a)}case 5:{const e=n(new Map,a);for(const[t,n]of r)e.set(i(t),i(n));return e}case 6:{const e=n(new Set,a);for(const t of r)e.add(i(t));return e}case 7:{const{name:e,message:t}=r;return n(Ph(e,t),a)}case 8:return n(BigInt(r),a);case"BigInt":return n(Object(BigInt(r)),a);case"ArrayBuffer":return n(new Uint8Array(r).buffer,r);case"DataView":{const{buffer:e}=new Uint8Array(r);return n(new DataView(e),r)}}return n(Ph(o,r),a)};return i})(new Map,e)(0),Ah="",{toString:Ih}={},{keys:Mh}=Object,jh=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Ih.call(e).slice(8,-1);switch(n){case"Array":return[1,Ah];case"Object":return[2,Ah];case"Date":return[3,Ah];case"RegExp":return[4,Ah];case"Map":return[5,Ah];case"Set":return[6,Ah];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Dh=([e,t])=>0===e&&("function"===t||"symbol"===t),Lh=(e,{json:t,lossy:n}={})=>{const i=[];return((e,t,n,i)=>{const a=(e,t)=>{const a=i.push(e)-1;return n.set(t,a),a},o=i=>{if(n.has(i))return n.get(i);let[r,s]=jh(i);switch(r){case 0:{let t=i;switch(s){case"bigint":r=8,t=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return a([-1],i)}return a([r,t],i)}case 1:{if(s){let e=i;return"DataView"===s?e=new Uint8Array(i.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(i)),a([s,[...e]],i)}const e=[],t=a([r,e],i);for(const t of i)e.push(o(t));return t}case 2:{if(s)switch(s){case"BigInt":return a([s,i.toString()],i);case"Boolean":case"Number":case"String":return a([s,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());const n=[],l=a([r,n],i);for(const t of Mh(i))!e&&Dh(jh(i[t]))||n.push([o(t),o(i[t])]);return l}case 3:return a([r,i.toISOString()],i);case 4:{const{source:e,flags:t}=i;return a([r,{source:e,flags:t}],i)}case 5:{const t=[],n=a([r,t],i);for(const[n,a]of i)(e||!Dh(jh(n))&&!Dh(jh(a)))&&t.push([o(n),o(a)]);return n}case 6:{const t=[],n=a([r,t],i);for(const n of i)!e&&Dh(jh(n))||t.push(o(n));return n}}const{message:l}=i;return a([r,{name:s,message:l}],i)};return o})(!(t||n),!!t,new Map,i)(e),i},Rh="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Eh(Lh(e,t)):structuredClone(e):(e,t)=>Eh(Lh(e,t));function Oh(e){const t=[];let n=-1,i=0,a=0;for(;++n55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(r=String.fromCharCode(o,t),a=1):r="�"}else r=String.fromCharCode(o);r&&(t.push(e.slice(i,n),encodeURIComponent(r)),i=n+a+1,r=""),a&&(n+=a,a=0)}return t.join("")+e.slice(i)}function Nh(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function _h(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const Vh=function(e){if(null==e)return Bh;if("function"==typeof e)return Fh(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n":"")+")"})}return u;function u(){let c,u,d,h=zh;if((!t||o(a,s,l[l.length-1]||void 0))&&(h=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:null==e?zh:[e]}(n(a,l)),h[0]===Uh))return h;if("children"in a&&a.children){const t=a;if(t.children&&"skip"!==h[0])for(u=(i?t.children.length:-1)+r,d=l.concat(t);u>-1&&u1}function qh(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),a=0;const o=[];for(;i;)o.push(Kh(t.slice(a,i.index),a>0,!0),i[0]),a=i.index+i[0].length,i=n.exec(t);return o.push(Kh(t.slice(a),a>0,!1)),o.join("")}function Kh(e,t,n){let i=0,a=e.length;if(t){let t=e.codePointAt(i);for(;9===t||32===t;)i++,t=e.codePointAt(i)}if(n){let t=e.codePointAt(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>i?e.slice(i,a):""}const Yh={blockquote:function(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)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",i={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(i.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=Oh(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let r,s=e.footnoteCounts.get(i);void 0===s?(s=0,e.footnoteOrder.push(i),r=e.footnoteOrder.length):r=o+1,s+=1,e.footnoteCounts.set(i,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $h(e,t);const a={src:Oh(i.url||""),alt:t.alt};null!==i.title&&void 0!==i.title&&(a.title=i.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:Oh(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $h(e,t);const a={href:Oh(i.url||"")};null!==i.title&&void 0!==i.title&&(a.title=i.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:Oh(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},listItem:function(e,t,n){const i=e.all(t),a=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s0){const i={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=lu(t.children[1]),r=su(t.children[t.children.length-1]);o&&r&&(i.position={start:o,end:r}),a.push(i)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const i=n?n.children:void 0,a=0===(i?i.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,r=o?o.length:t.children.length;let s=-1;const l=[];for(;++s0&&n.push({type:"text",value:"\n"}),n}function np(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ip(e,t){const n=function(e,t){const n=t||Jh,i=new Map,a=new Map,o=new Map,r={...Yh,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let i=-1;for(;++i0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof i?i:i(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(a,f),s.push(f)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Rh(r),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return a&&o.children.push({type:"text",value:"\n"},a),o}function ap(e,t){return e&&"run"in e?async function(n,i){const a=ip(n,{file:i,...t});await e.run(a,i)}:function(n,i){return ip(n,{file:i,...e||t})}}function op(e){if(e)throw e}var rp=r(849);function sp(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}const lp=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');pp(e);let n,i=0,a=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else a<0&&(n=!0,a=o+1);return a<0?"":e.slice(i,a)}if(t===e)return"";let r=-1,s=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else r<0&&(n=!0,r=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(a=o):(s=-1,a=r));return i===a?a=r:a<0&&(a=e.length),e.slice(i,a)},cp=function(e){if(pp(e),0===e.length)return".";let t,n=-1,i=e.length;for(;--i;)if(47===e.codePointAt(i)){if(t){n=i;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},up=function(e){pp(e);let t,n=e.length,i=-1,a=0,o=-1,r=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)i<0&&(t=!0,i=n+1),46===s?o<0?o=n:1!==r&&(r=1):o>-1&&(r=-1);else if(t){a=n+1;break}}return o<0||i<0||0===r||1===r&&o===i-1&&o===a+1?"":e.slice(o,i)},dp=function(...e){let t,n=-1;for(;++n2){if(i=a.lastIndexOf("/"),i!==a.length-1){i<0?(a="",o=0):(a=a.slice(0,i),o=a.length-1-a.lastIndexOf("/")),r=l,s=0;continue}}else if(a.length>0){a="",o=0,r=l,s=0;continue}t&&(a=a.length>0?a+"/..":"..",o=2)}else a.length>0?a+="/"+e.slice(r+1,l):a=e.slice(r+1,l),o=l-r-1;r=l,s=0}else 46===n&&s>-1?s++:s=-1}return a}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},hp="/";function pp(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fp=function(){return"/"};function mp(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}const gp=["history","path","basename","stem","extname","dirname"];class yp{constructor(e){let t;t=e?mp(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":fp(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,i=-1;for(;++it.length;let r;o&&t.push(i);try{r=e.apply(this,t)}catch(e){if(o&&n)throw e;return i(e)}o||(r&&r.then&&"function"==typeof r.then?r.then(a,i):r instanceof Error?i(r):a(r))};function i(e,...i){n||(n=!0,t(e,...i))}function a(e){i(null,e)}}(s,a)(...r):i(null,...r)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){const e=new Sp;let t=-1;for(;++t0){let[i,...o]=t;const r=n[a][1];sp(r)&&sp(i)&&(i=rp(!0,r,i)),n[a]=[e,i,...o]}}}}const Cp=(new Sp).freeze();function Tp(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Pp(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ep(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 Ap(e){if(!sp(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Ip(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mp(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new yp(e)}const jp=[],Dp={allowDangerousHtml:!0},Lp=/^(https?|ircs?|mailto|xmpp)$/i,Rp=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Op(e){const t=function(e){const t=e.rehypePlugins||jp,n=e.remarkPlugins||jp,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dp}:Dp;return Cp().use(Ch).use(n).use(ap,i).use(t)}(e),n=function(e){const t=e.children||"",n=new yp;return"string"==typeof t&&(n.value=t),n}(e);return function(e,t){const n=t.allowedElements,i=t.allowElement,a=t.components,o=t.disallowedElements,r=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Np;for(const e of Rp)Object.hasOwn(t,e.from)&&bc((e.from,e.to&&e.to,e.id));return Hh(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return r?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Mu)if(Object.hasOwn(Mu,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],i=Mu[t];(null===i||i.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let r=n?!n.includes(e.tagName):!!o&&o.includes(e.tagName);if(!r&&i&&"number"==typeof t&&(r=!i(e,t,a)),r&&a&&"number"==typeof t)return s&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=function(e,t){return function(n,i,a,o){const r=Array.isArray(a.children),s=lu(n);return t(i,a,o,r,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");a=t.jsx,o=t.jsxs,i=function(e,t,n,i){const r=Array.isArray(n.children)?o:a;return i?r(t,n,i):r(t,n)}}var a,o;const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?Qc:Zc,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},s=wu(r,e,void 0);return s&&"string"!=typeof s?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}(e,{Fragment:ve.Fragment,components:a,ignoreInvalidStyle:!0,jsx:ve.jsx,jsxs:ve.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function Np(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),a=e.indexOf("/");return-1===t||-1!==a&&t>a||-1!==n&&t>n||-1!==i&&t>i||Lp.test(e.slice(0,t))?e:""}function _p(e,t){return e===t}function Vp(e,t,n){var i=n&&n.equalityFn||_p,a=(0,h.useRef)(e),o=(0,h.useState)({})[1],r=function(e,t,n,i){var a=this,o=(0,h.useRef)(null),r=(0,h.useRef)(0),s=(0,h.useRef)(0),l=(0,h.useRef)(null),c=(0,h.useRef)([]),u=(0,h.useRef)(),d=(0,h.useRef)(),p=(0,h.useRef)(e),f=(0,h.useRef)(!0),m=(0,h.useRef)(),g=(0,h.useRef)();p.current=e;var y="undefined"!=typeof window,v=!t&&0!==t&&y;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,b=!("trailing"in n)||!!n.trailing,w=!!n.flushOnExit&&b,k="maxWait"in n,S="debounceOnServer"in n&&!!n.debounceOnServer,C=k?Math.max(+n.maxWait||0,t):null,T=(0,h.useMemo)(function(){var e=function(e){var t=c.current,n=u.current;return c.current=u.current=null,r.current=e,s.current=s.current||e,d.current=p.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(e):setTimeout(e,t)},h=function(e){if(!f.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||k&&e-r.current>=C},T=function(t){return l.current=null,b&&c.current?e(t):(c.current=u.current=null,d.current)},P=function e(){var i=Date.now();if(x&&s.current===r.current&&E(),h(i))return T(i);if(f.current){var a=t-(i-o.current),l=k?Math.min(a,C-(i-r.current)):a;n(e,l)}},E=function(){i&&i({})},A=function(){if(y||S){var i,s=Date.now(),p=h(s);if(c.current=[].slice.call(arguments),u.current=a,o.current=s,w&&!m.current&&(m.current=function(){var e;"hidden"===(null==(e=globalThis.document)?void 0:e.visibilityState)&&g.current.flush()},null==(i=globalThis.document)||null==i.addEventListener||i.addEventListener("visibilitychange",m.current)),p){if(!l.current&&f.current)return r.current=o.current,n(P,t),x?e(o.current):d.current;if(k)return n(P,t),e(o.current)}return l.current||n(P,t),d.current}};return A.cancel=function(){var e=l.current;e&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),r.current=0,c.current=o.current=u.current=l.current=null,e&&i&&i({})},A.isPending=function(){return!!l.current},A.flush=function(){return l.current?T(Date.now()):d.current},A},[x,k,t,C,b,w,v,y,S,i]);return g.current=T,(0,h.useEffect)(function(){return f.current=!0,function(){var e;w&&g.current.flush(),m.current&&(null==(e=globalThis.document)||null==e.removeEventListener||e.removeEventListener("visibilitychange",m.current),m.current=null),f.current=!1}},[w]),T}((0,h.useCallback)(function(e){a.current=e,o({})},[o]),t,n,o),s=(0,h.useRef)(e);return i(s.current,e)||(r(e),s.current=e),[a.current,r]}const Fp=Math.min,Bp=Math.max,zp=Math.round,Up=Math.floor,Hp=e=>({x:e,y:e}),$p={left:"right",right:"left",bottom:"top",top:"bottom"};function Wp(e,t,n){return Bp(e,Fp(t,n))}function qp(e,t){return"function"==typeof e?e(t):e}function Kp(e){return e.split("-")[0]}function Yp(e){return e.split("-")[1]}function Gp(e){return"x"===e?"y":"x"}function Xp(e){return"y"===e?"height":"width"}function Jp(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Zp(e){return Gp(Jp(e))}function Qp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ef=["left","right"],tf=["right","left"],nf=["top","bottom"],af=["bottom","top"];function of(e){const t=Kp(e);return $p[t]+e.slice(t.length)}function rf(e){const{x:t,y:n,width:i,height:a}=e;return{width:i,height:a,top:n,left:t,right:t+i,bottom:n+a,x:t,y:n}}function sf(e,t,n){let{reference:i,floating:a}=e;const o=Jp(t),r=Zp(t),s=Xp(r),l=Kp(t),c="y"===o,u=i.x+i.width/2-a.width/2,d=i.y+i.height/2-a.height/2,h=i[s]/2-a[s]/2;let p;switch(l){case"top":p={x:u,y:i.y-a.height};break;case"bottom":p={x:u,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-a.width,y:d};break;default:p={x:i.x,y:i.y}}switch(Yp(t)){case"start":p[r]-=h*(n&&c?-1:1);break;case"end":p[r]+=h*(n&&c?-1:1)}return p}async function lf(e,t){var n;void 0===t&&(t={});const{x:i,y:a,platform:o,rects:r,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=qp(t,e),f=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(p),m=s[h?"floating"===d?"reference":"floating":d],g=rf(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:i,y:a,width:r.floating.width,height:r.floating.height}:r.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),x=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},b=rf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-b.top+f.top)/x.y,bottom:(b.bottom-g.bottom+f.bottom)/x.y,left:(g.left-b.left+f.left)/x.x,right:(b.right-g.right+f.right)/x.x}}const cf=new Set(["left","top"]);function uf(){return"undefined"!=typeof window}function df(e){return ff(e)?(e.nodeName||"").toLowerCase():"#document"}function hf(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function pf(e){var t;return null==(t=(ff(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ff(e){return!!uf()&&(e instanceof Node||e instanceof hf(e).Node)}function mf(e){return!!uf()&&(e instanceof Element||e instanceof hf(e).Element)}function gf(e){return!!uf()&&(e instanceof HTMLElement||e instanceof hf(e).HTMLElement)}function yf(e){return!(!uf()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof hf(e).ShadowRoot)}function vf(e){const{overflow:t,overflowX:n,overflowY:i,display:a}=Af(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&"inline"!==a&&"contents"!==a}function xf(e){return/^(table|td|th)$/.test(df(e))}function bf(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const wf=/transform|translate|scale|rotate|perspective|filter/,kf=/paint|layout|strict|content/,Sf=e=>!!e&&"none"!==e;let Cf;function Tf(e){const t=mf(e)?Af(e):e;return Sf(t.transform)||Sf(t.translate)||Sf(t.scale)||Sf(t.rotate)||Sf(t.perspective)||!Pf()&&(Sf(t.backdropFilter)||Sf(t.filter))||wf.test(t.willChange||"")||kf.test(t.contain||"")}function Pf(){return null==Cf&&(Cf="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Cf}function Ef(e){return/^(html|body|#document)$/.test(df(e))}function Af(e){return hf(e).getComputedStyle(e)}function If(e){return mf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mf(e){if("html"===df(e))return e;const t=e.assignedSlot||e.parentNode||yf(e)&&e.host||pf(e);return yf(t)?t.host:t}function jf(e){const t=Mf(e);return Ef(t)?e.ownerDocument?e.ownerDocument.body:e.body:gf(t)&&vf(t)?t:jf(t)}function Df(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=jf(e),o=a===(null==(i=e.ownerDocument)?void 0:i.body),r=hf(a);if(o){const e=Lf(r);return t.concat(r,r.visualViewport||[],vf(a)?a:[],e&&n?Df(e):[])}return t.concat(a,Df(a,[],n))}function Lf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rf(e){const t=Af(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const a=gf(e),o=a?e.offsetWidth:n,r=a?e.offsetHeight:i,s=zp(n)!==o||zp(i)!==r;return s&&(n=o,i=r),{width:n,height:i,$:s}}function Of(e){return mf(e)?e:e.contextElement}function Nf(e){const t=Of(e);if(!gf(t))return Hp(1);const n=t.getBoundingClientRect(),{width:i,height:a,$:o}=Rf(t);let r=(o?zp(n.width):n.width)/i,s=(o?zp(n.height):n.height)/a;return r&&Number.isFinite(r)||(r=1),s&&Number.isFinite(s)||(s=1),{x:r,y:s}}const _f=Hp(0);function Vf(e){const t=hf(e);return Pf()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_f}function Ff(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=Of(e);let r=Hp(1);t&&(i?mf(i)&&(r=Nf(i)):r=Nf(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==hf(e))&&t}(o,n,i)?Vf(o):Hp(0);let l=(a.left+s.x)/r.x,c=(a.top+s.y)/r.y,u=a.width/r.x,d=a.height/r.y;if(o){const e=hf(o),t=i&&mf(i)?hf(i):i;let n=e,a=Lf(n);for(;a&&i&&t!==n;){const e=Nf(a),t=a.getBoundingClientRect(),i=Af(a),o=t.left+(a.clientLeft+parseFloat(i.paddingLeft))*e.x,r=t.top+(a.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=r,n=hf(a),a=Lf(n)}}return rf({width:u,height:d,x:l,y:c})}function Bf(e,t){const n=If(e).scrollLeft;return t?t.left+n:Ff(pf(e)).left+n}function zf(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bf(e,n),y:n.top+t.scrollTop}}function Uf(e,t,n){let i;if("viewport"===t)i=function(e,t){const n=hf(e),i=pf(e),a=n.visualViewport;let o=i.clientWidth,r=i.clientHeight,s=0,l=0;if(a){o=a.width,r=a.height;const e=Pf();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}const c=Bf(i);if(c<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(i.clientWidth-t.clientWidth-a);r<=25&&(o-=r)}else c<=25&&(o+=c);return{width:o,height:r,x:s,y:l}}(e,n);else if("document"===t)i=function(e){const t=pf(e),n=If(e),i=e.ownerDocument.body,a=Bp(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=Bp(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+Bf(e);const s=-n.scrollTop;return"rtl"===Af(i).direction&&(r+=Bp(t.clientWidth,i.clientWidth)-a),{width:a,height:o,x:r,y:s}}(pf(e));else if(mf(t))i=function(e,t){const n=Ff(e,!0,"fixed"===t),i=n.top+e.clientTop,a=n.left+e.clientLeft,o=gf(e)?Nf(e):Hp(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:i*o.y}}(t,n);else{const n=Vf(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rf(i)}function Hf(e,t){const n=Mf(e);return!(n===t||!mf(n)||Ef(n))&&("fixed"===Af(n).position||Hf(n,t))}function $f(e,t,n){const i=gf(t),a=pf(t),o="fixed"===n,r=Ff(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Hp(0);function c(){l.x=Bf(a)}if(i||!i&&!o)if(("body"!==df(t)||vf(a))&&(s=If(t)),i){const e=Ff(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!i&&a&&c();const u=!a||i||o?Hp(0):zf(a,s);return{x:r.left+s.scrollLeft-l.x-u.x,y:r.top+s.scrollTop-l.y-u.y,width:r.width,height:r.height}}function Wf(e){return"static"===Af(e).position}function qf(e,t){if(!gf(e)||"fixed"===Af(e).position)return null;if(t)return t(e);let n=e.offsetParent;return pf(e)===n&&(n=n.ownerDocument.body),n}function Kf(e,t){const n=hf(e);if(bf(e))return n;if(!gf(e)){let t=Mf(e);for(;t&&!Ef(t);){if(mf(t)&&!Wf(t))return t;t=Mf(t)}return n}let i=qf(e,t);for(;i&&xf(i)&&Wf(i);)i=qf(i,t);return i&&Ef(i)&&Wf(i)&&!Tf(i)?n:i||function(e){let t=Mf(e);for(;gf(t)&&!Ef(t);){if(Tf(t))return t;if(bf(t))return null;t=Mf(t)}return null}(e)||n}const Yf={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:i,strategy:a}=e;const o="fixed"===a,r=pf(i),s=!!t&&bf(t.floating);if(i===r||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Hp(1);const u=Hp(0),d=gf(i);if((d||!d&&!o)&&(("body"!==df(i)||vf(r))&&(l=If(i)),d)){const e=Ff(i);c=Nf(i),u.x=e.x+i.clientLeft,u.y=e.y+i.clientTop}const h=!r||d||o?Hp(0):zf(r,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:pf,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:a}=e;const o=[..."clippingAncestors"===n?bf(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let i=Df(e,[],!1).filter(e=>mf(e)&&"body"!==df(e)),a=null;const o="fixed"===Af(e).position;let r=o?Mf(e):e;for(;mf(r)&&!Ef(r);){const t=Af(r),n=Tf(r);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&("absolute"===a.position||"fixed"===a.position)||vf(r)&&!n&&Hf(e,r))?i=i.filter(e=>e!==r):a=t,r=Mf(r)}return t.set(e,i),i}(t,this._c):[].concat(n),i],r=Uf(t,o[0],a);let s=r.top,l=r.right,c=r.bottom,u=r.left;for(let e=1;e{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,i=null;const a=pf(e);function o(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null}return function r(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=c;if(s||t(),!h||!p)return;const f={rootMargin:-Up(d)+"px "+-Up(a.clientWidth-(u+h))+"px "+-Up(a.clientHeight-(d+p))+"px "+-Up(u)+"px",threshold:Bp(0,Fp(1,l))||1};let m=!0;function g(t){const i=t[0].intersectionRatio;if(i!==l){if(!m)return r();i?r(!1,i):n=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==i||Gf(c,e.getBoundingClientRect())||r(),m=!1}try{i=new IntersectionObserver(g,{...f,root:a.ownerDocument})}catch(e){i=new IntersectionObserver(g,f)}i.observe(e)}(!0),o}(c,n):null;let h,p=-1,f=null;r&&(f=new ResizeObserver(e=>{let[i]=e;i&&i.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let m=l?Ff(e):null;return l&&function t(){const i=Ff(e);m&&!Gf(m,i)&&n(),m=i,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const Jf=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:a,middlewareData:o,rects:r,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=qp(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const y=Kp(a),v=Jp(s),x=Kp(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(x||!m?[of(s)]:function(e){const t=of(e);return[Qp(e),t,Qp(t)]}(s)),k="none"!==f;!h&&k&&w.push(...function(e,t,n,i){const a=Yp(e);let o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?tf:ef:t?ef:tf;case"left":case"right":return t?nf:af;default:return[]}}(Kp(e),"start"===n,i);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Qp)))),o}(s,m,f,b));const S=[s,...w],C=await l.detectOverflow(t,g),T=[];let P=(null==(i=o.flip)?void 0:i.overflows)||[];if(u&&T.push(C[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const i=Yp(e),a=Zp(e),o=Xp(a);let r="x"===a?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=of(r)),[r,of(r)]}(a,r,b);T.push(C[e[0]],C[e[1]])}if(P=[...P,{placement:a,overflows:T}],!T.every(e=>e<=0)){var E,A;const e=((null==(E=o.flip)?void 0:E.index)||0)+1,t=S[e];if(t&&("alignment"!==d||v===Jp(t)||P.every(e=>Jp(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(A=P.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(p){case"bestFit":{var I;const e=null==(I=P.filter(e=>{if(k){const t=Jp(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}},Zf=(e,t,n)=>{const i=new Map,a={platform:Yf,...n},o={...a.platform,_c:i};return(async(e,t,n)=>{const{placement:i="bottom",strategy:a="absolute",middleware:o=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:lf},l=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=sf(c,i,l),h=i,p=0;const f={};for(let n=0;n{t.current=e}),t}const am=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:a,y:o,placement:r,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:i,elements:a}=e,o=await(null==i.isRTL?void 0:i.isRTL(a.floating)),r=Kp(n),s=Yp(n),l="y"===Jp(n),c=cf.has(r)?-1:1,u=o&&l?-1:1,d=qp(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(p="end"===s?-1*f:f),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}(t,e);return r===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:r}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},om=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:a,platform:o}=t,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=qp(e,t),u={x:n,y:i},d=await o.detectOverflow(t,c),h=Jp(Kp(a)),p=Gp(h);let f=u[p],m=u[h];if(r){const e="y"===p?"bottom":"right";f=Wp(f+d["y"===p?"top":"left"],f,f-d[e])}if(s){const e="y"===h?"bottom":"right";m=Wp(m+d["y"===h?"top":"left"],m,m-d[e])}const g=l.fn({...t,[p]:f,[h]:m});return{...g,data:{x:g.x-n,y:g.y-i,enabled:{[p]:r,[h]:s}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},rm=(e,t)=>{const n=Jf(e);return{name:n.name,fn:n.fn,options:[e,t]}};function sm(...e){return e.flat().filter(Boolean).map(e=>"string"==typeof e?e:"object"!=typeof e||Array.isArray(e)||null===e?"":Object.entries(e).filter(([e,t])=>t).map(([e])=>e).join(" ")).join(" ").trim()}const lm=372,cm=16,um={SPRING_CONFIG:{type:"spring",damping:25,stiffness:300},VELOCITY_MULTIPLIER:.1,NON_DRAGGABLE_SELECTORS:['[data-slot="messages"]','[data-slot="chat-input"]','[data-slot="chat-footer"]','[data-slot="chat-header"] [data-slot="button"]'].join(", ")},dm="GlotPress/2.4.0-alpha",hm="messages",pm={messages:{"":{domain:"messages","plural-forms":"nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;",lang:"ar"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["ذكاء ووردبريس الاصطناعي الخاص بك — جاهز للمساعدة في التصميم، التحرير، والإطلاق."],"a8c-agentticYesterday":["أمس"],"a8c-agentticUpload image files up to %s each.":["رفع ملفات الصور حتى %s لكل منها."],"a8c-agentticUnsupported chart type: %s":["نوع الرسم البياني غير مدعوم: %s"],"a8c-agentticToday":["اليوم"],"a8c-agentticThis action is no longer available or cannot be performed":["هذا الإجراء لم يعد متاحًا أو لا يمكن تنفيذه"],"a8c-agentticThinking…":["التفكير…"],"a8c-agentticStop processing":["أوقف المعالجة"],"a8c-agentticSend message":["أرسل رسالة"],"a8c-agentticRemove image":["إزالة الصورة"],"a8c-agentticOpen chat":["فتح الدردشة"],"a8c-agentticOnly %s image files are allowed.":["فقط ملفات الصور %s مسموح بها."],"a8c-agentticNo data points found for chart":["لم يتم العثور على نقاط بيانات للرسم البياني"],"a8c-agentticNo chart data available":["لا توجد بيانات مخطط متاحة"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["الرسالة طويلة جداً. يرجى أن تبقيها تحت %d حرفاً."],"a8c-agentticMaximum %d files allowed.":["الحد الأقصى المسموح به هو %d ملف."],"a8c-agentticInvalid chart data provided":["تم توفير بيانات الرسم البياني غير صالح"],"a8c-agentticFailed to parse chart data as JSON":["فشل في تحليل بيانات الرسم البياني كـ JSON"],"a8c-agentticExpand conversation":["توسيع المحادثة"],"a8c-agentticDrop files here to use":["اسحب الملفات هنا للاستخدام"],"a8c-agentticClose conversation":["إغلاق المحادثة"],"a8c-agentticClick to upload images or drag and drop":["انقر لرفع الصور أو اسحب وأفلت"],"a8c-agentticChart data must include chartType":["يجب أن تتضمن بيانات الرسم البياني chartType"],"a8c-agentticChart data must include a data array":["يجب أن تتضمن بيانات الرسم البياني مصفوفة بيانات"],"a8c-agentticAvailable types: line, bar":["أنواع متاحة: خط، عمود"],"a8c-agentticAsk anything":["اسأل أي شيء"],"a8c-agenttic%d days ago":["%d يوم مضى"]}},fm={"translation-revision-date":"2025-10-08 20:39:51+0000",generator:dm,domain:hm,locale_data:pm},mm=Object.freeze(Object.defineProperty({__proto__:null,default:fm,domain:hm,generator:dm,locale_data:pm},Symbol.toStringTag,{value:"Module"})),gm="GlotPress/2.4.0-alpha",ym="messages",vm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"de"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Dein WordPress KI — bereit, beim Designen, Bearbeiten und Starten zu helfen."],"a8c-agentticYesterday":["Gestern"],"a8c-agentticUpload image files up to %s each.":["Hochladen von Bilddateien bis zu %s jeweils."],"a8c-agentticUnsupported chart type: %s":["Nicht unterstützter Diagrammtyp: %s"],"a8c-agentticToday":["Heute"],"a8c-agentticThis action is no longer available or cannot be performed":["Diese Aktion ist nicht mehr verfügbar oder kann nicht ausgeführt werden."],"a8c-agentticThinking…":["Nachdenken…"],"a8c-agentticStop processing":["Verarbeitung stoppen"],"a8c-agentticSend message":["Nachricht senden"],"a8c-agentticRemove image":["Bild entfernen"],"a8c-agentticOpen chat":["Chat öffnen"],"a8c-agentticOnly %s image files are allowed.":["Nur %s Bilddateien sind erlaubt."],"a8c-agentticNo data points found for chart":["Keine Datenpunkte für das Diagramm gefunden"],"a8c-agentticNo chart data available":["Keine Diagrammdaten verfügbar"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Nachricht ist zu lang. Bitte halte sie unter %d Zeichen."],"a8c-agentticMaximum %d files allowed.":["Maximal %d Dateien erlaubt."],"a8c-agentticInvalid chart data provided":["Ungültige Diagrammdaten bereitgestellt"],"a8c-agentticFailed to parse chart data as JSON":["Fehler beim Parsen der Diagrammdaten als JSON"],"a8c-agentticExpand conversation":["Gespräch erweitern"],"a8c-agentticDrop files here to use":["Dateien hierher ziehen, um sie zu verwenden"],"a8c-agentticClose conversation":["Gespräch schließen"],"a8c-agentticClick to upload images or drag and drop":["Klicken Sie, um Bilder hochzuladen oder Drag-and-Drop"],"a8c-agentticChart data must include chartType":["Die Diagrammdaten müssen chartType enthalten"],"a8c-agentticChart data must include a data array":["Diagrammdaten müssen ein Daten-Array enthalten"],"a8c-agentticAvailable types: line, bar":["Verfügbare Typen: Linie, Balken"],"a8c-agentticAsk anything":["Frag irgendwas"],"a8c-agenttic%d days ago":["%d Tage her"]}},xm={"translation-revision-date":"2025-10-08 20:39:43+0000",generator:gm,domain:ym,locale_data:vm},bm=Object.freeze(Object.defineProperty({__proto__:null,default:xm,domain:ym,generator:gm,locale_data:vm},Symbol.toStringTag,{value:"Module"})),wm="GlotPress/2.4.0-alpha",km="messages",Sm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"es"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Tu WordPress AI — lista para ayudar a diseñar, editar y lanzar."],"a8c-agentticYesterday":["Ayer"],"a8c-agentticUpload image files up to %s each.":["Sube archivos de imagen de hasta %s cada uno."],"a8c-agentticUnsupported chart type: %s":["Tipo de gráfico no soportado: %s"],"a8c-agentticToday":["Hoy"],"a8c-agentticThis action is no longer available or cannot be performed":["Esta acción ya no está disponible o no se puede realizar"],"a8c-agentticThinking…":["Pensando…"],"a8c-agentticStop processing":["Detener el procesamiento"],"a8c-agentticSend message":["Enviar mensaje"],"a8c-agentticRemove image":["Eliminar imagen"],"a8c-agentticOpen chat":["Abre el chat"],"a8c-agentticOnly %s image files are allowed.":["Solo se permiten archivos de imagen %s."],"a8c-agentticNo data points found for chart":["No se encontraron puntos de datos para el gráfico"],"a8c-agentticNo chart data available":["No hay datos de gráfico disponibles"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["El mensaje es demasiado largo. Por favor, mantenlo por debajo de %d caracteres."],"a8c-agentticMaximum %d files allowed.":["Se permiten un máximo de %d archivos."],"a8c-agentticInvalid chart data provided":["Datos de gráfico no válidos proporcionados"],"a8c-agentticFailed to parse chart data as JSON":["Error al analizar los datos del gráfico como JSON"],"a8c-agentticExpand conversation":["Expandir conversación"],"a8c-agentticDrop files here to use":["Arrastra archivos aquí para usar"],"a8c-agentticClose conversation":["Cerrar conversación"],"a8c-agentticClick to upload images or drag and drop":["Hacer clic para subir imágenes o arrastrar y soltar"],"a8c-agentticChart data must include chartType":["Los datos del gráfico deben incluir chartType"],"a8c-agentticChart data must include a data array":["Los datos del gráfico deben incluir un array de datos"],"a8c-agentticAvailable types: line, bar":["Tipos disponibles: línea, barra"],"a8c-agentticAsk anything":["Pregunta lo que sea"],"a8c-agenttic%d days ago":["%d días hace"]}},Cm={"translation-revision-date":"2025-10-08 20:39:42+0000",generator:wm,domain:km,locale_data:Sm},Tm=Object.freeze(Object.defineProperty({__proto__:null,default:Cm,domain:km,generator:wm,locale_data:Sm},Symbol.toStringTag,{value:"Module"})),Pm="GlotPress/2.4.0-alpha",Em="messages",Am={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n > 1;",lang:"fr"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Votre WordPress IA — prête à aider à concevoir, éditer et lancer."],"a8c-agentticYesterday":["Hier"],"a8c-agentticUpload image files up to %s each.":["Charger des fichiers image jusqu'à %s chacun."],"a8c-agentticUnsupported chart type: %s":["Type de graphique non pris en charge : %s"],"a8c-agentticToday":["Aujourd'hui"],"a8c-agentticThis action is no longer available or cannot be performed":["Cette action n'est plus disponible ou ne peut pas être effectuée"],"a8c-agentticThinking…":["En train de réfléchir…"],"a8c-agentticStop processing":["Arrêter le traitement"],"a8c-agentticSend message":["Envoyer le message"],"a8c-agentticRemove image":["Supprimer l'image"],"a8c-agentticOpen chat":["Ouvrir le chat"],"a8c-agentticOnly %s image files are allowed.":["Seuls les fichiers d'image %s sont autorisés."],"a8c-agentticNo data points found for chart":["Aucun point de données trouvé pour le graphique"],"a8c-agentticNo chart data available":["Aucune donnée de graphique disponible"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Le message est trop long. Veuillez le garder sous %d caractères."],"a8c-agentticMaximum %d files allowed.":["Maximum %d fichiers autorisés."],"a8c-agentticInvalid chart data provided":["Données de graphique non valides fournies"],"a8c-agentticFailed to parse chart data as JSON":["Échec de l'analyse des données du graphique en tant que JSON"],"a8c-agentticExpand conversation":["Développer la conversation"],"a8c-agentticDrop files here to use":["Déposez des fichiers ici pour les utiliser"],"a8c-agentticClose conversation":["Fermer la conversation"],"a8c-agentticClick to upload images or drag and drop":["Clic pour mettre en ligne des images ou glisser-déposer"],"a8c-agentticChart data must include chartType":["Les données du graphique doivent inclure chartType"],"a8c-agentticChart data must include a data array":["Les données du graphique doivent inclure un tableau de données"],"a8c-agentticAvailable types: line, bar":["Saisir disponibles : ligne, barre"],"a8c-agentticAsk anything":["Demande n'importe quoi"],"a8c-agenttic%d days ago":["%d jours auparavant"]}},Im={"translation-revision-date":"2025-10-08 20:39:44+0000",generator:Pm,domain:Em,locale_data:Am},Mm=Object.freeze(Object.defineProperty({__proto__:null,default:Im,domain:Em,generator:Pm,locale_data:Am},Symbol.toStringTag,{value:"Module"})),jm="GlotPress/2.4.0-alpha",Dm="messages",Lm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"he_IL"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["הבינה המלאכותית של WordPress שלך — מוכנה לעזור לעצב, לערוך ולהשיק."],"a8c-agentticYesterday":["אתמול"],"a8c-agentticUpload image files up to %s each.":["להעלות קבצי תמונה עד %s כל אחד."],"a8c-agentticUnsupported chart type: %s":["סוג תרשים לא נתמך: %s"],"a8c-agentticToday":["היום"],"a8c-agentticThis action is no longer available or cannot be performed":["הפעולה הזו כבר לא זמינה או לא יכולה להתבצע"],"a8c-agentticThinking…":["חושב…"],"a8c-agentticStop processing":["עצור עיבוד"],"a8c-agentticSend message":["שלח הודעה"],"a8c-agentticRemove image":["להסיר תמונה"],"a8c-agentticOpen chat":["פתח צ'אט"],"a8c-agentticOnly %s image files are allowed.":["רק קבצי תמונה %s מותרים."],"a8c-agentticNo data points found for chart":["לא נמצאו נקודות נתונים עבור הגרף"],"a8c-agentticNo chart data available":["לא זמינים נתוני תרשים"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["ההודעה ארוכה מדי. בבקשה שמור אותה מתחת ל-%d תווים."],"a8c-agentticMaximum %d files allowed.":["מקסימום %d קבצים מותר."],"a8c-agentticInvalid chart data provided":["נתוני תרשים לא תקף שסופקו"],"a8c-agentticFailed to parse chart data as JSON":["נכשל בפירוש נתוני הגרף כ-JSON"],"a8c-agentticExpand conversation":["הרחב שיחה"],"a8c-agentticDrop files here to use":["גרור קבצים לכאן לשימוש"],"a8c-agentticClose conversation":["סגור שיחה"],"a8c-agentticClick to upload images or drag and drop":["לחץ כדי להעלות תמונות או גרור ושחרר"],"a8c-agentticChart data must include chartType":["נתוני הגרף חייבים לכלול chartType"],"a8c-agentticChart data must include a data array":["נתוני הגרף חייבים לכלול מערך נתונים"],"a8c-agentticAvailable types: line, bar":["סוגים זמינים: קו, עמודה"],"a8c-agentticAsk anything":["שאל כל דבר"],"a8c-agenttic%d days ago":["%d ימים לפני"]}},Rm={"translation-revision-date":"2025-10-08 20:39:45+0000",generator:jm,domain:Dm,locale_data:Lm},Om=Object.freeze(Object.defineProperty({__proto__:null,default:Rm,domain:Dm,generator:jm,locale_data:Lm},Symbol.toStringTag,{value:"Module"})),Nm="GlotPress/2.4.0-alpha",_m="messages",Vm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n > 1;",lang:"id"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["AI WordPress kamu — siap membantu mendesain, mengedit, dan meluncurkan."],"a8c-agentticYesterday":["Kemarin"],"a8c-agentticUpload image files up to %s each.":["Unggah file gambar hingga %s masing-masing."],"a8c-agentticUnsupported chart type: %s":["Tipe grafik tidak didukung: %s"],"a8c-agentticToday":["Hari ini"],"a8c-agentticThis action is no longer available or cannot be performed":["Tindakan ini tidak lagi tersedia atau tidak dapat dilakukan"],"a8c-agentticThinking…":["Berpikir…"],"a8c-agentticStop processing":["Berhenti memproses"],"a8c-agentticSend message":["Kirim pesan"],"a8c-agentticRemove image":["Hapus gambar"],"a8c-agentticOpen chat":["Buka obrolan"],"a8c-agentticOnly %s image files are allowed.":["Hanya file gambar %s yang diperbolehkan."],"a8c-agentticNo data points found for chart":["Tidak ada titik data yang ditemukan untuk grafik"],"a8c-agentticNo chart data available":["Tidak ada data grafik yang tersedia"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Pesan terlalu panjang. Harap jaga agar tetap di bawah %d karakter."],"a8c-agentticMaximum %d files allowed.":["Maksimum %d file diizinkan."],"a8c-agentticInvalid chart data provided":["Data grafik tidak valid yang diberikan"],"a8c-agentticFailed to parse chart data as JSON":["Gagal mengurai data grafik sebagai JSON"],"a8c-agentticExpand conversation":["Perluas percakapan"],"a8c-agentticDrop files here to use":["Seret file ke sini untuk digunakan"],"a8c-agentticClose conversation":["Tutup percakapan"],"a8c-agentticClick to upload images or drag and drop":["Klik untuk unggah gambar atau seret dan lepas"],"a8c-agentticChart data must include chartType":["Data grafik harus mencakup chartType"],"a8c-agentticChart data must include a data array":["Data grafik harus mencakup array data"],"a8c-agentticAvailable types: line, bar":["Jenis yang tersedia: garis, batang"],"a8c-agentticAsk anything":["Tanya apa saja"],"a8c-agenttic%d days ago":["%d hari yang lalu"]}},Fm={"translation-revision-date":"2025-10-08 20:39:49+0000",generator:Nm,domain:_m,locale_data:Vm},Bm=Object.freeze(Object.defineProperty({__proto__:null,default:Fm,domain:_m,generator:Nm,locale_data:Vm},Symbol.toStringTag,{value:"Module"})),zm="GlotPress/2.4.0-alpha",Um="messages",Hm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"it"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["La tua WordPress AI — pronta ad aiutarti a progettare, modificare e lanciare."],"a8c-agentticYesterday":["Ieri"],"a8c-agentticUpload image files up to %s each.":["Carica file immagine fino a %s ciascuno."],"a8c-agentticUnsupported chart type: %s":["Tipo di grafico non supportato: %s"],"a8c-agentticToday":["Oggi"],"a8c-agentticThis action is no longer available or cannot be performed":["Questa azione non è più disponibile o non può essere eseguita"],"a8c-agentticThinking…":["Pensando…"],"a8c-agentticStop processing":["Ferma l'elaborazione"],"a8c-agentticSend message":["Invia messaggio"],"a8c-agentticRemove image":["Rimuovi immagine"],"a8c-agentticOpen chat":["Apri chat"],"a8c-agentticOnly %s image files are allowed.":["Solo i file %s immagine sono consentiti."],"a8c-agentticNo data points found for chart":["Nessun punto dati trovato per il grafico"],"a8c-agentticNo chart data available":["Nessun dato del grafico disponibile"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Il messaggio è troppo lungo. Per favore, mantienilo sotto %d caratteri."],"a8c-agentticMaximum %d files allowed.":["Massimo %d file consentiti."],"a8c-agentticInvalid chart data provided":["Dati del grafico non validi forniti"],"a8c-agentticFailed to parse chart data as JSON":["Impossibile analizzare i dati del grafico come JSON"],"a8c-agentticExpand conversation":["Espandi conversazione"],"a8c-agentticDrop files here to use":["Trascina i file qui per usarli"],"a8c-agentticClose conversation":["Chiudi conversazione"],"a8c-agentticClick to upload images or drag and drop":["Clicca per caricare Immagini o trascina e rilascia"],"a8c-agentticChart data must include chartType":["I dati del grafico devono includere chartType"],"a8c-agentticChart data must include a data array":["I dati del grafico devono includere una matrice di dati"],"a8c-agentticAvailable types: line, bar":["Tipi disponibili: linea, barra"],"a8c-agentticAsk anything":["Chiedi qualsiasi cosa"],"a8c-agenttic%d days ago":["%d giorni fa"]}},$m={"translation-revision-date":"2025-10-08 20:39:46+0000",generator:zm,domain:Um,locale_data:Hm},Wm=Object.freeze(Object.defineProperty({__proto__:null,default:$m,domain:Um,generator:zm,locale_data:Hm},Symbol.toStringTag,{value:"Module"})),qm="GlotPress/2.4.0-alpha",Km="messages",Ym={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"ja_JP"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["あなたのWordPress AI — デザイン、編集、そしてローンチを手伝う準備ができています。"],"a8c-agentticYesterday":["昨日"],"a8c-agentticUpload image files up to %s each.":["%s ごとに画像ファイルをアップロードしてください。"],"a8c-agentticUnsupported chart type: %s":["サポートされていないチャートタイプ: %s"],"a8c-agentticToday":["「今日」"],"a8c-agentticThis action is no longer available or cannot be performed":["このアクションはもう利用できないか、実行できません。"],"a8c-agentticThinking…":["考え中…"],"a8c-agentticStop processing":["処理を停止"],"a8c-agentticSend message":["メッセージを送信"],"a8c-agentticRemove image":["画像を削除"],"a8c-agentticOpen chat":["チャットを開く"],"a8c-agentticOnly %s image files are allowed.":["許可されているのは %s 画像ファイルのみです。"],"a8c-agentticNo data points found for chart":["チャートにデータポイントが見つかりませんでした"],"a8c-agentticNo chart data available":["チャートデータは利用できません"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["メッセージが長すぎます。%d 文字以内にしてください。"],"a8c-agentticMaximum %d files allowed.":["最大 %d ファイルが許可されています。"],"a8c-agentticInvalid chart data provided":["無効なチャートデータが提供されました"],"a8c-agentticFailed to parse chart data as JSON":["チャートデータをJSONとして解析できませんでした"],"a8c-agentticExpand conversation":["会話を拡大する"],"a8c-agentticDrop files here to use":["ここにファイルをドロップして使用"],"a8c-agentticClose conversation":["会話を終了する"],"a8c-agentticClick to upload images or drag and drop":["画像をアップロードするにはクリックするか、ドラッグ&ドロップしてください"],"a8c-agentticChart data must include chartType":["チャートデータにはchartTypeを含める必要があります"],"a8c-agentticChart data must include a data array":["チャートデータにはデータ配列が含まれている必要があります"],"a8c-agentticAvailable types: line, bar":["利用可能なタイプ: ライン、バー"],"a8c-agentticAsk anything":["何でも聞いて"],"a8c-agenttic%d days ago":["%d日前"]}},Gm={"translation-revision-date":"2025-10-08 20:39:45+0000",generator:qm,domain:Km,locale_data:Ym},Xm=Object.freeze(Object.defineProperty({__proto__:null,default:Gm,domain:Km,generator:qm,locale_data:Ym},Symbol.toStringTag,{value:"Module"})),Jm="GlotPress/2.4.0-alpha",Zm="messages",Qm={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"ko_KR"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["당신의 워드프레스 AI — 디자인, 편집 및 출시를 도와줄 준비가 되어 있습니다."],"a8c-agentticYesterday":["어제"],"a8c-agentticUpload image files up to %s each.":["이미지 파일을 각각 %s까지 업로드하다."],"a8c-agentticUnsupported chart type: %s":["지원되지 않는 차트 유형: %s"],"a8c-agentticToday":["오늘"],"a8c-agentticThis action is no longer available or cannot be performed":["이 작업은 더 이상 사용 가능하지 않거나 수행할 수 없습니다."],"a8c-agentticThinking…":["생각 중…"],"a8c-agentticStop processing":["처리 중지"],"a8c-agentticSend message":["메시지 보내기"],"a8c-agentticRemove image":["이미지 제거"],"a8c-agentticOpen chat":["채팅 열기"],"a8c-agentticOnly %s image files are allowed.":["오직 %s 이미지 파일만 허용됩니다."],"a8c-agentticNo data points found for chart":["차트에 대한 데이터 포인트가 없습니다"],"a8c-agentticNo chart data available":["차트 데이터가 없습니다"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["메시지가 너무 깁니다. %d자 이하로 유지해 주세요."],"a8c-agentticMaximum %d files allowed.":["최대 %d개의 파일이 허용됩니다."],"a8c-agentticInvalid chart data provided":["유효하지 않은 차트 데이터가 제공되었습니다"],"a8c-agentticFailed to parse chart data as JSON":["차트 데이터를 JSON으로 파싱하는 데 실패했습니다"],"a8c-agentticExpand conversation":["대화 확장"],"a8c-agentticDrop files here to use":["여기에 파일을 드롭하여 사용하세요"],"a8c-agentticClose conversation":["대화 종료"],"a8c-agentticClick to upload images or drag and drop":["이미지를 업로드하려면 클릭하거나 드래그 앤 드롭하세요"],"a8c-agentticChart data must include chartType":["차트 데이터는 chartType을 포함해야 해"],"a8c-agentticChart data must include a data array":["차트 데이터는 데이터 배열을 포함해야 합니다"],"a8c-agentticAvailable types: line, bar":["사용 가능한 유형: 선, 막대"],"a8c-agentticAsk anything":["뭐든지 물어봐"],"a8c-agenttic%d days ago":["%d일 전"]}},eg={"translation-revision-date":"2025-10-08 20:39:51+0000",generator:Jm,domain:Zm,locale_data:Qm},tg=Object.freeze(Object.defineProperty({__proto__:null,default:eg,domain:Zm,generator:Jm,locale_data:Qm},Symbol.toStringTag,{value:"Module"})),ng="GlotPress/2.4.0-alpha",ig="messages",ag={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"nl"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Jouw WordPress AI — klaar om te helpen met ontwerpen, bewerken en lanceren."],"a8c-agentticYesterday":["Gisteren"],"a8c-agentticUpload image files up to %s each.":["Uploaden afbeeldingsbestanden tot %s elk."],"a8c-agentticUnsupported chart type: %s":["Niet-ondersteund grafiektype: %s"],"a8c-agentticToday":["Vandaag"],"a8c-agentticThis action is no longer available or cannot be performed":["Deze actie is niet langer beschikbaar of kan niet worden uitgevoerd"],"a8c-agentticThinking…":["Denken…"],"a8c-agentticStop processing":["Stop met verwerken"],"a8c-agentticSend message":["Stuur bericht"],"a8c-agentticRemove image":["Verwijder afbeelding"],"a8c-agentticOpen chat":["Open chat"],"a8c-agentticOnly %s image files are allowed.":["Alleen %s afbeeldingsbestanden zijn toegestaan."],"a8c-agentticNo data points found for chart":["Geen gegevenspunten gevonden voor grafiek"],"a8c-agentticNo chart data available":["Geen grafiekgegevens beschikbaar"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Bericht is te lang. Houd het onder de %d tekens."],"a8c-agentticMaximum %d files allowed.":["Maximaal %d bestanden toegestaan."],"a8c-agentticInvalid chart data provided":["Ongeldig grafiekgegevens geleverd"],"a8c-agentticFailed to parse chart data as JSON":["Kon de grafiekgegevens niet als JSON parseren"],"a8c-agentticExpand conversation":["Gesprek uitbreiden"],"a8c-agentticDrop files here to use":["Sleep bestanden hierheen om te gebruiken"],"a8c-agentticClose conversation":["Gesprek sluiten"],"a8c-agentticClick to upload images or drag and drop":["Klik om afbeeldingen te uploaden of sleep en zet neer"],"a8c-agentticChart data must include chartType":["Grafiekgegevens moeten chartType bevatten"],"a8c-agentticChart data must include a data array":["Grafiekgegevens moeten een data array bevatten"],"a8c-agentticAvailable types: line, bar":["Beschikbare types: lijn, staaf"],"a8c-agentticAsk anything":["Vraag iets"],"a8c-agenttic%d days ago":["%d dagen geleden"]}},og={"translation-revision-date":"2025-10-08 20:39:47+0000",generator:ng,domain:ig,locale_data:ag},rg=Object.freeze(Object.defineProperty({__proto__:null,default:og,domain:ig,generator:ng,locale_data:ag},Symbol.toStringTag,{value:"Module"})),sg="GlotPress/2.4.0-alpha",lg="messages",cg={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=(n > 1);",lang:"pt_BR"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Seu WordPress AI — pronto para ajudar a projetar, editar e lançar."],"a8c-agentticYesterday":["Ontem"],"a8c-agentticUpload image files up to %s each.":["Fazer upload de arquivos de imagem de até %s cada."],"a8c-agentticUnsupported chart type: %s":["Tipo de gráfico não suportado: %s"],"a8c-agentticToday":["Hoje"],"a8c-agentticThis action is no longer available or cannot be performed":["Esta ação não está mais disponível ou não pode ser realizada"],"a8c-agentticThinking…":["Pensando…"],"a8c-agentticStop processing":["Parar processamento"],"a8c-agentticSend message":["Enviar mensagem"],"a8c-agentticRemove image":["Remover Imagem"],"a8c-agentticOpen chat":["Abra o chat"],"a8c-agentticOnly %s image files are allowed.":["Apenas arquivos de imagem %s são permitidos."],"a8c-agentticNo data points found for chart":["Nenhum ponto de dados encontrado para o gráfico"],"a8c-agentticNo chart data available":["Não há dados de gráfico disponíveis"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["A mensagem é muito longa. Por favor, mantenha-a abaixo de %d caracteres."],"a8c-agentticMaximum %d files allowed.":["Máximo de %d arquivos permitidos."],"a8c-agentticInvalid chart data provided":["Dados de gráfico inválidos fornecidos"],"a8c-agentticFailed to parse chart data as JSON":["Falha ao analisar os dados do gráfico como JSON"],"a8c-agentticExpand conversation":["Expandir conversa"],"a8c-agentticDrop files here to use":["Arraste arquivos aqui para usar"],"a8c-agentticClose conversation":["Fechar conversa"],"a8c-agentticClick to upload images or drag and drop":["Clique para fazer upload de imagens ou arraste e solte"],"a8c-agentticChart data must include chartType":["Os dados do gráfico devem incluir chartType"],"a8c-agentticChart data must include a data array":["Os dados do gráfico devem incluir um array de dados"],"a8c-agentticAvailable types: line, bar":["Tipos disponíveis: linha, barra"],"a8c-agentticAsk anything":["Pergunte qualquer coisa"],"a8c-agenttic%d days ago":["%d dias atrás"]}},ug={"translation-revision-date":"2025-10-08 20:39:43+0000",generator:sg,domain:lg,locale_data:cg},dg=Object.freeze(Object.defineProperty({__proto__:null,default:ug,domain:lg,generator:sg,locale_data:cg},Symbol.toStringTag,{value:"Module"})),hg="GlotPress/2.4.0-alpha",pg="messages",fg={messages:{"":{domain:"messages","plural-forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);",lang:"ru"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Ваш WordPress ИИ — готов помочь в дизайне, редактировании и запуске."],"a8c-agentticYesterday":["Вчера"],"a8c-agentticUpload image files up to %s each.":["Загрузка изображений размером до %s каждый."],"a8c-agentticUnsupported chart type: %s":["Неподдерживаемый тип диаграммы: %s"],"a8c-agentticToday":["Сегодня"],"a8c-agentticThis action is no longer available or cannot be performed":["Это действие больше недоступно или не может быть выполнено"],"a8c-agentticThinking…":["Думаю…"],"a8c-agentticStop processing":["Остановить обработку"],"a8c-agentticSend message":["Отправить сообщение"],"a8c-agentticRemove image":["Удалить изображение"],"a8c-agentticOpen chat":["Открыть чат"],"a8c-agentticOnly %s image files are allowed.":["Разрешены только файлы изображений %s."],"a8c-agentticNo data points found for chart":["Не найдено данных для графика"],"a8c-agentticNo chart data available":["Нет доступных данных для графика"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Сообщение слишком длинное. Пожалуйста, сократите его до %d символов."],"a8c-agentticMaximum %d files allowed.":["Максимум %d файлов разрешено."],"a8c-agentticInvalid chart data provided":["Предоставлены неверные данные для графика"],"a8c-agentticFailed to parse chart data as JSON":["Не удалось разобрать данные графика как JSON"],"a8c-agentticExpand conversation":["Развернуть разговор"],"a8c-agentticDrop files here to use":["Перетащите файлы сюда для использования"],"a8c-agentticClose conversation":["Закрыть разговор"],"a8c-agentticClick to upload images or drag and drop":["Нажмите, чтобы загрузить изображения или перетащите и отпустите"],"a8c-agentticChart data must include chartType":["Данные графика должны включать chartType"],"a8c-agentticChart data must include a data array":["Данные для графика должны включать массив данных"],"a8c-agentticAvailable types: line, bar":["Доступные типы: линия, столбец"],"a8c-agentticAsk anything":["Спроси что угодно"],"a8c-agenttic%d days ago":["%d дней назад"]}},mg={"translation-revision-date":"2025-10-08 20:39:47+0000",generator:hg,domain:pg,locale_data:fg},gg=Object.freeze(Object.defineProperty({__proto__:null,default:mg,domain:pg,generator:hg,locale_data:fg},Symbol.toStringTag,{value:"Module"})),yg="GlotPress/2.4.0-alpha",vg="messages",xg={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"sv_SE"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Din WordPress AI – redo att hjälpa till med design, redigering och lansering."],"a8c-agentticYesterday":["Igår"],"a8c-agentticUpload image files up to %s each.":["Ladda upp bildfiler upp till %s vardera."],"a8c-agentticUnsupported chart type: %s":["Ej stödd diagramtyp: %s"],"a8c-agentticToday":["Idag"],"a8c-agentticThis action is no longer available or cannot be performed":["Denna åtgärd är inte längre tillgänglig eller kan inte utföras"],"a8c-agentticThinking…":["Tänker …"],"a8c-agentticStop processing":["Stoppa bearbetning"],"a8c-agentticSend message":["Skicka meddelande"],"a8c-agentticRemove image":["Ta bort bild"],"a8c-agentticOpen chat":["Öppna chatt"],"a8c-agentticOnly %s image files are allowed.":["Endast %s bildfiler är tillåtna."],"a8c-agentticNo data points found for chart":["Inga datapunkter hittades för diagrammet"],"a8c-agentticNo chart data available":["Inga diagramdata tillgängliga"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Meddelande är för långt. Håll det under %d tecken."],"a8c-agentticMaximum %d files allowed.":["Maximalt %d filer tillåtna."],"a8c-agentticInvalid chart data provided":["Ogiltig diagramdata angiven"],"a8c-agentticFailed to parse chart data as JSON":["Misslyckades med att tolka diagramdata som JSON"],"a8c-agentticExpand conversation":["Expandera konversation"],"a8c-agentticDrop files here to use":["Släpp filer här för att använda"],"a8c-agentticClose conversation":["Stäng konversation"],"a8c-agentticClick to upload images or drag and drop":["Klicka för att ladda upp bilder eller dra och släpp"],"a8c-agentticChart data must include chartType":["Diagramdata måste inkludera chartType"],"a8c-agentticChart data must include a data array":["Diagramdata måste inkludera en data array"],"a8c-agentticAvailable types: line, bar":["Tillgängliga typer: linje, stapel"],"a8c-agentticAsk anything":["Fråga vad som helst"],"a8c-agenttic%d days ago":["%d dagar sedan"]}},bg={"translation-revision-date":"2025-10-14 09:33:52+0000",generator:yg,domain:vg,locale_data:xg},wg=Object.freeze(Object.defineProperty({__proto__:null,default:bg,domain:vg,generator:yg,locale_data:xg},Symbol.toStringTag,{value:"Module"})),kg="GlotPress/2.4.0-alpha",Sg="messages",Cg={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=(n > 1);",lang:"tr"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["WordPress AI'niz — tasarım, düzenleme ve başlatma konusunda yardımcı olmaya hazır."],"a8c-agentticYesterday":["Dün"],"a8c-agentticUpload image files up to %s each.":["Görsel dosyalarını %s kadar karşıya yükle."],"a8c-agentticUnsupported chart type: %s":["Desteklenmeyen grafik türü: %s"],"a8c-agentticToday":["Bugün"],"a8c-agentticThis action is no longer available or cannot be performed":["Bu işlem artık mevcut değil veya gerçekleştirilemez."],"a8c-agentticThinking…":["Düşünüyorum…"],"a8c-agentticStop processing":["İşlemi durdur"],"a8c-agentticSend message":["Mesaj gönder"],"a8c-agentticRemove image":["Görseli kaldır"],"a8c-agentticOpen chat":["sohbeti aç"],"a8c-agentticOnly %s image files are allowed.":["Sadece %s görsel dosyasına izin verilir."],"a8c-agentticNo data points found for chart":["Grafik için veri noktası bulunamadı"],"a8c-agentticNo chart data available":["Hiçbir grafik verisi mevcut değil"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Mesaj çok uzun. Lütfen %d karakterin altında tut."],"a8c-agentticMaximum %d files allowed.":["En fazla %d dosya izin verilir."],"a8c-agentticInvalid chart data provided":["Geçersiz grafik verisi sağlandı"],"a8c-agentticFailed to parse chart data as JSON":["Grafik verilerini JSON olarak ayrıştırma başarısız oldu"],"a8c-agentticExpand conversation":["Konuşmayı genişlet"],"a8c-agentticDrop files here to use":["Buraya dosyaları bırakın kullanmak için"],"a8c-agentticClose conversation":["Konuşmayı kapat"],"a8c-agentticClick to upload images or drag and drop":["Görsel karşıya yüklemek için tıkla veya sürükleyip bırak"],"a8c-agentticChart data must include chartType":["Grafik verileri chartType içermelidir"],"a8c-agentticChart data must include a data array":["Grafik verileri bir veri dizilimi içermelidir"],"a8c-agentticAvailable types: line, bar":["Mevcut türler: çubuk, çubuk"],"a8c-agentticAsk anything":["Her şeyi sor"],"a8c-agenttic%d days ago":["%d gün önce"]}},Tg={"translation-revision-date":"2025-10-08 20:39:48+0000",generator:kg,domain:Sg,locale_data:Cg},Pg=Object.freeze(Object.defineProperty({__proto__:null,default:Tg,domain:Sg,generator:kg,locale_data:Cg},Symbol.toStringTag,{value:"Module"})),Eg="GlotPress/2.4.0-alpha",Ag="messages",Ig={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"zh_CN"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["您的 WordPress AI — 随时准备帮助设计、编辑和发布。"],"a8c-agentticYesterday":["昨天"],"a8c-agentticUpload image files up to %s each.":["上传图像文件,每个文件最多 %s。"],"a8c-agentticUnsupported chart type: %s":["不支持的图表类型: %s"],"a8c-agentticToday":["今天"],"a8c-agentticThis action is no longer available or cannot be performed":["此操作不再可用或无法执行"],"a8c-agentticThinking…":["思考中…"],"a8c-agentticStop processing":["停止处理"],"a8c-agentticSend message":["发送消息"],"a8c-agentticRemove image":["移除图像"],"a8c-agentticOpen chat":["打开聊天"],"a8c-agentticOnly %s image files are allowed.":["只允许 %s 图像文件。"],"a8c-agentticNo data points found for chart":["未找到图表的数据点"],"a8c-agentticNo chart data available":["没有可用的图表数据"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["消息太长了。请保持在 %d 个字符以内。"],"a8c-agentticMaximum %d files allowed.":["最多允许 %d 个文件。"],"a8c-agentticInvalid chart data provided":["提供的图表数据无效"],"a8c-agentticFailed to parse chart data as JSON":["无法将图表数据解析为 JSON"],"a8c-agentticExpand conversation":["展开对话"],"a8c-agentticDrop files here to use":["将文件拖到这里使用"],"a8c-agentticClose conversation":["关闭对话"],"a8c-agentticClick to upload images or drag and drop":["点击上传图像或拖放"],"a8c-agentticChart data must include chartType":["图表数据必须包含 chartType"],"a8c-agentticChart data must include a data array":["图表数据必须包含一个数据数组"],"a8c-agentticAvailable types: line, bar":["可用类型:线,柱"],"a8c-agentticAsk anything":["问任何事情"],"a8c-agenttic%d days ago":["%d 天前"]}},Mg={"translation-revision-date":"2025-10-08 20:39:49+0000",generator:Eg,domain:Ag,locale_data:Ig},jg=Object.freeze(Object.defineProperty({__proto__:null,default:Mg,domain:Ag,generator:Eg,locale_data:Ig},Symbol.toStringTag,{value:"Module"})),Dg="GlotPress/2.4.0-alpha",Lg="messages",Rg={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"zh_TW"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["你的 WordPress AI — 隨時準備幫助設計、編輯和啟動。"],"a8c-agentticYesterday":["昨天"],"a8c-agentticUpload image files up to %s each.":["上傳每個圖像檔案最多 %s。"],"a8c-agentticUnsupported chart type: %s":["不支援的圖表類型: %s"],"a8c-agentticToday":["今天"],"a8c-agentticThis action is no longer available or cannot be performed":["此操作不再可用或無法執行"],"a8c-agentticThinking…":["思考中…"],"a8c-agentticStop processing":["停止處理"],"a8c-agentticSend message":["發送訊息"],"a8c-agentticRemove image":["移除圖片"],"a8c-agentticOpen chat":["開啟聊天"],"a8c-agentticOnly %s image files are allowed.":["只允許 %s 圖像檔案。"],"a8c-agentticNo data points found for chart":["找不到圖表的數據點"],"a8c-agentticNo chart data available":["沒有可用的圖表數據"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["訊息太長了。請保持在 %d 個字元以內。"],"a8c-agentticMaximum %d files allowed.":["最多允許 %d 個檔案。"],"a8c-agentticInvalid chart data provided":["提供的圖表數據無效的"],"a8c-agentticFailed to parse chart data as JSON":["無法將圖表數據解析為 JSON"],"a8c-agentticExpand conversation":["擴展對話"],"a8c-agentticDrop files here to use":["將檔案拖到這裡使用"],"a8c-agentticClose conversation":["關閉對話"],"a8c-agentticClick to upload images or drag and drop":["點擊上傳圖片或拖放"],"a8c-agentticChart data must include chartType":["圖表數據必須包含 chartType"],"a8c-agentticChart data must include a data array":["圖表數據必須包含一個數據 array"],"a8c-agentticAvailable types: line, bar":["可用類型:線圖、條形圖"],"a8c-agentticAsk anything":["問任何事"],"a8c-agenttic%d days ago":["%d 天前"]}},Og={"translation-revision-date":"2025-10-08 20:39:50+0000",generator:Dg,domain:Lg,locale_data:Rg},Ng=Object.freeze(Object.defineProperty({__proto__:null,default:Og,domain:Lg,generator:Dg,locale_data:Rg},Symbol.toStringTag,{value:"Module"})),_g=Object.assign({"../../../../languages/wpcom-agenttic-ar.jed.json":mm,"../../../../languages/wpcom-agenttic-de.jed.json":bm,"../../../../languages/wpcom-agenttic-es.jed.json":Tm,"../../../../languages/wpcom-agenttic-fr.jed.json":Mm,"../../../../languages/wpcom-agenttic-he.jed.json":Om,"../../../../languages/wpcom-agenttic-id.jed.json":Bm,"../../../../languages/wpcom-agenttic-it.jed.json":Wm,"../../../../languages/wpcom-agenttic-ja.jed.json":Xm,"../../../../languages/wpcom-agenttic-ko.jed.json":tg,"../../../../languages/wpcom-agenttic-nl.jed.json":rg,"../../../../languages/wpcom-agenttic-pt-br.jed.json":dg,"../../../../languages/wpcom-agenttic-ru.jed.json":gg,"../../../../languages/wpcom-agenttic-sv.jed.json":wg,"../../../../languages/wpcom-agenttic-tr.jed.json":Pg,"../../../../languages/wpcom-agenttic-zh-cn.jed.json":jg,"../../../../languages/wpcom-agenttic-zh-tw.jed.json":Ng}),Vg={};Object.entries(_g).forEach(([e,t])=>{const n=e.split("/").pop().replace("wpcom-agenttic-","").replace(".jed.json","");Vg[n]=t.default});const Fg="agenttic-chat-position";const Bg={type:"spring",stiffness:300,damping:30},zg={type:"spring",damping:40,stiffness:500,mass:.8},Ug={...zg,stiffness:1e3,damping:90},Hg={type:"spring",damping:40,stiffness:500,mass:.8},$g={hidden:{opacity:0},visible:{opacity:1,transition:Bg},exit:{opacity:0,transition:{...Bg,duration:.1}}},Wg=(Symbol.toStringTag,(0,h.createContext)(null));function qg(){const e=(0,h.useContext)(Wg);if(!e)throw new Error("useAgentUIContext must be used within an AgentUIContainer");return e}function Kg({children:e,value:t}){return(0,ve.jsx)(Wg.Provider,{value:t,children:e})}const Yg={button:"button-module_button",pressed:"button-module_pressed",primary:"button-module_primary",ghost:"button-module_ghost",outline:"button-module_outline",transparent:"button-module_transparent",link:"button-module_link",icon:"button-module_icon",sm:"button-module_sm",lg:"button-module_lg",withTextAndIcon:"button-module_withTextAndIcon"},Gg=h.forwardRef(function({className:e,variant:t="primary",size:n,icon:i,children:a,asChild:o=!1,pressed:r=!1,...s},l){const c=o?mc:"button",u=!!i,d=n||(u&&!a?"icon":void 0);return(0,ve.jsxs)(c,{ref:l,"data-slot":"button",className:sm(Yg.button,Yg[t],d&&Yg[d],u&&a?Yg.withTextAndIcon:void 0,r?Yg.pressed:void 0,e),"aria-pressed":r,...s,children:[i,a]})});function Xg({className:e,size:t=24}){return(0,ve.jsx)("svg",{className:e,width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{d:"M19.6611 11.5224L16.3782 10.39C15.0799 9.94387 14.0561 8.92011 13.61 7.62181L12.4775 4.33887C12.3231 3.88704 11.6769 3.88704 11.5225 4.33887L10.39 7.62181C9.94388 8.92011 8.9201 9.94387 7.6218 10.39L4.33887 11.5224C3.88704 11.6768 3.88704 12.3231 4.33887 12.4776L7.6218 13.61C8.9201 14.0561 9.94388 15.0799 10.39 16.3782L11.5225 19.6611C11.6769 20.113 12.3231 20.113 12.4775 19.6611L13.61 16.3782C14.0561 15.0799 15.0799 14.0561 16.3782 13.61L19.6611 12.4776C20.113 12.3231 20.113 11.6768 19.6611 11.5224ZM15.8291 12.2431L14.1876 12.8093C13.5356 13.0323 13.0266 13.5471 12.8036 14.1934L12.2374 15.8348C12.1572 16.0636 11.837 16.0636 11.7569 15.8348L11.1907 14.1934C10.9677 13.5414 10.4529 13.0323 9.80662 12.8093L8.16515 12.2431C7.93637 12.163 7.93637 11.8427 8.16515 11.7626L9.80662 11.1964C10.4586 10.9734 10.9677 10.4586 11.1907 9.81233L11.7569 8.17087C11.837 7.94209 12.1572 7.94209 12.2374 8.17087L12.8036 9.81233C13.0266 10.4643 13.5414 10.9734 14.1876 11.1964L15.8291 11.7626C16.0579 11.8427 16.0579 12.163 15.8291 12.2431Z",fill:"currentColor"})})}Gg.displayName="Button";function Jg({icon:e=(0,ve.jsx)(Xg,{size:36}),onClick:t,onHover:n,focusOnMount:i=!1}){const a=(0,h.useRef)(null),o=(0,h.useRef)(i);return(0,h.useEffect)(()=>{o.current&&a.current&&a.current.focus(),o.current=!1},[o,a]),(0,ve.jsx)(Il.div,{"data-slot":"collapsed-view",layout:"preserve-aspect",layoutId:"collapsed-button",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,transition:{...Hg,delay:.2}},exit:{opacity:0,scale:0,transition:{duration:.15}},children:(0,ve.jsx)(Gg,{ref:a,onClick:t,onMouseEnter:n,variant:"link",className:"CollapsedView-module_button",icon:e,"aria-label":(0,cc.__)("Open chat","a8c-agenttic")})})}const Zg=h.forwardRef(({className:e,...t},n)=>(0,ve.jsx)("textarea",{"data-slot":"textarea",className:"Textarea-module_textarea",ref:n,...t}));function Qg({className:e,size:t=24}){return(0,ve.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,ve.jsx)("path",{d:"M12.2197 5C12.4186 5 12.6094 5.07902 12.75 5.21967L17 9.46967C17.2929 9.76256 17.2929 10.2374 17 10.5303C16.7071 10.8232 16.2322 10.8232 15.9393 10.5303L12.9697 7.56067V18.25C12.9697 18.6642 12.6339 19 12.2197 19C11.8055 19 11.4697 18.6642 11.4697 18.25V7.56065L8.5 10.5303C8.2071 10.8232 7.73223 10.8232 7.43934 10.5303C7.14644 10.2374 7.14645 9.76256 7.43934 9.46967L11.6894 5.21967C11.83 5.07902 12.0208 5 12.2197 5Z",fill:"currentColor"})})}function ey({className:e,size:t=24}){return(0,ve.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,ve.jsx)("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"})})}Zg.displayName="Textarea";const ty="ChatInput-module_button";function ny({className:e,size:t=24}){return(0,ve.jsx)("svg",{className:e,width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0045 13.4451L12 7.9864L5.9955 13.4451L7.00451 14.5549L12 10.0136L16.9955 14.5549L18.0045 13.4451Z",fill:"currentColor"})})}function iy({texts:e,interval:t=3e3,className:n=""}){const[i,a]=(0,h.useState)(0);return(0,h.useEffect)(()=>{const n=setInterval(()=>{a(t=>(t+1)%e.length)},t);return()=>clearInterval(n)},[e.length,t]),(0,ve.jsx)(_l,{mode:"wait",children:(0,ve.jsx)(Il.span,{"data-slot":"animated-placeholder",className:sm("AnimatedPlaceholder-module_container",n),initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.3,ease:[.4,0,.2,1]},children:e[i]},i)})}function ay({value:e,onChange:t,onSubmit:n,onKeyDown:i,textareaRef:a,placeholder:o=(0,cc.__)("Ask anything","a8c-agenttic"),isProcessing:r,onBlur:s,onFocus:l,onClick:c,fromCompact:u=!1,onExpand:d,showExpandButton:p=!0,focusOnMount:f=!1,customActions:m=[],actionOrder:g="before-submit",onStop:y,disabled:v,onMouseEnter:x,onMouseLeave:b,expandOnClick:w=!1,layout:k="inline"}){const S=(0,h.useId)(),{variant:C,floatingChatState:T,isInputOverLimit:P}=qg(),E=void 0!==v?!v:(e.trim()||r)&&!P,A=(0,h.useCallback)(e=>{const t=e.key.toLowerCase();("enter"!==t||e.shiftKey||!e.nativeEvent.isComposing&&229!==e.keyCode)&&("enter"!==t||e.shiftKey||E)?(((e.metaKey||e.ctrlKey)&&"z"===t||e.ctrlKey&&"y"===t)&&e.stopPropagation(),i(e)):e.preventDefault()},[E,i]),I=e=>e.endsWith("…")?e:`${e}…`,M=Array.isArray(o);let j;j=M?o.map(I):o?I(o):"";const D=(0,h.useRef)(f);(0,h.useEffect)(()=>{D.current&&a.current&&a.current.focus(),D.current=!1},[D,a]);const L=()=>m.map(e=>(0,ve.jsx)(Gg,{className:e.className||ty,onClick:e.onClick,disabled:e.disabled,variant:e.variant||"ghost",icon:e.icon,"aria-label":e["aria-label"]},e.id));return(0,ve.jsxs)("div",{"data-slot":"chat-input",className:"ChatInput-module_container"+("stacked"===k?" ChatInput-module_containerStacked":""),onMouseEnter:x,onMouseLeave:b,children:[(0,ve.jsxs)(Il.div,{className:"ChatInput-module_textareaContainer",initial:{opacity:0},animate:{opacity:1,scale:1,transition:e.trim()?{duration:0}:Ug},children:[!e&&M&&(0,ve.jsx)(iy,{texts:j}),(0,ve.jsx)(Zg,{id:S,ref:a,value:e,onChange:e=>t(e.target.value),onKeyDown:A,onBlur:s,onFocus:l,onClick:c,placeholder:M?"":j,rows:1,"aria-label":(0,cc.__)("Chat input","a8c-agenttic")})]}),(0,ve.jsxs)(Il.div,{className:"ChatInput-module_actions",initial:{opacity:u?1:0,scale:u?1:.5},animate:{opacity:1,scale:1,transition:e.trim()?{duration:0}:zg},children:["embedded"===C||"expanded"===T||w?null:p&&d?(0,ve.jsx)(Gg,{className:ty,onClick:d,variant:"ghost",icon:(0,ve.jsx)(ny,{}),"aria-label":(0,cc.__)("Expand conversation","a8c-agenttic")}):null,"before-submit"===g&&L(),r&&!y?null:(0,ve.jsx)(Gg,{className:ty,onClick:()=>{r&&y?y():n()},disabled:!E,variant:"primary",icon:r?(0,ve.jsx)(ey,{}):(0,ve.jsx)(Qg,{}),"aria-label":r?(0,cc.__)("Stop processing","a8c-agenttic"):(0,cc.__)("Send message","a8c-agenttic")}),"after-submit"===g&&L()]})]})}const oy=({className:e,suggestions:t,onSubmit:n,layout:i="horizontal",visible:a=!0,onMouseEnter:o,onMouseLeave:r,translateY:s="-100%"})=>{const{variant:l}=qg(),c=(0,h.useMemo)(()=>"floating"===l?null==t?void 0:t.slice(0,3):t,[t,l]);return c&&0!==c.length?(0,ve.jsx)(_l,{children:a&&(0,ve.jsx)(Il.div,{"data-slot":"suggestions",className:sm("Suggestions-module_container","vertical"===i?"Suggestions-module_vertical":"floating"===i?"Suggestions-module_floating":"",e),initial:{opacity:0,y:"-80%"},animate:{opacity:1,y:s},exit:{opacity:0,y:"-80%"},transition:Ug,onMouseEnter:o,onMouseLeave:r,children:c.map((e,t)=>(0,ve.jsx)(Il.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{...Ug,delay:.05*t},children:(0,ve.jsx)(Gg,{onClick:t=>{t.stopPropagation(),(async(e,t)=>{let i=!0;e.action&&(i=await e.action()),i&&n&&e.prompt&&n(e,t)})(e,c)},variant:"outline",className:"Suggestions-module_button",children:e.label})},e.id))})}):null};function ry({value:e,onChange:t,onSubmit:n,onKeyDown:i,textareaRef:a,placeholder:o,isProcessing:r,onBlur:s,onFocus:l,onExpand:c,showExpandButton:u=!0,focusOnMount:d=!1,customActions:p,actionOrder:f,onStop:m,suggestions:g,clearSuggestions:y,handleSuggestionSubmit:v,expandOnClick:x=!1}){const[b,w]=(0,h.useState)(!1),{setNamedTimeout:k,clearAllTimeouts:S}=function(){const e=(0,h.useRef)(new Map),t=(0,h.useCallback)(t=>{const n=e.current.get(t);n&&(clearTimeout(n),e.current.delete(t))},[]),n=(0,h.useCallback)((n,i,a)=>{t(n);const o=setTimeout(i,a);return e.current.set(n,o),o},[t]),i=(0,h.useCallback)(()=>{e.current.forEach(e=>{clearTimeout(e)}),e.current.clear()},[]),a=(0,h.useCallback)(t=>e.current.has(t),[]);return(0,h.useEffect)(()=>i,[i]),{setNamedTimeout:n,clearNamedTimeout:t,clearAllTimeouts:i,hasTimeout:a}}(),C=(0,h.useCallback)(()=>{k("hide-suggestions",()=>{w(!1)},4e3)},[k]),T=(0,h.useCallback)(()=>{x&&c&&!e&&c()},[x,c,e]);return(0,h.useEffect)(()=>{S(),e?w(!1):g&&0!==g.length?(w(!0),C()):w(!1)},[e,g,S,k,y,C]),(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(ay,{value:e,onChange:t,onSubmit:n,onKeyDown:i,textareaRef:a,placeholder:o,isProcessing:r,onBlur:s,onFocus:l,onClick:T,onExpand:c,showExpandButton:u,focusOnMount:d,customActions:p,actionOrder:f,onStop:m,expandOnClick:x,onMouseEnter:()=>{S(),w(!0)},onMouseLeave:()=>C()}),!e&&(0,ve.jsx)(oy,{suggestions:g,onSubmit:v,layout:"floating",visible:b,onMouseEnter:()=>{S(),w(!0)},onMouseLeave:()=>C()})]})}const sy="Chat-module_container",ly="Chat-module_expanded";function cy(){return(0,ve.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,cursor:"grabbing",pointerEvents:"auto",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}})}function uy({children:e,messages:t,isProcessing:n,error:i,onSubmit:a,variant:o="floating",triggerIcon:r,placeholder:s,notice:l,onOpen:c,onExpand:u,onClose:d,onStop:p,emptyView:f,floatingChatState:m,suggestions:g,clearSuggestions:y,onSuggestionClick:v,messageRenderer:x,messagesPosition:b,className:w,inputValue:k,onInputChange:S,draggableStates:C=["expanded"],locale:T="en",maxInputLength:P=600,onInputLimitExceeded:E,expandOnClick:A,expandOnHover:I=!0,thinkingMessage:M,initialChatPosition:j,onChatPositionChange:D,onTypingStatusChange:L}){const R=void 0!==k,[O,N]=(0,h.useState)(""),_=R?k:O,V=R?S:N,F=function(e){const t=e||"collapsed",[n,i]=(0,h.useState)(t);(0,h.useEffect)(()=>{void 0!==e&&i(e)},[e]);const a="collapsed"!==n&&"compact"!==n,o=(0,h.useCallback)(()=>{i("expanded")},[]),r=(0,h.useCallback)(()=>{i(t)},[t]),s=(0,h.useCallback)(()=>{i(e=>"collapsed"===e?"compact":"collapsed")},[]);return{state:n,initialState:t,setState:i,isOpen:a,open:o,close:r,toggle:s}}(m),B=(0,h.useRef)(!1),z=(0,h.useRef)(!1),U=(0,h.useRef)(!1),[H,$]=(0,h.useState)(!1),[W,q]=(0,h.useState)(!1),[K,Y]=(0,h.useState)(!1),G=function(){const[e,t]=(0,h.useState)(!0);return(0,h.useEffect)(()=>{const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("focus",e),window.addEventListener("blur",n),()=>{window.removeEventListener("focus",e),window.removeEventListener("blur",n)}},[]),e}(),[X,J]=(0,h.useState)(!1);(0,h.useEffect)(()=>{(function(e="en",t={}){if("en"===e)return!0;try{if(function(e,t){var n;const{domain:i="a8c-agenttic"}=t;try{const t=function(e){return Vg[e]||null}(e);if(!t)return console.warn(`Translations unavailable for locale: ${e}`),!1;const a=null==(n=t.locale_data)?void 0:n.messages;if(a){const t="",n=Object.fromEntries(Object.entries(a).map(([n,o])=>{var r;if(""===n)return["",{...a[""],domain:i,lang:(null==(r=a[""])?void 0:r.lang)||e}];const s=n.indexOf(t);return[s>-1?n.slice(s+1):n,o]}));(0,cc.setLocaleData)(n,i)}else(0,cc.setLocaleData)(t,i);return!0}catch(t){return console.warn(`Failed to load bundled translations for locale: ${e}`,t),!1}}(e,t))return!0}catch(t){console.warn(`Translation loading failed for locale ${e}`,t)}return!1})(T,{domain:"a8c-agenttic"})||console.warn(`Translations could not be loaded for locale: ${T}, defaulting to English`)},[T]),(0,h.useEffect)(()=>{const e=_.length>0,t=K&&G&&e;t!==X&&(J(t),null==L||L(t))},[K,G,_.length,X,L]);const Z=(0,h.useCallback)(()=>{Y(!0)},[]),Q=(0,h.useCallback)(()=>{Y(!1)},[]),ee=_.length>P;(0,h.useEffect)(()=>{ee&&(null==E||E())},[ee,E]),(0,h.useEffect)(()=>{B.current=!1,z.current=!1,U.current=!1},[F.state]);const te=(0,h.useRef)(new Set),ne=(0,h.useCallback)(()=>{te.current.forEach(e=>{clearTimeout(e)}),te.current.clear()},[]),ie=function({value:e,setValue:t,onSubmit:n,isProcessing:i,isInputOverLimit:a=!1,floatingChatState:o,disabled:r=!1}){const s=(0,h.useRef)(null),l=(0,h.useCallback)(()=>{t(""),s.current&&(s.current.style.height="auto",setTimeout(()=>{var e;null==(e=s.current)||e.focus()},100))},[t]),c=(0,h.useCallback)(()=>{const e=s.current;if(!e)return;e.style.height="auto";const t=e.scrollHeight;e.style.height=`${Math.min(Math.max(t,40),200)}px`},[]),u=(0,h.useCallback)(t=>{"Enter"===t.key&&!t.shiftKey&&!i&&!a&&!r&&(t.preventDefault(),n(e.trim()),l())},[e,i,a,n,l,r]);return(0,h.useEffect)(()=>{c()},[e,o,c]),{value:e,setValue:t,clear:l,textareaRef:s,handleKeyDown:u,adjustHeight:c}}({value:_,setValue:V,onSubmit:async e=>{"expanded"!==F.state&&(null==u||u()),F.setState("expanded"),await a(e)},isProcessing:n,isInputOverLimit:ee,floatingChatState:F.state}),[ae,oe]=(0,h.useState)(56),[re,se]=(0,h.useState)(function(e="left"){try{const e=localStorage.getItem(Fg);if("left"===e||"right"===e)return e}catch(e){console.warn("Failed to read chat position from localStorage:",e)}return e}(j)),le=(0,h.useRef)(null),ce=(0,h.useRef)(null),ue=(0,h.useRef)(null),de=Vl("right"===re?window.innerWidth-lm-32:0),he=Vl(0),pe=ia(Bl),fe=(0,h.useCallback)(async(e,t)=>{const n=e.prompt??e.label;if(e.autoSubmit){null==y||y();const e=n.trim();e&&await a(e)}else{const e=n.endsWith(" ")?n:`${n} `;ie.setValue(e),null==y||y(),ie.textareaRef.current&&(ie.textareaRef.current.focus(),ie.textareaRef.current.setSelectionRange(e.length,e.length))}null==v||v(e,t)},[y,a,v,ie]),me=(0,h.useCallback)(()=>{B.current=!0,F.open(),null==c||c(),null==u||u()},[F,c,u]),ge=(0,h.useCallback)(()=>{var e,t,n;const i=null==(t=null==(e=ue.current)?void 0:e.ownerDocument)?void 0:t.activeElement;return!(i&&null!=(n=ue.current)&&n.contains(i)||_.trim())},[_,ue]),ye=(0,h.useCallback)(e=>"collapsed"===e?56:"compact"===e?ae:520,[ae]),xe=(0,h.useCallback)(()=>{if(I&&"collapsed"===F.state&&(F.setState("compact"),"collapsed"===F.initialState)){const e=setTimeout(()=>{"compact"===F.state&&ge()&&F.setState("collapsed"),te.current.delete(e)},1500);te.current.add(e)}},[F,ge]),be=(0,h.useCallback)(()=>{if("collapsed"===F.initialState&&"compact"===F.state&&ge()){const e=setTimeout(()=>{"compact"===F.state&&ge()&&F.setState("collapsed"),te.current.delete(e)},1500);te.current.add(e)}},[F,ge]),we=(0,h.useCallback)(async()=>{const e=ie.value.trim();ie.clear(),"expanded"!==F.state&&(null==u||u()),F.setState("expanded"),await a(e)},[ie,a,F,u]),ke=(0,h.useCallback)(()=>{U.current=!0,null==u||u(),F.setState("expanded")},[u,F]),Se=(0,h.useCallback)(()=>{z.current=!0,ie.clear(),F.close(),d&&d()},[ie,F,d]),Ce=(0,h.useCallback)(e=>{if(!ue.current||!ce.current)return null;const t=ue.current.getBoundingClientRect(),n=ce.current.getBoundingClientRect(),i=window.getComputedStyle(ue.current),a=new DOMMatrixReadOnly(i.transform),o=t.x-a.e,r=t.y-a.f,s=e??re,l=ye(F.state);return{x:("left"===s?n.left:n.right-lm)-o,y:n.bottom-l-r}},[re,F.state,ye]),Te=(0,h.useCallback)(e=>{const t=e.target;t.ownerDocument===document&&(t.closest(um.NON_DRAGGABLE_SELECTORS)||(e.preventDefault(),pe.start(e.nativeEvent)))},[pe]),Pe=(0,h.useCallback)(()=>{q(!0)},[]),Ee=(0,h.useCallback)((e,t)=>{q(!1);const n=t.point.x,i=n<(window.innerWidth-372)/2?"left":"right";re!==i&&(se(i),function(e){try{localStorage.setItem(Fg,e)}catch(e){console.warn("Failed to save chat position to localStorage:",e)}}(i),null==D||D(i));const a=Ce(i);a&&(lc(de,a.x,{...um.SPRING_CONFIG,velocity:t.velocity.x*um.VELOCITY_MULTIPLIER}),lc(he,a.y,{...um.SPRING_CONFIG,velocity:t.velocity.y*um.VELOCITY_MULTIPLIER}))},[de,he,Ce,D,re]),Ae=(0,h.useRef)(F.state),Ie="compact"===Ae.current&&"expanded"===F.state;(0,h.useEffect)(()=>{ne(),Ae.current=F.state},[F.state,ne]),(0,h.useEffect)(()=>{const e=()=>{const e=Ce();e&&(de.set(e.x),he.set(e.y))};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[F.state,de,he,Ce]),(0,h.useEffect)(()=>{const e=te.current;return()=>{e.forEach(e=>{clearTimeout(e)}),e.clear()}},[]),(0,h.useEffect)(()=>{if("compact"===F.state&&le.current){const e=le.current.scrollHeight+16;oe(e)}},[F.state,ie.value]);const Me=f&&["floating","embedded"].includes(o)&&0===t.length&&h.isValidElement(f)?h.cloneElement(f,{onSuggestionClick:fe}):void 0,je=ee?{message:(0,cc.sprintf)( +(()=>{"use strict";var e,t,n,i,a={849(e){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},r=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,a=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(a)return a(e,n).value}return e[n]};e.exports=function e(){var t,n,i,a,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h{if("declaration"!==e.type)return;const{property:i,value:a}=e;o?t(i,a,e):a&&(n=n||{},n[i]=a)}),n};const a=i(n(77))}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return a[e].call(n.exports,n,n.exports,r),n.exports}r.m=a,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"==typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"==typeof n.then)return n}var a=Object.create(null);r.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&i&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>o[e]=()=>n[e]);return o.default=()=>n,r.d(a,o),a},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>e+".js?ver="+{222:"1d7b08e3b2d906807a0e",281:"105aed1fcbf7228ea4b4",954:"cc290b77914d31b14d41"}[e],r.miniCssF=e=>{},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i="openclawp:",r.l=(e,t,a,o)=>{if(n[e])n[e].push(t);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(p);var a=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach(e=>e(i)),t)return t(i)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={552:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var a=new Promise((n,a)=>i=e[t]=[n,a]);n.push(i[2]=a);var o=r.p+r.u(t),s=new Error;r.l(o,n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,a,[o,s,l]=n,c=0;if(o.some(t=>0!==e[t])){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);l&&l(r)}for(t&&t(n);cDc,booleanish:()=>Lc,commaOrSpaceSeparated:()=>Fc,commaSeparated:()=>_c,number:()=>Oc,overloadedBoolean:()=>Rc,spaceSeparated:()=>Nc});var l={};r.r(l),r.d(l,{attentionMarkers:()=>dh,contentInitial:()=>oh,disable:()=>hh,document:()=>ah,flow:()=>sh,flowInitial:()=>rh,insideSpan:()=>uh,string:()=>lh,text:()=>ch});const c=window.ReactDOM,u=window.wp.element,d=window.wp.components,h=window.React;var p=r.t(h,2);const f=(e,...t)=>{(function(){var e;return typeof globalThis<"u"&&"window"in globalThis&&"agenttic-client"===(null==(e=globalThis.window)?void 0:e.DEBUG)})()&&console.log(`[agenttic-client] ${e}`,...t)};function m(e){return JSON.stringify(e,null,2)}function g(e,...t){console.log(`[agenttic-client] ${e}`,...t)}window.wp.apiFetch;var y=Object.defineProperty,v=(e,t,n)=>((e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function x(){let e="";for(let t=0;t<8;t++)e+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()));return e}function b(){return x()}function w(e,t){return{type:"text",text:e,...t&&{metadata:t}}}function k(e){return e&&e.parts&&Array.isArray(e.parts)?e.parts.filter(e=>"text"===e.type).map(e=>e.text).join(" "):""}function S(e){if(!e||!e.parts||!Array.isArray(e.parts))return;const t=e.parts.find(e=>"progress"===e.type||"data"===e.type&&"summary"in e.data&&"string"==typeof e.data.summary);return t?{summary:t.data.summary,phase:t.data.phase}:void 0}function C(e){return{type:"data",data:{toolId:e.id,toolName:e.name,description:e.description,inputSchema:e.input_schema},metadata:{}}}function T(e){return{type:"data",data:{name:e.name,label:e.label,description:e.description,category:e.category,input_schema:e.input_schema,output_schema:e.output_schema,meta:e.meta},metadata:{}}}function P(e){return e&&e.parts&&Array.isArray(e.parts)?e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"toolId"in e.data&&"arguments"in e.data):[]}function E(e,t,n,i){return{type:"data",data:{toolCallId:e,toolId:t,result:n},metadata:i?{error:i}:void 0}}function A(e,t){const{contentType:n,...i}=t||{};return{role:"user",parts:[w(e,n?{contentType:n}:void 0)],kind:"message",messageId:b(),metadata:{timestamp:Date.now(),...i}}}function I(e){return{role:"agent",parts:[w(e)],kind:"message",messageId:b(),metadata:{timestamp:Date.now()}}}function M(e){return e&&"object"==typeof e&&"result"in e?{result:e.result,returnToAgent:!1!==e.returnToAgent,agentMessage:e.agentMessage}:{result:e,returnToAgent:!0}}function j(e,t=[]){return{role:"user",kind:"message",parts:[...t,...e],messageId:b(),metadata:{timestamp:Date.now()}}}function D(e,t=""){const n=[],i=t+e;let a="",o=0,r=0;for(;r0&&n.argumentFragments.push(e.content)}processDelta(e){switch(e.type){case"content":this.textContent+=e.content;break;case"tool_name":this.toolCalls.has(e.toolCallIndex)||this.toolCalls.set(e.toolCallIndex,{toolCallId:e.toolCallId,toolName:"",argumentFragments:[]}),this.toolCalls.get(e.toolCallIndex).toolName+=e.content;break;case"tool_argument":this.toolCalls.has(e.toolCallIndex)||this.toolCalls.set(e.toolCallIndex,{toolCallId:e.toolCallId,toolName:"",argumentFragments:[]}),this.toolCalls.get(e.toolCallIndex).argumentFragments.push(e.content)}}getTextContent(){return this.textContent}getCurrentMessage(e="agent"){const t=[];this.textContent&&t.push({type:"text",text:this.textContent});for(const[e,n]of this.toolCalls)if(n.toolName){const e=n.argumentFragments.join("");let i={};if(e)try{i=JSON.parse(e)}catch{i={_raw:e}}t.push({type:"data",data:{toolCallId:n.toolCallId,toolId:n.toolName,arguments:i}})}return{role:e,parts:t,kind:"message",messageId:b()}}reset(){this.textContent="",this.toolCalls.clear()}}function O(e,t,n="request"){throw clearTimeout(t),f("%s failed with error: %O",n,e),e instanceof Error&&(f("Error message: %s",e.message),f("Error stack: %s",e.stack)),e}function N(e,t="request"){if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`)}function _(e,t="request"){const n=new AbortController;return{timeoutId:setTimeout(()=>n.abort(),e),controller:n}}function F(e,t,n,i){f("Request: %s %s",e,t),f("Headers: %o",n),i&&f("Body: %s",m(i))}function V(e,t){if(!t)return e;const n=new AbortController,i=e=>{n.signal.aborted||n.abort(e.reason)};return e.aborted?n.abort(e.reason):e.addEventListener("abort",()=>i(e),{once:!0}),t.aborted?n.abort(t.reason):t.addEventListener("abort",()=>i(t),{once:!0}),n.signal}function B(e,t,n,i){const a={method:"POST",headers:e,body:t,signal:n};return void 0!==i&&(a.credentials=i),a}async function z(e,t,n,i,a,o){const{message:r,sessionId:s,taskId:l,metadata:c}=e,{agentId:u,agentUrl:d,authProvider:h,proxy:p}=t,{isStreaming:m=!1,enableTokenStreaming:g=!1}=n,y=s||o,v=function(e,t){return`${e}/${t}`}(d,u),b=await async function(e,t,n){let i=await async function(e,t){if(!t)return e;try{const n=[];if(t.getAvailableTools){const e=await t.getAvailableTools();if(e.length>0){const t=e.map(C);n.push(...t)}}if(t.getAbilities){const e=await t.getAbilities();if(e.length>0){const t=e.map(T);n.push(...t)}}return 0===n.length?e:{...e,parts:[...e.parts,...n]}}catch(t){return f("Warning: Failed to get tools: %s",t),e}}(e,t);i=function(e,t){if(!t)return e;try{const n=t.getClientContext();if(!n||0===Object.keys(n).length)return e;const i=function(e){return{type:"data",data:{clientContext:e},metadata:{}}}(n);return{...e,parts:[...e.parts,i]}}catch(t){return f("Warning: Failed to get context: %s",t),e}}(i,n);const{metadata:a,...o}=i;return o}(r,i,a),w={id:l,message:b,metadata:c};y&&(w.sessionId=y);const k=function(e,t="message/send",n=!1){const i={jsonrpc:"2.0",id:`req-${x()}`,method:t,params:{id:e.id||`task-${x()}`,...e}};return n&&"message/stream"===t&&(i.tokenStreaming=!0),i}(w,m?"message/stream":"message/send",g&&m),S=await async function(e,t=!1){const n={"Content-Type":"application/json"};if(t&&(n.Accept="text/event-stream"),e){const t=await e();return{...n,...t}}return n}(h,m);return F("POST",v,S,k),{request:k,headers:S,enhancedMessage:b,effectiveSessionId:y,fullAgentUrl:v}}async function U(e,t,n={}){const{request:i,headers:a,fullAgentUrl:o}=e,{timeout:r,credentials:s}=t,{abortSignal:l}=n,{timeoutId:c,controller:u}=_(r,"request"),d=l?V(u.signal,l):u.signal;try{const e=B(a,JSON.stringify(i),d,s);f("Making request to %s with options: %O",o,{method:e.method,headers:e.headers});const t=await fetch(o,e);clearTimeout(c),N(t,"request");const n=await t.json();return f("Response from %s: %d %O",o,t.status,m(n)),function(e,t="request"){if(e.error)throw new Error(`Protocol ${t} error: ${e.error.message}`);if(!e.result)throw new Error(`No result in ${t} response`);return e.result}(n,"request")}catch(e){O(e,c,"request")}}async function*H(e,t,n){const{request:i,headers:a,fullAgentUrl:o}=e,{credentials:r}=t,{streamingTimeout:s=6e4,abortSignal:l,enableTokenStreaming:c=!1}=n,{timeoutId:u,controller:d}=_(s,"streaming request"),h=l?V(d.signal,l):d.signal;try{const e=B(a,JSON.stringify(i),h,r),t=await fetch(o,e);if(clearTimeout(u),function(e,t="streaming request"){if(N(e,t),!e.body)throw new Error(`No response body for ${t}`)}(t,"streaming request"),!t.body)throw new Error("Response body is null - server may not support streaming");const n=c&&!0===i.tokenStreaming;yield*async function*(e,t={}){var n,i,a;const{supportDeltas:o=!1}=t,r=e.getReader(),s=new TextDecoder;let l="";const c=new R;let u=null,d=null;try{for(;;){const{done:e,value:t}=await r.read();if(e)break;const h=s.decode(t,{stream:!0}),{events:p,nextBuffer:m}=D(h,l);if(p&&Array.isArray(p))for(let e=0;e0&&"message/delta"===t.method&&typeof requestAnimationFrame<"u"&&await new Promise(e=>{requestAnimationFrame(()=>e(void 0))}),t.error)throw new Error(`Streaming error: ${t.error.message}`);if(o&&"message/delta"===t.method&&null!=(n=t.params)&&n.delta){const e=t.params.delta;try{let n=!1;L(e)?(c.processToolCallDelta(e),n=!0):"content"===e.deltaType&&(c.processContentDelta(e.content),n=!0),n&&(!u&&t.params.id&&(u=t.params.id),u&&(yield{id:u,status:{state:"working",message:c.getCurrentMessage()},final:!1,text:c.getTextContent()}))}catch(e){f("Failed to process delta: %o",e)}}else if(t.result&&t.result.status){u=t.result.id,d=t.result.status,(c.getTextContent()||c.getCurrentMessage().parts.length>0)&&c.reset();const e=(null==(i=t.result.status)?void 0:i.message)||{role:"agent",parts:[]},n=S(e);yield{id:t.result.id,sessionId:t.result.sessionId,status:t.result.status,final:"completed"===t.result.status.state||"failed"===t.result.status.state||"canceled"===t.result.status.state,text:k(e),progressMessage:null==n?void 0:n.summary,progressPhase:null==n?void 0:n.phase}}else if(t.id&&t.result&&(u=t.result.id,t.result.status)){const e=(null==(a=t.result.status)?void 0:a.message)||{role:"agent",parts:[]},n=S(e);yield{id:t.result.id,sessionId:t.result.sessionId,status:t.result.status,final:"completed"===t.result.status.state||"failed"===t.result.status.state||"canceled"===t.result.status.state,text:k(e),progressMessage:null==n?void 0:n.summary,progressPhase:null==n?void 0:n.phase}}}l=m}}finally{r.releaseLock()}}(t.body,{supportDeltas:n})}catch(e){O(e,u,"streaming request")}}const $=12e4;async function W(e,t,n,i,a){if(e.getAbilities){const o=await e.getAbilities();if(o.length>0)for(const r of o)if(t===r.name.replace(/\//g,"__").replace(/-/g,"_")||t===r.name){if(r.callback)try{const e={...n,...i&&{messageId:i},...a&&{toolCallId:a},...t&&{toolId:t}},o=await r.callback(e);return{result:o,returnToAgent:void 0===(null==o?void 0:o.returnToAgent)||o.returnToAgent,...(null==o?void 0:o.agentMessage)&&{agentMessage:o.agentMessage}}}catch(e){return f("Error executing ability %s: %O",r.name,e),{result:{error:e instanceof Error?e.message:String(e),success:!1},returnToAgent:!0}}if(!r.callback&&e.executeAbility)try{return{result:await e.executeAbility(r.name,n),returnToAgent:!0}}catch(e){return f("Error executing ability %s: %O",r.name,e),{result:{error:e instanceof Error?e.message:String(e),success:!1},returnToAgent:!0}}throw new Error(`Ability ${r.name} has no callback and no handler`)}}if(e.executeTool)return await e.executeTool(t,n,i,a);throw new Error(`No handler found for tool: ${t}. Tool provider must implement executeTool for non-ability tools.`)}const q=new Map;async function K(e,t){if(!e||!t||!e.getAvailableTools)return!1;const n=P(t);if(0===n.length)return!1;try{const t=await e.getAvailableTools();for(const e of n)if(t.some(t=>t.id===e.data.toolId))return!0}catch{return!1}return!1}function Y(e){return e.map(e=>{const t=e.data.toolCallId,n=q.get(t);if(n&&null!==n.resolvedValue){const i=n.resolvedValue;return i.error?E(t,e.data.toolId,void 0,i.error):E(t,e.data.toolId,i)}return e})}async function G(e,t,n){const i=[],a=[];let o=!1;for(const r of e){const{toolCallId:e,toolId:s,arguments:l}=r.data;try{const r=await W(t,s,l,n,e),{result:c,returnToAgent:u,agentMessage:d}=M(r);u&&(o=!0),d&&a.push(I(d)),i.push(E(e,s,c))}catch(t){o=!0,i.push(E(e,s,void 0,t instanceof Error?t.message:String(t)))}}return{results:i,shouldReturnToAgent:o,agentMessages:a}}function X(e){const t=[];for(const n of e)for(const e of n.parts)"text"===e.type?t.push({type:"data",data:{role:n.role,text:e.text}}):("data"===e.type||"file"===e.type)&&t.push(e);return t}async function J(e,t,n,i,a,o,r){const s=await z({message:t,taskId:e,sessionId:void 0},n,{isStreaming:!1},i,a,o);return await U(s,n,{abortSignal:r})}async function Z(e,t,n,i,a,o,r,s,l=[]){const c={message:t,taskId:e,sessionId:o},u=s||{isStreaming:!0};return Q(H(await z(c,n,{...u},i,a,o),n,{...u,abortSignal:r}),i,a,n,o,!0,l,r,u)}async function*Q(e,t,n,i,a,o=!0,r=[],s,l){var c,u,d,h,p,m,g,y,v,x,w,S;for await(const C of e){if(C.sessionId&&!a&&(a=C.sessionId),yield C,"running"===C.status.state&&C.status.message&&t&&await K(t,C.status.message)){const e=P(C.status.message);for(const n of e){const{toolCallId:e,toolId:i,arguments:a}=n.data;W(t,i,a,null==(u=null==(c=C.status)?void 0:c.message)?void 0:u.messageId,e).catch(e=>{f("Tool execution failed for %s: %O",i,e)})}yield{id:C.id,status:{state:"running",message:{role:"agent",kind:"message",parts:e,messageId:b()}},final:!1,text:""}}if("input-required"===C.status.state&&C.status.message&&t){const e=P(C.status.message);if(e.length>0){const c=[];let u=!1;const T=[],A=[];for(const n of e){const{toolCallId:e,toolId:i,arguments:a}=n.data;try{const n=await W(t,i,a,null==(h=null==(d=C.status)?void 0:d.message)?void 0:h.messageId,e),{result:o,returnToAgent:r,agentMessage:s}=M(n);if(r&&(u=!0),s&&A.push(I(s)),o.result instanceof Promise){const t=o.result,n={promise:t,resolvedValue:null};q.set(e,n),t.then(e=>{n.resolvedValue=e}).catch(t=>{f("Promise rejected for tool call %s: %O",e,t),n.resolvedValue={error:t instanceof Error?t.message:String(t)}})}const l=E(e,i,o);c.push(l),T.push(l)}catch(t){const n=E(e,i,void 0,t instanceof Error?t.message:String(t));c.push(n),T.push(n)}}if(r.push(C.status.message),c.length>0&&r.push({role:"agent",kind:"message",parts:c,messageId:b()}),u){const e=j([],X(r));yield{id:C.id,status:{state:"working",message:e},final:!1,text:""};const c=await Z(C.id,e,i,t,n,a,s,l,r);let u=null;for await(const e of c)e.final?u=e:yield e;if(!u)throw new Error("Continue task stream ended without final result");let d=null!=(p=u.status)&&p.message?P(u.status.message):[],h=u;if(d.length>0)for(yield{...u,final:!1,text:k((null==(m=u.status)?void 0:m.message)||{parts:[],messageId:b()})};d.length>0;){null!=(g=h.status)&&g.message&&r.push(h.status.message);const{results:e,shouldReturnToAgent:c}=await G(d,t,null==(v=null==(y=h.status)?void 0:y.message)?void 0:v.messageId);if(e.length>0&&(yield{id:h.id,status:{state:"working",message:{role:"agent",kind:"message",parts:e,messageId:b()}},final:!1,text:""}),!c)break;{const c=j(e,o?X(r):[]),u=await Z(h.id,c,i,t,n,a,s,l,r);let p=null;for await(const e of u)e.final?p=e:yield e;if(!p)throw new Error("Continue task stream ended without final result");h=p,d=null!=(x=h.status)&&x.message?P(h.status.message):[],d.length>0&&(yield{id:h.id,status:h.status,final:!1,text:k((null==(w=h.status)?void 0:w.message)||{parts:[],messageId:b()})})}}yield{...h,final:!0,text:k((null==(S=h.status)?void 0:S.message)||{parts:[],messageId:b()})}}else{const e={...C.status.message,parts:T},t={...C,status:{...C.status,message:e},final:0===A.length,text:k(e)};if(yield t,A.length>0){const e=A.map(e=>k(e)).join(" "),n=I(e);yield{id:t.id,status:{state:"completed",message:n},final:!0,text:e}}}}}}}function ee(e){const t=[];if(e.content){const n={type:"text",text:e.content};t.push(n)}const n=e.context;if(n&&!Array.isArray(n)&&Array.isArray(n.file_parts))for(const e of n.file_parts)if(null!=e&&e.uri){const n={type:"file",file:{name:"image",uri:e.uri},metadata:e.id?{id:e.id}:void 0};t.push(n)}if(n&&!Array.isArray(n)){const e=n,i=e.flags&&"object"==typeof e.flags&&null!==e.flags,a=Array.isArray(e.sources)&&e.sources.length>0;if(i||a){const n={};i&&(n.flags=e.flags),a&&(n.sources=e.sources),t.push({type:"data",data:n})}}const i="user"===e.role?"user":"agent",a=e.ts?1e3*e.ts:new Date(e.created_at.replace(" ","T")+"Z").getTime();return{role:i,kind:"message",parts:t,messageId:b(),metadata:{timestamp:a,serverId:e.message_id,chatId:e.chat_id}}}class te extends Error{constructor(e,t,n){super(e),this.statusCode=t,this.details=n,this.name="ServerConversationError"}}const ne="https://public-api.wordpress.com";async function ie(e,t,n=1,i=50,a=!1){const{botId:o,apiBaseUrl:r=ne,authProvider:s}=t;if(!e||!o)throw new Error("chatId and botId are required to load conversation from server");const l=Math.max(1,Math.min(n,100)),c=Math.max(1,Math.min(i,100)),u=new URL(`${r}/wpcom/v2/odie/chat/${encodeURIComponent(o)}/${encodeURIComponent(e)}`);u.searchParams.set("page_number",l.toString()),u.searchParams.set("items_per_page",c.toString()),f("Loading conversation from server: %s (page %d)",e,l);try{const e={"Content-Type":"application/json"};if(s){const t=await s();Object.assign(e,t)}const t=await fetch(u.toString(),{method:"GET",headers:e});if(!t.ok){const e=await t.text();let n=`Failed to load conversation from server: ${t.status} ${t.statusText}`;try{const t=JSON.parse(e);t.message&&(n=t.message)}catch{}const i=new te(n,t.status,e);throw f("Failed to load conversation from server: %O",i),i}const n=function(e,t=!1){var n,i,a,o,r,s;const l=e.messages.filter(e=>"tool_call"!==e.role&&("tool_result"!==e.role||!(!t||function(e){if("tool_call"!==e.role&&"tool_result"!==e.role)return!1;try{return"wpcom__think"===JSON.parse(e.content).tool_id}catch{return!1}}(e)))).map(ee);return{messages:l,pagination:{currentPage:(null==(n=e.metadata)?void 0:n.current_page)??1,itemsPerPage:(null==(i=e.metadata)?void 0:i.items_per_page)??10,totalPages:(null==(a=e.metadata)?void 0:a.total_pages)??1,totalMessages:(null==(o=e.metadata)?void 0:o.total_messages)??l.length,hasMore:((null==(r=e.metadata)?void 0:r.current_page)??1)<((null==(s=e.metadata)?void 0:s.total_pages)??1)},chatId:e.chat_id,sessionId:e.session_id}}(await t.json(),a);return f("Loaded %d messages from server (page %d/%d)",n.messages.length,n.pagination.currentPage,n.pagination.totalPages),n}catch(e){if(e instanceof te)throw e;const t=new te(`Network error loading conversation: ${e.message}`,void 0,e);throw f("Network error loading conversation: %O",e),t}}const ae="a8c_agenttic_conversation_history";function oe(e){var t,n;const i=e.parts.filter(e=>"text"===e.type),a=i.map(e=>e.text).join("\n"),o=i.some(e=>{var t;return"context"===(null==(t=e.metadata)?void 0:t.contentType)})?"context":void 0,r=e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"arguments"in e.data).map(e=>({toolCallId:e.data.toolCallId,toolId:e.data.toolId,arguments:e.data.arguments})),s=e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"result"in e.data).map(e=>({toolCallId:e.data.toolCallId,result:e.data.result,error:e.data.error})),l=e.parts.filter(e=>"file"===e.type).map(e=>({name:e.file.name,mimeType:e.file.mimeType,uri:e.file.uri}));let c;for(const t of e.parts){if("data"!==t.type||!t.data||"object"!=typeof t.data||"toolCallId"in t.data)continue;const e=t.data,n=e.flags;if(n&&"object"==typeof n&&null!==n&&"forward_to_human_support"in n){c={flags:n,..."sources"in e&&{sources:e.sources}};break}}const u=r.length>0||s.length>0?"agent":e.role,d=(null==(t=e.metadata)?void 0:t.timestamp)??Date.now(),h=(null==(n=e.metadata)?void 0:n.archived)??void 0;return{role:u,content:a||"(No text content)",timestamp:d,...void 0!==h&&{archived:h},...o&&{contentType:o},...l.length>0&&{files:l},...r.length>0&&{toolCalls:r},...s.length>0&&{toolResults:s},...c&&{agentMessageData:c}}}function re(e){const t=[];if(e.content&&"(No text content)"!==e.content&&t.push({type:"text",text:e.content,...e.contentType&&{metadata:{contentType:e.contentType}}}),e.files)for(const n of e.files)t.push({type:"file",file:{name:n.name,mimeType:n.mimeType,uri:n.uri}});if(e.toolCalls)for(const n of e.toolCalls)t.push({type:"data",data:{toolCallId:n.toolCallId,toolId:n.toolId,arguments:n.arguments}});if(e.toolResults)for(const n of e.toolResults)t.push({type:"data",data:{toolCallId:n.toolCallId,result:n.result,...n.error&&{error:n.error}}});if(e.agentMessageData){const n={};void 0!==e.agentMessageData.flags&&(n.flags=e.agentMessageData.flags),"sources"in e.agentMessageData&&(n.sources=e.agentMessageData.sources??null),Object.keys(n).length>0&&t.push({type:"data",data:n})}return{role:e.role,kind:"message",parts:t,messageId:b(),metadata:{timestamp:e.timestamp,...void 0!==e.archived&&{archived:e.archived}}}}const se=new Map;function le(e){const t=e.parts.filter(e=>"text"===e.type||"data"!==e.type||(!("role"in e.data)||!("text"in e.data))&&!!("toolCallId"in e.data&&"arguments"in e.data||"flags"in e.data&&e.data.flags&&"object"==typeof e.data.flags&&"forward_to_human_support"in e.data.flags||"sources"in e.data&&Array.isArray(e.data.sources)&&e.data.sources.length>0||"toolCallId"in e.data&&"result"in e.data));return{...e,parts:t,metadata:e.metadata||{timestamp:Date.now()}}}function ce(e){const t=[];for(const n of e)for(const e of n.parts)if("text"===e.type)t.push({type:"data",data:{role:n.role,text:e.text}});else if("file"===e.type)t.push(e);else if("data"===e.type){if("role"in e.data&&"text"in e.data)continue;if("toolCallId"in e.data&&"arguments"in e.data){t.push(e);continue}if("toolCallId"in e.data&&"result"in e.data){t.push(e);continue}}return t}function ue(e,t=[],n=[]){const i=ce(t),a=n.map(e=>{const t="string"==typeof e?e:e.url,n="object"==typeof e?e.metadata:void 0,i=(null==n?void 0:n.fileType)||"image/jpeg";return{type:"file",file:{name:(null==n?void 0:n.fileName)||"image",mimeType:i,uri:t},metadata:n}});return{role:"user",parts:[...i,{type:"text",text:e},...a],kind:"message",messageId:b(),metadata:{timestamp:Date.now()}}}function de(e){return null!=e&&e.parts?e.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&"result"in e.data):[]}function he(e,t){if(typeof localStorage>"u")g("localStorage not available, cannot update session ID");else try{const n=localStorage.getItem(e);if(n){const i=JSON.parse(n),a=i.sessionId;i.sessionId=t,localStorage.setItem(e,JSON.stringify(i)),g("Updated localStorage[%s] session ID: %s -> %s",e,a,t)}else{const n={sessionId:t,timestamp:Date.now()};localStorage.setItem(e,JSON.stringify(n)),g("Created new session in localStorage[%s]: %s",e,t)}}catch(e){g("Failed to update localStorage sessionId to %s: %O",t,e)}}const pe=function(){const e=new Map;async function t(t,n){const i=e.get(t);if(null!=i&&i.sessionId)try{await async function(e,t,n){const i=n||e;if(se.set(i,[...t]),se.size>50){const e=se.keys().next().value;e&&se.delete(e)}if(!(typeof sessionStorage>"u"))try{const e={storageKey:i,messages:t.map(oe),lastUpdated:Date.now()};sessionStorage.setItem(`${ae}_${i}`,JSON.stringify(e))}catch(e){f("Failed to store conversation in sessionStorage for key %s: %O",i,e)}}(i.sessionId,n,i.conversationStorageKey)}catch(e){g(`Failed to persist conversation history for agent ${t}:`,e)}}return{async createAgent(t,n){if(e.has(t))return e.get(t).client;const i=function(e){const{agentId:t,agentUrl:n,authProvider:i,defaultSessionId:a,timeout:o=$,toolProvider:r,contextProvider:s,enableStreaming:l=!1,credentials:c}=e,u={agentId:t,agentUrl:n,authProvider:i,timeout:o,credentials:c};return{async sendMessage(e){var t,n;const{abortSignal:i}=e,o=e.sessionId||a||void 0,l=[];l.push(e.message);const c=await z(e,u,{isStreaming:!1},r,s,o);let d=await U(c,u,{abortSignal:i});const h=[],p=[];for(;d.status.message&&r;){const e=P(d.status.message);if(0===e.length)break;h.push(...e);const t=[];let n=!1;for(const i of e){const{toolCallId:e,toolId:a,arguments:o}=i.data;try{const i=await W(r,a,o),{result:s,returnToAgent:l,agentMessage:c}=M(i);l&&(n=!0),c&&p.push(I(c));const u=E(e,a,s);t.push(u),h.push(u)}catch(n){const i=E(e,a,void 0,n instanceof Error?n.message:String(n));t.push(i),h.push(i)}}if(l.push(d.status.message),!n)break;{const e=j(t);d=await J(d.id,e,u,r,s,o,i)}}if(h.length>0&&null!=(t=d.status)&&t.message){const e={...d.status.message,parts:h};d={...d,status:{...d.status,message:e}}}if(p.length>0){const e=p.map(e=>k(e)).join(" "),t=I(e);return{...d,text:e,agentMessage:t}}return{...d,text:k((null==(n=d.status)?void 0:n.message)||{parts:[],messageId:b()})}},async*sendMessageStream(e){const{withHistory:t=!0,abortSignal:n,enableStreaming:i}=e,c=e.sessionId||a||void 0,d=i??l,h=[];h.push(e.message);const p=H(await z(e,u,{isStreaming:!0,enableTokenStreaming:d},r,s,c),u,{enableTokenStreaming:d,streamingTimeout:o,abortSignal:n});yield*Q(p,r,s,u,c,t,h,n,{isStreaming:!0,enableTokenStreaming:d,streamingTimeout:o})},async continueTask(e,t,n){var i;const a=A(t);let o=await J(e,a,u,r,s,n);for(;"input-required"===o.status.state&&o.status.message&&r;){const e=P(o.status.message);if(0===e.length)break;const{results:t,shouldReturnToAgent:i}=await G(e,r);if(!i)break;{const e=j(t);o=await J(o.id,e,u,r,s,n)}}return{...o,text:k((null==(i=o.status)?void 0:i.message)||{parts:[],messageId:b()})}},async getTask(){throw new Error("getTask not implemented yet")},async cancelTask(){throw new Error("cancelTask not implemented yet")}}}(n),a=n.sessionId||null,o=n.conversationStorageKey,r=n.sessionIdStorageKey,s={odieBotId:n.odieBotId,authProvider:n.authProvider};let l=[];if(a)try{l=(await async function(e,t,n){return null!=n&&n.odieBotId?async function(e,t){const{odieBotId:n,authProvider:i}=t;if(!n)throw new Error("odieBotId is required for server storage");const a=ne;try{const t=await ie(e,{botId:n,apiBaseUrl:a,authProvider:i},1,50);return f("Loaded conversation from server: %s (%d messages, page %d/%d)",e,t.messages.length,t.pagination.currentPage,t.pagination.totalPages),{messages:t.messages,pagination:t.pagination}}catch(e){throw f("Failed to load conversation from server: %O",e),e}}(e,n):async function(e,t){const n=t||e;if(se.has(n))return{messages:[...se.get(n)]};if(typeof sessionStorage>"u")return{messages:[]};try{const e=sessionStorage.getItem(`${ae}_${n}`);if(e){const t=JSON.parse(e).messages.map(re);return se.set(n,t),{messages:[...t]}}}catch(e){f("Failed to load conversation from sessionStorage for key %s: %O",n,e)}return{messages:[]}}(e,t)}(a,o,s)).messages}catch(e){g(`Failed to load conversation history for agent ${t} with session ${a}:`,e)}const c={client:i,sessionId:a,conversationStorageKey:o,sessionIdStorageKey:r,storageConfig:s,conversationHistory:l,currentAbortController:null};return e.set(t,c),i},getAgent(t){const n=e.get(t);return(null==n?void 0:n.client)||null},hasAgent:t=>e.has(t),removeAgent:t=>e.delete(t),async sendMessage(n,i,a={}){var o;const r=e.get(n);if(!r)throw new Error(`Agent with key "${n}" not found`);const{withHistory:s=!0,sessionId:l,...c}=a,{client:u,conversationHistory:d}=r,h=a.message||ue(i,d,a.imageUrls),p=await u.sendMessage({message:h,withHistory:s,sessionId:l||r.sessionId||void 0,...c});if(p.sessionId){const e=r.sessionId;r.sessionId=p.sessionId,e&&p.sessionId&&e!==p.sessionId&&r.sessionIdStorageKey&&(g("Session ID changed from %s to %s, updating localStorage",e,p.sessionId),he(r.sessionIdStorageKey,p.sessionId))}let f=null;if(null!=(o=p.status)&&o.message){const e=p.status.message.parts.filter(e=>"data"===e.type&&"toolCallId"in e.data&&("arguments"in e.data||"result"in e.data)),t=p.status.message.parts.filter(e=>"text"===e.type);f={role:"agent",kind:"message",parts:[...e,...t],messageId:b(),metadata:{timestamp:Date.now()}}}const m=[...d,A(i),...f?[le(f)]:[]];let y=m;if(p.agentMessage){const e=le(p.agentMessage);y=[...m,e]}return r.conversationHistory=y,s&&await t(n,y),p},async*sendMessageStream(n,i,a={}){var o,r,s,l,c,u;const d=e.get(n);if(!d)throw new Error(`Agent with key "${n}" not found`);const{withHistory:h=!0,abortSignal:p,metadata:f,sessionId:m,message:y,...v}=a,{client:x}=d,w=f?(({contentType:e,...t})=>t)(f):void 0,k=new AbortController;d.currentAbortController=k,p&&p.addEventListener("abort",()=>k.abort());let S=[...d.conversationHistory],C=[];const T=await async function(e){const t=[];for(const n of e)if(n.parts&&Array.isArray(n.parts))if(n.parts.some(e=>"data"===e.type&&"toolCallId"in e.data&&"result"in e.data)){const e=Y(n.parts);t.push({...n,parts:e})}else t.push(n);else t.push(n);return q.clear(),t}(S);let E;if(d.conversationHistory=T,S=T,h&&await t(n,T),y){const e=ce(T);E={...y,parts:[...e,...y.parts]}}else E=ue(i,T,a.imageUrls);if(a.metadata&&!y){const{contentType:e,...t}=a.metadata;if(e){const t=E.parts[E.parts.length-1];t&&"text"===t.type&&(t.metadata={...t.metadata,contentType:e})}Object.keys(t).length>0&&(E.metadata={...E.metadata,...t})}const I=y||A(i,a.metadata);if(a.imageUrls&&a.imageUrls.length>0){const e=a.imageUrls.map(e=>{const t="string"==typeof e?e:e.url,n="string"==typeof e?void 0:e.metadata,i=(null==n?void 0:n.fileType)||"image/jpeg";return{type:"file",file:{name:(null==n?void 0:n.fileName)||"image",mimeType:i,uri:t},metadata:n}});I.parts.push(...e)}S=[...S,I],d.conversationHistory=S,h&&await t(n,S);for await(const e of x.sendMessageStream({message:E,withHistory:h,sessionId:m||d.sessionId||void 0,abortSignal:k.signal,...v,...w&&Object.keys(w).length>0&&{metadata:w}})){if(e.sessionId){const t=d.sessionId;d.sessionId=e.sessionId,e.sessionId&&t!==e.sessionId&&d.sessionIdStorageKey&&(g("Session ID %s, updating localStorage",t?`changed from ${t} to ${e.sessionId}`:`received: ${e.sessionId}`),he(d.sessionIdStorageKey,e.sessionId))}if("input-required"===(null==(o=e.status)?void 0:o.state)&&null!=(r=e.status)&&r.message){C=P(e.status.message).map(e=>e.data.toolCallId);const i=le(e.status.message);S=[...S,i],d.conversationHistory=S,h&&await t(n,S)}if("working"===(null==(s=e.status)?void 0:s.state)&&null!=(l=e.status)&&l.message&&!e.final){const i=de(e.status.message).filter(e=>C.includes(e.data.toolCallId));if(i.length>0){const e={role:"agent",kind:"message",parts:i,messageId:b()};S=[...S,le(e)],d.conversationHistory=S,h&&await t(n,S)}}if(e.final&&"input-required"!==(null==(c=e.status)?void 0:c.state)){C=[];let i=null;null!=(u=e.status)&&u.message&&(i=le(e.status.message),S=[...S,i],d.conversationHistory=S,h&&await t(n,S))}yield e}d.currentAbortController=null},async*sendToolResult(t,n,i,a,o={}){const r=e.get(t);if(!r)throw new Error(`Agent with key "${t}" not found`);r.conversationHistory=r.conversationHistory.map(e=>({...e,parts:e.parts.filter(e=>!(e=>{var t;return"data"===e.type&&(null==(t=e.data)?void 0:t.toolCallId)===n&&"result"in e.data})(e))})).filter(e=>e.parts.length>0),yield*this.sendMessageStream(t,"",{...o,message:{role:"user",kind:"message",parts:[E(n,i,a)],messageId:b()}})},async resetConversation(t){const n=e.get(t);if(!n)throw new Error(`Agent with key "${t}" not found`);n.conversationHistory=[],n.sessionId&&await async function(e,t){const n=t||e;if(se.delete(n),!(typeof sessionStorage>"u"))try{sessionStorage.removeItem(`${ae}_${n}`)}catch(e){f("Failed to clear conversation from sessionStorage for key %s: %O",n,e)}}(n.sessionId,n.conversationStorageKey)},async replaceMessages(n,i){const a=e.get(n);if(!a)throw new Error(`Agent with key "${n}" not found`);a.conversationHistory=[...i],a.sessionId&&await t(n,i)},getConversationHistory(t){const n=e.get(t);if(!n)throw new Error(`Agent with key "${t}" not found`);return[...n.conversationHistory]},updateSessionId(t,n){const i=e.get(t);if(!i)throw new Error(`Agent with key "${t}" not found`);i.sessionId=n,i.sessionIdStorageKey&&he(i.sessionIdStorageKey,n)},abortCurrentRequest(t){const n=e.get(t);if(!n)throw new Error(`Agent with key "${t}" not found`);n.currentAbortController&&(n.currentAbortController.abort(),n.currentAbortController=null)},clear(){e.clear()}}}();function fe(){return pe}const me=e=>[...e].sort((e,t)=>e.timestamp-t.timestamp),ge=(e,t="40%")=>({type:"component",component:()=>h.createElement("img",{src:e,alt:"Uploaded image",style:{maxWidth:t,height:"auto",borderRadius:"8px",marginTop:"8px",marginRight:"8px",display:"inline-block"}})}),ye=(e,t=[])=>{var n,i;if(e.parts.some(e=>{if("data"===e.type){const t=e.data;return t.toolCallId||t.toolId||t.result}return!1}))return null;const a=e.parts.map(e=>{var t;if("text"===e.type)return{type:(null==(t=e.metadata)?void 0:t.contentType)||"text",text:e.text};if("file"===e.type){const t=e.file.uri||(e.file.mimeType&&e.file.bytes?`data:${e.file.mimeType};base64,${e.file.bytes}`:void 0);if(t)return ge(t)}if("data"===e.type){const t=e.data;return t.component&&t.componentProps?{type:"component",component:t.component,componentProps:t.componentProps}:t.flags&&"object"==typeof t.flags&&"forward_to_human_support"in t.flags||Array.isArray(t.sources)&&t.sources.length>0?{type:"data",data:t}:{type:"text",text:JSON.stringify(t)}}return{type:"text",text:"[Unsupported content]"}}),o=(null==(n=e.metadata)?void 0:n.timestamp)??Date.now(),r={id:e.messageId,role:"agent"===e.role?"agent":"user",content:a,timestamp:o,archived:!(null==(i=e.metadata)||!i.archived),showIcon:"agent"===e.role,icon:"agent"===e.role?"assistant":void 0};if("agent"===e.role&&t.length>0){const e=function(e,t){return t.flatMap(t=>"function"==typeof t.actions?t.actions(e):t.actions).filter(t=>!(t.condition&&!t.condition(e))).map(e=>"component"===e.type?{type:"component",id:e.id,label:e.label,component:e.component,componentProps:e.componentProps,order:e.order}:{id:e.id,label:e.label,icon:e.icon,onClick:e.onClick,tooltip:e.tooltip,disabled:e.disabled||!1,pressed:e.pressed,showLabel:e.showLabel,order:e.order}).sort((e,t)=>(e.order??1/0)-(t.order??1/0))}(r,t);e.length>0&&(r.actions=e)}return r};const ve=window.ReactJSXRuntime,xe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],be=(()=>new Set(xe))(),we=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},Se={...ke,transform:e=>we(0,1,e)},Ce={...ke,default:1},Te=e=>Math.round(1e5*e)/1e5,Pe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Ee=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ae=(e,t)=>n=>Boolean("string"==typeof n&&Ee.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ie=(e,t,n)=>i=>{if("string"!=typeof i)return i;const[a,o,r,s]=i.match(Pe);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==s?parseFloat(s):1}},Me={...ke,transform:e=>Math.round((e=>we(0,255,e))(e))},je={test:Ae("rgb","red"),parse:Ie("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Me.transform(e)+", "+Me.transform(t)+", "+Me.transform(n)+", "+Te(Se.transform(i))+")"},De={test:Ae("#"),parse:function(e){let t="",n="",i="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}},transform:je.transform},Le=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Re=Le("deg"),Oe=Le("%"),Ne=Le("px"),_e=Le("vh"),Fe=Le("vw"),Ve=(()=>({...Oe,parse:e=>Oe.parse(e)/100,transform:e=>Oe.transform(100*e)}))(),Be={test:Ae("hsl","hue"),parse:Ie("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Oe.transform(Te(t))+", "+Oe.transform(Te(n))+", "+Te(Se.transform(i))+")"},ze={test:e=>je.test(e)||De.test(e)||Be.test(e),parse:e=>je.test(e)?je.parse(e):Be.test(e)?Be.parse(e):De.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?je.transform(e):Be.transform(e),getAnimatableNone:e=>{const t=ze.parse(e);return t.alpha=0,ze.transform(t)}},Ue=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,He="number",$e="color",We=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function qe(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},a=[];let o=0;const r=t.replace(We,e=>(ze.test(e)?(i.color.push(o),a.push($e),n.push(ze.parse(e))):e.startsWith("var(")?(i.var.push(o),a.push("var"),n.push(e)):(i.number.push(o),a.push(He),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:a}}function Ke({split:e,types:t}){const n=e.length;return i=>{let a="";for(let o=0;o0},parse:function(e){return qe(e).values},createTransformer:function(e){return Ke(qe(e))},getAnimatableNone:function(e){const t=qe(e);return Ke(t)(t.values.map((e,n)=>((e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:ze.test(n)?ze.getAnimatableNone(n):n;var n})(e,t.split[n])))}},Ge=new Set(["brightness","contrast","saturate","opacity"]);function Xe(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[i]=n.match(Pe)||[];if(!i)return e;const a=n.replace(i,"");let o=Ge.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+a+")"}const Je=/\b([a-z-]*)\(.*?\)/gu,Ze={...Ye,getAnimatableNone:e=>{const t=e.match(Je);return t?t.map(Xe).join(" "):e}},Qe={...Ye,getAnimatableNone:e=>{const t=Ye.parse(e);return Ye.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},et={...ke,transform:Math.round},tt={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,rotate:Re,rotateX:Re,rotateY:Re,rotateZ:Re,scale:Ce,scaleX:Ce,scaleY:Ce,scaleZ:Ce,skew:Re,skewX:Re,skewY:Re,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Se,originX:Ve,originY:Ve,originZ:Ne,zIndex:et,fillOpacity:Se,strokeOpacity:Se,numOctaves:et},nt={...tt,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:Ze,WebkitFilter:Ze,mask:Qe,WebkitMask:Qe},it=e=>nt[e],at=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ot=e=>Boolean(e&&e.getVelocity),rt=new Set(["width","height","top","left","right","bottom",...xe]),st=e=>t=>t.test(e),lt=[ke,Ne,Oe,Re,Fe,_e,{test:e=>"auto"===e,parse:e=>e}],ct=e=>lt.find(st(e)),ut=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),dt=e=>t=>"string"==typeof t&&t.startsWith(e),ht=dt("--"),pt=dt("var(--"),ft=e=>!!pt(e)&&mt.test(e.split("/*")[0].trim()),mt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function gt(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const yt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vt(e,t,n=1){const[i,a]=function(e){const t=yt.exec(e);if(!t)return[,];const[,n,i,a]=t;return[`--${n??i}`,a]}(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const e=o.trim();return ut(e)?parseFloat(e):e}return ft(a)?vt(a,t,n+1):a}const xt=e=>180*e/Math.PI,bt=e=>{const t=xt(Math.atan2(e[1],e[0]));return kt(t)},wt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bt,rotateZ:bt,skewX:e=>xt(Math.atan(e[1])),skewY:e=>xt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kt=e=>((e%=360)<0&&(e+=360),e),St=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ct=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Tt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:St,scaleY:Ct,scale:e=>(St(e)+Ct(e))/2,rotateX:e=>kt(xt(Math.atan2(e[6],e[5]))),rotateY:e=>kt(xt(Math.atan2(-e[2],e[0]))),rotateZ:bt,rotate:bt,skewX:e=>xt(Math.atan(e[4])),skewY:e=>xt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Pt(e){return e.includes("scale")?1:0}function Et(e,t){if(!e||"none"===e)return Pt(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,a;if(n)i=Tt,a=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=wt,a=t}if(!a)return Pt(t);const o=i[t],r=a[1].split(",").map(At);return"function"==typeof o?o(r):r[o]}function At(e){return parseFloat(e.trim())}const It=e=>e===ke||e===Ne,Mt=new Set(["x","y","z"]),jt=xe.filter(e=>!Mt.has(e)),Dt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:i})=>{const a=e.max-e.min;return"border-box"===i?a:a-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:i})=>{const a=e.max-e.min;return"border-box"===i?a:a-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Et(t,"x"),y:(e,{transform:t})=>Et(t,"y")};Dt.translateX=Dt.x,Dt.translateY=Dt.y;const Lt=e=>e,Rt={},Ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Nt={value:null,addProjectionMetrics:null};function _t(e,t){let n=!1,i=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ot.reduce((e,n)=>(e[n]=function(e,t){let n=new Set,i=new Set,a=!1,o=!1;const r=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){r.has(t)&&(u.schedule(t),e()),l++,t(s)}const u={schedule:(e,t=!1,o=!1)=>{const s=o&&a?n:i;return t&&r.add(e),s.add(e),e},cancel:e=>{i.delete(e),r.delete(e)},process:e=>{if(s=e,a)return void(o=!0);a=!0;const r=n;n=i,i=r,n.forEach(c),t&&Nt.value&&Nt.value.frameloop[t].push(l),l=0,n.clear(),a=!1,o&&(o=!1,u.process(e))}};return u}(o,t?n:void 0),e),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:f}=r,m=()=>{const o=Rt.useManualTiming,r=o?a.timestamp:performance.now();n=!1,o||(a.delta=i?1e3/60:Math.max(Math.min(r-a.timestamp,40),1)),a.timestamp=r,a.isProcessing=!0,s.process(a),l.process(a),c.process(a),u.process(a),d.process(a),h.process(a),p.process(a),f.process(a),a.isProcessing=!1,n&&t&&(i=!1,e(m))};return{schedule:Ot.reduce((t,o)=>{const s=r[o];return t[o]=(t,o=!1,r=!1)=>(n||(n=!0,i=!0,a.isProcessing||e(m)),s.schedule(t,o,r)),t},{}),cancel:e=>{for(let t=0;te.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return jt.forEach(n=>{const i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}$t=!1,Ht=!1,Ut.forEach(e=>e.complete(Wt)),Ut.clear()}function Kt(){Ut.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($t=!0)})}class Yt{constructor(e,t,n,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ut.add(this),Ht||(Ht=!0,Ft.read(Kt),Ft.resolveKeyframes(qt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:i}=this;if(null===e[0]){const a=i?.get(),o=e[e.length-1];if(void 0!==a)e[0]=a;else if(n&&t){const i=n.readValue(t,o);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=o),i&&void 0===a&&i.set(e[0])}!function(e){for(let t=1;t/^0[^.\s]+$/u.test(e);function Xt(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||Gt(e)}const Jt=new Set([Ze,Qe]);function Zt(e,t){let n=it(e);return Jt.has(n)||(n=Ye),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Qt=new Set(["auto","none","0"]);class en extends Yt{constructor(e,t,n,i,a){super(e,t,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const tn=e=>1e3*e,nn=e=>e/1e3;function an(e,t){-1===e.indexOf(t)&&e.push(t)}function on(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class rn{constructor(){this.subscriptions=[]}add(e){return an(this.subscriptions,e),()=>on(this.subscriptions,e)}notify(e,t,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let a=0;ae.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}function ln(e){let t;return()=>(void 0===t&&(t=e()),t)}const cn={};function un(e,t){const n=ln(e);return()=>cn[t]??n()}const dn=un(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),hn=e=>null!==e;function pn(e,{repeat:t,repeatType:n="loop"},i,a=1){const o=e.filter(hn),r=a<0||t&&"loop"!==n&&t%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}class fn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const mn={layout:0,mainThread:0,waapi:0},gn=e=>Array.isArray(e)&&"number"==typeof e[0],yn=un(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),vn=(e,t,n=10)=>{let i="";const a=Math.max(Math.round(t/n),2);for(let t=0;t`cubic-bezier(${e}, ${t}, ${n}, ${i})`,bn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xn([0,.65,.55,1]),circOut:xn([.55,0,1,.45]),backIn:xn([.31,.01,.66,-.59]),backOut:xn([.33,1.53,.69,.99])};function wn(e,t){return e?"function"==typeof e?yn()?vn(e,t):"ease-out":gn(e)?xn(e):Array.isArray(e)?e.map(e=>wn(e,t)||bn.easeOut):bn[e]:void 0}function kn(e,t,n,{delay:i=0,duration:a=300,repeat:o=0,repeatType:r="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=wn(s,a);Array.isArray(d)&&(u.easing=d),Nt.value&&mn.waapi++;const h={delay:i,duration:a,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};c&&(h.pseudoElement=c);const p=e.animate(u,h);return Nt.value&&p.finished.finally(()=>{mn.waapi--}),p}function Sn(e){return"function"==typeof e&&"applyToOptions"in e}class Cn extends fn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:r,onComplete:s}=e;this.isPseudoElement=Boolean(a),this.allowFlatten=o,this.options=e,e.type;const l=function({type:e,...t}){return Sn(e)&&yn()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=kn(t,n,i,l,a),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const e=pn(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(e),sn(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return nn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+nn(e)}get time(){return nn(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=tn(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&dn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Lt):i(this)}}const Tn=new Set(["opacity","clipPath","filter","transform"]),{schedule:Pn,cancel:En}=_t(queueMicrotask,!1);let An;function In(){An=void 0}const Mn={now:()=>(void 0===An&&Mn.set(Bt.isProcessing||Rt.useManualTiming?Bt.timestamp:performance.now()),An),set:e=>{An=e,queueMicrotask(In)}};function jn(e,t){return t?e*(1e3/t):0}const Dn={current:void 0};class Ln{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=Mn.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Mn.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new rn);const n=this.events[e].add(t);return"change"===e?()=>{n(),Ft.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Dn.current&&Dn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Mn.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return jn(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rn(e,t){return new Ln(e,t)}const On=[...lt,ze,Ye],Nn=new WeakMap;function Fn(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Vn(e){return"string"==typeof e||Array.isArray(e)}const Bn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],zn=["initial",...Bn];function Un(e){return Fn(e.animate)||zn.some(t=>Vn(e[t]))}function Hn(e){return Boolean(Un(e)||e.variants)}const $n={current:null},Wn={current:!1},qn="undefined"!=typeof window;function Kn(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Yn(e,t,n,i){if("function"==typeof t){const[a,o]=Kn(i);t=t(void 0!==n?n:e.custom,a,o)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[a,o]=Kn(i);t=t(void 0!==n?n:e.custom,a,o)}return t}const Gn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xn={};function Jn(e){Xn=e}class Zn{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:r},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Yt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Mn.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Wn.current||function(){if(Wn.current=!0,qn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$n.current=e.matches;e.addEventListener("change",t),t()}else $n.current=!1}(),this.shouldReduceMotion=$n.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Vt(this.notifyUpdate),Vt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Tn.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:a,ease:o,duration:r}=t.accelerate,s=new Cn({element:this.current,name:e,keyframes:i,times:a,ease:o,duration:tn(r)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=be.has(e);n&&this.onBindTransform&&this.onBindTransform();const i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Ft.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Xn){const t=Xn[e];if(!t)continue;const{isEnabled:n,Feature:i}=t;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Rn(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(ut(n)||Gt(n))?n=parseFloat(n):(i=n,!On.find(st(i))&&Ye.test(t)&&(n=Zt(e,t))),this.setBaseTarget(e,ot(n)?n.get():n)),ot(n)?n.get():n;var i}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let n;if("string"==typeof t||"object"==typeof t){const i=Yn(this.props,t,this.presenceContext?.custom);i&&(n=i[e])}if(t&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||ot(i)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new rn),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Pn.render(this.render)}}class Qn extends Zn{constructor(){super(...arguments),this.KeyframeResolver=en}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ot(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function ei(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ti=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ni={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ii=xe.length;function ai(e,t,n){const{style:i,vars:a,transformOrigin:o}=e;let r=!1,s=!1;for(const e in t){const n=t[e];if(be.has(e))r=!0;else if(ht(e))a[e]=n;else{const t=ti(n,tt[e]);e.startsWith("origin")?(s=!0,o[e]=t):i[e]=t}}if(t.transform||(r||n?i.transform=function(e,t,n){let i="",a=!0;for(let o=0;o"string"==typeof e&&"svg"===e.toLowerCase();function di(e,{style:t,vars:n},i,a){const o=e.style;let r;for(r in t)o[r]=t[r];for(r in a?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}function hi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const pi={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Ne.test(e))return e;e=parseFloat(e)}return`${hi(e,t.target.x)}% ${hi(e,t.target.y)}%`}},fi=(e,t,n)=>e+(t-e)*n,mi={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,a=Ye.parse(e);if(a.length>5)return i;const o=Ye.createTransformer(e),r="number"!=typeof a[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;a[0+r]/=s,a[1+r]/=l;const c=fi(s,l,.5);return"number"==typeof a[2+r]&&(a[2+r]/=c),"number"==typeof a[3+r]&&(a[3+r]/=c),o(a)}},gi={borderRadius:{...pi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pi,borderTopRightRadius:pi,borderBottomLeftRadius:pi,borderBottomRightRadius:pi,boxShadow:mi};function yi(e,{layout:t,layoutId:n}){return be.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!gi[e]||"opacity"===e)}function vi(e,t,n){const i=e.style,a=t?.style,o={};if(!i)return o;for(const t in i)(ot(i[t])||a&&ot(a[t])||yi(t,e)||void 0!==n?.getValue(t)?.liveStyle)&&(o[t]=i[t]);return o}function xi(e,t,n){const i=vi(e,t,n);for(const n in e)(ot(e[n])||ot(t[n]))&&(i[-1!==xe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return i}class bi extends Qn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=at}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(be.has(t)){const e=it(t);return e&&e.default||0}return t=ci.has(t)?t:ei(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return xi(e,t,n)}build(e,t,n){li(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,i){!function(e,t,n,i){di(e,t,void 0,i);for(const n in t.attrs)e.setAttribute(ci.has(n)?n:ei(n),t.attrs[n])}(e,t,0,i)}mount(e){this.isSVGTag=ui(e.tagName),super.mount(e)}}function wi({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function ki(e){return void 0===e||1===e}function Si({scale:e,scaleX:t,scaleY:n}){return!ki(e)||!ki(t)||!ki(n)}function Ci(e){return Si(e)||Ti(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ti(e){return Pi(e.x)||Pi(e.y)}function Pi(e){return e&&"0%"!==e}function Ei(e,t,n){return n+t*(e-n)}function Ai(e,t,n,i,a){return void 0!==a&&(e=Ei(e,a,i)),Ei(e,n,i)+t}function Ii(e,t=0,n=1,i,a){e.min=Ai(e.min,t,n,i,a),e.max=Ai(e.max,t,n,i,a)}function Mi(e,{x:t,y:n}){Ii(e.x,t.translate,t.scale,t.originPoint),Ii(e.y,n.translate,n.scale,n.originPoint)}const ji=.999999999999,Di=1.0000000000001;function Li(e,t){e.min+=t,e.max+=t}function Ri(e,t,n,i,a=.5){Ii(e,t,n,fi(e.min,e.max,a),i)}function Oi(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function Ni(e,t,n){const i=n??e;Ri(e.x,Oi(t.x,i.x),t.scaleX,t.scale,t.originX),Ri(e.y,Oi(t.y,i.y),t.scaleY,t.scale,t.originY)}function _i(e,t){return wi(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}class Fi extends Qn{constructor(){super(...arguments),this.type="html",this.renderInstance=di}readValueFromInstance(e,t){if(be.has(t))return this.projection?.isProjecting?Pt(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Et(n,t)})(e,t);{const i=(n=e,window.getComputedStyle(n)),a=(ht(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof a?a.trim():a}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return _i(e,t)}build(e,t,n){ai(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return vi(e,t,n)}}const Vi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bi(e){return"string"==typeof e&&!e.includes("-")&&!!(Vi.indexOf(e)>-1||/[A-Z]/u.test(e))}const zi=(e,t)=>t.isSVG??Bi(e)?new bi(t):new Fi(t,{allowProjection:e!==h.Fragment}),Ui=(0,h.createContext)({}),Hi=(0,h.createContext)({strict:!1}),$i=(0,h.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Wi=(0,h.createContext)({});function qi(e){return Array.isArray(e)?e.join(" "):e}function Ki(e,t,n){for(const i in t)ot(t[i])||yi(i,n)||(e[i]=t[i])}function Yi(e,t){const n={},i=function(e,t){const n={};return Ki(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,h.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return ai(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function Gi(e,t,n,i){const a=(0,h.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return li(n,t,ui(i),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};Ki(t,e.style,e),a.style={...t,...a.style}}return a}const Xi=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ji(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Xi.has(e)}let Zi=e=>!Ji(e);try{"function"==typeof(Qi=require("@emotion/is-prop-valid").default)&&(Zi=e=>e.startsWith("on")?!Ji(e):Qi(e))}catch{}var Qi;function ea(e,t,n,{latestValues:i},a,o=!1,r){const s=(r??Bi(e)?Gi:Yi)(t,i,a,e),l=function(e,t,n){const i={};for(const a in e)"values"===a&&"object"==typeof e.values||ot(e[a])||(Zi(a)||!0===n&&Ji(a)||!t&&!Ji(a)||e.draggable&&a.startsWith("onDrag"))&&(i[a]=e[a]);return i}(t,"string"==typeof e,o),c=e!==h.Fragment?{...l,...s,ref:n}:{},{children:u}=t,d=(0,h.useMemo)(()=>ot(u)?u.get():u,[u]);return(0,h.createElement)(e,{...c,children:d})}function ta(e){return ot(e)?e.get():e}const na=(0,h.createContext)(null);function ia(e){const t=(0,h.useRef)(null);return null===t.current&&(t.current=e()),t.current}function aa(e,t,n,i){const a={},o=i(e,{});for(const e in o)a[e]=ta(o[e]);let{initial:r,animate:s}=e;const l=Un(e),c=Hn(e);t&&c&&!l&&!1!==e.inherit&&(void 0===r&&(r=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const d=u?s:r;if(d&&"boolean"!=typeof d&&!Fn(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n(t,n)=>{const i=(0,h.useContext)(Wi),a=(0,h.useContext)(na),o=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,a){return{latestValues:aa(n,i,a,e),renderState:t()}}(e,t,i,a);return n?o():ia(o)},ra=oa({scrapeMotionValuesFromProps:vi,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})}),sa=oa({scrapeMotionValuesFromProps:xi,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}})}),la={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let ca=!1;function ua(){return function(){if(ca)return;const e={};for(const t in la)e[t]={isEnabled:e=>la[t].some(t=>!!e[t])};Jn(e),ca=!0}(),Xn}const da=Symbol.for("motionComponentSymbol");function ha(e,t,n){const i=(0,h.useRef)(n);(0,h.useInsertionEffect)(()=>{i.current=n});const a=(0,h.useRef)(null);return(0,h.useCallback)(n=>{n&&e.onMount?.(n);const o=i.current;if("function"==typeof o)if(n){const e=o(n);"function"==typeof e&&(a.current=e)}else a.current?(a.current(),a.current=null):o(n);else o&&(o.current=n);t&&(n?t.mount(n):t.unmount())},[t])}const pa="data-"+ei("framerAppearId"),fa=(0,h.createContext)({});function ma(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const ga="undefined"!=typeof window?h.useLayoutEffect:h.useEffect;function ya(e,t,n,i,a,o){const{visualElement:r}=(0,h.useContext)(Wi),s=(0,h.useContext)(Hi),l=(0,h.useContext)(na),c=(0,h.useContext)($i),u=c.reducedMotion,d=c.skipAnimations,p=(0,h.useRef)(null),f=(0,h.useRef)(!1);i=i||s.renderer,!p.current&&i&&(p.current=i(e,{visualState:t,parent:r,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:d,isSVG:o}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,g=(0,h.useContext)(fa);!m||m.projection||!a||"html"!==m.type&&"svg"!==m.type||function(e,t,n,i){const{layoutId:a,layout:o,drag:r,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:va(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:Boolean(r)||s&&ma(s),visualElement:e,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,n,a,g);const y=(0,h.useRef)(!1);(0,h.useInsertionEffect)(()=>{m&&y.current&&m.update(n,l)});const v=n[pa],x=(0,h.useRef)(Boolean(v)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return ga(()=>{f.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),(0,h.useEffect)(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),x.current=!1),m.enteringChildren=void 0)}),m}function va(e){if(e)return!1!==e.options.allowProjection?e.projection:va(e.parent)}function xa(e,{forwardMotionProps:t=!1,type:n}={},i,a){i&&function(e){const t=ua();for(const n in e)t[n]={...t[n],...e[n]};Jn(t)}(i);const o=n?"svg"===n:Bi(e),r=o?sa:ra;function s(n,i){let s;const l={...(0,h.useContext)($i),...n,layoutId:ba(n)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Un(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Vn(t)?t:void 0,animate:Vn(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,h.useContext)(Wi));return(0,h.useMemo)(()=>({initial:t,animate:n}),[qi(t),qi(n)])}(n),d=r(n,c);if(!c&&"undefined"!=typeof window){(0,h.useContext)(Hi).strict;const t=function(e){const t=ua(),{drag:n,layout:i}=t;if(!n&&!i)return{};const a={...n,...i};return{MeasureLayout:n?.isEnabled(e)||i?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}(l);s=t.MeasureLayout,u.visualElement=ya(e,d,l,a,t.ProjectionNode,o)}return(0,ve.jsxs)(Wi.Provider,{value:u,children:[s&&u.visualElement?(0,ve.jsx)(s,{visualElement:u.visualElement,...l}):null,ea(e,n,ha(d,u.visualElement,i),d,c,t,o)]})}s.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const l=(0,h.forwardRef)(s);return l[da]=e,l}function ba({layoutId:e}){const t=(0,h.useContext)(Ui).id;return t&&void 0!==e?t+"-"+e:e}function wa(e,t){if("undefined"==typeof Proxy)return xa;const n=new Map,i=(n,i)=>xa(n,i,e,t);return new Proxy((e,t)=>i(e,t),{get:(a,o)=>"create"===o?i:(n.has(o)||n.set(o,xa(o,void 0,e,t)),n.get(o))})}class ka{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Sa(e,t,n){const i=e.getProps();return Yn(i,t,void 0!==n?n:i.custom,e)}function Ca(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function Ta(e,t){const n=e?.[t]??e?.default??e;return n!==e?Ca(n,e):n}const Pa=e=>Array.isArray(e);function Ea(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Rn(n))}function Aa(e){return Pa(e)?e[e.length-1]||0:e}function Ia(e,t){const n=e.getValue("willChange");if(i=n,Boolean(ot(i)&&i.add))return n.add(t);if(!n&&Rt.WillChange){const n=new Rt.WillChange("auto");e.addValue("willChange",n),n.add(t)}var i}function Ma(e){return e.props[pa]}const ja=(e,t)=>n=>t(e(n)),Da=(...e)=>e.reduce(ja);function La(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ra(e,t){return n=>n>0?t:e}const Oa=(e,t,n)=>{const i=e*e,a=n*(t*t-i)+i;return a<0?0:Math.sqrt(a)},Na=[De,je,Be];function _a(e){const t=(n=e,Na.find(e=>e.test(n)));var n;if(Boolean(t),!Boolean(t))return!1;let i=t.parse(e);return t===Be&&(i=function({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,n/=100;let a=0,o=0,r=0;if(t/=100){const i=n<.5?n*(1+t):n+t-n*t,s=2*n-i;a=La(s,i,e+1/3),o=La(s,i,e),r=La(s,i,e-1/3)}else a=o=r=n;return{red:Math.round(255*a),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Fa=(e,t)=>{const n=_a(e),i=_a(t);if(!n||!i)return Ra(e,t);const a={...n};return e=>(a.red=Oa(n.red,i.red,e),a.green=Oa(n.green,i.green,e),a.blue=Oa(n.blue,i.blue,e),a.alpha=fi(n.alpha,i.alpha,e),je.transform(a))},Va=new Set(["none","hidden"]);function Ba(e,t){return n=>fi(e,t,n)}function za(e){return"number"==typeof e?Ba:"string"==typeof e?ft(e)?Ra:ze.test(e)?Fa:$a:Array.isArray(e)?Ua:"object"==typeof e?ze.test(e)?Fa:Ha:Ra}function Ua(e,t){const n=[...e],i=n.length,a=e.map((e,n)=>za(e)(e,t[n]));return e=>{for(let t=0;t{for(const t in i)n[t]=i[t](e);return n}}const $a=(e,t)=>{const n=Ye.createTransformer(t),i=qe(e),a=qe(t);return i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length?Va.has(e)&&!a.values.length||Va.has(t)&&!i.values.length?function(e,t){return Va.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Da(Ua(function(e,t){const n=[],i={color:0,var:0,number:0};for(let a=0;a{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>Ft.update(t,e),stop:()=>Vt(t),now:()=>Bt.isProcessing?Bt.timestamp:Mn.now()}},Ka=2e4;function Ya(e){let t=0,n=e.next(t);for(;!n.done&&t=Ka?1/0:t}function Ga(e,t=100,n){const i=n({...e,keyframes:[0,t]}),a=Math.min(Ya(i),Ka);return{type:"keyframes",ease:e=>i.next(a*e).value/t,duration:nn(a)}}const Xa=.01,Ja=2,Za=.005,Qa=.5;function eo(e,t){return e*Math.sqrt(1-t*t)}const to=["duration","bounce"],no=["stiffness","damping","mass"];function io(e,t){return t.some(t=>void 0!==e[t])}function ao(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:a}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],s={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!io(e,no)&&io(e,to))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(1.2*n),a=i*i,o=2*we(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:1,stiffness:a,damping:o}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:i=1}){let a,o;tn(10);let r=1-t;r=we(.05,1,r),e=we(.01,10,nn(e)),r<1?(a=t=>{const i=t*r,a=i*e;return.001-(i-n)/eo(t,r)*Math.exp(-a)},o=t=>{const i=t*r*e,o=i*n+n,s=Math.pow(r,2)*Math.pow(t,2)*e,l=Math.exp(-i),c=eo(Math.pow(t,2),r);return(.001-a(t)>0?-1:1)*((o-s)*l)/c}):(a=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let i=n;for(let n=1;n<12;n++)i-=e(i)/t(i);return i}(a,o,5/e);if(e=tn(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*i;return{stiffness:t,damping:2*r*Math.sqrt(i*t),duration:e}}}({...e,velocity:0});t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-nn(n.velocity||0)}),f=h||0,m=c/(2*Math.sqrt(l*u)),g=r-o,y=nn(Math.sqrt(l/u)),v=Math.abs(g)<5;let x,b,w,k,S,C;if(i||(i=v?Xa:Ja),a||(a=v?Za:Qa),m<1)w=eo(y,m),k=(f+m*y*g)/w,x=e=>{const t=Math.exp(-m*y*e);return r-t*(k*Math.sin(w*e)+g*Math.cos(w*e))},S=m*y*k+g*w,C=m*y*g-k*w,b=e=>Math.exp(-m*y*e)*(S*Math.sin(w*e)+C*Math.cos(w*e));else if(1===m){x=e=>r-Math.exp(-y*e)*(g+(f+y*g)*e);const e=f+y*g;b=t=>Math.exp(-y*t)*(y*e*t-f)}else{const e=y*Math.sqrt(m*m-1);x=t=>{const n=Math.exp(-m*y*t),i=Math.min(e*t,300);return r-n*((f+m*y*g)*Math.sinh(i)+e*g*Math.cosh(i))/e};const t=(f+m*y*g)/e,n=m*y*t-g*e,i=m*y*g-t*e;b=t=>{const a=Math.exp(-m*y*t),o=Math.min(e*t,300);return a*(n*Math.sinh(o)+i*Math.cosh(o))}}const T={calculatedDuration:p&&d||null,velocity:e=>tn(b(e)),next:e=>{if(!p&&m<1){const t=Math.exp(-m*y*e),n=Math.sin(w*e),o=Math.cos(w*e),l=r-t*(k*n+g*o),c=tn(t*(S*n+C*o));return s.done=Math.abs(c)<=i&&Math.abs(r-l)<=a,s.value=s.done?r:l,s}const t=x(e);if(p)s.done=e>=d;else{const n=tn(b(e));s.done=Math.abs(n)<=i&&Math.abs(r-t)<=a}return s.value=s.done?r:t,s},toString:()=>{const e=Math.min(Ya(T),Ka),t=vn(t=>T.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return T}function oo(e,t,n){const i=Math.max(t-5,0);return jn(n-e(i),t-i)}function ro({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:r,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)-f*Math.exp(-e/i),v=e=>g+y(e),x=e=>{const t=y(e),n=v(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let b,w;const k=e=>{var t;t=h.value,(void 0!==s&&tl)&&(b=e,w=ao({keyframes:[h.value,p(h.value)],velocity:oo(v,e,h.value),damping:a,stiffness:o,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==b||(t=!0,x(e),k(e)),void 0!==b&&e>=b?w.next(e-b):(!t&&x(e),h)}}}ao.applyToOptions=e=>{const t=Ga(e,100,ao);return e.ease=t.ease,e.duration=tn(t.duration),e.type="keyframes",e};const so=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function lo(e,t,n,i){if(e===t&&n===i)return Lt;return a=>0===a||1===a?a:so(function(e,t,n,i,a){let o,r,s=0;do{r=t+(n-t)/2,o=so(r,i,a)-e,o>0?n=r:t=r}while(Math.abs(o)>1e-7&&++s<12);return r}(a,0,1,e,n),t,i)}const co=lo(.42,0,1,1),uo=lo(0,0,.58,1),ho=lo(.42,0,.58,1),po=e=>Array.isArray(e)&&"number"!=typeof e[0],fo=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mo=e=>t=>1-e(1-t),go=lo(.33,1.53,.69,.99),yo=mo(go),vo=fo(yo),xo=e=>e>=1?1:(e*=2)<1?.5*yo(e):.5*(2-Math.pow(2,-10*(e-1))),bo=e=>1-Math.sin(Math.acos(e)),wo=mo(bo),ko=fo(bo),So={linear:Lt,easeIn:co,easeInOut:ho,easeOut:uo,circIn:bo,circInOut:ko,circOut:wo,backIn:yo,backInOut:vo,backOut:go,anticipate:xo},Co=e=>{if(gn(e)){e.length;const[t,n,i,a]=e;return lo(t,n,i,a)}return"string"==typeof e?So[e]:e},To=(e,t,n)=>{const i=t-e;return 0===i?1:(n-e)/i};function Po(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const a=To(0,t,i);e.push(fi(n,1,a))}}function Eo(e){const t=[0];return Po(t,e.length-1),t}function Ao({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const a=po(i)?i.map(Co):Co(i),o={done:!1,value:t[0]},r=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Eo(t),e),s=function(e,t,{clamp:n=!0,ease:i,mixer:a}={}){const o=e.length;if(t.length,1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];const r=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const i=[],a=n||Rt.mix||Wa,o=e.length-1;for(let n=0;n{if(r&&n1)for(;ic(we(e[0],e[o-1],t)):c}(r,t,{ease:Array.isArray(a)?a:(l=t,c=a,l.map(()=>c||ho).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}const Io={decay:ro,inertia:ro,tween:Ao,keyframes:Ao,spring:ao};function Mo(e){"string"==typeof e.type&&(e.type=Io[e.type])}const jo=e=>e/100;class Do extends fn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==Mn.now()&&this.tick(Mn.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},mn.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Mo(e);const{type:t=Ao,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:r}=e;const s=t||Ao;s!==Ao&&"number"!=typeof r[0]&&(this.mixKeyframes=Da(jo,Wa(r[0],r[1])),r=[0,100]);const l=s({...e,keyframes:r});"mirror"===a&&(this.mirroredGenerator=s({...e,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Ya(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:d,repeatDelay:h,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,b=n;if(u){const e=Math.min(this.currentTime,i)/r;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,u+1),Boolean(t%2)&&("reverse"===d?(n=1-n,h&&(n-=h/r)):"mirror"===d&&(b=o)),x=we(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=b.next(x),a&&!y&&(v.value=a(v.value));let{done:w}=v;y||null===s||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&p!==ro&&(v.value=pn(c,this.options,m,this.speed)),f&&f(v.value),k&&this.finish(),v}then(e,t){return this.finished.then(e,t)}get duration(){return nn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+nn(e)}get time(){return nn(this.currentTime)}set time(e){e=tn(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;return e<=0?this.options.velocity||0:this.generator.velocity?this.generator.velocity(e):oo(e=>this.generator.next(e).value,e,this.generator.next(e).value)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Mn.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=nn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=qa,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Mn.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,mn.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const Lo={anticipate:xo,backInOut:vo,circInOut:ko};class Ro extends Cn{constructor(e){var t;"string"==typeof(t=e).ease&&t.ease in Lo&&(t.ease=Lo[t.ease]),Mo(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:i,element:a,...o}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const r=new Do({...o,autoplay:!1}),s=Math.max(10,Mn.now()-this.startTime),l=we(0,10,s-10),c=r.sample(s).value,{name:u}=this.options;a&&u&&sn(a,u,c),t.setWithVelocity(r.sample(Math.max(0,s-l)).value,c,l),r.stop()}}const Oo=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Ye.test(e)&&"0"!==e||e.startsWith("url(")));function No(e){e.duration=0,e.type="keyframes"}const _o=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,Fo=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vo=ln(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Bo extends fn{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:r,name:s,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Mn.now();const d={autoplay:e,delay:t,type:n,repeat:i,repeatDelay:a,repeatType:o,name:s,motionValue:l,element:c,...u},h=c?.KeyframeResolver||Yt;this.keyframeResolver=new h(r,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:r,delay:s,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Mn.now();let u=!0;(function(e,t,n,i){const a=e[0];if(null===a)return!1;if("display"===t||"visibility"===t)return!0;const o=e[e.length-1],r=Oo(a,t),s=Oo(o,t);return!(!r||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},h=u&&!l&&function(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:a,damping:o,type:r,keyframes:s}=e,l=t?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Vo()&&n&&(Tn.has(n)||Fo.has(n)&&function(e){for(let t=0;t{this.notifyFinished()}).catch(Lt),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Wt=!0,Kt(),qt(),Wt=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const zo={type:"spring",stiffness:500,damping:25,restSpeed:10},Uo={type:"keyframes",duration:.8},Ho={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$o=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),Wo=(e,t,n,i={},a,o)=>r=>{const s=Ta(i,e)||{},l=s.delay||i.delay||0;let{elapsed:c=0}=i;c-=tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{r(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:o?void 0:a};(function(e){for(const t in e)if(!$o.has(t))return!0;return!1})(s)||Object.assign(u,((e,{keyframes:t})=>t.length>2?Uo:be.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:zo:Ho)(e,u)),u.duration&&(u.duration=tn(u.duration)),u.repeatDelay&&(u.repeatDelay=tn(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(No(u),0===u.delay&&(d=!0)),(Rt.instantAnimations||Rt.skipAnimations||a?.shouldSkipAnimations)&&(d=!0,No(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!o&&void 0!==t.get()){const e=pn(u.keyframes,s);if(void 0!==e)return void Ft.update(()=>{u.onUpdate(e),u.onComplete()})}return s.isSync?new Do(u):new Bo(u)};function qo({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,i}function Ko(e,t,{delay:n=0,transitionOverride:i,type:a}={}){let{transition:o,transitionEnd:r,...s}=t;const l=e.getDefaultTransition();o=o?Ca(o,l):l;const c=o?.reduceMotion;i&&(o=i);const u=[],d=a&&e.animationState&&e.animationState.getState()[a];for(const t in s){const i=e.getValue(t,e.latestValues[t]??null),a=s[t];if(void 0===a||d&&qo(d,t))continue;const r={delay:n,...Ta(o||{},t)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(a)&&a===l&&!r.velocity){Ft.update(()=>i.set(a));continue}let h=!1;if(window.MotionHandoffAnimation){const n=Ma(e);if(n){const e=window.MotionHandoffAnimation(n,t,Ft);null!==e&&(r.startTime=e,h=!0)}}Ia(e,t);const p=c??e.shouldReduceMotion;i.start(Wo(t,i,a,p&&rt.has(t)?{type:!1}:r,e,h));const f=i.animation;f&&u.push(f)}if(r){const t=()=>Ft.update(()=>{r&&function(e,t){const n=Sa(e,t);let{transitionEnd:i={},transition:a={},...o}=n||{};o={...o,...i};for(const t in o)Ea(e,t,Aa(o[t]))}(e,r)});u.length?Promise.all(u).then(t):t()}return u}function Yo(e,t,n,i=0,a=1){const o=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),r=e.size,s=(r-1)*i;return"function"==typeof n?n(o,r):1===a?o*i:s-o*i}function Go(e,t,n={}){const i=Sa(e,t,"exit"===n.type?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(Ko(e,i,n)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:s}=a;return function(e,t,n=0,i=0,a=0,o=1,r){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(Go(l,t,{...r,delay:n+("function"==typeof i?0:i)+Yo(e.variantChildren,l,i,a,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,i,o,r,s,n)}:()=>Promise.resolve(),{when:s}=a;if(s){const[e,t]="beforeChildren"===s?[o,r]:[r,o];return e().then(()=>t())}return Promise.all([o(),r(n.delay)])}const Xo=zn.length;function Jo(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Jo(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;nPromise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let i;if(e.notify("AnimationStart",t),Array.isArray(t)){const a=t.map(t=>Go(e,t,n));i=Promise.all(a)}else if("string"==typeof t)i=Go(e,t,n);else{const a="function"==typeof t?Sa(e,t,n.custom):t;i=Promise.all(Ko(e,a,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=ar(),i=!0,a=!1;const o=t=>(n,i)=>{const a=Sa(e,i,"exit"===t?e.presenceContext?.custom:void 0);if(a){const{transition:e,transitionEnd:t,...i}=a;n={...n,...i,...t}}return n};function r(r){const{props:s}=e,l=Jo(e.parent)||{},c=[],u=new Set;let d={},h=1/0;for(let t=0;th&&g,w=!1;const k=Array.isArray(m)?m:[m];let S=k.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:C={}}=f,T={...C,...S},P=t=>{b=!0,u.has(t)&&(w=!0,u.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in T){const t=S[e],n=C[e];if(d.hasOwnProperty(e))continue;let i=!1;i=Pa(t)&&Pa(n)?!Zo(t,n):t!==n,i?null!=t?P(e):u.add(e):void 0!==t&&u.has(e)?P(e):f.protectedKeys[e]=!0}f.prevProp=m,f.prevResolvedValues=S,f.isActive&&(d={...d,...S}),(i||a)&&e.blockInitialAnimation&&(b=!1);const E=v&&x;b&&(!E||w)&&c.push(...k.map(t=>{const n={type:p};if("string"==typeof t&&(i||a)&&!E&&e.manuallyAnimateOnMount&&e.parent){const{parent:i}=e,a=Sa(i,t);if(i.enteringChildren&&a){const{delayChildren:t}=a.transition||{};n.delay=Yo(i.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof s.initial){const n=Sa(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{const i=e.getBaseTarget(n),a=e.getValue(n);a&&(a.liveStyle=!0),t[n]=i??null}),c.push({animation:t})}let p=Boolean(c.length);return!i||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),i=!1,a=!1,p?t(c):Promise.resolve()}return{animateChanges:r,setActive:function(t,i){if(n[t].isActive===i)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,i)),n[t].isActive=i;const a=r(t);for(const e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=ar(),a=!0}}}function nr(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Zo(t,e)}function ir(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ar(){return{animate:ir(!0),whileInView:ir(),whileHover:ir(),whileTap:ir(),whileDrag:ir(),whileFocus:ir(),exit:ir()}}let or=0;const rr={animation:{Feature:class extends ka{constructor(e){super(e),e.animationState||(e.animationState=tr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Fn(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ka{constructor(){super(...arguments),this.id=or++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&!1===n){if(this.isExitComplete){const{initial:e,custom:t}=this.node.getProps();if("string"==typeof e){const n=Sa(this.node,e,t);if(n){const{transition:e,transitionEnd:t,...i}=n;for(const e in i)this.node.getValue(e)?.jump(i[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}},sr={x:!1,y:!1};function lr(){return sr.x||sr.y}function cr(e){return[e("x"),e("y")]}function ur(e){return e.max-e.min}function dr(e,t,n,i=.5){e.origin=i,e.originPoint=fi(t.min,t.max,e.origin),e.scale=ur(n)/ur(t),e.translate=fi(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function hr(e,t,n,i){dr(e.x,t.x,n.x,i?i.originX:void 0),dr(e.y,t.y,n.y,i?i.originY:void 0)}function pr(e,t,n,i=0){const a=i?fi(n.min,n.max,i):n.min;e.min=a+t.min,e.max=e.min+ur(t)}function fr(e,t,n,i=0){const a=i?fi(n.min,n.max,i):n.min;e.min=t.min-a,e.max=e.min+ur(t)}function mr(e,t,n,i){fr(e.x,t.x,n.x,i?.x),fr(e.y,t.y,n.y,i?.y)}const gr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),yr=new Set(["INPUT","SELECT","TEXTAREA"]);function vr(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function xr(e){return"object"==typeof e&&null!==e}function br(e){return xr(e)&&"ownerSVGElement"in e}function wr(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let i=document;t&&(i=t.current);const a=n?.[e]??i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(e=>null!=e)}const kr=new WeakMap;let Sr;const Cr=(e,t,n)=>(i,a)=>a&&a[0]?a[0][e+"Size"]:br(i)&&"getBBox"in i?i.getBBox()[t]:i[n],Tr=Cr("inline","width","offsetWidth"),Pr=Cr("block","height","offsetHeight");function Er({target:e,borderBoxSize:t}){kr.get(e)?.forEach(n=>{n(e,{get width(){return Tr(e,t)},get height(){return Pr(e,t)}})})}function Ar(e){e.forEach(Er)}const Ir=new Set;let Mr;function jr(e,t){return"function"==typeof e?(n=e,Ir.add(n),Mr||(Mr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ir.forEach(t=>t(e))},window.addEventListener("resize",Mr)),()=>{Ir.delete(n),Ir.size||"function"!=typeof Mr||(window.removeEventListener("resize",Mr),Mr=void 0)}):function(e,t){Sr||"undefined"!=typeof ResizeObserver&&(Sr=new ResizeObserver(Ar));const n=wr(e);return n.forEach(e=>{let n=kr.get(e);n||(n=new Set,kr.set(e,n)),n.add(t),Sr?.observe(e)}),()=>{n.forEach(e=>{const n=kr.get(e);n?.delete(t),n?.size||Sr?.unobserve(e)})}}(e,t);var n}const Dr=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Lr(e){return{point:{x:e.pageX,y:e.pageY}}}function Rr(e,t,n,i){return vr(e,t,(e=>t=>Dr(t)&&e(t,Lr(t)))(n),i)}const Or=({current:e})=>e?e.ownerDocument.defaultView:null,Nr=(e,t)=>Math.abs(e-t),_r=new Set(["auto","scroll"]);class Fr{constructor(e,t,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Vr(this.lastRawMoveEventInfo,this.transformPagePoint));const e=zr(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Nr(e.x,t.x),i=Nr(e.y,t.y);return Math.sqrt(n**2+i**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:i}=e,{timestamp:a}=Bt;this.history.push({...i,timestamp:a});const{onStart:o,onMove:r}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Vr(t,this.transformPagePoint),Ft.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:a}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||a&&a(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=zr("pointercancel"===e.type?this.lastMoveEventInfo:Vr(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),i&&i(e,o)},!Dr(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const s=Vr(Lr(e),this.transformPagePoint),{point:l}=s,{timestamp:c}=Bt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=t;u&&u(e,zr(s,this.history)),this.removeListeners=Da(Rr(this.contextWindow,"pointermove",this.handlePointerMove),Rr(this.contextWindow,"pointerup",this.handlePointerUp),Rr(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(_r.has(e.overflowX)||_r.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a=i.x-t.x,o=i.y-t.y;0===a&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=a,this.history[0].y-=o),this.scrollPositions.set(e,i),Ft.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vt(this.updatePoint)}}function Vr(e,t){return t?{point:t(e.point)}:e}function Br(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zr({point:e},t){return{point:e,delta:Br(e,Hr(t)),offset:Br(e,Ur(t)),velocity:$r(t,.1)}}function Ur(e){return e[0]}function Hr(e){return e[e.length-1]}function $r(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const a=Hr(e);for(;n>=0&&(i=e[n],!(a.timestamp-i.timestamp>tn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&a.timestamp-i.timestamp>2*tn(t)&&(i=e[1]);const o=nn(a.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(a.x-i.x)/o,y:(a.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Wr(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function qr(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min{t&&this.snapToCursor(Lr(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?sr[o]?null:(sr[o]=!0,()=>{sr[o]=!1}):sr.x||sr.y?null:(sr.x=sr.y=!0,()=>{sr.x=sr.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cr(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Oe.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[e];i&&(t=ur(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),a&&Ft.update(()=>a(e,t),!1,!0),Ia(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:a,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=t;if(i&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(r),void(null!==this.currentDirection&&a&&a(this.currentDirection));this.updateAxis("x",t.point,r),this.updateAxis("y",t.point,r),this.visualElement.render(),o&&Ft.update(()=>o(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:a,distanceThreshold:n,contextWindow:Or(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Ft.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:i}=this.getProps();if(!n||!Qr(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,{min:t,max:n},i){return void 0!==t&&en&&(e=i?fi(n,e,i.max):Math.min(e,n)),e}(o,this.constraints[e],this.elastic[e])),a.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&ma(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:i,right:a}){return{x:Wr(e.x,n,a),y:Wr(e.y,t,i)}}(n.layoutBox,e),this.elastic=function(e=Kr){return!1===e?e=0:!0===e&&(e=Kr),{x:Yr(e,"left","right"),y:Yr(e,"top","bottom")}}(t),i!==this.constraints&&!ma(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&cr(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ma(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=function(e,t,n){const i=_i(e,n),{scroll:a}=t;return a&&(Li(i.x,a.offset.x),Li(i.y,a.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(e,t){return{x:qr(e.x,t.x),y:qr(e.y,t.y)}}(i.layout.layoutBox,a);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=wi(e))}return o}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),s=this.constraints||{},l=cr(r=>{if(!Qr(r,t,this.currentDirection))return;let l=s&&s[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,d={type:"inertia",velocity:n?e[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Ia(this.visualElement,e),n.start(Wo(e,n,0,t,this.visualElement,!1))}stopAnimation(){cr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){cr(t=>{const{drag:n}=this.getProps();if(!Qr(t,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(t);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[t],r=a.get()||0;a.set(e[t]-fi(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ma(t)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};cr(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();i[e]=function(e,t){let n=.5;const i=ur(e),a=ur(t);return a>i?n=To(t.min,t.max-i,e.min):i>a&&(n=To(e.min,e.max-a,t.min)),we(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),cr(t=>{if(!Qr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:a,max:o}=this.constraints[t];n.set(fi(a,o,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Xr.set(this.visualElement,this);const e=this.visualElement.current,t=Rr(e,"pointerdown",t=>{const{drag:n,dragListener:i=!0}=this.getProps(),a=t.target,o=a!==e&&function(e){return yr.has(e.tagName)||!0===e.isContentEditable}(a);n&&i&&!o&&this.start(t)});let n;const i=()=>{const{dragConstraints:t}=this.getProps();ma(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const i=jr(e,Zr(n)),a=jr(t,Zr(n));return()=>{i(),a()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,o=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Ft.read(i);const r=vr(window,"resize",()=>this.scalePositionWithinConstraints()),s=a.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(cr(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{r(),t(),o(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=Kr,dragMomentum:r=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:r}}}function Zr(e){let t=!0;return()=>{t?t=!1:e()}}function Qr(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const es=e=>(t,n)=>{e&&Ft.update(()=>e(t,n),!1,!0)},ts={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ns(e=!0){const t=(0,h.useContext)(na);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:i,register:a}=t,o=(0,h.useId)();(0,h.useEffect)(()=>{if(e)return a(o)},[e]);const r=(0,h.useCallback)(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,r]:[!0]}let is=!1;class as extends h.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;a&&(t.group&&t.group.add(a),n&&n.register&&i&&n.register(a),is&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ts.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:i,isPresent:a}=this.props,{projection:o}=n;return o?(o.isPresent=a,e.layoutDependency!==t&&o.setOptions({...o.options,layoutDependency:t}),is=!0,i||e.layoutDependency!==t||void 0===t||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Ft.postRender(()=>{const e=o.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Pn.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:i}=e;is=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function os(e){const[t,n]=ns(),i=(0,h.useContext)(Ui);return(0,ve.jsx)(as,{...e,layoutGroup:i,switchLayoutGroup:(0,h.useContext)(fa),isPresent:t,safeToRemove:n})}function rs(e,t,n){const i=ot(e)?e:Rn(e);return i.start(Wo("",i,t,n)),i.animation}function ss(e){return br(e)&&"svg"===e.tagName}const ls=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],cs=ls.length,us=e=>"string"==typeof e?parseFloat(e):e,ds=e=>"number"==typeof e||Ne.test(e);function hs(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const ps=ms(0,.5,wo),fs=ms(.5,.95,Lt);function ms(e,t,n){return i=>it?1:n(To(e,t,i))}function gs(e,t){e.min=t.min,e.max=t.max}function ys(e,t){gs(e.x,t.x),gs(e.y,t.y)}function vs(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xs(e,t,n,i,a){return e=Ei(e-=t,1/n,i),void 0!==a&&(e=Ei(e,1/a,i)),e}function bs(e,t,[n,i,a],o,r){!function(e,t=0,n=1,i=.5,a,o=e,r=e){if(Oe.test(t)&&(t=parseFloat(t),t=fi(r.min,r.max,t/100)-r.min),"number"!=typeof t)return;let s=fi(o.min,o.max,i);e===o&&(s-=t),e.min=xs(e.min,t,n,s,a),e.max=xs(e.max,t,n,s,a)}(e,t[n],t[i],t[a],t.scale,o,r)}const ws=["x","scaleX","originX"],ks=["y","scaleY","originY"];function Ss(e,t,n,i){bs(e.x,t,ws,n?n.x:void 0,i?i.x:void 0),bs(e.y,t,ks,n?n.y:void 0,i?i.y:void 0)}function Cs(e){return 0===e.translate&&1===e.scale}function Ts(e){return Cs(e.x)&&Cs(e.y)}function Ps(e,t){return e.min===t.min&&e.max===t.max}function Es(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function As(e,t){return Es(e.x,t.x)&&Es(e.y,t.y)}function Is(e){return ur(e.x)/ur(e.y)}function Ms(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class js{constructor(){this.members=[]}add(e){an(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(on(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(on(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent&&!1!==e.instance?.isConnected)return this.promote(e),!0}return!1}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:a}=e.options;void 0!==i&&i===a||(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ds=(e,t)=>e.depth-t.depth;class Ls{constructor(){this.children=[],this.isDirty=!1}add(e){an(this.children,e),this.isDirty=!0}remove(e){on(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ds),this.isDirty=!1,this.children.forEach(e)}}const Rs={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Os=["","X","Y","Z"];let Ns=0;function _s(e,t,n,i){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),i&&(i[e]=0))}function Fs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ma(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ft,!(t||i))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&Fs(i)}function Vs({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:a}){return class{constructor(e={},n=t?.()){this.id=Ns++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Nt.value&&(Rs.nodes=Rs.calculatedTargetDeltas=Rs.calculatedProjections=0),this.nodes.forEach(Us),this.nodes.forEach(Js),this.nodes.forEach(Zs),this.nodes.forEach(Hs),Nt.addProjectionMetrics&&Nt.addProjectionMetrics(Rs)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;Ft.read(()=>{i=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==i&&(i=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Mn.now(),i=({timestamp:a})=>{const o=a-n;o>=t&&(Vt(i),e(o-t))};return Ft.setup(i,!0),()=>Vt(i)}(a,250),ts.hasAnimatedSinceResize&&(ts.hasAnimatedSinceResize=!1,this.nodes.forEach(Xs)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||al,{onLayoutAnimationStart:r,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!As(this.targetLayout,i),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...Ta(o,"layout"),onPlay:r,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c)}else t||Xs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Qs),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Fs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ur(this.snapshot.measuredBox.x)||ur(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eji&&(t.x=1),t.yji&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,t),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:s}=e;s?(this.projectionDelta&&this.prevProjectionDelta?(vs(this.prevProjectionDelta.x,this.projectionDelta.x),vs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),hr(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Ms(this.projectionDelta.x,this.prevProjectionDelta.x)&&Ms(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",s)),Nt.value&&Rs.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,i=n?n.latestValues:{},a={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const r={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(s&&!c&&!0===this.options.crossfade&&!this.path.some(il));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,p,f,m,g;tl(o.x,e.x,n),tl(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mr(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),p=this.relativeTarget,f=this.relativeTargetOrigin,m=r,g=n,nl(p.x,f.x,m.x,g),nl(p.y,f.y,m.y,g),d&&(l=this.relativeTarget,h=d,Ps(l.x,h.x)&&Ps(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ys(d,this.relativeTarget)),s&&(this.animationValues=a,function(e,t,n,i,a,o){a?(e.opacity=fi(0,n.opacity??1,ps(i)),e.opacityExit=fi(t.opacity??1,0,fs(i))):o&&(e.opacity=fi(t.opacity??1,n.opacity??1,i));for(let a=0;a{ts.hasAnimatedSinceResize=!0,mn.layout++,this.motionValue||(this.motionValue=Rn(0)),this.motionValue.jump(0,!1),this.currentAnimation=rs(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{mn.layout--},onComplete:()=>{mn.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:i,latestValues:a}=e;if(t&&n&&i){if(this!==e&&this.layout&&i&&ll(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=ur(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const i=ur(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+i}ys(t,n),Ni(t,a),hr(this.projectionDeltaWithTransform,this.layoutCorrected,t,a)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new js),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){const{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const i={};n.z&&_s("z",e,i,this.animationValues);for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(Ws),this.root.sharedNodes.clear()}}}function Bs(e){e.updateLayout()}function zs(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if("size"===a)cr(e=>{const i=o?t.measuredBox[e]:t.layoutBox[e],a=ur(i);i.min=n[e].min,i.max=i.min+a});else if("x"===a||"y"===a){const e="x"===a?"y":"x";gs(o?t.measuredBox[e]:t.layoutBox[e],n[e])}else ll(a,t.layoutBox,n)&&cr(i=>{const a=o?t.measuredBox[i]:t.layoutBox[i],r=ur(n[i]);a.max=a.min+r,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};hr(r,n,t.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?hr(s,e.applyTransform(i,!0),t.measuredBox):hr(s,n,t.layoutBox);const l=!Ts(r);let c=!1;if(!e.resumeFrom){const i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:a,layout:o}=i;if(a&&o){const r=e.options.layoutAnchor||void 0,s={x:{min:0,max:0},y:{min:0,max:0}};mr(s,t.layoutBox,a.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};mr(l,n,o.layoutBox,r),As(s,l)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=s,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:s,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Us(e){Nt.value&&Rs.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Hs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $s(e){e.clearSnapshot()}function Ws(e){e.clearMeasurements()}function qs(e){e.isLayoutDirty=!0,e.updateLayout()}function Ks(e){e.isLayoutDirty=!1}function Ys(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Gs(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Xs(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Js(e){e.resolveTargetDelta()}function Zs(e){e.calcProjection()}function Qs(e){e.resetSkewAndRotation()}function el(e){e.removeLeadSnapshot()}function tl(e,t,n){e.translate=fi(t.translate,0,n),e.scale=fi(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nl(e,t,n,i){e.min=fi(t.min,n.min,i),e.max=fi(t.max,n.max,i)}function il(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const al={duration:.45,ease:[.4,0,.1,1]},ol=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rl=ol("applewebkit/")&&!ol("chrome/")?Math.round:Lt;function sl(e){e.min=rl(e.min),e.max=rl(e.max)}function ll(e,t,n){return"position"===e||"preserve-aspect"===e&&(i=Is(t),a=Is(n),!(Math.abs(i-a)<=.2));var i,a}function cl(e){return e!==e.root&&e.scroll?.wasRoot}const ul=Vs({attachResizeListener:(e,t)=>vr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),dl={current:void 0},hl=Vs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dl.current){const e=new ul({});e.mount(window),e.setOptions({layoutScroll:!0}),dl.current=e}return dl.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),pl={pan:{Feature:class extends ka{constructor(){super(...arguments),this.removePointerDownListener=Lt}onPointerDown(e){this.session=new Fr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Or(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:es(e),onStart:es(t),onMove:es(n),onEnd:(e,t)=>{delete this.session,i&&Ft.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=Rr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ka{constructor(e){super(e),this.removeGroupControls=Lt,this.removeListeners=Lt,this.controls=new Jr(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Lt}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:hl,MeasureLayout:os}};function fl(e,t){const n=wr(e),i=new AbortController;return[n,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function ml(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===n);const a=i["onHover"+n];a&&Ft.postRender(()=>a(t,Lr(t)))}function gl(e){return xr(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const yl=(e,t)=>!!t&&(e===t||yl(e,t.parentElement)),vl=new WeakSet;function xl(e){return t=>{"Enter"===t.key&&e(t)}}function bl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function wl(e){return Dr(e)&&!lr()}const kl=new WeakSet;function Sl(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===n);const a=i["onTap"+("End"===n?"":n)];a&&Ft.postRender(()=>a(t,Lr(t)))}const Cl=new WeakMap,Tl=new WeakMap,Pl=e=>{const t=Cl.get(e.target);t&&t(e)},El=e=>{e.forEach(Pl)};const Al={some:0,all:1},Il=wa({...rr,...{inView:{Feature:class extends ka{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:i="some",once:a}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Al[i]};this.stopObserver=function(e,t,n){const i=function({root:e,...t}){const n=e||document;Tl.has(n)||Tl.set(n,{});const i=Tl.get(n),a=JSON.stringify(t);return i[a]||(i[a]=new IntersectionObserver(El,{root:e,...t})),i[a]}(t);return Cl.set(e,n),i.observe(e),()=>{Cl.delete(e),i.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,a&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=t?n:i;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends ka{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=function(e,t,n={}){const[i,a,o]=fl(e,n),r=e=>{const i=e.currentTarget;if(!wl(e))return;if(kl.has(e))return;vl.add(i),n.stopPropagation&&kl.add(e);const o=t(i,e),r=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),vl.has(i)&&vl.delete(i),wl(e)&&"function"==typeof o&&o(e,{success:t})},s=e=>{r(e,i===window||i===document||n.useGlobalTarget||yl(i,e.target))},l=e=>{r(e,!1)};window.addEventListener("pointerup",s,a),window.addEventListener("pointercancel",l,a)};return i.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",r,a),gl(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const i=xl(()=>{if(vl.has(n))return;bl(n,"down");const e=xl(()=>{bl(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>bl(n,"cancel"),t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)})(e,a)),t=e,gr.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),o}(e,(e,t)=>(Sl(this.node,t,"Start"),(e,{success:t})=>Sl(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ka{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Da(vr(this.node.current,"focus",()=>this.onFocus()),vr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ka{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[i,a,o]=fl(e,n);return i.forEach(e=>{let n,i=!1,o=!1;const r=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{i=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),o&&(o=!1,r(e))},l=e=>{"touch"!==e.pointerType&&(i?o=!0:r(e))};e.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||lr())return;o=!1;const r=t(e,i);"function"==typeof r&&(n=r,e.addEventListener("pointerleave",l,a))},a),e.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",s,a),window.addEventListener("pointercancel",s,a)},a)}),o}(e,(e,t)=>(ml(this.node,t,"Start"),e=>ml(this.node,e,"End"))))}unmount(){}}}},...pl,layout:{ProjectionNode:hl,MeasureLayout:os}},zi);function Ml(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class jl extends h.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(gl(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=gl(e)&&e.offsetWidth||0,i=gl(e)&&e.offsetHeight||0,a=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=n-o.width-o.left,o.bottom=i-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Dl({children:e,isPresent:t,anchorX:n,anchorY:i,root:a,pop:o}){const r=(0,h.useId)(),s=(0,h.useRef)(null),l=(0,h.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=(0,h.useContext)($i),u=e.props?.ref??e?.ref,d=function(...e){return h.useCallback(function(...e){return t=>{let n=!1;const i=e.map(e=>{const i=Ml(e,t);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let t=0;t{const{width:e,height:u,top:d,left:h,right:p,bottom:f}=l.current;if(t||!1===o||!s.current||!e||!u)return;const m="left"===n?`left: ${h}`:`right: ${p}`,g="bottom"===i?`bottom: ${f}`:`top: ${d}`;s.current.dataset.motionPopId=r;const y=document.createElement("style");c&&(y.nonce=c);const v=a??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${u}px !important;\n ${m}px !important;\n ${g}px !important;\n }\n `),()=>{s.current?.removeAttribute("data-motion-pop-id"),v.contains(y)&&v.removeChild(y)}},[t]),(0,ve.jsx)(jl,{isPresent:t,childRef:s,sizeRef:l,pop:o,children:!1===o?e:h.cloneElement(e,{ref:d})})}const Ll=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:a,presenceAffectsLayout:o,mode:r,anchorX:s,anchorY:l,root:c})=>{const u=ia(Rl),d=(0,h.useId)();let p=!0,f=(0,h.useMemo)(()=>(p=!1,{id:d,initial:t,isPresent:n,custom:a,onExitComplete:e=>{u.set(e,!0);for(const e of u.values())if(!e)return;i&&i()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,i]);return o&&p&&(f={...f}),(0,h.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),h.useEffect(()=>{!n&&!u.size&&i&&i()},[n]),e=(0,ve.jsx)(Dl,{pop:"popLayout"===r,isPresent:n,anchorX:s,anchorY:l,root:c,children:e}),(0,ve.jsx)(na.Provider,{value:f,children:e})};function Rl(){return new Map}const Ol=e=>e.key||"";function Nl(e){const t=[];return h.Children.forEach(e,e=>{(0,h.isValidElement)(e)&&t.push(e)}),t}const _l=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:o="sync",propagate:r=!1,anchorX:s="left",anchorY:l="top",root:c})=>{const[u,d]=ns(r),p=(0,h.useMemo)(()=>Nl(e),[e]),f=r&&!u?[]:p.map(Ol),m=(0,h.useRef)(!0),g=(0,h.useRef)(p),y=ia(()=>new Map),v=(0,h.useRef)(new Set),[x,b]=(0,h.useState)(p),[w,k]=(0,h.useState)(p);ga(()=>{m.current=!1,g.current=p;for(let e=0;e{const h=Ol(e),x=!(r&&!u)&&(p===w||f.includes(h));return(0,ve.jsx)(Ll,{isPresent:x,initial:!(m.current&&!n)&&void 0,custom:t,presenceAffectsLayout:a,mode:o,root:c,onExitComplete:x?void 0:()=>{if(v.current.has(h))return;if(!y.has(h))return;v.current.add(h),y.set(h,!0);let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(C?.(),k(g.current),r&&d?.(),i&&i())},anchorX:s,anchorY:l,children:e},h)})})};function Fl(e){const t=ia(()=>Rn(e)),{isStatic:n}=(0,h.useContext)($i);if(n){const[,n]=(0,h.useState)(e);(0,h.useEffect)(()=>t.on("change",n),[])}return t}class Vl{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(n=>{n.start(e.nativeEvent||e,t)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}}const Bl=()=>new Vl;class zl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;nt.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Ul(this.animations,"duration")}get iterationDuration(){return Ul(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Ul(e,t){let n=0;for(let i=0;in&&(n=a)}return n}class Hl extends zl{then(e,t){return this.finished.finally(e).then(()=>{})}}function $l(e,t){return po(e)?e[((e,t,n)=>{const i=t-0;return((n-0)%i+i)%i+0})(0,e.length,t)]:e}function Wl(e){return"object"==typeof e&&!Array.isArray(e)}function ql(e,t,n,i){return null==e?[]:"string"==typeof e&&Wl(t)?wr(e,n,i):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>null!=e):[e]}function Kl(e,t,n){return e*(t+1)}function Yl(e,t,n,i){return"number"==typeof t?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):"<"===t?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):i.get(t)??e}function Gl(e,t,n,i,a,o){!function(e,t,n){for(let i=0;it&&a.at"number"==typeof e,ic=e=>e.every(nc);class ac extends Zn{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,t){if(function(e,t){return e in t}(t,e)){const n=e[t];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}}function oc(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=br(e)&&!ss(e)?new bi(t):new Fi(t);n.mount(e),Nn.set(e,n)}function rc(e){const t=new ac({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),Nn.set(e,t)}function sc(e,t,n,i){const a=[];if(function(e,t){return ot(e)||"number"==typeof e||"string"==typeof e&&!Wl(t)}(e,t))a.push(rs(e,Wl(t)&&t.default||t,n&&n.default||n));else{if(null==e)return a;const o=ql(e,t,i),r=o.length;Boolean(r);for(let e=0;e{const l=ec(e),{delay:c=0,times:u=Eo(l),type:p=t.type||"keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:x=t.ease||"easeOut",duration:b}=n;const w="function"==typeof c?c(r,s):c,k=l.length,S=Sn(p)?p:a?.[p||"keyframes"];if(k<=2&&S){let e=100;if(2===k&&ic(l)){const t=l[1]-l[0];e=Math.abs(t)}const n={...t,...v};void 0!==b&&(n.duration=tn(b));const i=Ga(n,e,S);x=i.ease,b=i.duration}b??(b=o);const C=d+w;1===u.length&&0===u[0]&&(u[1]=1);const T=u.length-l.length;if(T>0&&Po(u,T),1===l.length&&l.unshift(null),f){b=Kl(b,f);const e=[...l],t=[...u];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let i=0;i{for(const a in e){const o=e[a];o.sort(Jl);const s=[],l=[],c=[];for(let e=0;e{if(Array.isArray(e)&&"function"==typeof e[0]){const t=e[0],n=Rn(0);return n.on("change",t),1===e.length?[n,[0,1]]:2===e.length?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:ao});return a.forEach(({keyframes:e,transition:t},n)=>{i.push(...sc(n,e,t))}),i}(e,void 0!==n?{reduceMotion:n,...s}:s,t)}else{const{onComplete:s,...l}=a||{};"function"==typeof s&&(o=s),r=sc(e,i,void 0!==n?{reduceMotion:n,...l}:l,t)}var s;const l=new Hl(r);return o&&l.finished.then(o),t&&(t.animations.push(l),l.finished.then(()=>{on(t.animations,l)})),l}}(),cc=window.wp.i18n;function uc(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var dc=Symbol.for("react.lazy"),hc=p[" use ".trim().toString()];function pc(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===dc&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t;var t}function fc(e){const t=gc(e),n=h.forwardRef((e,n)=>{let{children:i,...a}=e;pc(i)&&"function"==typeof hc&&(i=hc(i._payload));const o=h.Children.toArray(i),r=o.find(vc);if(r){const e=r.props.children,i=o.map(t=>t===r?h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null:t);return(0,ve.jsx)(t,{...a,ref:n,children:h.isValidElement(e)?h.cloneElement(e,void 0,i):null})}return(0,ve.jsx)(t,{...a,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}var mc=fc("Slot");function gc(e){const t=h.forwardRef((e,t)=>{let{children:n,...i}=e;if(pc(n)&&"function"==typeof hc&&(n=hc(n._payload)),h.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),a=function(e,t){const n={...t};for(const i in t){const a=e[i],o=t[i];/^on[A-Z]/.test(i)?a&&o?n[i]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(n[i]=a):"style"===i?n[i]={...a,...o}:"className"===i&&(n[i]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==h.Fragment&&(a.ref=t?function(...e){return t=>{let n=!1;const i=e.map(e=>{const i=uc(e,t);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let t=0;t1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yc=Symbol("radix.slottable");function vc(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===yc}function xc(){}function bc(){}const wc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kc=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sc={};function Cc(e,t){return((t||Sc).jsx?kc:wc).test(e)}const Tc=/[ \t\n\f\r]/g;function Pc(e){return""===e.replace(Tc,"")}class Ec{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Ac(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new Ec(n,i,t)}function Ic(e){return e.toLowerCase()}Ec.prototype.normal={},Ec.prototype.property={},Ec.prototype.space=void 0;class Mc{constructor(e,t){this.attribute=t,this.property=e}}Mc.prototype.attribute="",Mc.prototype.booleanish=!1,Mc.prototype.boolean=!1,Mc.prototype.commaOrSpaceSeparated=!1,Mc.prototype.commaSeparated=!1,Mc.prototype.defined=!1,Mc.prototype.mustUseProperty=!1,Mc.prototype.number=!1,Mc.prototype.overloadedBoolean=!1,Mc.prototype.property="",Mc.prototype.spaceSeparated=!1,Mc.prototype.space=void 0;let jc=0;const Dc=Vc(),Lc=Vc(),Rc=Vc(),Oc=Vc(),Nc=Vc(),_c=Vc(),Fc=Vc();function Vc(){return 2**++jc}const Bc=Object.keys(s);class zc extends Mc{constructor(e,t,n,i){let a=-1;if(super(e,t),Uc(this,"space",i),"number"==typeof n)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Wc(e,t){return t in e?e[t]:t}function qc(e,t){return Wc(e,t.toLowerCase())}const Kc=Hc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_c,acceptCharset:Nc,accessKey:Nc,action:null,allow:null,allowFullScreen:Dc,allowPaymentRequest:Dc,allowUserMedia:Dc,alt:null,as:null,async:Dc,autoCapitalize:null,autoComplete:Nc,autoFocus:Dc,autoPlay:Dc,blocking:Nc,capture:null,charSet:null,checked:Dc,cite:null,className:Nc,cols:Oc,colSpan:null,content:null,contentEditable:Lc,controls:Dc,controlsList:Nc,coords:Oc|_c,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Dc,defer:Dc,dir:null,dirName:null,disabled:Dc,download:Rc,draggable:Lc,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Dc,formTarget:null,headers:Nc,height:Oc,hidden:Rc,high:Oc,href:null,hrefLang:null,htmlFor:Nc,httpEquiv:Nc,id:null,imageSizes:null,imageSrcSet:null,inert:Dc,inputMode:null,integrity:null,is:null,isMap:Dc,itemId:null,itemProp:Nc,itemRef:Nc,itemScope:Dc,itemType:Nc,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Dc,low:Oc,manifest:null,max:null,maxLength:Oc,media:null,method:null,min:null,minLength:Oc,multiple:Dc,muted:Dc,name:null,nonce:null,noModule:Dc,noValidate:Dc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Dc,optimum:Oc,pattern:null,ping:Nc,placeholder:null,playsInline:Dc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Dc,referrerPolicy:null,rel:Nc,required:Dc,reversed:Dc,rows:Oc,rowSpan:Oc,sandbox:Nc,scope:null,scoped:Dc,seamless:Dc,selected:Dc,shadowRootClonable:Dc,shadowRootDelegatesFocus:Dc,shadowRootMode:null,shape:null,size:Oc,sizes:null,slot:null,span:Oc,spellCheck:Lc,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oc,step:null,style:null,tabIndex:Oc,target:null,title:null,translate:null,type:null,typeMustMatch:Dc,useMap:null,value:Lc,width:Oc,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nc,axis:null,background:null,bgColor:null,border:Oc,borderColor:null,bottomMargin:Oc,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Dc,declare:Dc,event:null,face:null,frame:null,frameBorder:null,hSpace:Oc,leftMargin:Oc,link:null,longDesc:null,lowSrc:null,marginHeight:Oc,marginWidth:Oc,noResize:Dc,noHref:Dc,noShade:Dc,noWrap:Dc,object:null,profile:null,prompt:null,rev:null,rightMargin:Oc,rules:null,scheme:null,scrolling:Lc,standby:null,summary:null,text:null,topMargin:Oc,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oc,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Dc,disableRemotePlayback:Dc,prefix:null,property:null,results:Oc,security:null,unselectable:null},space:"html",transform:qc}),Yc=Hc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Fc,accentHeight:Oc,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oc,amplitude:Oc,arabicForm:null,ascent:Oc,attributeName:null,attributeType:null,azimuth:Oc,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oc,by:null,calcMode:null,capHeight:Oc,className:Nc,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oc,diffuseConstant:Oc,direction:null,display:null,dur:null,divisor:Oc,dominantBaseline:null,download:Dc,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oc,enableBackground:null,end:null,event:null,exponent:Oc,externalResourcesRequired:null,fill:null,fillOpacity:Oc,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_c,g2:_c,glyphName:_c,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oc,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oc,horizOriginX:Oc,horizOriginY:Oc,id:null,ideographic:Oc,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oc,k:Oc,k1:Oc,k2:Oc,k3:Oc,k4:Oc,kernelMatrix:Fc,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oc,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oc,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oc,overlineThickness:Oc,paintOrder:null,panose1:null,path:null,pathLength:Oc,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nc,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oc,pointsAtY:Oc,pointsAtZ:Oc,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fc,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fc,rev:Fc,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fc,requiredFeatures:Fc,requiredFonts:Fc,requiredFormats:Fc,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oc,specularExponent:Oc,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oc,strikethroughThickness:Oc,string:null,stroke:null,strokeDashArray:Fc,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oc,strokeOpacity:Oc,strokeWidth:null,style:null,surfaceScale:Oc,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fc,tabIndex:Oc,tableValues:null,target:null,targetX:Oc,targetY:Oc,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fc,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oc,underlineThickness:Oc,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oc,values:null,vAlphabetic:Oc,vMathematical:Oc,vectorEffect:null,vHanging:Oc,vIdeographic:Oc,version:null,vertAdvY:Oc,vertOriginX:Oc,vertOriginY:Oc,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oc,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Wc}),Gc=Hc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Xc=Hc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qc}),Jc=Hc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Zc=Ac([$c,Kc,Gc,Xc,Jc],"html"),Qc=Ac([$c,Yc,Gc,Xc,Jc],"svg"),eu=/[A-Z]/g,tu=/-[a-z]/g,nu=/^data[-\w.:]+$/i;function iu(e){return"-"+e.toLowerCase()}function au(e){return e.charAt(1).toUpperCase()}const ou={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"};var ru=r(229);const su=cu("end"),lu=cu("start");function cu(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function uu(e){return e&&"object"==typeof e?"position"in e||"type"in e?hu(e.position):"start"in e||"end"in e?hu(e):"line"in e||"column"in e?du(e):"":""}function du(e){return pu(e&&e.line)+":"+pu(e&&e.column)}function hu(e){return du(e&&e.start)+"-"+du(e&&e.end)}function pu(e){return e&&"number"==typeof e?e:1}class fu extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let i="",a={},o=!1;if(t&&(a="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?i=e:!a.cause&&e&&(o=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?a.ruleId=n:(a.source=n.slice(0,e),a.ruleId=n.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){const e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}const r=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=r?r.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=r?r.line:void 0,this.name=uu(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fu.prototype.file="",fu.prototype.name="",fu.prototype.reason="",fu.prototype.message="",fu.prototype.stack="",fu.prototype.column=void 0,fu.prototype.line=void 0,fu.prototype.ancestors=void 0,fu.prototype.cause=void 0,fu.prototype.fatal=void 0,fu.prototype.place=void 0,fu.prototype.ruleId=void 0,fu.prototype.source=void 0;const mu={}.hasOwnProperty,gu=new Map,yu=/[A-Z]/g,vu=new Set(["table","tbody","thead","tfoot","tr"]),xu=new Set(["td","th"]),bu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wu(e,t,n){return"element"===t.type?function(e,t,n){const i=e.schema;let a=i;"svg"===t.tagName.toLowerCase()&&"html"===i.space&&(a=Qc,e.schema=a),e.ancestors.push(t);const o=Pu(e,t.tagName,!1),r=function(e,t){const n={};let i,a;for(a in t.properties)if("children"!==a&&mu.call(t.properties,a)){const o=Tu(e,a,t.properties[a]);if(o){const[a,r]=o;e.tableCellAlignToStyle&&"align"===a&&"string"==typeof r&&xu.has(t.tagName)?i=r:n[a]=r}}return i&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=i),n}(e,t);let s=Cu(e,t);return vu.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&Pc(t.value):Pc(t));var t})),ku(e,r,o,t),Su(r,s),e.ancestors.pop(),e.schema=i,e.create(t,o,r,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Eu(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const i=e.schema;let a=i;"svg"===t.name&&"html"===i.space&&(a=Qc,e.schema=a),e.ancestors.push(t);const o=null===t.name?e.Fragment:Pu(e,t.name,!0),r=function(e,t){const n={};for(const i of t.attributes)if("mdxJsxExpressionAttribute"===i.type)if(i.data&&i.data.estree&&e.evaluater){const t=i.data.estree.body[0];xc(t.type);const a=t.expression;xc(a.type);const o=a.properties[0];xc(o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Eu(e,t.position);else{const a=i.name;let o;if(i.value&&"object"==typeof i.value)if(i.value.data&&i.value.data.estree&&e.evaluater){const t=i.value.data.estree.body[0];xc(t.type),o=e.evaluater.evaluateExpression(t.expression)}else Eu(e,t.position);else o=null===i.value||i.value;n[a]=o}return n}(e,t),s=Cu(e,t);return ku(e,r,o,t),Su(r,s),e.ancestors.pop(),e.schema=i,e.create(t,o,r,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Eu(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const i={};return Su(i,Cu(e,t)),e.create(t,e.Fragment,i,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function ku(e,t,n,i){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Su(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Cu(e,t){const n=[];let i=-1;const a=e.passKeys?new Map:gu;for(;++i4&&"data"===n.slice(0,4)&&nu.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(tu,au);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!tu.test(e)){let n=e.replace(eu,iu);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}a=zc}return new a(i,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===i.property){let t="object"==typeof n?n:function(e,t){try{return ru(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,i=new fu("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=bu+"#cannot-parse-style-attribute",i}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)mu.call(e,n)&&(t[Au(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&i.space?ou[i.property]||i.property:i.attribute,n]}}function Pu(e,t,n){let i;if(n)if(t.includes(".")){const e=t.split(".");let n,a=-1;for(;++aa?0:a+t:t>a?a:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);r0?(Ru(e,e.length,0,t),e):t}class Nu{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const i=t||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&_u(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),_u(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_u(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e-1&&e.test(String.fromCharCode(t))}}function nd(e,t,n,i){const a=i?i-1:Number.POSITIVE_INFINITY;let o=0;return function(i){return Zu(i)?(e.enter(n),r(i)):t(i)};function r(i){return Zu(i)&&o++o))return;const n=t.events.length;let a,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(a){s=t.events[l][1].end;break}a=!0}for(y(r),e=n;ei;){const i=n[a];t.containerState=i[1],i[0].exit.call(t,e)}n.length=i}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}},od={tokenize:function(e,t,n){return nd(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},rd={partial:!0,tokenize:function(e,t,n){return function(t){return Zu(t)?nd(e,i,"linePrefix")(t):i(t)};function i(e){return null===e||Xu(e)?t(e):n(e)}}},sd={resolve:function(e){return Fu(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(t)};function i(t){return null===t?a(t):Xu(t)?e.check(ld,o,a)(t):(e.consume(t),i)}function a(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}},ld={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),nd(e,a,"linePrefix")};function a(a){if(null===a||Xu(a))return n(a);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(i.parser.constructs.flow,n,t)(a)}}},cd={tokenize:function(e){const t=this,n=e.attempt(rd,function(i){if(null!==i)return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(i)},e.attempt(this.parser.constructs.flowInitial,i,nd(e,e.attempt(this.parser.constructs.flow,i,e.attempt(sd,i)),"linePrefix")));return n;function i(i){if(null!==i)return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(i)}}},ud={resolveAll:fd()},dd=pd("string"),hd=pd("text");function pd(e){return{resolveAll:fd("text"===e?md:void 0),tokenize:function(t){const n=this,i=this.parser.constructs[e],a=t.attempt(i,o,r);return o;function o(e){return l(e)?a(e):r(e)}function r(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=i[e];let a=-1;if(t)for(;++a=3&&(null===o||Xu(o))?(e.exit("thematicBreak"),t(o)):n(o)}function r(t){return t===i?(e.consume(t),a++,r):(e.exit("thematicBreakSequence"),Zu(t)?nd(e,o,"whitespace")(t):o(t))}}},yd={continuation:{tokenize:function(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(rd,function(n){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,nd(e,t,"listItemIndent",i.containerState.size+1)(n)},function(n){return i.containerState.furtherBlankLines||!Zu(n)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(n)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(xd,t,a)(n))});function a(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,nd(e,e.attempt(yd,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const i=this,a=i.events[i.events.length-1];let o=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,r=0;return function(t){const a=i.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!i.containerState.marker||t===i.containerState.marker:Ku(t)){if(i.containerState.type||(i.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(gd,n,l)(t):l(t);if(!i.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return Ku(t)&&++r<10?(e.consume(t),s):(!i.interrupt||r<2)&&(i.containerState.marker?t===i.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||t,e.check(rd,i.interrupt?n:c,e.attempt(vd,d,u))}function c(e){return i.containerState.initialBlankLine=!0,o++,d(e)}function u(t){return Zu(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},vd={partial:!0,tokenize:function(e,t,n){const i=this;return nd(e,function(e){const a=i.events[i.events.length-1];return!Zu(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):n(e)},"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},xd={partial:!0,tokenize:function(e,t,n){const i=this;return nd(e,function(e){const a=i.events[i.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(e):n(e)},"listItemIndent",i.containerState.size+1)}},bd={continuation:{tokenize:function(e,t,n){const i=this;return function(t){return Zu(t)?nd(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(i){return e.attempt(bd,t,n)(i)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const i=this;return function(t){if(62===t){const n=i.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return n(t)};function a(n){return Zu(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function wd(e,t,n,i,a,o,r,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(i),e.enter(a),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||qu(t)?n(t):(e.enter(i),e.enter(r),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(a),e.exit(i),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||Xu(t)?n(t):(e.consume(t),92===t?p:h)}function p(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function f(a){return u||null!==a&&41!==a&&!Ju(a)?u999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(d):93===d?(e.exit(o),e.enter(a),e.consume(d),e.exit(a),e.exit(i),t):Xu(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||Xu(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!Zu(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Sd(e,t,n,i,a,o){let r;return function(t){return 34===t||39===t||40===t?(e.enter(i),e.enter(a),e.consume(t),e.exit(a),r=40===t?41:t,s):n(t)};function s(n){return n===r?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),t):(e.enter(o),l(n))}function l(t){return t===r?(e.exit(o),s(r)):null===t?n(t):Xu(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),nd(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===r||null===t||Xu(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===r||92===t?(e.consume(t),c):c(t)}}function Cd(e,t){let n;return function i(a){return Xu(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,i):Zu(a)?nd(e,i,n?"linePrefix":"lineSuffix")(a):t(a)}}function Td(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pd={name:"definition",tokenize:function(e,t,n){const i=this;let a;return function(t){return e.enter("definition"),function(t){return kd.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return a=Td(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),r):n(t)}function r(t){return Ju(t)?Cd(e,s)(t):s(t)}function s(t){return wd(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Ed,c,c)(t)}function c(t){return Zu(t)?nd(e,u,"whitespace")(t):u(t)}function u(o){return null===o||Xu(o)?(e.exit("definition"),i.parser.defined.push(a),t(o)):n(o)}}},Ed={partial:!0,tokenize:function(e,t,n){return function(t){return Ju(t)?Cd(e,i)(t):n(t)};function i(t){return Sd(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return Zu(t)?nd(e,o,"whitespace")(t):o(t)}function o(e){return null===e||Xu(e)?t(e):n(e)}}},Ad={name:"codeIndented",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("codeIndented"),nd(e,a,"linePrefix",5)(t)};function a(e){const t=i.events[i.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?s(t):Xu(t)?e.attempt(Id,o,s)(t):(e.enter("codeFlowValue"),r(t))}function r(t){return null===t||Xu(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),r)}function s(n){return e.exit("codeIndented"),t(n)}}},Id={partial:!0,tokenize:function(e,t,n){const i=this;return a;function a(t){return i.parser.lazy[i.now().line]?n(t):Xu(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):nd(e,o,"linePrefix",5)(t)}function o(e){const o=i.events[i.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):Xu(e)?a(e):n(e)}}},Md={name:"headingAtx",resolve:function(e,t){let n,i,a=e.length-2,o=3;return"whitespace"===e[o][1].type&&(o+=2),a-2>o&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(o===a-1||a-4>o&&"whitespace"===e[a-2][1].type)&&(a-=o+1===a?2:4),a>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[a][1].end},i={type:"chunkText",start:e[o][1].start,end:e[a][1].end,contentType:"text"},Ru(e,o,a-o+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e},tokenize:function(e,t,n){let i=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),a(t)}(t)};function a(t){return 35===t&&i++<6?(e.consume(t),a):null===t||Ju(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),r(n)):null===n||Xu(n)?(e.exit("atxHeading"),t(n)):Zu(n)?nd(e,o,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function r(t){return 35===t?(e.consume(t),r):(e.exit("atxHeadingSequence"),o(t))}function s(t){return null===t||35===t||Ju(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),s)}}},jd={name:"setextUnderline",resolveTo:function(e,t){let n,i,a,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(i=o)}else"content"===e[o][1].type&&e.splice(o,1),a||"definition"!==e[o][1].type||(a=o);const r={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",r,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=r,e.push(["exit",r,t]),e},tokenize:function(e,t,n){const i=this;let a;return function(t){let r,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){r="paragraph"===i.events[s][1].type;break}return i.parser.lazy[i.now().line]||!i.interrupt&&!r?n(t):(e.enter("setextHeadingLine"),a=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t))};function o(t){return t===a?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),Zu(t)?nd(e,r,"lineSuffix")(t):r(t))}function r(i){return null===i||Xu(i)?(e.exit("setextHeadingLine"),t(i)):n(i)}}},Dd=["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"],Ld=["pre","script","style","textarea"],Rd={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},tokenize:function(e,t,n){const i=this;let a,o,r,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),o=!0,p):63===s?(e.consume(s),a=3,i.interrupt?t:R):Hu(s)?(e.consume(s),r=String.fromCharCode(s),f):n(s)}function u(o){return 45===o?(e.consume(o),a=2,d):91===o?(e.consume(o),a=5,s=0,h):Hu(o)?(e.consume(o),a=4,i.interrupt?t:R):n(o)}function d(a){return 45===a?(e.consume(a),i.interrupt?t:R):n(a)}function h(a){return a==="CDATA[".charCodeAt(s++)?(e.consume(a),6===s?i.interrupt?t:P:h):n(a)}function p(t){return Hu(t)?(e.consume(t),r=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||Ju(s)){const l=47===s,c=r.toLowerCase();return l||o||!Ld.includes(c)?Dd.includes(r.toLowerCase())?(a=6,l?(e.consume(s),m):i.interrupt?t(s):P(s)):(a=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(s):o?g(s):y(s)):(a=1,i.interrupt?t(s):P(s))}return 45===s||$u(s)?(e.consume(s),r+=String.fromCharCode(s),f):n(s)}function m(a){return 62===a?(e.consume(a),i.interrupt?t:P):n(a)}function g(t){return Zu(t)?(e.consume(t),g):C(t)}function y(t){return 47===t?(e.consume(t),C):58===t||95===t||Hu(t)?(e.consume(t),v):Zu(t)?(e.consume(t),y):C(t)}function v(t){return 45===t||46===t||58===t||95===t||$u(t)?(e.consume(t),v):x(t)}function x(t){return 61===t?(e.consume(t),b):Zu(t)?(e.consume(t),x):y(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):Zu(t)?(e.consume(t),b):k(t)}function w(t){return t===l?(e.consume(t),l=null,S):null===t||Xu(t)?n(t):(e.consume(t),w)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Ju(t)?x(t):(e.consume(t),k)}function S(e){return 47===e||62===e||Zu(e)?y(e):n(e)}function C(t){return 62===t?(e.consume(t),T):n(t)}function T(t){return null===t||Xu(t)?P(t):Zu(t)?(e.consume(t),T):n(t)}function P(t){return 45===t&&2===a?(e.consume(t),M):60===t&&1===a?(e.consume(t),j):62===t&&4===a?(e.consume(t),O):63===t&&3===a?(e.consume(t),R):93===t&&5===a?(e.consume(t),L):!Xu(t)||6!==a&&7!==a?null===t||Xu(t)?(e.exit("htmlFlowData"),E(t)):(e.consume(t),P):(e.exit("htmlFlowData"),e.check(Od,N,E)(t))}function E(t){return e.check(Nd,A,N)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return null===t||Xu(t)?E(t):(e.enter("htmlFlowData"),P(t))}function M(t){return 45===t?(e.consume(t),R):P(t)}function j(t){return 47===t?(e.consume(t),r="",D):P(t)}function D(t){if(62===t){const n=r.toLowerCase();return Ld.includes(n)?(e.consume(t),O):P(t)}return Hu(t)&&r.length<8?(e.consume(t),r+=String.fromCharCode(t),D):P(t)}function L(t){return 93===t?(e.consume(t),R):P(t)}function R(t){return 62===t?(e.consume(t),O):45===t&&2===a?(e.consume(t),R):P(t)}function O(t){return null===t||Xu(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),O)}function N(n){return e.exit("htmlFlow"),t(n)}}},Od={partial:!0,tokenize:function(e,t,n){return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(rd,t,n)}}},Nd={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return Xu(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):n(t)};function a(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},_d={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a)};function a(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},Fd={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const i=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r};function r(t){return e.enter("codeFencedFence"),Zu(t)?nd(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===o?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===o?(a++,e.consume(t),c):a>=s?(e.exit("codeFencedFenceSequence"),Zu(t)?nd(e,u,"whitespace")(t):u(t)):n(t)}function u(i){return null===i||Xu(i)?(e.exit("codeFencedFence"),t(i)):n(i)}}};let o,r=0,s=0;return function(t){return function(t){const n=i.events[i.events.length-1];return r=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===o?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),Zu(t)?nd(e,c,"whitespace")(t):c(t))}function c(n){return null===n||Xu(n)?(e.exit("codeFencedFence"),i.interrupt?t(n):e.check(_d,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||Xu(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):Zu(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),nd(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),u)}function d(t){return null===t||Xu(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(t))}function h(t){return null===t||Xu(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===o?n(t):(e.consume(t),h)}function p(t){return e.attempt(a,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return r>0&&Zu(t)?nd(e,g,"linePrefix",r+1)(t):g(t)}function g(t){return null===t||Xu(t)?e.check(_d,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||Xu(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}}},Vd=document.createElement("i");function Bd(e){const t="&"+e+";";Vd.innerHTML=t;const n=Vd.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const zd={name:"characterReference",tokenize:function(e,t,n){const i=this;let a,o,r=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),a=31,o=$u,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Yu,c):(e.enter("characterReferenceValue"),a=7,o=Ku,c(t))}function c(s){if(59===s&&r){const a=e.exit("characterReferenceValue");return o!==$u||Bd(i.sliceSerialize(a))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return o(s)&&r++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},h={...e[u][1].start};Zd(d,-s),Zd(h,s),o={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},r={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:h},a={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},i={type:s>1?"strong":"emphasis",start:{...o.start},end:{...r.end}},e[n][1].end={...o.start},e[u][1].start={...r.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Ou(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Ou(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),l=Ou(l,$d(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=Ou(l,[["exit",a,t],["enter",r,t],["exit",r,t],["exit",i,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=Ou(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,Ru(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u-1){const e=r[0];"string"==typeof e?r[0]=e.slice(i):r.shift()}o>0&&r.push(e[a].slice(0,o))}return r}(r,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:a,offset:o}=i;return{_bufferIndex:e,_index:t,line:n,column:a,offset:o}}function m(e){l=void 0,d=e,h=h(e)}function g(e,t){t.restore()}function y(e,t){return function(n,a,o){let r,d,h,p;return Array.isArray(n)?g(n):"tokenize"in n?g([n]):(m=n,function(e){const t=null!==e&&m[e],n=null!==e&&m.null;return g([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});var m;function g(e){return r=e,d=0,0===e.length?o:y(e[d])}function y(e){return function(n){return p=function(){const e=f(),t=u.previous,n=u.currentConstruct,a=u.events.length,o=Array.from(s);return{from:a,restore:function(){i=e,u.previous=t,u.currentConstruct=n,u.events.length=a,s=o,x()}}}(),h=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?b():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,v,b)(n)}}function v(t){return l=!0,e(h,p),a}function b(e){return l=!0,p.restore(),++d13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const gh=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yh(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return mh(n.slice(t?2:1),t?16:10)}return Bd(n)||e}const vh={}.hasOwnProperty;function xh(e,t,n){return t&&"object"==typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(v),autolinkProtocol:u,autolinkEmail:u,atxHeading:a(m),blockQuote:a(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:a(f),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(f,o),codeText:a(function(){return{type:"inlineCode",value:""}},o),codeTextData:u,data:u,codeFlowValue:u,definition:a(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:a(g),hardBreakTrailing:a(g),htmlFlow:a(y,o),htmlFlowData:u,htmlText:a(y,o),htmlTextData:u,image:a(function(){return{type:"image",title:null,url:"",alt:null}}),label:o,link:a(v),listItem:a(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:a(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:a(x),paragraph:a(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(m),strong:a(function(){return{type:"strong",children:[]}}),thematicBreak:a(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:s(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let i;n?(i=mh(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):i=Bd(t);this.stack[this.stack.length-1].value+=i},characterReference:function(e){this.stack.pop().position.end=bh(e.end)},codeFenced:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:s(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Td(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(h),hardBreakTrailing:s(h),htmlFlow:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:s(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(gh,yh)}(t),n.identifier=Td(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak)return n.children[n.children.length-1].position.end=bh(e.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),d.call(this,e))},link:s(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Td(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:s(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:s(),thematicBreak:s()}};wh(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let a={type:"root",children:[]};const s={stack:[a],tokenStack:[],config:t,enter:r,exit:l,buffer:o,resume:c,data:n},u=[];let d=-1;for(;++d0){const e=s.tokenStack[s.tokenStack.length-1];(e[1]||Sh).call(s,void 0,e[0])}for(a.position={start:bh(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:bh(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Th[e](t)},Eh=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),i=a=>{if(e.has(a))return e.get(a);const[o,r]=t[a];switch(o){case 0:case-1:return n(r,a);case 1:{const e=n([],a);for(const t of r)e.push(i(t));return e}case 2:{const e=n({},a);for(const[t,n]of r)e[i(t)]=i(n);return e}case 3:return n(new Date(r),a);case 4:{const{source:e,flags:t}=r;return n(new RegExp(e,t),a)}case 5:{const e=n(new Map,a);for(const[t,n]of r)e.set(i(t),i(n));return e}case 6:{const e=n(new Set,a);for(const t of r)e.add(i(t));return e}case 7:{const{name:e,message:t}=r;return n(Ph(e,t),a)}case 8:return n(BigInt(r),a);case"BigInt":return n(Object(BigInt(r)),a);case"ArrayBuffer":return n(new Uint8Array(r).buffer,r);case"DataView":{const{buffer:e}=new Uint8Array(r);return n(new DataView(e),r)}}return n(Ph(o,r),a)};return i})(new Map,e)(0),Ah="",{toString:Ih}={},{keys:Mh}=Object,jh=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Ih.call(e).slice(8,-1);switch(n){case"Array":return[1,Ah];case"Object":return[2,Ah];case"Date":return[3,Ah];case"RegExp":return[4,Ah];case"Map":return[5,Ah];case"Set":return[6,Ah];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Dh=([e,t])=>0===e&&("function"===t||"symbol"===t),Lh=(e,{json:t,lossy:n}={})=>{const i=[];return((e,t,n,i)=>{const a=(e,t)=>{const a=i.push(e)-1;return n.set(t,a),a},o=i=>{if(n.has(i))return n.get(i);let[r,s]=jh(i);switch(r){case 0:{let t=i;switch(s){case"bigint":r=8,t=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return a([-1],i)}return a([r,t],i)}case 1:{if(s){let e=i;return"DataView"===s?e=new Uint8Array(i.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(i)),a([s,[...e]],i)}const e=[],t=a([r,e],i);for(const t of i)e.push(o(t));return t}case 2:{if(s)switch(s){case"BigInt":return a([s,i.toString()],i);case"Boolean":case"Number":case"String":return a([s,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());const n=[],l=a([r,n],i);for(const t of Mh(i))!e&&Dh(jh(i[t]))||n.push([o(t),o(i[t])]);return l}case 3:return a([r,i.toISOString()],i);case 4:{const{source:e,flags:t}=i;return a([r,{source:e,flags:t}],i)}case 5:{const t=[],n=a([r,t],i);for(const[n,a]of i)(e||!Dh(jh(n))&&!Dh(jh(a)))&&t.push([o(n),o(a)]);return n}case 6:{const t=[],n=a([r,t],i);for(const n of i)!e&&Dh(jh(n))||t.push(o(n));return n}}const{message:l}=i;return a([r,{name:s,message:l}],i)};return o})(!(t||n),!!t,new Map,i)(e),i},Rh="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Eh(Lh(e,t)):structuredClone(e):(e,t)=>Eh(Lh(e,t));function Oh(e){const t=[];let n=-1,i=0,a=0;for(;++n55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(r=String.fromCharCode(o,t),a=1):r="�"}else r=String.fromCharCode(o);r&&(t.push(e.slice(i,n),encodeURIComponent(r)),i=n+a+1,r=""),a&&(n+=a,a=0)}return t.join("")+e.slice(i)}function Nh(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function _h(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const Fh=function(e){if(null==e)return Bh;if("function"==typeof e)return Vh(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n":"")+")"})}return u;function u(){let c,u,d,h=zh;if((!t||o(a,s,l[l.length-1]||void 0))&&(h=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:null==e?zh:[e]}(n(a,l)),h[0]===Uh))return h;if("children"in a&&a.children){const t=a;if(t.children&&"skip"!==h[0])for(u=(i?t.children.length:-1)+r,d=l.concat(t);u>-1&&u1}function qh(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),a=0;const o=[];for(;i;)o.push(Kh(t.slice(a,i.index),a>0,!0),i[0]),a=i.index+i[0].length,i=n.exec(t);return o.push(Kh(t.slice(a),a>0,!1)),o.join("")}function Kh(e,t,n){let i=0,a=e.length;if(t){let t=e.codePointAt(i);for(;9===t||32===t;)i++,t=e.codePointAt(i)}if(n){let t=e.codePointAt(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>i?e.slice(i,a):""}const Yh={blockquote:function(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)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",i={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(i.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=Oh(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let r,s=e.footnoteCounts.get(i);void 0===s?(s=0,e.footnoteOrder.push(i),r=e.footnoteOrder.length):r=o+1,s+=1,e.footnoteCounts.set(i,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $h(e,t);const a={src:Oh(i.url||""),alt:t.alt};null!==i.title&&void 0!==i.title&&(a.title=i.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:Oh(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $h(e,t);const a={href:Oh(i.url||"")};null!==i.title&&void 0!==i.title&&(a.title=i.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:Oh(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},listItem:function(e,t,n){const i=e.all(t),a=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s0){const i={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=lu(t.children[1]),r=su(t.children[t.children.length-1]);o&&r&&(i.position={start:o,end:r}),a.push(i)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const i=n?n.children:void 0,a=0===(i?i.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,r=o?o.length:t.children.length;let s=-1;const l=[];for(;++s0&&n.push({type:"text",value:"\n"}),n}function np(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ip(e,t){const n=function(e,t){const n=t||Jh,i=new Map,a=new Map,o=new Map,r={...Yh,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let i=-1;for(;++i0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof i?i:i(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(a,f),s.push(f)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Rh(r),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return a&&o.children.push({type:"text",value:"\n"},a),o}function ap(e,t){return e&&"run"in e?async function(n,i){const a=ip(n,{file:i,...t});await e.run(a,i)}:function(n,i){return ip(n,{file:i,...e||t})}}function op(e){if(e)throw e}var rp=r(849);function sp(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}const lp=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');pp(e);let n,i=0,a=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else a<0&&(n=!0,a=o+1);return a<0?"":e.slice(i,a)}if(t===e)return"";let r=-1,s=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else r<0&&(n=!0,r=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(a=o):(s=-1,a=r));return i===a?a=r:a<0&&(a=e.length),e.slice(i,a)},cp=function(e){if(pp(e),0===e.length)return".";let t,n=-1,i=e.length;for(;--i;)if(47===e.codePointAt(i)){if(t){n=i;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},up=function(e){pp(e);let t,n=e.length,i=-1,a=0,o=-1,r=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)i<0&&(t=!0,i=n+1),46===s?o<0?o=n:1!==r&&(r=1):o>-1&&(r=-1);else if(t){a=n+1;break}}return o<0||i<0||0===r||1===r&&o===i-1&&o===a+1?"":e.slice(o,i)},dp=function(...e){let t,n=-1;for(;++n2){if(i=a.lastIndexOf("/"),i!==a.length-1){i<0?(a="",o=0):(a=a.slice(0,i),o=a.length-1-a.lastIndexOf("/")),r=l,s=0;continue}}else if(a.length>0){a="",o=0,r=l,s=0;continue}t&&(a=a.length>0?a+"/..":"..",o=2)}else a.length>0?a+="/"+e.slice(r+1,l):a=e.slice(r+1,l),o=l-r-1;r=l,s=0}else 46===n&&s>-1?s++:s=-1}return a}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},hp="/";function pp(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fp=function(){return"/"};function mp(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}const gp=["history","path","basename","stem","extname","dirname"];class yp{constructor(e){let t;t=e?mp(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":fp(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,i=-1;for(;++it.length;let r;o&&t.push(i);try{r=e.apply(this,t)}catch(e){if(o&&n)throw e;return i(e)}o||(r&&r.then&&"function"==typeof r.then?r.then(a,i):r instanceof Error?i(r):a(r))};function i(e,...i){n||(n=!0,t(e,...i))}function a(e){i(null,e)}}(s,a)(...r):i(null,...r)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){const e=new Sp;let t=-1;for(;++t0){let[i,...o]=t;const r=n[a][1];sp(r)&&sp(i)&&(i=rp(!0,r,i)),n[a]=[e,i,...o]}}}}const Cp=(new Sp).freeze();function Tp(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Pp(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ep(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 Ap(e){if(!sp(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Ip(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mp(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new yp(e)}const jp=[],Dp={allowDangerousHtml:!0},Lp=/^(https?|ircs?|mailto|xmpp)$/i,Rp=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Op(e){const t=function(e){const t=e.rehypePlugins||jp,n=e.remarkPlugins||jp,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dp}:Dp;return Cp().use(Ch).use(n).use(ap,i).use(t)}(e),n=function(e){const t=e.children||"",n=new yp;return"string"==typeof t&&(n.value=t),n}(e);return function(e,t){const n=t.allowedElements,i=t.allowElement,a=t.components,o=t.disallowedElements,r=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Np;for(const e of Rp)Object.hasOwn(t,e.from)&&bc((e.from,e.to&&e.to,e.id));return Hh(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return r?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Mu)if(Object.hasOwn(Mu,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],i=Mu[t];(null===i||i.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let r=n?!n.includes(e.tagName):!!o&&o.includes(e.tagName);if(!r&&i&&"number"==typeof t&&(r=!i(e,t,a)),r&&a&&"number"==typeof t)return s&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=function(e,t){return function(n,i,a,o){const r=Array.isArray(a.children),s=lu(n);return t(i,a,o,r,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");a=t.jsx,o=t.jsxs,i=function(e,t,n,i){const r=Array.isArray(n.children)?o:a;return i?r(t,n,i):r(t,n)}}var a,o;const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?Qc:Zc,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},s=wu(r,e,void 0);return s&&"string"!=typeof s?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}(e,{Fragment:ve.Fragment,components:a,ignoreInvalidStyle:!0,jsx:ve.jsx,jsxs:ve.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function Np(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),a=e.indexOf("/");return-1===t||-1!==a&&t>a||-1!==n&&t>n||-1!==i&&t>i||Lp.test(e.slice(0,t))?e:""}function _p(e,t){return e===t}function Fp(e,t,n){var i=n&&n.equalityFn||_p,a=(0,h.useRef)(e),o=(0,h.useState)({})[1],r=function(e,t,n,i){var a=this,o=(0,h.useRef)(null),r=(0,h.useRef)(0),s=(0,h.useRef)(0),l=(0,h.useRef)(null),c=(0,h.useRef)([]),u=(0,h.useRef)(),d=(0,h.useRef)(),p=(0,h.useRef)(e),f=(0,h.useRef)(!0),m=(0,h.useRef)(),g=(0,h.useRef)();p.current=e;var y="undefined"!=typeof window,v=!t&&0!==t&&y;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,b=!("trailing"in n)||!!n.trailing,w=!!n.flushOnExit&&b,k="maxWait"in n,S="debounceOnServer"in n&&!!n.debounceOnServer,C=k?Math.max(+n.maxWait||0,t):null,T=(0,h.useMemo)(function(){var e=function(e){var t=c.current,n=u.current;return c.current=u.current=null,r.current=e,s.current=s.current||e,d.current=p.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(e):setTimeout(e,t)},h=function(e){if(!f.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||k&&e-r.current>=C},T=function(t){return l.current=null,b&&c.current?e(t):(c.current=u.current=null,d.current)},P=function e(){var i=Date.now();if(x&&s.current===r.current&&E(),h(i))return T(i);if(f.current){var a=t-(i-o.current),l=k?Math.min(a,C-(i-r.current)):a;n(e,l)}},E=function(){i&&i({})},A=function(){if(y||S){var i,s=Date.now(),p=h(s);if(c.current=[].slice.call(arguments),u.current=a,o.current=s,w&&!m.current&&(m.current=function(){var e;"hidden"===(null==(e=globalThis.document)?void 0:e.visibilityState)&&g.current.flush()},null==(i=globalThis.document)||null==i.addEventListener||i.addEventListener("visibilitychange",m.current)),p){if(!l.current&&f.current)return r.current=o.current,n(P,t),x?e(o.current):d.current;if(k)return n(P,t),e(o.current)}return l.current||n(P,t),d.current}};return A.cancel=function(){var e=l.current;e&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),r.current=0,c.current=o.current=u.current=l.current=null,e&&i&&i({})},A.isPending=function(){return!!l.current},A.flush=function(){return l.current?T(Date.now()):d.current},A},[x,k,t,C,b,w,v,y,S,i]);return g.current=T,(0,h.useEffect)(function(){return f.current=!0,function(){var e;w&&g.current.flush(),m.current&&(null==(e=globalThis.document)||null==e.removeEventListener||e.removeEventListener("visibilitychange",m.current),m.current=null),f.current=!1}},[w]),T}((0,h.useCallback)(function(e){a.current=e,o({})},[o]),t,n,o),s=(0,h.useRef)(e);return i(s.current,e)||(r(e),s.current=e),[a.current,r]}const Vp=Math.min,Bp=Math.max,zp=Math.round,Up=Math.floor,Hp=e=>({x:e,y:e}),$p={left:"right",right:"left",bottom:"top",top:"bottom"};function Wp(e,t,n){return Bp(e,Vp(t,n))}function qp(e,t){return"function"==typeof e?e(t):e}function Kp(e){return e.split("-")[0]}function Yp(e){return e.split("-")[1]}function Gp(e){return"x"===e?"y":"x"}function Xp(e){return"y"===e?"height":"width"}function Jp(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Zp(e){return Gp(Jp(e))}function Qp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ef=["left","right"],tf=["right","left"],nf=["top","bottom"],af=["bottom","top"];function of(e){const t=Kp(e);return $p[t]+e.slice(t.length)}function rf(e){const{x:t,y:n,width:i,height:a}=e;return{width:i,height:a,top:n,left:t,right:t+i,bottom:n+a,x:t,y:n}}function sf(e,t,n){let{reference:i,floating:a}=e;const o=Jp(t),r=Zp(t),s=Xp(r),l=Kp(t),c="y"===o,u=i.x+i.width/2-a.width/2,d=i.y+i.height/2-a.height/2,h=i[s]/2-a[s]/2;let p;switch(l){case"top":p={x:u,y:i.y-a.height};break;case"bottom":p={x:u,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-a.width,y:d};break;default:p={x:i.x,y:i.y}}switch(Yp(t)){case"start":p[r]-=h*(n&&c?-1:1);break;case"end":p[r]+=h*(n&&c?-1:1)}return p}async function lf(e,t){var n;void 0===t&&(t={});const{x:i,y:a,platform:o,rects:r,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=qp(t,e),f=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(p),m=s[h?"floating"===d?"reference":"floating":d],g=rf(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:i,y:a,width:r.floating.width,height:r.floating.height}:r.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),x=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},b=rf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-b.top+f.top)/x.y,bottom:(b.bottom-g.bottom+f.bottom)/x.y,left:(g.left-b.left+f.left)/x.x,right:(b.right-g.right+f.right)/x.x}}const cf=new Set(["left","top"]);function uf(){return"undefined"!=typeof window}function df(e){return ff(e)?(e.nodeName||"").toLowerCase():"#document"}function hf(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function pf(e){var t;return null==(t=(ff(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ff(e){return!!uf()&&(e instanceof Node||e instanceof hf(e).Node)}function mf(e){return!!uf()&&(e instanceof Element||e instanceof hf(e).Element)}function gf(e){return!!uf()&&(e instanceof HTMLElement||e instanceof hf(e).HTMLElement)}function yf(e){return!(!uf()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof hf(e).ShadowRoot)}function vf(e){const{overflow:t,overflowX:n,overflowY:i,display:a}=Af(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&"inline"!==a&&"contents"!==a}function xf(e){return/^(table|td|th)$/.test(df(e))}function bf(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const wf=/transform|translate|scale|rotate|perspective|filter/,kf=/paint|layout|strict|content/,Sf=e=>!!e&&"none"!==e;let Cf;function Tf(e){const t=mf(e)?Af(e):e;return Sf(t.transform)||Sf(t.translate)||Sf(t.scale)||Sf(t.rotate)||Sf(t.perspective)||!Pf()&&(Sf(t.backdropFilter)||Sf(t.filter))||wf.test(t.willChange||"")||kf.test(t.contain||"")}function Pf(){return null==Cf&&(Cf="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Cf}function Ef(e){return/^(html|body|#document)$/.test(df(e))}function Af(e){return hf(e).getComputedStyle(e)}function If(e){return mf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mf(e){if("html"===df(e))return e;const t=e.assignedSlot||e.parentNode||yf(e)&&e.host||pf(e);return yf(t)?t.host:t}function jf(e){const t=Mf(e);return Ef(t)?e.ownerDocument?e.ownerDocument.body:e.body:gf(t)&&vf(t)?t:jf(t)}function Df(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=jf(e),o=a===(null==(i=e.ownerDocument)?void 0:i.body),r=hf(a);if(o){const e=Lf(r);return t.concat(r,r.visualViewport||[],vf(a)?a:[],e&&n?Df(e):[])}return t.concat(a,Df(a,[],n))}function Lf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rf(e){const t=Af(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const a=gf(e),o=a?e.offsetWidth:n,r=a?e.offsetHeight:i,s=zp(n)!==o||zp(i)!==r;return s&&(n=o,i=r),{width:n,height:i,$:s}}function Of(e){return mf(e)?e:e.contextElement}function Nf(e){const t=Of(e);if(!gf(t))return Hp(1);const n=t.getBoundingClientRect(),{width:i,height:a,$:o}=Rf(t);let r=(o?zp(n.width):n.width)/i,s=(o?zp(n.height):n.height)/a;return r&&Number.isFinite(r)||(r=1),s&&Number.isFinite(s)||(s=1),{x:r,y:s}}const _f=Hp(0);function Ff(e){const t=hf(e);return Pf()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_f}function Vf(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=Of(e);let r=Hp(1);t&&(i?mf(i)&&(r=Nf(i)):r=Nf(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==hf(e))&&t}(o,n,i)?Ff(o):Hp(0);let l=(a.left+s.x)/r.x,c=(a.top+s.y)/r.y,u=a.width/r.x,d=a.height/r.y;if(o){const e=hf(o),t=i&&mf(i)?hf(i):i;let n=e,a=Lf(n);for(;a&&i&&t!==n;){const e=Nf(a),t=a.getBoundingClientRect(),i=Af(a),o=t.left+(a.clientLeft+parseFloat(i.paddingLeft))*e.x,r=t.top+(a.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=r,n=hf(a),a=Lf(n)}}return rf({width:u,height:d,x:l,y:c})}function Bf(e,t){const n=If(e).scrollLeft;return t?t.left+n:Vf(pf(e)).left+n}function zf(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bf(e,n),y:n.top+t.scrollTop}}function Uf(e,t,n){let i;if("viewport"===t)i=function(e,t){const n=hf(e),i=pf(e),a=n.visualViewport;let o=i.clientWidth,r=i.clientHeight,s=0,l=0;if(a){o=a.width,r=a.height;const e=Pf();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}const c=Bf(i);if(c<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(i.clientWidth-t.clientWidth-a);r<=25&&(o-=r)}else c<=25&&(o+=c);return{width:o,height:r,x:s,y:l}}(e,n);else if("document"===t)i=function(e){const t=pf(e),n=If(e),i=e.ownerDocument.body,a=Bp(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=Bp(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+Bf(e);const s=-n.scrollTop;return"rtl"===Af(i).direction&&(r+=Bp(t.clientWidth,i.clientWidth)-a),{width:a,height:o,x:r,y:s}}(pf(e));else if(mf(t))i=function(e,t){const n=Vf(e,!0,"fixed"===t),i=n.top+e.clientTop,a=n.left+e.clientLeft,o=gf(e)?Nf(e):Hp(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:i*o.y}}(t,n);else{const n=Ff(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rf(i)}function Hf(e,t){const n=Mf(e);return!(n===t||!mf(n)||Ef(n))&&("fixed"===Af(n).position||Hf(n,t))}function $f(e,t,n){const i=gf(t),a=pf(t),o="fixed"===n,r=Vf(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Hp(0);function c(){l.x=Bf(a)}if(i||!i&&!o)if(("body"!==df(t)||vf(a))&&(s=If(t)),i){const e=Vf(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!i&&a&&c();const u=!a||i||o?Hp(0):zf(a,s);return{x:r.left+s.scrollLeft-l.x-u.x,y:r.top+s.scrollTop-l.y-u.y,width:r.width,height:r.height}}function Wf(e){return"static"===Af(e).position}function qf(e,t){if(!gf(e)||"fixed"===Af(e).position)return null;if(t)return t(e);let n=e.offsetParent;return pf(e)===n&&(n=n.ownerDocument.body),n}function Kf(e,t){const n=hf(e);if(bf(e))return n;if(!gf(e)){let t=Mf(e);for(;t&&!Ef(t);){if(mf(t)&&!Wf(t))return t;t=Mf(t)}return n}let i=qf(e,t);for(;i&&xf(i)&&Wf(i);)i=qf(i,t);return i&&Ef(i)&&Wf(i)&&!Tf(i)?n:i||function(e){let t=Mf(e);for(;gf(t)&&!Ef(t);){if(Tf(t))return t;if(bf(t))return null;t=Mf(t)}return null}(e)||n}const Yf={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:i,strategy:a}=e;const o="fixed"===a,r=pf(i),s=!!t&&bf(t.floating);if(i===r||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Hp(1);const u=Hp(0),d=gf(i);if((d||!d&&!o)&&(("body"!==df(i)||vf(r))&&(l=If(i)),d)){const e=Vf(i);c=Nf(i),u.x=e.x+i.clientLeft,u.y=e.y+i.clientTop}const h=!r||d||o?Hp(0):zf(r,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:pf,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:a}=e;const o=[..."clippingAncestors"===n?bf(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let i=Df(e,[],!1).filter(e=>mf(e)&&"body"!==df(e)),a=null;const o="fixed"===Af(e).position;let r=o?Mf(e):e;for(;mf(r)&&!Ef(r);){const t=Af(r),n=Tf(r);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&("absolute"===a.position||"fixed"===a.position)||vf(r)&&!n&&Hf(e,r))?i=i.filter(e=>e!==r):a=t,r=Mf(r)}return t.set(e,i),i}(t,this._c):[].concat(n),i],r=Uf(t,o[0],a);let s=r.top,l=r.right,c=r.bottom,u=r.left;for(let e=1;e{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,i=null;const a=pf(e);function o(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null}return function r(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=c;if(s||t(),!h||!p)return;const f={rootMargin:-Up(d)+"px "+-Up(a.clientWidth-(u+h))+"px "+-Up(a.clientHeight-(d+p))+"px "+-Up(u)+"px",threshold:Bp(0,Vp(1,l))||1};let m=!0;function g(t){const i=t[0].intersectionRatio;if(i!==l){if(!m)return r();i?r(!1,i):n=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==i||Gf(c,e.getBoundingClientRect())||r(),m=!1}try{i=new IntersectionObserver(g,{...f,root:a.ownerDocument})}catch(e){i=new IntersectionObserver(g,f)}i.observe(e)}(!0),o}(c,n):null;let h,p=-1,f=null;r&&(f=new ResizeObserver(e=>{let[i]=e;i&&i.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let m=l?Vf(e):null;return l&&function t(){const i=Vf(e);m&&!Gf(m,i)&&n(),m=i,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const Jf=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:a,middlewareData:o,rects:r,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=qp(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const y=Kp(a),v=Jp(s),x=Kp(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(x||!m?[of(s)]:function(e){const t=of(e);return[Qp(e),t,Qp(t)]}(s)),k="none"!==f;!h&&k&&w.push(...function(e,t,n,i){const a=Yp(e);let o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?tf:ef:t?ef:tf;case"left":case"right":return t?nf:af;default:return[]}}(Kp(e),"start"===n,i);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Qp)))),o}(s,m,f,b));const S=[s,...w],C=await l.detectOverflow(t,g),T=[];let P=(null==(i=o.flip)?void 0:i.overflows)||[];if(u&&T.push(C[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const i=Yp(e),a=Zp(e),o=Xp(a);let r="x"===a?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=of(r)),[r,of(r)]}(a,r,b);T.push(C[e[0]],C[e[1]])}if(P=[...P,{placement:a,overflows:T}],!T.every(e=>e<=0)){var E,A;const e=((null==(E=o.flip)?void 0:E.index)||0)+1,t=S[e];if(t&&("alignment"!==d||v===Jp(t)||P.every(e=>Jp(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(A=P.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(p){case"bestFit":{var I;const e=null==(I=P.filter(e=>{if(k){const t=Jp(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}},Zf=(e,t,n)=>{const i=new Map,a={platform:Yf,...n},o={...a.platform,_c:i};return(async(e,t,n)=>{const{placement:i="bottom",strategy:a="absolute",middleware:o=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:lf},l=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=sf(c,i,l),h=i,p=0;const f={};for(let n=0;n{t.current=e}),t}const am=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:a,y:o,placement:r,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:i,elements:a}=e,o=await(null==i.isRTL?void 0:i.isRTL(a.floating)),r=Kp(n),s=Yp(n),l="y"===Jp(n),c=cf.has(r)?-1:1,u=o&&l?-1:1,d=qp(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(p="end"===s?-1*f:f),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}(t,e);return r===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:r}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},om=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:a,platform:o}=t,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=qp(e,t),u={x:n,y:i},d=await o.detectOverflow(t,c),h=Jp(Kp(a)),p=Gp(h);let f=u[p],m=u[h];if(r){const e="y"===p?"bottom":"right";f=Wp(f+d["y"===p?"top":"left"],f,f-d[e])}if(s){const e="y"===h?"bottom":"right";m=Wp(m+d["y"===h?"top":"left"],m,m-d[e])}const g=l.fn({...t,[p]:f,[h]:m});return{...g,data:{x:g.x-n,y:g.y-i,enabled:{[p]:r,[h]:s}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},rm=(e,t)=>{const n=Jf(e);return{name:n.name,fn:n.fn,options:[e,t]}};function sm(...e){return e.flat().filter(Boolean).map(e=>"string"==typeof e?e:"object"!=typeof e||Array.isArray(e)||null===e?"":Object.entries(e).filter(([e,t])=>t).map(([e])=>e).join(" ")).join(" ").trim()}const lm=372,cm=16,um={SPRING_CONFIG:{type:"spring",damping:25,stiffness:300},VELOCITY_MULTIPLIER:.1,NON_DRAGGABLE_SELECTORS:['[data-slot="messages"]','[data-slot="chat-input"]','[data-slot="chat-footer"]','[data-slot="chat-header"] [data-slot="button"]'].join(", ")},dm="GlotPress/2.4.0-alpha",hm="messages",pm={messages:{"":{domain:"messages","plural-forms":"nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;",lang:"ar"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["ذكاء ووردبريس الاصطناعي الخاص بك — جاهز للمساعدة في التصميم، التحرير، والإطلاق."],"a8c-agentticYesterday":["أمس"],"a8c-agentticUpload image files up to %s each.":["رفع ملفات الصور حتى %s لكل منها."],"a8c-agentticUnsupported chart type: %s":["نوع الرسم البياني غير مدعوم: %s"],"a8c-agentticToday":["اليوم"],"a8c-agentticThis action is no longer available or cannot be performed":["هذا الإجراء لم يعد متاحًا أو لا يمكن تنفيذه"],"a8c-agentticThinking…":["التفكير…"],"a8c-agentticStop processing":["أوقف المعالجة"],"a8c-agentticSend message":["أرسل رسالة"],"a8c-agentticRemove image":["إزالة الصورة"],"a8c-agentticOpen chat":["فتح الدردشة"],"a8c-agentticOnly %s image files are allowed.":["فقط ملفات الصور %s مسموح بها."],"a8c-agentticNo data points found for chart":["لم يتم العثور على نقاط بيانات للرسم البياني"],"a8c-agentticNo chart data available":["لا توجد بيانات مخطط متاحة"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["الرسالة طويلة جداً. يرجى أن تبقيها تحت %d حرفاً."],"a8c-agentticMaximum %d files allowed.":["الحد الأقصى المسموح به هو %d ملف."],"a8c-agentticInvalid chart data provided":["تم توفير بيانات الرسم البياني غير صالح"],"a8c-agentticFailed to parse chart data as JSON":["فشل في تحليل بيانات الرسم البياني كـ JSON"],"a8c-agentticExpand conversation":["توسيع المحادثة"],"a8c-agentticDrop files here to use":["اسحب الملفات هنا للاستخدام"],"a8c-agentticClose conversation":["إغلاق المحادثة"],"a8c-agentticClick to upload images or drag and drop":["انقر لرفع الصور أو اسحب وأفلت"],"a8c-agentticChart data must include chartType":["يجب أن تتضمن بيانات الرسم البياني chartType"],"a8c-agentticChart data must include a data array":["يجب أن تتضمن بيانات الرسم البياني مصفوفة بيانات"],"a8c-agentticAvailable types: line, bar":["أنواع متاحة: خط، عمود"],"a8c-agentticAsk anything":["اسأل أي شيء"],"a8c-agenttic%d days ago":["%d يوم مضى"]}},fm={"translation-revision-date":"2025-10-08 20:39:51+0000",generator:dm,domain:hm,locale_data:pm},mm=Object.freeze(Object.defineProperty({__proto__:null,default:fm,domain:hm,generator:dm,locale_data:pm},Symbol.toStringTag,{value:"Module"})),gm="GlotPress/2.4.0-alpha",ym="messages",vm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"de"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Dein WordPress KI — bereit, beim Designen, Bearbeiten und Starten zu helfen."],"a8c-agentticYesterday":["Gestern"],"a8c-agentticUpload image files up to %s each.":["Hochladen von Bilddateien bis zu %s jeweils."],"a8c-agentticUnsupported chart type: %s":["Nicht unterstützter Diagrammtyp: %s"],"a8c-agentticToday":["Heute"],"a8c-agentticThis action is no longer available or cannot be performed":["Diese Aktion ist nicht mehr verfügbar oder kann nicht ausgeführt werden."],"a8c-agentticThinking…":["Nachdenken…"],"a8c-agentticStop processing":["Verarbeitung stoppen"],"a8c-agentticSend message":["Nachricht senden"],"a8c-agentticRemove image":["Bild entfernen"],"a8c-agentticOpen chat":["Chat öffnen"],"a8c-agentticOnly %s image files are allowed.":["Nur %s Bilddateien sind erlaubt."],"a8c-agentticNo data points found for chart":["Keine Datenpunkte für das Diagramm gefunden"],"a8c-agentticNo chart data available":["Keine Diagrammdaten verfügbar"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Nachricht ist zu lang. Bitte halte sie unter %d Zeichen."],"a8c-agentticMaximum %d files allowed.":["Maximal %d Dateien erlaubt."],"a8c-agentticInvalid chart data provided":["Ungültige Diagrammdaten bereitgestellt"],"a8c-agentticFailed to parse chart data as JSON":["Fehler beim Parsen der Diagrammdaten als JSON"],"a8c-agentticExpand conversation":["Gespräch erweitern"],"a8c-agentticDrop files here to use":["Dateien hierher ziehen, um sie zu verwenden"],"a8c-agentticClose conversation":["Gespräch schließen"],"a8c-agentticClick to upload images or drag and drop":["Klicken Sie, um Bilder hochzuladen oder Drag-and-Drop"],"a8c-agentticChart data must include chartType":["Die Diagrammdaten müssen chartType enthalten"],"a8c-agentticChart data must include a data array":["Diagrammdaten müssen ein Daten-Array enthalten"],"a8c-agentticAvailable types: line, bar":["Verfügbare Typen: Linie, Balken"],"a8c-agentticAsk anything":["Frag irgendwas"],"a8c-agenttic%d days ago":["%d Tage her"]}},xm={"translation-revision-date":"2025-10-08 20:39:43+0000",generator:gm,domain:ym,locale_data:vm},bm=Object.freeze(Object.defineProperty({__proto__:null,default:xm,domain:ym,generator:gm,locale_data:vm},Symbol.toStringTag,{value:"Module"})),wm="GlotPress/2.4.0-alpha",km="messages",Sm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"es"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Tu WordPress AI — lista para ayudar a diseñar, editar y lanzar."],"a8c-agentticYesterday":["Ayer"],"a8c-agentticUpload image files up to %s each.":["Sube archivos de imagen de hasta %s cada uno."],"a8c-agentticUnsupported chart type: %s":["Tipo de gráfico no soportado: %s"],"a8c-agentticToday":["Hoy"],"a8c-agentticThis action is no longer available or cannot be performed":["Esta acción ya no está disponible o no se puede realizar"],"a8c-agentticThinking…":["Pensando…"],"a8c-agentticStop processing":["Detener el procesamiento"],"a8c-agentticSend message":["Enviar mensaje"],"a8c-agentticRemove image":["Eliminar imagen"],"a8c-agentticOpen chat":["Abre el chat"],"a8c-agentticOnly %s image files are allowed.":["Solo se permiten archivos de imagen %s."],"a8c-agentticNo data points found for chart":["No se encontraron puntos de datos para el gráfico"],"a8c-agentticNo chart data available":["No hay datos de gráfico disponibles"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["El mensaje es demasiado largo. Por favor, mantenlo por debajo de %d caracteres."],"a8c-agentticMaximum %d files allowed.":["Se permiten un máximo de %d archivos."],"a8c-agentticInvalid chart data provided":["Datos de gráfico no válidos proporcionados"],"a8c-agentticFailed to parse chart data as JSON":["Error al analizar los datos del gráfico como JSON"],"a8c-agentticExpand conversation":["Expandir conversación"],"a8c-agentticDrop files here to use":["Arrastra archivos aquí para usar"],"a8c-agentticClose conversation":["Cerrar conversación"],"a8c-agentticClick to upload images or drag and drop":["Hacer clic para subir imágenes o arrastrar y soltar"],"a8c-agentticChart data must include chartType":["Los datos del gráfico deben incluir chartType"],"a8c-agentticChart data must include a data array":["Los datos del gráfico deben incluir un array de datos"],"a8c-agentticAvailable types: line, bar":["Tipos disponibles: línea, barra"],"a8c-agentticAsk anything":["Pregunta lo que sea"],"a8c-agenttic%d days ago":["%d días hace"]}},Cm={"translation-revision-date":"2025-10-08 20:39:42+0000",generator:wm,domain:km,locale_data:Sm},Tm=Object.freeze(Object.defineProperty({__proto__:null,default:Cm,domain:km,generator:wm,locale_data:Sm},Symbol.toStringTag,{value:"Module"})),Pm="GlotPress/2.4.0-alpha",Em="messages",Am={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n > 1;",lang:"fr"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Votre WordPress IA — prête à aider à concevoir, éditer et lancer."],"a8c-agentticYesterday":["Hier"],"a8c-agentticUpload image files up to %s each.":["Charger des fichiers image jusqu'à %s chacun."],"a8c-agentticUnsupported chart type: %s":["Type de graphique non pris en charge : %s"],"a8c-agentticToday":["Aujourd'hui"],"a8c-agentticThis action is no longer available or cannot be performed":["Cette action n'est plus disponible ou ne peut pas être effectuée"],"a8c-agentticThinking…":["En train de réfléchir…"],"a8c-agentticStop processing":["Arrêter le traitement"],"a8c-agentticSend message":["Envoyer le message"],"a8c-agentticRemove image":["Supprimer l'image"],"a8c-agentticOpen chat":["Ouvrir le chat"],"a8c-agentticOnly %s image files are allowed.":["Seuls les fichiers d'image %s sont autorisés."],"a8c-agentticNo data points found for chart":["Aucun point de données trouvé pour le graphique"],"a8c-agentticNo chart data available":["Aucune donnée de graphique disponible"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Le message est trop long. Veuillez le garder sous %d caractères."],"a8c-agentticMaximum %d files allowed.":["Maximum %d fichiers autorisés."],"a8c-agentticInvalid chart data provided":["Données de graphique non valides fournies"],"a8c-agentticFailed to parse chart data as JSON":["Échec de l'analyse des données du graphique en tant que JSON"],"a8c-agentticExpand conversation":["Développer la conversation"],"a8c-agentticDrop files here to use":["Déposez des fichiers ici pour les utiliser"],"a8c-agentticClose conversation":["Fermer la conversation"],"a8c-agentticClick to upload images or drag and drop":["Clic pour mettre en ligne des images ou glisser-déposer"],"a8c-agentticChart data must include chartType":["Les données du graphique doivent inclure chartType"],"a8c-agentticChart data must include a data array":["Les données du graphique doivent inclure un tableau de données"],"a8c-agentticAvailable types: line, bar":["Saisir disponibles : ligne, barre"],"a8c-agentticAsk anything":["Demande n'importe quoi"],"a8c-agenttic%d days ago":["%d jours auparavant"]}},Im={"translation-revision-date":"2025-10-08 20:39:44+0000",generator:Pm,domain:Em,locale_data:Am},Mm=Object.freeze(Object.defineProperty({__proto__:null,default:Im,domain:Em,generator:Pm,locale_data:Am},Symbol.toStringTag,{value:"Module"})),jm="GlotPress/2.4.0-alpha",Dm="messages",Lm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"he_IL"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["הבינה המלאכותית של WordPress שלך — מוכנה לעזור לעצב, לערוך ולהשיק."],"a8c-agentticYesterday":["אתמול"],"a8c-agentticUpload image files up to %s each.":["להעלות קבצי תמונה עד %s כל אחד."],"a8c-agentticUnsupported chart type: %s":["סוג תרשים לא נתמך: %s"],"a8c-agentticToday":["היום"],"a8c-agentticThis action is no longer available or cannot be performed":["הפעולה הזו כבר לא זמינה או לא יכולה להתבצע"],"a8c-agentticThinking…":["חושב…"],"a8c-agentticStop processing":["עצור עיבוד"],"a8c-agentticSend message":["שלח הודעה"],"a8c-agentticRemove image":["להסיר תמונה"],"a8c-agentticOpen chat":["פתח צ'אט"],"a8c-agentticOnly %s image files are allowed.":["רק קבצי תמונה %s מותרים."],"a8c-agentticNo data points found for chart":["לא נמצאו נקודות נתונים עבור הגרף"],"a8c-agentticNo chart data available":["לא זמינים נתוני תרשים"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["ההודעה ארוכה מדי. בבקשה שמור אותה מתחת ל-%d תווים."],"a8c-agentticMaximum %d files allowed.":["מקסימום %d קבצים מותר."],"a8c-agentticInvalid chart data provided":["נתוני תרשים לא תקף שסופקו"],"a8c-agentticFailed to parse chart data as JSON":["נכשל בפירוש נתוני הגרף כ-JSON"],"a8c-agentticExpand conversation":["הרחב שיחה"],"a8c-agentticDrop files here to use":["גרור קבצים לכאן לשימוש"],"a8c-agentticClose conversation":["סגור שיחה"],"a8c-agentticClick to upload images or drag and drop":["לחץ כדי להעלות תמונות או גרור ושחרר"],"a8c-agentticChart data must include chartType":["נתוני הגרף חייבים לכלול chartType"],"a8c-agentticChart data must include a data array":["נתוני הגרף חייבים לכלול מערך נתונים"],"a8c-agentticAvailable types: line, bar":["סוגים זמינים: קו, עמודה"],"a8c-agentticAsk anything":["שאל כל דבר"],"a8c-agenttic%d days ago":["%d ימים לפני"]}},Rm={"translation-revision-date":"2025-10-08 20:39:45+0000",generator:jm,domain:Dm,locale_data:Lm},Om=Object.freeze(Object.defineProperty({__proto__:null,default:Rm,domain:Dm,generator:jm,locale_data:Lm},Symbol.toStringTag,{value:"Module"})),Nm="GlotPress/2.4.0-alpha",_m="messages",Fm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n > 1;",lang:"id"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["AI WordPress kamu — siap membantu mendesain, mengedit, dan meluncurkan."],"a8c-agentticYesterday":["Kemarin"],"a8c-agentticUpload image files up to %s each.":["Unggah file gambar hingga %s masing-masing."],"a8c-agentticUnsupported chart type: %s":["Tipe grafik tidak didukung: %s"],"a8c-agentticToday":["Hari ini"],"a8c-agentticThis action is no longer available or cannot be performed":["Tindakan ini tidak lagi tersedia atau tidak dapat dilakukan"],"a8c-agentticThinking…":["Berpikir…"],"a8c-agentticStop processing":["Berhenti memproses"],"a8c-agentticSend message":["Kirim pesan"],"a8c-agentticRemove image":["Hapus gambar"],"a8c-agentticOpen chat":["Buka obrolan"],"a8c-agentticOnly %s image files are allowed.":["Hanya file gambar %s yang diperbolehkan."],"a8c-agentticNo data points found for chart":["Tidak ada titik data yang ditemukan untuk grafik"],"a8c-agentticNo chart data available":["Tidak ada data grafik yang tersedia"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Pesan terlalu panjang. Harap jaga agar tetap di bawah %d karakter."],"a8c-agentticMaximum %d files allowed.":["Maksimum %d file diizinkan."],"a8c-agentticInvalid chart data provided":["Data grafik tidak valid yang diberikan"],"a8c-agentticFailed to parse chart data as JSON":["Gagal mengurai data grafik sebagai JSON"],"a8c-agentticExpand conversation":["Perluas percakapan"],"a8c-agentticDrop files here to use":["Seret file ke sini untuk digunakan"],"a8c-agentticClose conversation":["Tutup percakapan"],"a8c-agentticClick to upload images or drag and drop":["Klik untuk unggah gambar atau seret dan lepas"],"a8c-agentticChart data must include chartType":["Data grafik harus mencakup chartType"],"a8c-agentticChart data must include a data array":["Data grafik harus mencakup array data"],"a8c-agentticAvailable types: line, bar":["Jenis yang tersedia: garis, batang"],"a8c-agentticAsk anything":["Tanya apa saja"],"a8c-agenttic%d days ago":["%d hari yang lalu"]}},Vm={"translation-revision-date":"2025-10-08 20:39:49+0000",generator:Nm,domain:_m,locale_data:Fm},Bm=Object.freeze(Object.defineProperty({__proto__:null,default:Vm,domain:_m,generator:Nm,locale_data:Fm},Symbol.toStringTag,{value:"Module"})),zm="GlotPress/2.4.0-alpha",Um="messages",Hm={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"it"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["La tua WordPress AI — pronta ad aiutarti a progettare, modificare e lanciare."],"a8c-agentticYesterday":["Ieri"],"a8c-agentticUpload image files up to %s each.":["Carica file immagine fino a %s ciascuno."],"a8c-agentticUnsupported chart type: %s":["Tipo di grafico non supportato: %s"],"a8c-agentticToday":["Oggi"],"a8c-agentticThis action is no longer available or cannot be performed":["Questa azione non è più disponibile o non può essere eseguita"],"a8c-agentticThinking…":["Pensando…"],"a8c-agentticStop processing":["Ferma l'elaborazione"],"a8c-agentticSend message":["Invia messaggio"],"a8c-agentticRemove image":["Rimuovi immagine"],"a8c-agentticOpen chat":["Apri chat"],"a8c-agentticOnly %s image files are allowed.":["Solo i file %s immagine sono consentiti."],"a8c-agentticNo data points found for chart":["Nessun punto dati trovato per il grafico"],"a8c-agentticNo chart data available":["Nessun dato del grafico disponibile"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Il messaggio è troppo lungo. Per favore, mantienilo sotto %d caratteri."],"a8c-agentticMaximum %d files allowed.":["Massimo %d file consentiti."],"a8c-agentticInvalid chart data provided":["Dati del grafico non validi forniti"],"a8c-agentticFailed to parse chart data as JSON":["Impossibile analizzare i dati del grafico come JSON"],"a8c-agentticExpand conversation":["Espandi conversazione"],"a8c-agentticDrop files here to use":["Trascina i file qui per usarli"],"a8c-agentticClose conversation":["Chiudi conversazione"],"a8c-agentticClick to upload images or drag and drop":["Clicca per caricare Immagini o trascina e rilascia"],"a8c-agentticChart data must include chartType":["I dati del grafico devono includere chartType"],"a8c-agentticChart data must include a data array":["I dati del grafico devono includere una matrice di dati"],"a8c-agentticAvailable types: line, bar":["Tipi disponibili: linea, barra"],"a8c-agentticAsk anything":["Chiedi qualsiasi cosa"],"a8c-agenttic%d days ago":["%d giorni fa"]}},$m={"translation-revision-date":"2025-10-08 20:39:46+0000",generator:zm,domain:Um,locale_data:Hm},Wm=Object.freeze(Object.defineProperty({__proto__:null,default:$m,domain:Um,generator:zm,locale_data:Hm},Symbol.toStringTag,{value:"Module"})),qm="GlotPress/2.4.0-alpha",Km="messages",Ym={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"ja_JP"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["あなたのWordPress AI — デザイン、編集、そしてローンチを手伝う準備ができています。"],"a8c-agentticYesterday":["昨日"],"a8c-agentticUpload image files up to %s each.":["%s ごとに画像ファイルをアップロードしてください。"],"a8c-agentticUnsupported chart type: %s":["サポートされていないチャートタイプ: %s"],"a8c-agentticToday":["「今日」"],"a8c-agentticThis action is no longer available or cannot be performed":["このアクションはもう利用できないか、実行できません。"],"a8c-agentticThinking…":["考え中…"],"a8c-agentticStop processing":["処理を停止"],"a8c-agentticSend message":["メッセージを送信"],"a8c-agentticRemove image":["画像を削除"],"a8c-agentticOpen chat":["チャットを開く"],"a8c-agentticOnly %s image files are allowed.":["許可されているのは %s 画像ファイルのみです。"],"a8c-agentticNo data points found for chart":["チャートにデータポイントが見つかりませんでした"],"a8c-agentticNo chart data available":["チャートデータは利用できません"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["メッセージが長すぎます。%d 文字以内にしてください。"],"a8c-agentticMaximum %d files allowed.":["最大 %d ファイルが許可されています。"],"a8c-agentticInvalid chart data provided":["無効なチャートデータが提供されました"],"a8c-agentticFailed to parse chart data as JSON":["チャートデータをJSONとして解析できませんでした"],"a8c-agentticExpand conversation":["会話を拡大する"],"a8c-agentticDrop files here to use":["ここにファイルをドロップして使用"],"a8c-agentticClose conversation":["会話を終了する"],"a8c-agentticClick to upload images or drag and drop":["画像をアップロードするにはクリックするか、ドラッグ&ドロップしてください"],"a8c-agentticChart data must include chartType":["チャートデータにはchartTypeを含める必要があります"],"a8c-agentticChart data must include a data array":["チャートデータにはデータ配列が含まれている必要があります"],"a8c-agentticAvailable types: line, bar":["利用可能なタイプ: ライン、バー"],"a8c-agentticAsk anything":["何でも聞いて"],"a8c-agenttic%d days ago":["%d日前"]}},Gm={"translation-revision-date":"2025-10-08 20:39:45+0000",generator:qm,domain:Km,locale_data:Ym},Xm=Object.freeze(Object.defineProperty({__proto__:null,default:Gm,domain:Km,generator:qm,locale_data:Ym},Symbol.toStringTag,{value:"Module"})),Jm="GlotPress/2.4.0-alpha",Zm="messages",Qm={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"ko_KR"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["당신의 워드프레스 AI — 디자인, 편집 및 출시를 도와줄 준비가 되어 있습니다."],"a8c-agentticYesterday":["어제"],"a8c-agentticUpload image files up to %s each.":["이미지 파일을 각각 %s까지 업로드하다."],"a8c-agentticUnsupported chart type: %s":["지원되지 않는 차트 유형: %s"],"a8c-agentticToday":["오늘"],"a8c-agentticThis action is no longer available or cannot be performed":["이 작업은 더 이상 사용 가능하지 않거나 수행할 수 없습니다."],"a8c-agentticThinking…":["생각 중…"],"a8c-agentticStop processing":["처리 중지"],"a8c-agentticSend message":["메시지 보내기"],"a8c-agentticRemove image":["이미지 제거"],"a8c-agentticOpen chat":["채팅 열기"],"a8c-agentticOnly %s image files are allowed.":["오직 %s 이미지 파일만 허용됩니다."],"a8c-agentticNo data points found for chart":["차트에 대한 데이터 포인트가 없습니다"],"a8c-agentticNo chart data available":["차트 데이터가 없습니다"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["메시지가 너무 깁니다. %d자 이하로 유지해 주세요."],"a8c-agentticMaximum %d files allowed.":["최대 %d개의 파일이 허용됩니다."],"a8c-agentticInvalid chart data provided":["유효하지 않은 차트 데이터가 제공되었습니다"],"a8c-agentticFailed to parse chart data as JSON":["차트 데이터를 JSON으로 파싱하는 데 실패했습니다"],"a8c-agentticExpand conversation":["대화 확장"],"a8c-agentticDrop files here to use":["여기에 파일을 드롭하여 사용하세요"],"a8c-agentticClose conversation":["대화 종료"],"a8c-agentticClick to upload images or drag and drop":["이미지를 업로드하려면 클릭하거나 드래그 앤 드롭하세요"],"a8c-agentticChart data must include chartType":["차트 데이터는 chartType을 포함해야 해"],"a8c-agentticChart data must include a data array":["차트 데이터는 데이터 배열을 포함해야 합니다"],"a8c-agentticAvailable types: line, bar":["사용 가능한 유형: 선, 막대"],"a8c-agentticAsk anything":["뭐든지 물어봐"],"a8c-agenttic%d days ago":["%d일 전"]}},eg={"translation-revision-date":"2025-10-08 20:39:51+0000",generator:Jm,domain:Zm,locale_data:Qm},tg=Object.freeze(Object.defineProperty({__proto__:null,default:eg,domain:Zm,generator:Jm,locale_data:Qm},Symbol.toStringTag,{value:"Module"})),ng="GlotPress/2.4.0-alpha",ig="messages",ag={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"nl"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Jouw WordPress AI — klaar om te helpen met ontwerpen, bewerken en lanceren."],"a8c-agentticYesterday":["Gisteren"],"a8c-agentticUpload image files up to %s each.":["Uploaden afbeeldingsbestanden tot %s elk."],"a8c-agentticUnsupported chart type: %s":["Niet-ondersteund grafiektype: %s"],"a8c-agentticToday":["Vandaag"],"a8c-agentticThis action is no longer available or cannot be performed":["Deze actie is niet langer beschikbaar of kan niet worden uitgevoerd"],"a8c-agentticThinking…":["Denken…"],"a8c-agentticStop processing":["Stop met verwerken"],"a8c-agentticSend message":["Stuur bericht"],"a8c-agentticRemove image":["Verwijder afbeelding"],"a8c-agentticOpen chat":["Open chat"],"a8c-agentticOnly %s image files are allowed.":["Alleen %s afbeeldingsbestanden zijn toegestaan."],"a8c-agentticNo data points found for chart":["Geen gegevenspunten gevonden voor grafiek"],"a8c-agentticNo chart data available":["Geen grafiekgegevens beschikbaar"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Bericht is te lang. Houd het onder de %d tekens."],"a8c-agentticMaximum %d files allowed.":["Maximaal %d bestanden toegestaan."],"a8c-agentticInvalid chart data provided":["Ongeldig grafiekgegevens geleverd"],"a8c-agentticFailed to parse chart data as JSON":["Kon de grafiekgegevens niet als JSON parseren"],"a8c-agentticExpand conversation":["Gesprek uitbreiden"],"a8c-agentticDrop files here to use":["Sleep bestanden hierheen om te gebruiken"],"a8c-agentticClose conversation":["Gesprek sluiten"],"a8c-agentticClick to upload images or drag and drop":["Klik om afbeeldingen te uploaden of sleep en zet neer"],"a8c-agentticChart data must include chartType":["Grafiekgegevens moeten chartType bevatten"],"a8c-agentticChart data must include a data array":["Grafiekgegevens moeten een data array bevatten"],"a8c-agentticAvailable types: line, bar":["Beschikbare types: lijn, staaf"],"a8c-agentticAsk anything":["Vraag iets"],"a8c-agenttic%d days ago":["%d dagen geleden"]}},og={"translation-revision-date":"2025-10-08 20:39:47+0000",generator:ng,domain:ig,locale_data:ag},rg=Object.freeze(Object.defineProperty({__proto__:null,default:og,domain:ig,generator:ng,locale_data:ag},Symbol.toStringTag,{value:"Module"})),sg="GlotPress/2.4.0-alpha",lg="messages",cg={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=(n > 1);",lang:"pt_BR"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Seu WordPress AI — pronto para ajudar a projetar, editar e lançar."],"a8c-agentticYesterday":["Ontem"],"a8c-agentticUpload image files up to %s each.":["Fazer upload de arquivos de imagem de até %s cada."],"a8c-agentticUnsupported chart type: %s":["Tipo de gráfico não suportado: %s"],"a8c-agentticToday":["Hoje"],"a8c-agentticThis action is no longer available or cannot be performed":["Esta ação não está mais disponível ou não pode ser realizada"],"a8c-agentticThinking…":["Pensando…"],"a8c-agentticStop processing":["Parar processamento"],"a8c-agentticSend message":["Enviar mensagem"],"a8c-agentticRemove image":["Remover Imagem"],"a8c-agentticOpen chat":["Abra o chat"],"a8c-agentticOnly %s image files are allowed.":["Apenas arquivos de imagem %s são permitidos."],"a8c-agentticNo data points found for chart":["Nenhum ponto de dados encontrado para o gráfico"],"a8c-agentticNo chart data available":["Não há dados de gráfico disponíveis"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["A mensagem é muito longa. Por favor, mantenha-a abaixo de %d caracteres."],"a8c-agentticMaximum %d files allowed.":["Máximo de %d arquivos permitidos."],"a8c-agentticInvalid chart data provided":["Dados de gráfico inválidos fornecidos"],"a8c-agentticFailed to parse chart data as JSON":["Falha ao analisar os dados do gráfico como JSON"],"a8c-agentticExpand conversation":["Expandir conversa"],"a8c-agentticDrop files here to use":["Arraste arquivos aqui para usar"],"a8c-agentticClose conversation":["Fechar conversa"],"a8c-agentticClick to upload images or drag and drop":["Clique para fazer upload de imagens ou arraste e solte"],"a8c-agentticChart data must include chartType":["Os dados do gráfico devem incluir chartType"],"a8c-agentticChart data must include a data array":["Os dados do gráfico devem incluir um array de dados"],"a8c-agentticAvailable types: line, bar":["Tipos disponíveis: linha, barra"],"a8c-agentticAsk anything":["Pergunte qualquer coisa"],"a8c-agenttic%d days ago":["%d dias atrás"]}},ug={"translation-revision-date":"2025-10-08 20:39:43+0000",generator:sg,domain:lg,locale_data:cg},dg=Object.freeze(Object.defineProperty({__proto__:null,default:ug,domain:lg,generator:sg,locale_data:cg},Symbol.toStringTag,{value:"Module"})),hg="GlotPress/2.4.0-alpha",pg="messages",fg={messages:{"":{domain:"messages","plural-forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);",lang:"ru"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Ваш WordPress ИИ — готов помочь в дизайне, редактировании и запуске."],"a8c-agentticYesterday":["Вчера"],"a8c-agentticUpload image files up to %s each.":["Загрузка изображений размером до %s каждый."],"a8c-agentticUnsupported chart type: %s":["Неподдерживаемый тип диаграммы: %s"],"a8c-agentticToday":["Сегодня"],"a8c-agentticThis action is no longer available or cannot be performed":["Это действие больше недоступно или не может быть выполнено"],"a8c-agentticThinking…":["Думаю…"],"a8c-agentticStop processing":["Остановить обработку"],"a8c-agentticSend message":["Отправить сообщение"],"a8c-agentticRemove image":["Удалить изображение"],"a8c-agentticOpen chat":["Открыть чат"],"a8c-agentticOnly %s image files are allowed.":["Разрешены только файлы изображений %s."],"a8c-agentticNo data points found for chart":["Не найдено данных для графика"],"a8c-agentticNo chart data available":["Нет доступных данных для графика"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Сообщение слишком длинное. Пожалуйста, сократите его до %d символов."],"a8c-agentticMaximum %d files allowed.":["Максимум %d файлов разрешено."],"a8c-agentticInvalid chart data provided":["Предоставлены неверные данные для графика"],"a8c-agentticFailed to parse chart data as JSON":["Не удалось разобрать данные графика как JSON"],"a8c-agentticExpand conversation":["Развернуть разговор"],"a8c-agentticDrop files here to use":["Перетащите файлы сюда для использования"],"a8c-agentticClose conversation":["Закрыть разговор"],"a8c-agentticClick to upload images or drag and drop":["Нажмите, чтобы загрузить изображения или перетащите и отпустите"],"a8c-agentticChart data must include chartType":["Данные графика должны включать chartType"],"a8c-agentticChart data must include a data array":["Данные для графика должны включать массив данных"],"a8c-agentticAvailable types: line, bar":["Доступные типы: линия, столбец"],"a8c-agentticAsk anything":["Спроси что угодно"],"a8c-agenttic%d days ago":["%d дней назад"]}},mg={"translation-revision-date":"2025-10-08 20:39:47+0000",generator:hg,domain:pg,locale_data:fg},gg=Object.freeze(Object.defineProperty({__proto__:null,default:mg,domain:pg,generator:hg,locale_data:fg},Symbol.toStringTag,{value:"Module"})),yg="GlotPress/2.4.0-alpha",vg="messages",xg={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=n != 1;",lang:"sv_SE"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["Din WordPress AI – redo att hjälpa till med design, redigering och lansering."],"a8c-agentticYesterday":["Igår"],"a8c-agentticUpload image files up to %s each.":["Ladda upp bildfiler upp till %s vardera."],"a8c-agentticUnsupported chart type: %s":["Ej stödd diagramtyp: %s"],"a8c-agentticToday":["Idag"],"a8c-agentticThis action is no longer available or cannot be performed":["Denna åtgärd är inte längre tillgänglig eller kan inte utföras"],"a8c-agentticThinking…":["Tänker …"],"a8c-agentticStop processing":["Stoppa bearbetning"],"a8c-agentticSend message":["Skicka meddelande"],"a8c-agentticRemove image":["Ta bort bild"],"a8c-agentticOpen chat":["Öppna chatt"],"a8c-agentticOnly %s image files are allowed.":["Endast %s bildfiler är tillåtna."],"a8c-agentticNo data points found for chart":["Inga datapunkter hittades för diagrammet"],"a8c-agentticNo chart data available":["Inga diagramdata tillgängliga"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Meddelande är för långt. Håll det under %d tecken."],"a8c-agentticMaximum %d files allowed.":["Maximalt %d filer tillåtna."],"a8c-agentticInvalid chart data provided":["Ogiltig diagramdata angiven"],"a8c-agentticFailed to parse chart data as JSON":["Misslyckades med att tolka diagramdata som JSON"],"a8c-agentticExpand conversation":["Expandera konversation"],"a8c-agentticDrop files here to use":["Släpp filer här för att använda"],"a8c-agentticClose conversation":["Stäng konversation"],"a8c-agentticClick to upload images or drag and drop":["Klicka för att ladda upp bilder eller dra och släpp"],"a8c-agentticChart data must include chartType":["Diagramdata måste inkludera chartType"],"a8c-agentticChart data must include a data array":["Diagramdata måste inkludera en data array"],"a8c-agentticAvailable types: line, bar":["Tillgängliga typer: linje, stapel"],"a8c-agentticAsk anything":["Fråga vad som helst"],"a8c-agenttic%d days ago":["%d dagar sedan"]}},bg={"translation-revision-date":"2025-10-14 09:33:52+0000",generator:yg,domain:vg,locale_data:xg},wg=Object.freeze(Object.defineProperty({__proto__:null,default:bg,domain:vg,generator:yg,locale_data:xg},Symbol.toStringTag,{value:"Module"})),kg="GlotPress/2.4.0-alpha",Sg="messages",Cg={messages:{"":{domain:"messages","plural-forms":"nplurals=2; plural=(n > 1);",lang:"tr"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["WordPress AI'niz — tasarım, düzenleme ve başlatma konusunda yardımcı olmaya hazır."],"a8c-agentticYesterday":["Dün"],"a8c-agentticUpload image files up to %s each.":["Görsel dosyalarını %s kadar karşıya yükle."],"a8c-agentticUnsupported chart type: %s":["Desteklenmeyen grafik türü: %s"],"a8c-agentticToday":["Bugün"],"a8c-agentticThis action is no longer available or cannot be performed":["Bu işlem artık mevcut değil veya gerçekleştirilemez."],"a8c-agentticThinking…":["Düşünüyorum…"],"a8c-agentticStop processing":["İşlemi durdur"],"a8c-agentticSend message":["Mesaj gönder"],"a8c-agentticRemove image":["Görseli kaldır"],"a8c-agentticOpen chat":["sohbeti aç"],"a8c-agentticOnly %s image files are allowed.":["Sadece %s görsel dosyasına izin verilir."],"a8c-agentticNo data points found for chart":["Grafik için veri noktası bulunamadı"],"a8c-agentticNo chart data available":["Hiçbir grafik verisi mevcut değil"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["Mesaj çok uzun. Lütfen %d karakterin altında tut."],"a8c-agentticMaximum %d files allowed.":["En fazla %d dosya izin verilir."],"a8c-agentticInvalid chart data provided":["Geçersiz grafik verisi sağlandı"],"a8c-agentticFailed to parse chart data as JSON":["Grafik verilerini JSON olarak ayrıştırma başarısız oldu"],"a8c-agentticExpand conversation":["Konuşmayı genişlet"],"a8c-agentticDrop files here to use":["Buraya dosyaları bırakın kullanmak için"],"a8c-agentticClose conversation":["Konuşmayı kapat"],"a8c-agentticClick to upload images or drag and drop":["Görsel karşıya yüklemek için tıkla veya sürükleyip bırak"],"a8c-agentticChart data must include chartType":["Grafik verileri chartType içermelidir"],"a8c-agentticChart data must include a data array":["Grafik verileri bir veri dizilimi içermelidir"],"a8c-agentticAvailable types: line, bar":["Mevcut türler: çubuk, çubuk"],"a8c-agentticAsk anything":["Her şeyi sor"],"a8c-agenttic%d days ago":["%d gün önce"]}},Tg={"translation-revision-date":"2025-10-08 20:39:48+0000",generator:kg,domain:Sg,locale_data:Cg},Pg=Object.freeze(Object.defineProperty({__proto__:null,default:Tg,domain:Sg,generator:kg,locale_data:Cg},Symbol.toStringTag,{value:"Module"})),Eg="GlotPress/2.4.0-alpha",Ag="messages",Ig={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"zh_CN"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["您的 WordPress AI — 随时准备帮助设计、编辑和发布。"],"a8c-agentticYesterday":["昨天"],"a8c-agentticUpload image files up to %s each.":["上传图像文件,每个文件最多 %s。"],"a8c-agentticUnsupported chart type: %s":["不支持的图表类型: %s"],"a8c-agentticToday":["今天"],"a8c-agentticThis action is no longer available or cannot be performed":["此操作不再可用或无法执行"],"a8c-agentticThinking…":["思考中…"],"a8c-agentticStop processing":["停止处理"],"a8c-agentticSend message":["发送消息"],"a8c-agentticRemove image":["移除图像"],"a8c-agentticOpen chat":["打开聊天"],"a8c-agentticOnly %s image files are allowed.":["只允许 %s 图像文件。"],"a8c-agentticNo data points found for chart":["未找到图表的数据点"],"a8c-agentticNo chart data available":["没有可用的图表数据"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["消息太长了。请保持在 %d 个字符以内。"],"a8c-agentticMaximum %d files allowed.":["最多允许 %d 个文件。"],"a8c-agentticInvalid chart data provided":["提供的图表数据无效"],"a8c-agentticFailed to parse chart data as JSON":["无法将图表数据解析为 JSON"],"a8c-agentticExpand conversation":["展开对话"],"a8c-agentticDrop files here to use":["将文件拖到这里使用"],"a8c-agentticClose conversation":["关闭对话"],"a8c-agentticClick to upload images or drag and drop":["点击上传图像或拖放"],"a8c-agentticChart data must include chartType":["图表数据必须包含 chartType"],"a8c-agentticChart data must include a data array":["图表数据必须包含一个数据数组"],"a8c-agentticAvailable types: line, bar":["可用类型:线,柱"],"a8c-agentticAsk anything":["问任何事情"],"a8c-agenttic%d days ago":["%d 天前"]}},Mg={"translation-revision-date":"2025-10-08 20:39:49+0000",generator:Eg,domain:Ag,locale_data:Ig},jg=Object.freeze(Object.defineProperty({__proto__:null,default:Mg,domain:Ag,generator:Eg,locale_data:Ig},Symbol.toStringTag,{value:"Module"})),Dg="GlotPress/2.4.0-alpha",Lg="messages",Rg={messages:{"":{domain:"messages","plural-forms":"nplurals=1; plural=0;",lang:"zh_TW"},"a8c-agentticYour WordPress AI — ready to help design, edit, and launch.":["你的 WordPress AI — 隨時準備幫助設計、編輯和啟動。"],"a8c-agentticYesterday":["昨天"],"a8c-agentticUpload image files up to %s each.":["上傳每個圖像檔案最多 %s。"],"a8c-agentticUnsupported chart type: %s":["不支援的圖表類型: %s"],"a8c-agentticToday":["今天"],"a8c-agentticThis action is no longer available or cannot be performed":["此操作不再可用或無法執行"],"a8c-agentticThinking…":["思考中…"],"a8c-agentticStop processing":["停止處理"],"a8c-agentticSend message":["發送訊息"],"a8c-agentticRemove image":["移除圖片"],"a8c-agentticOpen chat":["開啟聊天"],"a8c-agentticOnly %s image files are allowed.":["只允許 %s 圖像檔案。"],"a8c-agentticNo data points found for chart":["找不到圖表的數據點"],"a8c-agentticNo chart data available":["沒有可用的圖表數據"],"a8c-agentticMessage is too long. Please keep it under %d characters.":["訊息太長了。請保持在 %d 個字元以內。"],"a8c-agentticMaximum %d files allowed.":["最多允許 %d 個檔案。"],"a8c-agentticInvalid chart data provided":["提供的圖表數據無效的"],"a8c-agentticFailed to parse chart data as JSON":["無法將圖表數據解析為 JSON"],"a8c-agentticExpand conversation":["擴展對話"],"a8c-agentticDrop files here to use":["將檔案拖到這裡使用"],"a8c-agentticClose conversation":["關閉對話"],"a8c-agentticClick to upload images or drag and drop":["點擊上傳圖片或拖放"],"a8c-agentticChart data must include chartType":["圖表數據必須包含 chartType"],"a8c-agentticChart data must include a data array":["圖表數據必須包含一個數據 array"],"a8c-agentticAvailable types: line, bar":["可用類型:線圖、條形圖"],"a8c-agentticAsk anything":["問任何事"],"a8c-agenttic%d days ago":["%d 天前"]}},Og={"translation-revision-date":"2025-10-08 20:39:50+0000",generator:Dg,domain:Lg,locale_data:Rg},Ng=Object.freeze(Object.defineProperty({__proto__:null,default:Og,domain:Lg,generator:Dg,locale_data:Rg},Symbol.toStringTag,{value:"Module"})),_g=Object.assign({"../../../../languages/wpcom-agenttic-ar.jed.json":mm,"../../../../languages/wpcom-agenttic-de.jed.json":bm,"../../../../languages/wpcom-agenttic-es.jed.json":Tm,"../../../../languages/wpcom-agenttic-fr.jed.json":Mm,"../../../../languages/wpcom-agenttic-he.jed.json":Om,"../../../../languages/wpcom-agenttic-id.jed.json":Bm,"../../../../languages/wpcom-agenttic-it.jed.json":Wm,"../../../../languages/wpcom-agenttic-ja.jed.json":Xm,"../../../../languages/wpcom-agenttic-ko.jed.json":tg,"../../../../languages/wpcom-agenttic-nl.jed.json":rg,"../../../../languages/wpcom-agenttic-pt-br.jed.json":dg,"../../../../languages/wpcom-agenttic-ru.jed.json":gg,"../../../../languages/wpcom-agenttic-sv.jed.json":wg,"../../../../languages/wpcom-agenttic-tr.jed.json":Pg,"../../../../languages/wpcom-agenttic-zh-cn.jed.json":jg,"../../../../languages/wpcom-agenttic-zh-tw.jed.json":Ng}),Fg={};Object.entries(_g).forEach(([e,t])=>{const n=e.split("/").pop().replace("wpcom-agenttic-","").replace(".jed.json","");Fg[n]=t.default});const Vg="agenttic-chat-position";const Bg={type:"spring",stiffness:300,damping:30},zg={type:"spring",damping:40,stiffness:500,mass:.8},Ug={...zg,stiffness:1e3,damping:90},Hg={type:"spring",damping:40,stiffness:500,mass:.8},$g={hidden:{opacity:0},visible:{opacity:1,transition:Bg},exit:{opacity:0,transition:{...Bg,duration:.1}}},Wg=(Symbol.toStringTag,(0,h.createContext)(null));function qg(){const e=(0,h.useContext)(Wg);if(!e)throw new Error("useAgentUIContext must be used within an AgentUIContainer");return e}function Kg({children:e,value:t}){return(0,ve.jsx)(Wg.Provider,{value:t,children:e})}const Yg={button:"button-module_button",pressed:"button-module_pressed",primary:"button-module_primary",ghost:"button-module_ghost",outline:"button-module_outline",transparent:"button-module_transparent",link:"button-module_link",icon:"button-module_icon",sm:"button-module_sm",lg:"button-module_lg",withTextAndIcon:"button-module_withTextAndIcon"},Gg=h.forwardRef(function({className:e,variant:t="primary",size:n,icon:i,children:a,asChild:o=!1,pressed:r=!1,...s},l){const c=o?mc:"button",u=!!i,d=n||(u&&!a?"icon":void 0);return(0,ve.jsxs)(c,{ref:l,"data-slot":"button",className:sm(Yg.button,Yg[t],d&&Yg[d],u&&a?Yg.withTextAndIcon:void 0,r?Yg.pressed:void 0,e),"aria-pressed":r,...s,children:[i,a]})});function Xg({className:e,size:t=24}){return(0,ve.jsx)("svg",{className:e,width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{d:"M19.6611 11.5224L16.3782 10.39C15.0799 9.94387 14.0561 8.92011 13.61 7.62181L12.4775 4.33887C12.3231 3.88704 11.6769 3.88704 11.5225 4.33887L10.39 7.62181C9.94388 8.92011 8.9201 9.94387 7.6218 10.39L4.33887 11.5224C3.88704 11.6768 3.88704 12.3231 4.33887 12.4776L7.6218 13.61C8.9201 14.0561 9.94388 15.0799 10.39 16.3782L11.5225 19.6611C11.6769 20.113 12.3231 20.113 12.4775 19.6611L13.61 16.3782C14.0561 15.0799 15.0799 14.0561 16.3782 13.61L19.6611 12.4776C20.113 12.3231 20.113 11.6768 19.6611 11.5224ZM15.8291 12.2431L14.1876 12.8093C13.5356 13.0323 13.0266 13.5471 12.8036 14.1934L12.2374 15.8348C12.1572 16.0636 11.837 16.0636 11.7569 15.8348L11.1907 14.1934C10.9677 13.5414 10.4529 13.0323 9.80662 12.8093L8.16515 12.2431C7.93637 12.163 7.93637 11.8427 8.16515 11.7626L9.80662 11.1964C10.4586 10.9734 10.9677 10.4586 11.1907 9.81233L11.7569 8.17087C11.837 7.94209 12.1572 7.94209 12.2374 8.17087L12.8036 9.81233C13.0266 10.4643 13.5414 10.9734 14.1876 11.1964L15.8291 11.7626C16.0579 11.8427 16.0579 12.163 15.8291 12.2431Z",fill:"currentColor"})})}Gg.displayName="Button";function Jg({icon:e=(0,ve.jsx)(Xg,{size:36}),onClick:t,onHover:n,focusOnMount:i=!1}){const a=(0,h.useRef)(null),o=(0,h.useRef)(i);return(0,h.useEffect)(()=>{o.current&&a.current&&a.current.focus(),o.current=!1},[o,a]),(0,ve.jsx)(Il.div,{"data-slot":"collapsed-view",layout:"preserve-aspect",layoutId:"collapsed-button",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,transition:{...Hg,delay:.2}},exit:{opacity:0,scale:0,transition:{duration:.15}},children:(0,ve.jsx)(Gg,{ref:a,onClick:t,onMouseEnter:n,variant:"link",className:"CollapsedView-module_button",icon:e,"aria-label":(0,cc.__)("Open chat","a8c-agenttic")})})}const Zg=h.forwardRef(({className:e,...t},n)=>(0,ve.jsx)("textarea",{"data-slot":"textarea",className:"Textarea-module_textarea",ref:n,...t}));function Qg({className:e,size:t=24}){return(0,ve.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,ve.jsx)("path",{d:"M12.2197 5C12.4186 5 12.6094 5.07902 12.75 5.21967L17 9.46967C17.2929 9.76256 17.2929 10.2374 17 10.5303C16.7071 10.8232 16.2322 10.8232 15.9393 10.5303L12.9697 7.56067V18.25C12.9697 18.6642 12.6339 19 12.2197 19C11.8055 19 11.4697 18.6642 11.4697 18.25V7.56065L8.5 10.5303C8.2071 10.8232 7.73223 10.8232 7.43934 10.5303C7.14644 10.2374 7.14645 9.76256 7.43934 9.46967L11.6894 5.21967C11.83 5.07902 12.0208 5 12.2197 5Z",fill:"currentColor"})})}function ey({className:e,size:t=24}){return(0,ve.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,ve.jsx)("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"})})}Zg.displayName="Textarea";const ty="ChatInput-module_button";function ny({className:e,size:t=24}){return(0,ve.jsx)("svg",{className:e,width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0045 13.4451L12 7.9864L5.9955 13.4451L7.00451 14.5549L12 10.0136L16.9955 14.5549L18.0045 13.4451Z",fill:"currentColor"})})}function iy({texts:e,interval:t=3e3,className:n=""}){const[i,a]=(0,h.useState)(0);return(0,h.useEffect)(()=>{const n=setInterval(()=>{a(t=>(t+1)%e.length)},t);return()=>clearInterval(n)},[e.length,t]),(0,ve.jsx)(_l,{mode:"wait",children:(0,ve.jsx)(Il.span,{"data-slot":"animated-placeholder",className:sm("AnimatedPlaceholder-module_container",n),initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.3,ease:[.4,0,.2,1]},children:e[i]},i)})}function ay({value:e,onChange:t,onSubmit:n,onKeyDown:i,textareaRef:a,placeholder:o=(0,cc.__)("Ask anything","a8c-agenttic"),isProcessing:r,onBlur:s,onFocus:l,onClick:c,fromCompact:u=!1,onExpand:d,showExpandButton:p=!0,focusOnMount:f=!1,customActions:m=[],actionOrder:g="before-submit",onStop:y,disabled:v,onMouseEnter:x,onMouseLeave:b,expandOnClick:w=!1,layout:k="inline"}){const S=(0,h.useId)(),{variant:C,floatingChatState:T,isInputOverLimit:P}=qg(),E=void 0!==v?!v:(e.trim()||r)&&!P,A=(0,h.useCallback)(e=>{const t=e.key.toLowerCase();("enter"!==t||e.shiftKey||!e.nativeEvent.isComposing&&229!==e.keyCode)&&("enter"!==t||e.shiftKey||E)?(((e.metaKey||e.ctrlKey)&&"z"===t||e.ctrlKey&&"y"===t)&&e.stopPropagation(),i(e)):e.preventDefault()},[E,i]),I=e=>e.endsWith("…")?e:`${e}…`,M=Array.isArray(o);let j;j=M?o.map(I):o?I(o):"";const D=(0,h.useRef)(f);(0,h.useEffect)(()=>{D.current&&a.current&&a.current.focus(),D.current=!1},[D,a]);const L=()=>m.map(e=>(0,ve.jsx)(Gg,{className:e.className||ty,onClick:e.onClick,disabled:e.disabled,variant:e.variant||"ghost",icon:e.icon,"aria-label":e["aria-label"]},e.id));return(0,ve.jsxs)("div",{"data-slot":"chat-input",className:"ChatInput-module_container"+("stacked"===k?" ChatInput-module_containerStacked":""),onMouseEnter:x,onMouseLeave:b,children:[(0,ve.jsxs)(Il.div,{className:"ChatInput-module_textareaContainer",initial:{opacity:0},animate:{opacity:1,scale:1,transition:e.trim()?{duration:0}:Ug},children:[!e&&M&&(0,ve.jsx)(iy,{texts:j}),(0,ve.jsx)(Zg,{id:S,ref:a,value:e,onChange:e=>t(e.target.value),onKeyDown:A,onBlur:s,onFocus:l,onClick:c,placeholder:M?"":j,rows:1,"aria-label":(0,cc.__)("Chat input","a8c-agenttic")})]}),(0,ve.jsxs)(Il.div,{className:"ChatInput-module_actions",initial:{opacity:u?1:0,scale:u?1:.5},animate:{opacity:1,scale:1,transition:e.trim()?{duration:0}:zg},children:["embedded"===C||"expanded"===T||w?null:p&&d?(0,ve.jsx)(Gg,{className:ty,onClick:d,variant:"ghost",icon:(0,ve.jsx)(ny,{}),"aria-label":(0,cc.__)("Expand conversation","a8c-agenttic")}):null,"before-submit"===g&&L(),r&&!y?null:(0,ve.jsx)(Gg,{className:ty,onClick:()=>{r&&y?y():n()},disabled:!E,variant:"primary",icon:r?(0,ve.jsx)(ey,{}):(0,ve.jsx)(Qg,{}),"aria-label":r?(0,cc.__)("Stop processing","a8c-agenttic"):(0,cc.__)("Send message","a8c-agenttic")}),"after-submit"===g&&L()]})]})}const oy=({className:e,suggestions:t,onSubmit:n,layout:i="horizontal",visible:a=!0,onMouseEnter:o,onMouseLeave:r,translateY:s="-100%"})=>{const{variant:l}=qg(),c=(0,h.useMemo)(()=>"floating"===l?null==t?void 0:t.slice(0,3):t,[t,l]);return c&&0!==c.length?(0,ve.jsx)(_l,{children:a&&(0,ve.jsx)(Il.div,{"data-slot":"suggestions",className:sm("Suggestions-module_container","vertical"===i?"Suggestions-module_vertical":"floating"===i?"Suggestions-module_floating":"",e),initial:{opacity:0,y:"-80%"},animate:{opacity:1,y:s},exit:{opacity:0,y:"-80%"},transition:Ug,onMouseEnter:o,onMouseLeave:r,children:c.map((e,t)=>(0,ve.jsx)(Il.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{...Ug,delay:.05*t},children:(0,ve.jsx)(Gg,{onClick:t=>{t.stopPropagation(),(async(e,t)=>{let i=!0;e.action&&(i=await e.action()),i&&n&&e.prompt&&n(e,t)})(e,c)},variant:"outline",className:"Suggestions-module_button",children:e.label})},e.id))})}):null};function ry({value:e,onChange:t,onSubmit:n,onKeyDown:i,textareaRef:a,placeholder:o,isProcessing:r,onBlur:s,onFocus:l,onExpand:c,showExpandButton:u=!0,focusOnMount:d=!1,customActions:p,actionOrder:f,onStop:m,suggestions:g,clearSuggestions:y,handleSuggestionSubmit:v,expandOnClick:x=!1}){const[b,w]=(0,h.useState)(!1),{setNamedTimeout:k,clearAllTimeouts:S}=function(){const e=(0,h.useRef)(new Map),t=(0,h.useCallback)(t=>{const n=e.current.get(t);n&&(clearTimeout(n),e.current.delete(t))},[]),n=(0,h.useCallback)((n,i,a)=>{t(n);const o=setTimeout(i,a);return e.current.set(n,o),o},[t]),i=(0,h.useCallback)(()=>{e.current.forEach(e=>{clearTimeout(e)}),e.current.clear()},[]),a=(0,h.useCallback)(t=>e.current.has(t),[]);return(0,h.useEffect)(()=>i,[i]),{setNamedTimeout:n,clearNamedTimeout:t,clearAllTimeouts:i,hasTimeout:a}}(),C=(0,h.useCallback)(()=>{k("hide-suggestions",()=>{w(!1)},4e3)},[k]),T=(0,h.useCallback)(()=>{x&&c&&!e&&c()},[x,c,e]);return(0,h.useEffect)(()=>{S(),e?w(!1):g&&0!==g.length?(w(!0),C()):w(!1)},[e,g,S,k,y,C]),(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(ay,{value:e,onChange:t,onSubmit:n,onKeyDown:i,textareaRef:a,placeholder:o,isProcessing:r,onBlur:s,onFocus:l,onClick:T,onExpand:c,showExpandButton:u,focusOnMount:d,customActions:p,actionOrder:f,onStop:m,expandOnClick:x,onMouseEnter:()=>{S(),w(!0)},onMouseLeave:()=>C()}),!e&&(0,ve.jsx)(oy,{suggestions:g,onSubmit:v,layout:"floating",visible:b,onMouseEnter:()=>{S(),w(!0)},onMouseLeave:()=>C()})]})}const sy="Chat-module_container",ly="Chat-module_expanded";function cy(){return(0,ve.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,cursor:"grabbing",pointerEvents:"auto",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}})}function uy({children:e,messages:t,isProcessing:n,error:i,onSubmit:a,variant:o="floating",triggerIcon:r,placeholder:s,notice:l,onOpen:c,onExpand:u,onClose:d,onStop:p,emptyView:f,floatingChatState:m,suggestions:g,clearSuggestions:y,onSuggestionClick:v,messageRenderer:x,messagesPosition:b,className:w,inputValue:k,onInputChange:S,draggableStates:C=["expanded"],locale:T="en",maxInputLength:P=600,onInputLimitExceeded:E,expandOnClick:A,expandOnHover:I=!0,thinkingMessage:M,initialChatPosition:j,onChatPositionChange:D,onTypingStatusChange:L}){const R=void 0!==k,[O,N]=(0,h.useState)(""),_=R?k:O,F=R?S:N,V=function(e){const t=e||"collapsed",[n,i]=(0,h.useState)(t);(0,h.useEffect)(()=>{void 0!==e&&i(e)},[e]);const a="collapsed"!==n&&"compact"!==n,o=(0,h.useCallback)(()=>{i("expanded")},[]),r=(0,h.useCallback)(()=>{i(t)},[t]),s=(0,h.useCallback)(()=>{i(e=>"collapsed"===e?"compact":"collapsed")},[]);return{state:n,initialState:t,setState:i,isOpen:a,open:o,close:r,toggle:s}}(m),B=(0,h.useRef)(!1),z=(0,h.useRef)(!1),U=(0,h.useRef)(!1),[H,$]=(0,h.useState)(!1),[W,q]=(0,h.useState)(!1),[K,Y]=(0,h.useState)(!1),G=function(){const[e,t]=(0,h.useState)(!0);return(0,h.useEffect)(()=>{const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("focus",e),window.addEventListener("blur",n),()=>{window.removeEventListener("focus",e),window.removeEventListener("blur",n)}},[]),e}(),[X,J]=(0,h.useState)(!1);(0,h.useEffect)(()=>{(function(e="en",t={}){if("en"===e)return!0;try{if(function(e,t){var n;const{domain:i="a8c-agenttic"}=t;try{const t=function(e){return Fg[e]||null}(e);if(!t)return console.warn(`Translations unavailable for locale: ${e}`),!1;const a=null==(n=t.locale_data)?void 0:n.messages;if(a){const t="",n=Object.fromEntries(Object.entries(a).map(([n,o])=>{var r;if(""===n)return["",{...a[""],domain:i,lang:(null==(r=a[""])?void 0:r.lang)||e}];const s=n.indexOf(t);return[s>-1?n.slice(s+1):n,o]}));(0,cc.setLocaleData)(n,i)}else(0,cc.setLocaleData)(t,i);return!0}catch(t){return console.warn(`Failed to load bundled translations for locale: ${e}`,t),!1}}(e,t))return!0}catch(t){console.warn(`Translation loading failed for locale ${e}`,t)}return!1})(T,{domain:"a8c-agenttic"})||console.warn(`Translations could not be loaded for locale: ${T}, defaulting to English`)},[T]),(0,h.useEffect)(()=>{const e=_.length>0,t=K&&G&&e;t!==X&&(J(t),null==L||L(t))},[K,G,_.length,X,L]);const Z=(0,h.useCallback)(()=>{Y(!0)},[]),Q=(0,h.useCallback)(()=>{Y(!1)},[]),ee=_.length>P;(0,h.useEffect)(()=>{ee&&(null==E||E())},[ee,E]),(0,h.useEffect)(()=>{B.current=!1,z.current=!1,U.current=!1},[V.state]);const te=(0,h.useRef)(new Set),ne=(0,h.useCallback)(()=>{te.current.forEach(e=>{clearTimeout(e)}),te.current.clear()},[]),ie=function({value:e,setValue:t,onSubmit:n,isProcessing:i,isInputOverLimit:a=!1,floatingChatState:o,disabled:r=!1}){const s=(0,h.useRef)(null),l=(0,h.useCallback)(()=>{t(""),s.current&&(s.current.style.height="auto",setTimeout(()=>{var e;null==(e=s.current)||e.focus()},100))},[t]),c=(0,h.useCallback)(()=>{const e=s.current;if(!e)return;e.style.height="auto";const t=e.scrollHeight;e.style.height=`${Math.min(Math.max(t,40),200)}px`},[]),u=(0,h.useCallback)(t=>{"Enter"===t.key&&!t.shiftKey&&!i&&!a&&!r&&(t.preventDefault(),n(e.trim()),l())},[e,i,a,n,l,r]);return(0,h.useEffect)(()=>{c()},[e,o,c]),{value:e,setValue:t,clear:l,textareaRef:s,handleKeyDown:u,adjustHeight:c}}({value:_,setValue:F,onSubmit:async e=>{"expanded"!==V.state&&(null==u||u()),V.setState("expanded"),await a(e)},isProcessing:n,isInputOverLimit:ee,floatingChatState:V.state}),[ae,oe]=(0,h.useState)(56),[re,se]=(0,h.useState)(function(e="left"){try{const e=localStorage.getItem(Vg);if("left"===e||"right"===e)return e}catch(e){console.warn("Failed to read chat position from localStorage:",e)}return e}(j)),le=(0,h.useRef)(null),ce=(0,h.useRef)(null),ue=(0,h.useRef)(null),de=Fl("right"===re?window.innerWidth-lm-32:0),he=Fl(0),pe=ia(Bl),fe=(0,h.useCallback)(async(e,t)=>{const n=e.prompt??e.label;if(e.autoSubmit){null==y||y();const e=n.trim();e&&await a(e)}else{const e=n.endsWith(" ")?n:`${n} `;ie.setValue(e),null==y||y(),ie.textareaRef.current&&(ie.textareaRef.current.focus(),ie.textareaRef.current.setSelectionRange(e.length,e.length))}null==v||v(e,t)},[y,a,v,ie]),me=(0,h.useCallback)(()=>{B.current=!0,V.open(),null==c||c(),null==u||u()},[V,c,u]),ge=(0,h.useCallback)(()=>{var e,t,n;const i=null==(t=null==(e=ue.current)?void 0:e.ownerDocument)?void 0:t.activeElement;return!(i&&null!=(n=ue.current)&&n.contains(i)||_.trim())},[_,ue]),ye=(0,h.useCallback)(e=>"collapsed"===e?56:"compact"===e?ae:520,[ae]),xe=(0,h.useCallback)(()=>{if(I&&"collapsed"===V.state&&(V.setState("compact"),"collapsed"===V.initialState)){const e=setTimeout(()=>{"compact"===V.state&&ge()&&V.setState("collapsed"),te.current.delete(e)},1500);te.current.add(e)}},[V,ge]),be=(0,h.useCallback)(()=>{if("collapsed"===V.initialState&&"compact"===V.state&&ge()){const e=setTimeout(()=>{"compact"===V.state&&ge()&&V.setState("collapsed"),te.current.delete(e)},1500);te.current.add(e)}},[V,ge]),we=(0,h.useCallback)(async()=>{const e=ie.value.trim();ie.clear(),"expanded"!==V.state&&(null==u||u()),V.setState("expanded"),await a(e)},[ie,a,V,u]),ke=(0,h.useCallback)(()=>{U.current=!0,null==u||u(),V.setState("expanded")},[u,V]),Se=(0,h.useCallback)(()=>{z.current=!0,ie.clear(),V.close(),d&&d()},[ie,V,d]),Ce=(0,h.useCallback)(e=>{if(!ue.current||!ce.current)return null;const t=ue.current.getBoundingClientRect(),n=ce.current.getBoundingClientRect(),i=window.getComputedStyle(ue.current),a=new DOMMatrixReadOnly(i.transform),o=t.x-a.e,r=t.y-a.f,s=e??re,l=ye(V.state);return{x:("left"===s?n.left:n.right-lm)-o,y:n.bottom-l-r}},[re,V.state,ye]),Te=(0,h.useCallback)(e=>{const t=e.target;t.ownerDocument===document&&(t.closest(um.NON_DRAGGABLE_SELECTORS)||(e.preventDefault(),pe.start(e.nativeEvent)))},[pe]),Pe=(0,h.useCallback)(()=>{q(!0)},[]),Ee=(0,h.useCallback)((e,t)=>{q(!1);const n=t.point.x,i=n<(window.innerWidth-372)/2?"left":"right";re!==i&&(se(i),function(e){try{localStorage.setItem(Vg,e)}catch(e){console.warn("Failed to save chat position to localStorage:",e)}}(i),null==D||D(i));const a=Ce(i);a&&(lc(de,a.x,{...um.SPRING_CONFIG,velocity:t.velocity.x*um.VELOCITY_MULTIPLIER}),lc(he,a.y,{...um.SPRING_CONFIG,velocity:t.velocity.y*um.VELOCITY_MULTIPLIER}))},[de,he,Ce,D,re]),Ae=(0,h.useRef)(V.state),Ie="compact"===Ae.current&&"expanded"===V.state;(0,h.useEffect)(()=>{ne(),Ae.current=V.state},[V.state,ne]),(0,h.useEffect)(()=>{const e=()=>{const e=Ce();e&&(de.set(e.x),he.set(e.y))};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[V.state,de,he,Ce]),(0,h.useEffect)(()=>{const e=te.current;return()=>{e.forEach(e=>{clearTimeout(e)}),e.clear()}},[]),(0,h.useEffect)(()=>{if("compact"===V.state&&le.current){const e=le.current.scrollHeight+16;oe(e)}},[V.state,ie.value]);const Me=f&&["floating","embedded"].includes(o)&&0===t.length&&h.isValidElement(f)?h.cloneElement(f,{onSuggestionClick:fe}):void 0,je=ee?{message:(0,cc.sprintf)( /* translators: %d: maximum number of characters allowed */ /* translators: %d: maximum number of characters allowed */ -(0,cc.__)("Message is too long. Please keep it under %d characters.","a8c-agenttic"),P),dismissible:!1,status:"error"}:l,De={messages:t,isProcessing:n,error:i,inputValue:ie.value,setInputValue:ie.setValue,clearInput:ie.clear,textareaRef:ie.textareaRef,handleKeyDown:ie.handleKeyDown,onSubmit:a,handleSubmit:we,onStop:p,variant:o,placeholder:s,emptyView:Me,messageRenderer:x,messagesPosition:b,floatingChatState:F.state,triggerIcon:r,onOpen:me,onExpand:ke,onClose:Se,suggestions:g,clearSuggestions:y,handleSuggestionSubmit:fe,notice:je,thinkingMessage:M,focusOnMount:U.current,fromCompact:Ie,showExpandButton:!ie.value.trim(),isInputOverLimit:ee,onInputFocus:Z,onInputBlur:Q};return"embedded"===o?(0,ve.jsx)(Kg,{value:De,children:(0,ve.jsx)("div",{"data-slot":"chat-embedded",className:sm(w,sy,"Chat-module_embedded"),children:e})}):(0,ve.jsxs)(Kg,{value:De,children:[(0,ve.jsx)("div",{ref:ce,style:{position:"fixed",top:cm,left:cm,right:cm,bottom:cm,pointerEvents:"none"}}),W&&(0,ve.jsx)(cy,{}),(0,ve.jsx)(Il.div,{ref:ue,"data-slot":"chat-floating",className:sm(w,sy,"Chat-module_floating",{[ly]:"expanded"===F.state,animating:H}),onMouseLeave:"compact"===F.state?be:void 0,drag:C.includes(F.state),dragControls:pe,dragListener:!1,dragConstraints:!!W&&ce,dragMomentum:!1,dragElastic:.1,dragTransition:{power:.1,timeConstant:100},onDragStart:Pe,onDragEnd:Ee,onPointerDown:Te,style:{x:de,y:he,bottom:cm,left:cm,cursor:C.includes(F.state)?"grab":"default"},children:(0,ve.jsx)(Il.div,{layout:!0,className:"Chat-module_content",initial:!1,animate:{width:"collapsed"===F.state?56:lm,height:ye(F.state),x:"collapsed"===F.state&&"right"===re?316:0,transition:ie.value.trim()?{duration:0}:Hg},onAnimationStart:()=>$(!0),onAnimationComplete:()=>$(!1),style:{borderRadius:24},children:(0,ve.jsxs)(_l,{mode:"wait",children:["collapsed"===F.state&&(0,ve.jsx)(Jg,{icon:r,onClick:me,onHover:xe,focusOnMount:z.current},"collapsed"),"compact"===F.state&&(0,ve.jsx)("div",{ref:le,children:(0,ve.jsx)(ry,{value:ie.value,onChange:ie.setValue,onSubmit:we,onKeyDown:ie.handleKeyDown,textareaRef:ie.textareaRef,placeholder:s,isProcessing:n,onBlur:be,onFocus:Z,onExpand:ke,showExpandButton:!ie.value.trim(),focusOnMount:B.current,onStop:p,suggestions:g,clearSuggestions:y,handleSuggestionSubmit:fe,expandOnClick:A},"compact")}),"expanded"===F.state&&e]})})})]})}function dy({className:e,size:t=24}){return(0,ve.jsx)("svg",{className:e,width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{d:"M12.0001 13.0607L16.4697 17.5304L17.5304 16.4697L13.0607 12.0001L17.5304 7.53039L16.4697 6.46973L12.0001 10.9394L7.5304 6.46973L6.46973 7.53039L10.9394 12.0001L6.46974 16.4697L7.5304 17.5304L12.0001 13.0607Z",fill:"currentColor"})})}function hy({onClose:e,className:t}){return(0,ve.jsx)(Il.div,{"data-slot":"chat-header","data-draggable":"true",className:"ChatHeader-module_container",initial:{opacity:0},animate:{opacity:1},transition:{...zg,delay:.1},children:e&&(0,ve.jsx)(Gg,{variant:"ghost",icon:(0,ve.jsx)(dy,{}),onClick:e,"aria-label":(0,cc.__)("Close conversation","a8c-agenttic")})})}function py({className:e}={}){const{onClose:t}=qg();return(0,ve.jsx)(hy,{onClose:t,className:e})}const fy={container:"MessageActions-module_container"};function my({message:e}){return e.actions&&0!==e.actions.length?(0,ve.jsx)("div",{className:fy.container,"data-visible":"true",role:"toolbar","aria-label":"Message actions",children:e.actions.map(t=>{if("component"===t.type){const e=t.component;return(0,ve.jsx)(e,{...t.componentProps||{}},t.id)}return(0,ve.jsx)(Gg,{className:fy.button,icon:t.icon,onClick:()=>t.onClick(e),variant:"ghost",size:"sm",type:"button",disabled:t.disabled,pressed:t.pressed,title:t.tooltip||t.label,"aria-label":t.label,...t.tooltip&&{title:t.tooltip},children:t.showLabel?t.label:void 0},t.id)})}):null}const gy={message:"Message-module_message",user:"Message-module_user",bubble:"Message-module_bubble",error:"Message-module_error",content:"Message-module_content",disabled:"Message-module_disabled"},yy=h.forwardRef(function({message:e,messageRenderer:t=Op},n){return(0,ve.jsxs)(Il.div,{ref:n,variants:$g,initial:"hidden",animate:"visible","data-slot":"message","data-role":e.role,className:sm(gy.message,gy[e.role],e.disabled?gy.disabled:void 0),children:[(0,ve.jsxs)("div",{className:gy.content,title:e.disabled?(0,cc.__)("This action is no longer available or cannot be performed","a8c-agenttic"):void 0,children:[(0,ve.jsx)("div",{className:gy.bubble,children:(()=>{const n=Array.isArray(e.content)?e.content:[];return(0,ve.jsx)(ve.Fragment,{children:n.map((e,n)=>{if("text"===e.type&&e.text)return(0,ve.jsx)(t,{children:e.text},n);if("component"===e.type&&e.component){const t=e.component;return(0,ve.jsx)(t,{...e.componentProps||{}},n)}return null})})})()}),"user"!==e.role&&(0,ve.jsx)(my,{message:e})]}),"user"===e.role&&(0,ve.jsx)(my,{message:e})]})}),vy={container:"Messages-module_container",bottomMessages:"Messages-module_bottomMessages"},xy=(0,h.memo)(h.forwardRef(function({content:e=(0,cc.__)("Thinking…","a8c-agenttic")},t){const n=(0,h.useMemo)(()=>(0,ve.jsx)(Xg,{}),[]);return(0,ve.jsxs)("div",{ref:t,"data-slot":"thinking",className:"Thinking-module_container",children:[(0,ve.jsx)("div",{className:"Thinking-module_icon",children:n}),(0,ve.jsx)("span",{className:"Thinking-module_content",children:e})]})}));function by({messages:e,isProcessing:t,error:n,emptyView:i,messageRenderer:a,thinkingMessage:o,messagesPosition:r="top"}){const s=(0,h.useRef)(null),l=(e=>e.map(e=>({...e,content:e.content.filter(e=>"context"!==e.type)})).filter(e=>e.content.length>0))(e);!function({scrollAreaRef:e,visibleMessages:t}){const n=(0,h.useRef)(0),i=(0,h.useRef)(!0),a=(0,h.useRef)(!0),o=(0,h.useRef)(0),r=(0,h.useRef)(null),s=(0,h.useCallback)(()=>{cancelAnimationFrame(o.current),o.current=0,r.current=null},[]),l=(0,h.useCallback)(()=>{s();const t=()=>{const n=e.current;if(!n||!a.current)return void s();if(null!==r.current&&n.scrollTop=i)return void s();const l=i-n.scrollTop;if(l<=1)return n.scrollTop=i,void s();n.scrollTop+=Math.ceil(.12*l),r.current=n.scrollTop,o.current=requestAnimationFrame(t)};o.current=requestAnimationFrame(t)},[e,s]);(0,h.useEffect)(()=>{const t=e.current;if(!t)return;const n=()=>{a.current=!1,s()};return t.addEventListener("wheel",n,{passive:!0}),t.addEventListener("touchmove",n,{passive:!0}),()=>{t.removeEventListener("wheel",n),t.removeEventListener("touchmove",n)}},[e,s]),(0,h.useEffect)(()=>s,[s]),(0,h.useEffect)(()=>{const r=e.current;if(!r||0===t.length)return void(n.current=t.length);const c=t.length>n.current,u=t[t.length-1];if(i.current)return r.scrollTop=r.scrollHeight,i.current=!1,void(n.current=t.length);c&&"user"===u.role&&(a.current=!0,s()),a.current?("agent"===u.role?o.current||l():c&&r.scrollTo({top:r.scrollHeight,behavior:"smooth"}),n.current=t.length):n.current=t.length},[t,e,l,s])}({scrollAreaRef:s,visibleMessages:l});const c=l.length>0&&"agent"===l[l.length-1].role,u=(0,h.useMemo)(()=>{const e=l.filter(e=>"agent"===e.role);return e.length?e[e.length-1].content.filter(e=>"text"===e.type).map(e=>e.text).join(" "):""},[l]),[d]=Vp(u,1e3);return 0!==l.length||t?(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"},children:d}),(0,ve.jsx)("div",{"data-slot":"messages",className:sm(vy.container,"bottom"===r?vy.bottomMessages:""),ref:s,children:(0,ve.jsxs)(_l,{mode:"popLayout",children:[l.map(e=>(0,ve.jsx)(yy,{message:e,messageRenderer:a},e.reactKey||e.id)),t&&!c&&(0,ve.jsx)(xy,{content:o}),n&&(0,ve.jsx)("div",{className:"error-message",style:{color:"var(--color-error)",padding:"var(--spacing-4)",textAlign:"center"},children:n})]})})]}):i?(0,ve.jsx)("div",{"data-slot":"messages",className:`${vy.container} ${vy.emptyState}`,ref:s,children:i}):null}function wy({className:e}={}){const{messages:t,isProcessing:n,error:i,emptyView:a,messageRenderer:o,messagesPosition:r,thinkingMessage:s}=qg();return(0,ve.jsx)(by,{messages:t,isProcessing:n,error:i,emptyView:a,messageRenderer:o,thinkingMessage:s,className:e,messagesPosition:r})}function ky({className:e,size:t=24}){return(0,ve.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,ve.jsx)("path",{d:"M12 5C12.4142 5 12.75 5.33579 12.75 5.75V11.25H18.25C18.6642 11.25 19 11.5858 19 12C19 12.4142 18.6642 12.75 18.25 12.75H12.75V18.25C12.75 18.6642 12.4142 19 12 19C11.5858 19 11.25 18.6642 11.25 18.25V12.75H5.75C5.33579 12.75 5 12.4142 5 12C5 11.5858 5.33579 11.25 5.75 11.25H11.25V5.75C11.25 5.33579 11.5858 5 12 5Z",fill:"currentColor"})})}function Sy({className:e,disabled:t,customActions:n,actionOrder:i,onKeyDown:a,layout:o,imageUploaderRef:r}={}){const{inputValue:s,setInputValue:l,handleSubmit:c,handleKeyDown:u,textareaRef:d,placeholder:p,isProcessing:f,onStop:m,fromCompact:g,onExpand:y,showExpandButton:v,focusOnMount:x,onInputFocus:b,onInputBlur:w}=qg(),k=(0,h.useMemo)(()=>r?[{id:"image-upload",icon:(0,ve.jsx)(ky,{}),onClick:()=>{var e;return null==(e=r.current)?void 0:e.openFileDialog()},variant:"ghost","aria-label":(0,cc.__)("Upload image","a8c-agenttic")},...n||[]]:n,[r,n]);return(0,ve.jsx)(ay,{value:s,onChange:l,onSubmit:c,onKeyDown:e=>{null==a||a(e),!e.defaultPrevented&&u(e)},onFocus:b,onBlur:w,textareaRef:d,placeholder:p,isProcessing:f,onStop:m,fromCompact:g,onExpand:y,showExpandButton:v,focusOnMount:x,disabled:t,customActions:k,actionOrder:i,className:e,layout:o??(r?"stacked":"inline")})}function Cy({className:e,showSuggestions:t,onSelect:n}={}){const{suggestions:i,handleSuggestionSubmit:a,inputValue:o,messages:r,variant:s,emptyView:l}=qg(),c=(0,h.useCallback)((e,t)=>{try{const t=e.prompt??e.label;null==n||n(t)}catch(e){console.warn("Suggestions onSelect callback failed:",e)}a(e,t)},[n,a]);return o&&!t||l&&["floating","embedded"].includes(s)&&0===r.length&&!o?null:(0,ve.jsx)(oy,{suggestions:i,onSubmit:c,className:e})}function Ty({className:e,size:t=18}){return(0,ve.jsxs)("svg",{width:t,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,role:"img","aria-label":"Alert",children:[(0,ve.jsx)("path",{d:"M8.4375 12V10.875H9.5625V12H8.4375Z",fill:"currentColor"}),(0,ve.jsx)("path",{d:"M8.4375 6L8.4375 9.75H9.5625V6L8.4375 6Z",fill:"currentColor"}),(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3C5.68629 3 3 5.68629 3 9C3 12.3137 5.68629 15 9 15C12.3137 15 15 12.3137 15 9C15 5.68629 12.3137 3 9 3ZM4.125 9C4.125 11.6924 6.30761 13.875 9 13.875C11.6924 13.875 13.875 11.6924 13.875 9C13.875 6.30761 11.6924 4.125 9 4.125C6.30761 4.125 4.125 6.30761 4.125 9Z",fill:"currentColor"})]})}function Py({className:e,size:t=18}){return(0,ve.jsxs)("svg",{width:t,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,role:"img","aria-label":"Alert",children:[(0,ve.jsx)("path",{d:"M9.56279 13.0952H8.43779V11.9702H9.56279V13.0952Z",fill:"currentColor"}),(0,ve.jsx)("path",{d:"M8.43779 10.8452H9.56279V7.0952L8.43779 7.0952V10.8452Z",fill:"currentColor"}),(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.85634 3.48153C8.35812 2.58949 9.64245 2.58949 10.1442 3.48153L15.6118 13.2017C16.104 14.0767 15.4717 15.1577 14.4679 15.1577H3.53267C2.52884 15.1577 1.89659 14.0767 2.38873 13.2017L7.85634 3.48153ZM9.16371 4.03308C9.09203 3.90564 8.90855 3.90564 8.83686 4.03308L3.36925 13.7533C3.29895 13.8783 3.38927 14.0327 3.53267 14.0327H14.4679C14.6113 14.0327 14.7016 13.8783 14.6313 13.7533L9.16371 4.03308Z",fill:"currentColor"})]})}const Ey="Notice-module_isSuccess",Ay="Notice-module_isWarning",Iy="Notice-module_isError";function My({icon:e,message:t,action:n,dismissible:i=!0,onDismiss:a,className:o,status:r}){const s=(0,h.useCallback)(()=>{if(h.isValidElement(e))return e;if(!1===e||null===e)return null;switch(r){case"warning":return(0,ve.jsx)(Ty,{});case"error":return(0,ve.jsx)(Py,{});default:return null}},[e,r])();return(0,ve.jsxs)("div",{"data-slot":"notice",className:sm("Notice-module_container",{[Ey]:"success"===r,[Ay]:"warning"===r,[Iy]:"error"===r},o),children:[(0,ve.jsxs)("div",{className:"Notice-module_content",children:[s&&(0,ve.jsx)("div",{className:"Notice-module_icon",children:s}),(0,ve.jsx)("div",{children:(0,ve.jsx)(Op,{allowedElements:["p","strong","em","a","br"],unwrapDisallowed:!0,components:{a:({node:e,...t})=>(0,ve.jsx)("a",{...t,target:"_blank",rel:"noopener noreferrer",children:t.children})},children:t})})]}),(0,ve.jsxs)("div",{className:"Notice-module_actions",children:[n&&(0,ve.jsx)(Gg,{className:"Notice-module_action",onClick:n.onClick,variant:"link",children:n.label}),i&&a&&(0,ve.jsx)(Gg,{className:"Notice-module_dismissible",onClick:a,variant:"ghost",size:"sm",icon:(0,ve.jsx)(dy,{})})]})]})}function jy({className:e}={}){const{notice:t}=qg();return t?(0,ve.jsx)(My,{icon:t.icon,message:t.message,action:t.action,dismissible:t.dismissible,onDismiss:t.onDismiss,className:e,status:t.status}):null}const Dy="ChatFooter-module_container";function Ly({children:e,className:t}={}){return e?(0,ve.jsx)(Il.div,{"data-slot":"chat-footer",className:sm(Dy,t),initial:{opacity:0,scale:1},animate:{opacity:1,scale:1},transition:{...zg},children:e}):(0,ve.jsxs)(Il.div,{"data-slot":"chat-footer",className:sm(Dy,t),initial:{opacity:0,scale:1},animate:{opacity:1,scale:1},transition:{...zg},children:[(0,ve.jsx)(Cy,{}),(0,ve.jsx)(jy,{}),(0,ve.jsx)(Sy,{})]})}const Ry="ConversationView-module_container",Oy="ConversationView-module_withHeader",Ny=(0,h.forwardRef)(function({showHeader:e=!0,children:t,className:n}={},i){const{onClose:a}=qg();if((0,h.useEffect)(()=>{const e=e=>{"Escape"===e.key&&a&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),t){const e=h.Children.toArray(t).some(e=>h.isValidElement(e)&&(e.type===py||"function"==typeof e.type&&"AgentUIHeader"===e.type.name));return(0,ve.jsx)("div",{ref:i,"data-slot":"conversation-view",className:`${Ry}${e?` ${Oy}`:""}${n?` ${n}`:""}`,children:t})}return(0,ve.jsxs)("div",{ref:i,"data-slot":"conversation-view",className:`${Ry}${e?` ${Oy}`:""}${n?` ${n}`:""}`,children:[e&&(0,ve.jsx)(py,{}),(0,ve.jsx)(wy,{}),(0,ve.jsx)(Ly,{})]})});Ny.displayName="AgentUIConversationView";const _y={Container:uy,Header:py,Messages:wy,Input:Sy,Suggestions:Cy,Notice:jy,InputToolbar:function({children:e,className:t,icon:n,label:i,disabled:a}={}){const[o,r]=(0,h.useState)(!1),s=(0,h.useRef)(null),l=h.useId(),u=()=>{r(e=>!e)},d=()=>{r(!1)},{refs:p,floatingStyles:f}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:o,floating:r}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=h.useState(i);em(f,i)||m(i);const[g,y]=h.useState(null),[v,x]=h.useState(null),b=h.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),w=h.useCallback(e=>{e!==T.current&&(T.current=e,x(e))},[]),k=o||g,S=r||v,C=h.useRef(null),T=h.useRef(null),P=h.useRef(d),E=null!=l,A=im(l),I=im(a),M=im(u),j=h.useCallback(()=>{if(!C.current||!T.current)return;const e={placement:t,strategy:n,middleware:f};I.current&&(e.platform=I.current),Zf(C.current,T.current,e).then(e=>{const t={...e,isPositioned:!1!==M.current};D.current&&!em(P.current,t)&&(P.current=t,c.flushSync(()=>{p(t)}))})},[f,t,n,I,M]);Qf(()=>{!1===u&&P.current.isPositioned&&(P.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const D=h.useRef(!1);Qf(()=>(D.current=!0,()=>{D.current=!1}),[]),Qf(()=>{if(k&&(C.current=k),S&&(T.current=S),k&&S){if(A.current)return A.current(k,S,j);j()}},[k,S,j,A,E]);const L=h.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:w}),[b,w]),R=h.useMemo(()=>({reference:k,floating:S}),[k,S]),O=h.useMemo(()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=nm(R.floating,d.x),i=nm(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+i+"px)",...tm(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:i}},[n,s,R.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:j,refs:L,elements:R,floatingStyles:O}),[d,j,L,R,O])}({placement:"bottom-start",transform:!0,middleware:[am(8),rm({fallbackPlacements:["bottom","bottom-end","top-start","top","top-end"],fallbackStrategy:"bestFit"}),om({padding:8})],whileElementsMounted:Xf});(0,h.useEffect)(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d()};if(o)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[o]),(0,h.useEffect)(()=>{const e=e=>{var t,n;o&&"Escape"===e.key&&(e.preventDefault(),d(),null==(n=null==(t=p.reference)?void 0:t.current)||n.focus())};if(o)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o]),(0,h.useEffect)(()=>{var e,t,n;o&&null!=(e=p.floating)&&e.current&&(null==(n=null==(t=p.floating)?void 0:t.current)||n.focus())},[o]);const m=i??"Input Toolbar";return(0,ve.jsx)("div",{ref:s,className:t,children:(0,ve.jsxs)("div",{className:"AgentUIInputToolbar-module_container",children:[(0,ve.jsxs)("button",{ref:p.setReference,type:"button",onClick:u,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),u())},className:"AgentUIInputToolbar-module_button","aria-expanded":o,"aria-haspopup":"true","aria-controls":o?l:void 0,"aria-label":m,disabled:a,children:[n,(0,ve.jsx)("span",{children:m}),(0,ve.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"AgentUIInputToolbar-module_icon "+(o?"AgentUIInputToolbar-module_iconOpen":""),children:(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0045 10.5549L12 16.0136L5.9955 10.5549L7.00451 9.44504L12 13.9864L16.9955 9.44504L18.0045 10.5549Z",fill:"currentColor"})})]}),o&&(0,ve.jsx)("div",{ref:p.setFloating,id:l,className:"AgentUIInputToolbar-module_dropdown",role:"dialog","aria-label":m,tabIndex:-1,style:f,children:e})]})})},Footer:Ly,ConversationView:Ny},Vy=Object.assign(e=>(0,ve.jsx)(uy,{...e,className:sm("agenttic",e.className),children:(0,ve.jsx)(Ny,{showHeader:"floating"===e.variant})}),_y),Fy="ImageUploader-module_previewItem",By=(0,h.memo)(({image:e,allowDragToInsert:t,showFileMetadata:n,onDragStart:i,onDragEnd:a,onRemove:o})=>{const r=e.mime_type?e.mime_type.split("/")[1].toUpperCase():"",s=e.title||e.name||e.url.split("/").pop()||"image";return(0,ve.jsxs)("div",{className:Fy,draggable:t,onDragStart:t=>i(e,t),onDragEnd:t=>a(e,t),children:[(0,ve.jsx)("button",{className:"ImageUploader-module_removeButton",onClick:t=>o(t,e),"aria-label":(0,cc.__)("Remove image","a8c-agenttic"),type:"button",children:(0,ve.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M7.4632e-09 8C3.34139e-09 3.58172 3.58172 -3.34139e-09 8 -7.4632e-09C12.4183 -1.1585e-08 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 1.1585e-08 12.4183 7.4632e-09 8ZM6.16569 5.03431C5.85327 4.7219 5.34673 4.7219 5.03431 5.03431C4.7219 5.34673 4.7219 5.85327 5.03431 6.16569L6.86863 8L5.03431 9.83432C4.7219 10.1467 4.7219 10.6533 5.03431 10.9657C5.34673 11.2781 5.85327 11.2781 6.16569 10.9657L8 9.13137L9.83432 10.9657C10.1467 11.2781 10.6533 11.2781 10.9657 10.9657C11.2781 10.6533 11.2781 10.1467 10.9657 9.83432L9.13137 8L10.9657 6.16569C11.2781 5.85327 11.2781 5.34673 10.9657 5.03431C10.6533 4.7219 10.1467 4.7219 9.83432 5.03431L8 6.86863L6.16569 5.03431Z"})})}),(0,ve.jsx)("img",{src:e.url,alt:e.alt||s,className:"ImageUploader-module_previewImage",loading:"lazy"}),n&&(0,ve.jsxs)("div",{className:"ImageUploader-module_previewMeta",children:[(0,ve.jsx)("span",{className:"ImageUploader-module_previewFilename",title:s+(e.alt?` - ${e.alt}`:""),children:s}),(0,ve.jsx)("span",{className:"ImageUploader-module_previewType",children:r})]})]},e.id)});(0,h.forwardRef)(function({images:e=[],uploadingImages:t=[],onFilesSelected:n,onBrowse:i,onDrop:a,onPaste:o,onRemoveImage:r,onImageDragStart:s,onImageDragEnd:l,acceptedFileTypes:c=["image/jpeg","image/png"],maxFileSize:u,maxFiles:d,uploadingIndicator:p,className:f="",showFileMetadata:m=!0,allowDragToInsert:g=!0,onError:y,visible:v=!0,dropZoneRef:x},b){const{textareaRef:w}=qg(),[k,S]=(0,h.useState)(!1),[C,T]=(0,h.useState)(!1),[P,E]=(0,h.useState)(!1),A=(0,h.useRef)(null),I=(0,h.useRef)(null),M=(0,h.useRef)(0);(0,h.useImperativeHandle)(b,()=>({openFileDialog:()=>{var e;null==(e=A.current)||e.click()}})),(0,h.useEffect)(()=>{const e=x?x.current:window;if(!e)return;const t=e=>{var t,n;null!=(n=null==(t=e.dataTransfer)?void 0:t.types)&&n.includes("Files")&&(M.current+=1,T(!0))},n=e=>{M.current-=1,(0===M.current||null===e.relatedTarget)&&(M.current=0,T(!1))},i=()=>{M.current=0,T(!1)};return e.addEventListener("dragenter",t),e.addEventListener("dragleave",n),e.addEventListener("drop",i),()=>{e.removeEventListener("dragenter",t),e.removeEventListener("dragleave",n),e.removeEventListener("drop",i)}},[x]),(0,h.useEffect)(()=>()=>{I.current&&clearTimeout(I.current)},[]);const j=(0,h.useCallback)(e=>{const t=Math.min(e,10485760),n=Math.floor(t/1048576);return n>=1?`${n} MB`:`${Math.floor(t/1024)} KB`},[]),D=(0,h.useCallback)(e=>{if(!e||0===e.length)return;const t=Array.from(e),i=t.filter(e=>c.includes(e.type));if(i.lengthe.split("/")[1].toUpperCase()).join(" or ");null==y||y((0,cc.sprintf)( +(0,cc.__)("Message is too long. Please keep it under %d characters.","a8c-agenttic"),P),dismissible:!1,status:"error"}:l,De={messages:t,isProcessing:n,error:i,inputValue:ie.value,setInputValue:ie.setValue,clearInput:ie.clear,textareaRef:ie.textareaRef,handleKeyDown:ie.handleKeyDown,onSubmit:a,handleSubmit:we,onStop:p,variant:o,placeholder:s,emptyView:Me,messageRenderer:x,messagesPosition:b,floatingChatState:V.state,triggerIcon:r,onOpen:me,onExpand:ke,onClose:Se,suggestions:g,clearSuggestions:y,handleSuggestionSubmit:fe,notice:je,thinkingMessage:M,focusOnMount:U.current,fromCompact:Ie,showExpandButton:!ie.value.trim(),isInputOverLimit:ee,onInputFocus:Z,onInputBlur:Q};return"embedded"===o?(0,ve.jsx)(Kg,{value:De,children:(0,ve.jsx)("div",{"data-slot":"chat-embedded",className:sm(w,sy,"Chat-module_embedded"),children:e})}):(0,ve.jsxs)(Kg,{value:De,children:[(0,ve.jsx)("div",{ref:ce,style:{position:"fixed",top:cm,left:cm,right:cm,bottom:cm,pointerEvents:"none"}}),W&&(0,ve.jsx)(cy,{}),(0,ve.jsx)(Il.div,{ref:ue,"data-slot":"chat-floating",className:sm(w,sy,"Chat-module_floating",{[ly]:"expanded"===V.state,animating:H}),onMouseLeave:"compact"===V.state?be:void 0,drag:C.includes(V.state),dragControls:pe,dragListener:!1,dragConstraints:!!W&&ce,dragMomentum:!1,dragElastic:.1,dragTransition:{power:.1,timeConstant:100},onDragStart:Pe,onDragEnd:Ee,onPointerDown:Te,style:{x:de,y:he,bottom:cm,left:cm,cursor:C.includes(V.state)?"grab":"default"},children:(0,ve.jsx)(Il.div,{layout:!0,className:"Chat-module_content",initial:!1,animate:{width:"collapsed"===V.state?56:lm,height:ye(V.state),x:"collapsed"===V.state&&"right"===re?316:0,transition:ie.value.trim()?{duration:0}:Hg},onAnimationStart:()=>$(!0),onAnimationComplete:()=>$(!1),style:{borderRadius:24},children:(0,ve.jsxs)(_l,{mode:"wait",children:["collapsed"===V.state&&(0,ve.jsx)(Jg,{icon:r,onClick:me,onHover:xe,focusOnMount:z.current},"collapsed"),"compact"===V.state&&(0,ve.jsx)("div",{ref:le,children:(0,ve.jsx)(ry,{value:ie.value,onChange:ie.setValue,onSubmit:we,onKeyDown:ie.handleKeyDown,textareaRef:ie.textareaRef,placeholder:s,isProcessing:n,onBlur:be,onFocus:Z,onExpand:ke,showExpandButton:!ie.value.trim(),focusOnMount:B.current,onStop:p,suggestions:g,clearSuggestions:y,handleSuggestionSubmit:fe,expandOnClick:A},"compact")}),"expanded"===V.state&&e]})})})]})}function dy({className:e,size:t=24}){return(0,ve.jsx)("svg",{className:e,width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{d:"M12.0001 13.0607L16.4697 17.5304L17.5304 16.4697L13.0607 12.0001L17.5304 7.53039L16.4697 6.46973L12.0001 10.9394L7.5304 6.46973L6.46973 7.53039L10.9394 12.0001L6.46974 16.4697L7.5304 17.5304L12.0001 13.0607Z",fill:"currentColor"})})}function hy({onClose:e,className:t}){return(0,ve.jsx)(Il.div,{"data-slot":"chat-header","data-draggable":"true",className:"ChatHeader-module_container",initial:{opacity:0},animate:{opacity:1},transition:{...zg,delay:.1},children:e&&(0,ve.jsx)(Gg,{variant:"ghost",icon:(0,ve.jsx)(dy,{}),onClick:e,"aria-label":(0,cc.__)("Close conversation","a8c-agenttic")})})}function py({className:e}={}){const{onClose:t}=qg();return(0,ve.jsx)(hy,{onClose:t,className:e})}const fy={container:"MessageActions-module_container"};function my({message:e}){return e.actions&&0!==e.actions.length?(0,ve.jsx)("div",{className:fy.container,"data-visible":"true",role:"toolbar","aria-label":"Message actions",children:e.actions.map(t=>{if("component"===t.type){const e=t.component;return(0,ve.jsx)(e,{...t.componentProps||{}},t.id)}return(0,ve.jsx)(Gg,{className:fy.button,icon:t.icon,onClick:()=>t.onClick(e),variant:"ghost",size:"sm",type:"button",disabled:t.disabled,pressed:t.pressed,title:t.tooltip||t.label,"aria-label":t.label,...t.tooltip&&{title:t.tooltip},children:t.showLabel?t.label:void 0},t.id)})}):null}const gy={message:"Message-module_message",user:"Message-module_user",bubble:"Message-module_bubble",error:"Message-module_error",content:"Message-module_content",disabled:"Message-module_disabled"},yy=h.forwardRef(function({message:e,messageRenderer:t=Op},n){return(0,ve.jsxs)(Il.div,{ref:n,variants:$g,initial:"hidden",animate:"visible","data-slot":"message","data-role":e.role,className:sm(gy.message,gy[e.role],e.disabled?gy.disabled:void 0),children:[(0,ve.jsxs)("div",{className:gy.content,title:e.disabled?(0,cc.__)("This action is no longer available or cannot be performed","a8c-agenttic"):void 0,children:[(0,ve.jsx)("div",{className:gy.bubble,children:(()=>{const n=Array.isArray(e.content)?e.content:[];return(0,ve.jsx)(ve.Fragment,{children:n.map((e,n)=>{if("text"===e.type&&e.text)return(0,ve.jsx)(t,{children:e.text},n);if("component"===e.type&&e.component){const t=e.component;return(0,ve.jsx)(t,{...e.componentProps||{}},n)}return null})})})()}),"user"!==e.role&&(0,ve.jsx)(my,{message:e})]}),"user"===e.role&&(0,ve.jsx)(my,{message:e})]})}),vy={container:"Messages-module_container",bottomMessages:"Messages-module_bottomMessages"},xy=(0,h.memo)(h.forwardRef(function({content:e=(0,cc.__)("Thinking…","a8c-agenttic")},t){const n=(0,h.useMemo)(()=>(0,ve.jsx)(Xg,{}),[]);return(0,ve.jsxs)("div",{ref:t,"data-slot":"thinking",className:"Thinking-module_container",children:[(0,ve.jsx)("div",{className:"Thinking-module_icon",children:n}),(0,ve.jsx)("span",{className:"Thinking-module_content",children:e})]})}));function by({messages:e,isProcessing:t,error:n,emptyView:i,messageRenderer:a,thinkingMessage:o,messagesPosition:r="top"}){const s=(0,h.useRef)(null),l=(e=>e.map(e=>({...e,content:e.content.filter(e=>"context"!==e.type)})).filter(e=>e.content.length>0))(e);!function({scrollAreaRef:e,visibleMessages:t}){const n=(0,h.useRef)(0),i=(0,h.useRef)(!0),a=(0,h.useRef)(!0),o=(0,h.useRef)(0),r=(0,h.useRef)(null),s=(0,h.useCallback)(()=>{cancelAnimationFrame(o.current),o.current=0,r.current=null},[]),l=(0,h.useCallback)(()=>{s();const t=()=>{const n=e.current;if(!n||!a.current)return void s();if(null!==r.current&&n.scrollTop=i)return void s();const l=i-n.scrollTop;if(l<=1)return n.scrollTop=i,void s();n.scrollTop+=Math.ceil(.12*l),r.current=n.scrollTop,o.current=requestAnimationFrame(t)};o.current=requestAnimationFrame(t)},[e,s]);(0,h.useEffect)(()=>{const t=e.current;if(!t)return;const n=()=>{a.current=!1,s()};return t.addEventListener("wheel",n,{passive:!0}),t.addEventListener("touchmove",n,{passive:!0}),()=>{t.removeEventListener("wheel",n),t.removeEventListener("touchmove",n)}},[e,s]),(0,h.useEffect)(()=>s,[s]),(0,h.useEffect)(()=>{const r=e.current;if(!r||0===t.length)return void(n.current=t.length);const c=t.length>n.current,u=t[t.length-1];if(i.current)return r.scrollTop=r.scrollHeight,i.current=!1,void(n.current=t.length);c&&"user"===u.role&&(a.current=!0,s()),a.current?("agent"===u.role?o.current||l():c&&r.scrollTo({top:r.scrollHeight,behavior:"smooth"}),n.current=t.length):n.current=t.length},[t,e,l,s])}({scrollAreaRef:s,visibleMessages:l});const c=l.length>0&&"agent"===l[l.length-1].role,u=(0,h.useMemo)(()=>{const e=l.filter(e=>"agent"===e.role);return e.length?e[e.length-1].content.filter(e=>"text"===e.type).map(e=>e.text).join(" "):""},[l]),[d]=Fp(u,1e3);return 0!==l.length||t?(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"},children:d}),(0,ve.jsx)("div",{"data-slot":"messages",className:sm(vy.container,"bottom"===r?vy.bottomMessages:""),ref:s,children:(0,ve.jsxs)(_l,{mode:"popLayout",children:[l.map(e=>(0,ve.jsx)(yy,{message:e,messageRenderer:a},e.reactKey||e.id)),t&&!c&&(0,ve.jsx)(xy,{content:o}),n&&(0,ve.jsx)("div",{className:"error-message",style:{color:"var(--color-error)",padding:"var(--spacing-4)",textAlign:"center"},children:n})]})})]}):i?(0,ve.jsx)("div",{"data-slot":"messages",className:`${vy.container} ${vy.emptyState}`,ref:s,children:i}):null}function wy({className:e}={}){const{messages:t,isProcessing:n,error:i,emptyView:a,messageRenderer:o,messagesPosition:r,thinkingMessage:s}=qg();return(0,ve.jsx)(by,{messages:t,isProcessing:n,error:i,emptyView:a,messageRenderer:o,thinkingMessage:s,className:e,messagesPosition:r})}function ky({className:e,size:t=24}){return(0,ve.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,ve.jsx)("path",{d:"M12 5C12.4142 5 12.75 5.33579 12.75 5.75V11.25H18.25C18.6642 11.25 19 11.5858 19 12C19 12.4142 18.6642 12.75 18.25 12.75H12.75V18.25C12.75 18.6642 12.4142 19 12 19C11.5858 19 11.25 18.6642 11.25 18.25V12.75H5.75C5.33579 12.75 5 12.4142 5 12C5 11.5858 5.33579 11.25 5.75 11.25H11.25V5.75C11.25 5.33579 11.5858 5 12 5Z",fill:"currentColor"})})}function Sy({className:e,disabled:t,customActions:n,actionOrder:i,onKeyDown:a,layout:o,imageUploaderRef:r}={}){const{inputValue:s,setInputValue:l,handleSubmit:c,handleKeyDown:u,textareaRef:d,placeholder:p,isProcessing:f,onStop:m,fromCompact:g,onExpand:y,showExpandButton:v,focusOnMount:x,onInputFocus:b,onInputBlur:w}=qg(),k=(0,h.useMemo)(()=>r?[{id:"image-upload",icon:(0,ve.jsx)(ky,{}),onClick:()=>{var e;return null==(e=r.current)?void 0:e.openFileDialog()},variant:"ghost","aria-label":(0,cc.__)("Upload image","a8c-agenttic")},...n||[]]:n,[r,n]);return(0,ve.jsx)(ay,{value:s,onChange:l,onSubmit:c,onKeyDown:e=>{null==a||a(e),!e.defaultPrevented&&u(e)},onFocus:b,onBlur:w,textareaRef:d,placeholder:p,isProcessing:f,onStop:m,fromCompact:g,onExpand:y,showExpandButton:v,focusOnMount:x,disabled:t,customActions:k,actionOrder:i,className:e,layout:o??(r?"stacked":"inline")})}function Cy({className:e,showSuggestions:t,onSelect:n}={}){const{suggestions:i,handleSuggestionSubmit:a,inputValue:o,messages:r,variant:s,emptyView:l}=qg(),c=(0,h.useCallback)((e,t)=>{try{const t=e.prompt??e.label;null==n||n(t)}catch(e){console.warn("Suggestions onSelect callback failed:",e)}a(e,t)},[n,a]);return o&&!t||l&&["floating","embedded"].includes(s)&&0===r.length&&!o?null:(0,ve.jsx)(oy,{suggestions:i,onSubmit:c,className:e})}function Ty({className:e,size:t=18}){return(0,ve.jsxs)("svg",{width:t,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,role:"img","aria-label":"Alert",children:[(0,ve.jsx)("path",{d:"M8.4375 12V10.875H9.5625V12H8.4375Z",fill:"currentColor"}),(0,ve.jsx)("path",{d:"M8.4375 6L8.4375 9.75H9.5625V6L8.4375 6Z",fill:"currentColor"}),(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3C5.68629 3 3 5.68629 3 9C3 12.3137 5.68629 15 9 15C12.3137 15 15 12.3137 15 9C15 5.68629 12.3137 3 9 3ZM4.125 9C4.125 11.6924 6.30761 13.875 9 13.875C11.6924 13.875 13.875 11.6924 13.875 9C13.875 6.30761 11.6924 4.125 9 4.125C6.30761 4.125 4.125 6.30761 4.125 9Z",fill:"currentColor"})]})}function Py({className:e,size:t=18}){return(0,ve.jsxs)("svg",{width:t,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,role:"img","aria-label":"Alert",children:[(0,ve.jsx)("path",{d:"M9.56279 13.0952H8.43779V11.9702H9.56279V13.0952Z",fill:"currentColor"}),(0,ve.jsx)("path",{d:"M8.43779 10.8452H9.56279V7.0952L8.43779 7.0952V10.8452Z",fill:"currentColor"}),(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.85634 3.48153C8.35812 2.58949 9.64245 2.58949 10.1442 3.48153L15.6118 13.2017C16.104 14.0767 15.4717 15.1577 14.4679 15.1577H3.53267C2.52884 15.1577 1.89659 14.0767 2.38873 13.2017L7.85634 3.48153ZM9.16371 4.03308C9.09203 3.90564 8.90855 3.90564 8.83686 4.03308L3.36925 13.7533C3.29895 13.8783 3.38927 14.0327 3.53267 14.0327H14.4679C14.6113 14.0327 14.7016 13.8783 14.6313 13.7533L9.16371 4.03308Z",fill:"currentColor"})]})}const Ey="Notice-module_isSuccess",Ay="Notice-module_isWarning",Iy="Notice-module_isError";function My({icon:e,message:t,action:n,dismissible:i=!0,onDismiss:a,className:o,status:r}){const s=(0,h.useCallback)(()=>{if(h.isValidElement(e))return e;if(!1===e||null===e)return null;switch(r){case"warning":return(0,ve.jsx)(Ty,{});case"error":return(0,ve.jsx)(Py,{});default:return null}},[e,r])();return(0,ve.jsxs)("div",{"data-slot":"notice",className:sm("Notice-module_container",{[Ey]:"success"===r,[Ay]:"warning"===r,[Iy]:"error"===r},o),children:[(0,ve.jsxs)("div",{className:"Notice-module_content",children:[s&&(0,ve.jsx)("div",{className:"Notice-module_icon",children:s}),(0,ve.jsx)("div",{children:(0,ve.jsx)(Op,{allowedElements:["p","strong","em","a","br"],unwrapDisallowed:!0,components:{a:({node:e,...t})=>(0,ve.jsx)("a",{...t,target:"_blank",rel:"noopener noreferrer",children:t.children})},children:t})})]}),(0,ve.jsxs)("div",{className:"Notice-module_actions",children:[n&&(0,ve.jsx)(Gg,{className:"Notice-module_action",onClick:n.onClick,variant:"link",children:n.label}),i&&a&&(0,ve.jsx)(Gg,{className:"Notice-module_dismissible",onClick:a,variant:"ghost",size:"sm",icon:(0,ve.jsx)(dy,{})})]})]})}function jy({className:e}={}){const{notice:t}=qg();return t?(0,ve.jsx)(My,{icon:t.icon,message:t.message,action:t.action,dismissible:t.dismissible,onDismiss:t.onDismiss,className:e,status:t.status}):null}const Dy="ChatFooter-module_container";function Ly({children:e,className:t}={}){return e?(0,ve.jsx)(Il.div,{"data-slot":"chat-footer",className:sm(Dy,t),initial:{opacity:0,scale:1},animate:{opacity:1,scale:1},transition:{...zg},children:e}):(0,ve.jsxs)(Il.div,{"data-slot":"chat-footer",className:sm(Dy,t),initial:{opacity:0,scale:1},animate:{opacity:1,scale:1},transition:{...zg},children:[(0,ve.jsx)(Cy,{}),(0,ve.jsx)(jy,{}),(0,ve.jsx)(Sy,{})]})}const Ry="ConversationView-module_container",Oy="ConversationView-module_withHeader",Ny=(0,h.forwardRef)(function({showHeader:e=!0,children:t,className:n}={},i){const{onClose:a}=qg();if((0,h.useEffect)(()=>{const e=e=>{"Escape"===e.key&&a&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),t){const e=h.Children.toArray(t).some(e=>h.isValidElement(e)&&(e.type===py||"function"==typeof e.type&&"AgentUIHeader"===e.type.name));return(0,ve.jsx)("div",{ref:i,"data-slot":"conversation-view",className:`${Ry}${e?` ${Oy}`:""}${n?` ${n}`:""}`,children:t})}return(0,ve.jsxs)("div",{ref:i,"data-slot":"conversation-view",className:`${Ry}${e?` ${Oy}`:""}${n?` ${n}`:""}`,children:[e&&(0,ve.jsx)(py,{}),(0,ve.jsx)(wy,{}),(0,ve.jsx)(Ly,{})]})});Ny.displayName="AgentUIConversationView";const _y={Container:uy,Header:py,Messages:wy,Input:Sy,Suggestions:Cy,Notice:jy,InputToolbar:function({children:e,className:t,icon:n,label:i,disabled:a}={}){const[o,r]=(0,h.useState)(!1),s=(0,h.useRef)(null),l=h.useId(),u=()=>{r(e=>!e)},d=()=>{r(!1)},{refs:p,floatingStyles:f}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:o,floating:r}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=h.useState(i);em(f,i)||m(i);const[g,y]=h.useState(null),[v,x]=h.useState(null),b=h.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),w=h.useCallback(e=>{e!==T.current&&(T.current=e,x(e))},[]),k=o||g,S=r||v,C=h.useRef(null),T=h.useRef(null),P=h.useRef(d),E=null!=l,A=im(l),I=im(a),M=im(u),j=h.useCallback(()=>{if(!C.current||!T.current)return;const e={placement:t,strategy:n,middleware:f};I.current&&(e.platform=I.current),Zf(C.current,T.current,e).then(e=>{const t={...e,isPositioned:!1!==M.current};D.current&&!em(P.current,t)&&(P.current=t,c.flushSync(()=>{p(t)}))})},[f,t,n,I,M]);Qf(()=>{!1===u&&P.current.isPositioned&&(P.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const D=h.useRef(!1);Qf(()=>(D.current=!0,()=>{D.current=!1}),[]),Qf(()=>{if(k&&(C.current=k),S&&(T.current=S),k&&S){if(A.current)return A.current(k,S,j);j()}},[k,S,j,A,E]);const L=h.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:w}),[b,w]),R=h.useMemo(()=>({reference:k,floating:S}),[k,S]),O=h.useMemo(()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=nm(R.floating,d.x),i=nm(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+i+"px)",...tm(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:i}},[n,s,R.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:j,refs:L,elements:R,floatingStyles:O}),[d,j,L,R,O])}({placement:"bottom-start",transform:!0,middleware:[am(8),rm({fallbackPlacements:["bottom","bottom-end","top-start","top","top-end"],fallbackStrategy:"bestFit"}),om({padding:8})],whileElementsMounted:Xf});(0,h.useEffect)(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d()};if(o)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[o]),(0,h.useEffect)(()=>{const e=e=>{var t,n;o&&"Escape"===e.key&&(e.preventDefault(),d(),null==(n=null==(t=p.reference)?void 0:t.current)||n.focus())};if(o)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o]),(0,h.useEffect)(()=>{var e,t,n;o&&null!=(e=p.floating)&&e.current&&(null==(n=null==(t=p.floating)?void 0:t.current)||n.focus())},[o]);const m=i??"Input Toolbar";return(0,ve.jsx)("div",{ref:s,className:t,children:(0,ve.jsxs)("div",{className:"AgentUIInputToolbar-module_container",children:[(0,ve.jsxs)("button",{ref:p.setReference,type:"button",onClick:u,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),u())},className:"AgentUIInputToolbar-module_button","aria-expanded":o,"aria-haspopup":"true","aria-controls":o?l:void 0,"aria-label":m,disabled:a,children:[n,(0,ve.jsx)("span",{children:m}),(0,ve.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"AgentUIInputToolbar-module_icon "+(o?"AgentUIInputToolbar-module_iconOpen":""),children:(0,ve.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0045 10.5549L12 16.0136L5.9955 10.5549L7.00451 9.44504L12 13.9864L16.9955 9.44504L18.0045 10.5549Z",fill:"currentColor"})})]}),o&&(0,ve.jsx)("div",{ref:p.setFloating,id:l,className:"AgentUIInputToolbar-module_dropdown",role:"dialog","aria-label":m,tabIndex:-1,style:f,children:e})]})})},Footer:Ly,ConversationView:Ny},Fy=Object.assign(e=>(0,ve.jsx)(uy,{...e,className:sm("agenttic",e.className),children:(0,ve.jsx)(Ny,{showHeader:"floating"===e.variant})}),_y),Vy="ImageUploader-module_previewItem",By=(0,h.memo)(({image:e,allowDragToInsert:t,showFileMetadata:n,onDragStart:i,onDragEnd:a,onRemove:o})=>{const r=e.mime_type?e.mime_type.split("/")[1].toUpperCase():"",s=e.title||e.name||e.url.split("/").pop()||"image";return(0,ve.jsxs)("div",{className:Vy,draggable:t,onDragStart:t=>i(e,t),onDragEnd:t=>a(e,t),children:[(0,ve.jsx)("button",{className:"ImageUploader-module_removeButton",onClick:t=>o(t,e),"aria-label":(0,cc.__)("Remove image","a8c-agenttic"),type:"button",children:(0,ve.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ve.jsx)("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M7.4632e-09 8C3.34139e-09 3.58172 3.58172 -3.34139e-09 8 -7.4632e-09C12.4183 -1.1585e-08 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 1.1585e-08 12.4183 7.4632e-09 8ZM6.16569 5.03431C5.85327 4.7219 5.34673 4.7219 5.03431 5.03431C4.7219 5.34673 4.7219 5.85327 5.03431 6.16569L6.86863 8L5.03431 9.83432C4.7219 10.1467 4.7219 10.6533 5.03431 10.9657C5.34673 11.2781 5.85327 11.2781 6.16569 10.9657L8 9.13137L9.83432 10.9657C10.1467 11.2781 10.6533 11.2781 10.9657 10.9657C11.2781 10.6533 11.2781 10.1467 10.9657 9.83432L9.13137 8L10.9657 6.16569C11.2781 5.85327 11.2781 5.34673 10.9657 5.03431C10.6533 4.7219 10.1467 4.7219 9.83432 5.03431L8 6.86863L6.16569 5.03431Z"})})}),(0,ve.jsx)("img",{src:e.url,alt:e.alt||s,className:"ImageUploader-module_previewImage",loading:"lazy"}),n&&(0,ve.jsxs)("div",{className:"ImageUploader-module_previewMeta",children:[(0,ve.jsx)("span",{className:"ImageUploader-module_previewFilename",title:s+(e.alt?` - ${e.alt}`:""),children:s}),(0,ve.jsx)("span",{className:"ImageUploader-module_previewType",children:r})]})]},e.id)});(0,h.forwardRef)(function({images:e=[],uploadingImages:t=[],onFilesSelected:n,onBrowse:i,onDrop:a,onPaste:o,onRemoveImage:r,onImageDragStart:s,onImageDragEnd:l,acceptedFileTypes:c=["image/jpeg","image/png"],maxFileSize:u,maxFiles:d,uploadingIndicator:p,className:f="",showFileMetadata:m=!0,allowDragToInsert:g=!0,onError:y,visible:v=!0,dropZoneRef:x},b){const{textareaRef:w}=qg(),[k,S]=(0,h.useState)(!1),[C,T]=(0,h.useState)(!1),[P,E]=(0,h.useState)(!1),A=(0,h.useRef)(null),I=(0,h.useRef)(null),M=(0,h.useRef)(0);(0,h.useImperativeHandle)(b,()=>({openFileDialog:()=>{var e;null==(e=A.current)||e.click()}})),(0,h.useEffect)(()=>{const e=x?x.current:window;if(!e)return;const t=e=>{var t,n;null!=(n=null==(t=e.dataTransfer)?void 0:t.types)&&n.includes("Files")&&(M.current+=1,T(!0))},n=e=>{M.current-=1,(0===M.current||null===e.relatedTarget)&&(M.current=0,T(!1))},i=()=>{M.current=0,T(!1)};return e.addEventListener("dragenter",t),e.addEventListener("dragleave",n),e.addEventListener("drop",i),()=>{e.removeEventListener("dragenter",t),e.removeEventListener("dragleave",n),e.removeEventListener("drop",i)}},[x]),(0,h.useEffect)(()=>()=>{I.current&&clearTimeout(I.current)},[]);const j=(0,h.useCallback)(e=>{const t=Math.min(e,10485760),n=Math.floor(t/1048576);return n>=1?`${n} MB`:`${Math.floor(t/1024)} KB`},[]),D=(0,h.useCallback)(e=>{if(!e||0===e.length)return;const t=Array.from(e),i=t.filter(e=>c.includes(e.type));if(i.lengthe.split("/")[1].toUpperCase()).join(" or ");null==y||y((0,cc.sprintf)( /* translators: %s: allowed file types (e.g., "JPEG or PNG") */ /* translators: %s: allowed file types (e.g., "JPEG or PNG") */ (0,cc.__)("Only %s image files are allowed.","a8c-agenttic"),e)),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{E(!1)},3e3)}if(d&&i.length>d){null==y||y((0,cc.sprintf)( /* translators: %d: maximum number of files allowed */ /* translators: %d: maximum number of files allowed */ -(0,cc.__)("Maximum %d files allowed.","a8c-agenttic"),d));const e=i.slice(0,d);return void(e.length>0&&n(e))}i.length>0&&n(i)},[n,c,d,y]),L=(0,h.useRef)(D);(0,h.useEffect)(()=>{L.current=D},[D]),(0,h.useEffect)(()=>{const e=null==x?void 0:x.current;if(!e)return;const t=e=>{e.preventDefault()},n=e=>{var t;e.preventDefault(),M.current=0,T(!1),S(!1),null!=(t=e.dataTransfer)&&t.files&&(L.current(e.dataTransfer.files),null==a||a(Array.from(e.dataTransfer.files)))};return e.addEventListener("dragover",t),e.addEventListener("drop",n),()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",n)}},[x,a]),(0,h.useEffect)(()=>{const e=e=>{var t;const n=w.current&&document.activeElement===w.current,i=w.current&&e.target&&(e.target===w.current||w.current.contains(e.target));if(!n&&!i)return;const a=null==(t=e.clipboardData)?void 0:t.items;if(!a)return;const r=[];for(let e=0;e0&&(e.preventDefault(),L.current(r),null==o||o(r))};return window.addEventListener("paste",e),()=>{window.removeEventListener("paste",e)}},[o]);const R=()=>{var e;null==(e=A.current)||e.click()},O=(0,h.useCallback)((e,t)=>{null==s||s(e,t)},[s]),N=(0,h.useCallback)((e,t)=>{null==l||l(e,t)},[l]),_=(0,h.useCallback)((e,t)=>{e.stopPropagation(),r(t)},[r]);if(!v)return null;const V=e.length>0,F=t.length>0,B=C,z=!C&&(V||F),U=V||F||C||P,H=u?(0,cc.sprintf)( +(0,cc.__)("Maximum %d files allowed.","a8c-agenttic"),d));const e=i.slice(0,d);return void(e.length>0&&n(e))}i.length>0&&n(i)},[n,c,d,y]),L=(0,h.useRef)(D);(0,h.useEffect)(()=>{L.current=D},[D]),(0,h.useEffect)(()=>{const e=null==x?void 0:x.current;if(!e)return;const t=e=>{e.preventDefault()},n=e=>{var t;e.preventDefault(),M.current=0,T(!1),S(!1),null!=(t=e.dataTransfer)&&t.files&&(L.current(e.dataTransfer.files),null==a||a(Array.from(e.dataTransfer.files)))};return e.addEventListener("dragover",t),e.addEventListener("drop",n),()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",n)}},[x,a]),(0,h.useEffect)(()=>{const e=e=>{var t;const n=w.current&&document.activeElement===w.current,i=w.current&&e.target&&(e.target===w.current||w.current.contains(e.target));if(!n&&!i)return;const a=null==(t=e.clipboardData)?void 0:t.items;if(!a)return;const r=[];for(let e=0;e0&&(e.preventDefault(),L.current(r),null==o||o(r))};return window.addEventListener("paste",e),()=>{window.removeEventListener("paste",e)}},[o]);const R=()=>{var e;null==(e=A.current)||e.click()},O=(0,h.useCallback)((e,t)=>{null==s||s(e,t)},[s]),N=(0,h.useCallback)((e,t)=>{null==l||l(e,t)},[l]),_=(0,h.useCallback)((e,t)=>{e.stopPropagation(),r(t)},[r]);if(!v)return null;const F=e.length>0,V=t.length>0,B=C,z=!C&&(F||V),U=F||V||C||P,H=u?(0,cc.sprintf)( /* translators: %s: maximum file size (e.g., "5 MB") */ /* translators: %s: maximum file size (e.g., "5 MB") */ (0,cc.__)("Upload image files up to %s each.","a8c-agenttic"),j(u)):"",$=(0,cc.sprintf)( /* translators: %s: allowed file types (e.g., "JPEG or PNG") */ /* translators: %s: allowed file types (e.g., "JPEG or PNG") */ -(0,cc.__)("Only %s image files are allowed.","a8c-agenttic"),c.map(e=>e.split("/")[1].toUpperCase()).join(" or "));return(0,ve.jsx)("div",{className:`ImageUploader-module_container ${U?"ImageUploader-module_active":""} ${f}`,"data-slot":"image-uploader",children:(0,ve.jsx)("div",{className:`ImageUploader-module_uploader ${F?"ImageUploader-module_uploading":""} ${k?"ImageUploader-module_draggingOver":""}`,children:(0,ve.jsxs)("div",{className:"ImageUploader-module_content",children:[!P&&(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)("input",{ref:A,type:"file",accept:c.join(","),multiple:!d||d>1,onChange:e=>{if(e.target.files){const t=Array.from(e.target.files);D(e.target.files),null==i||i(t)}e.target.value=""},className:"ImageUploader-module_hiddenInput"}),(0,ve.jsxs)("div",{className:"ImageUploader-module_clickArea",onClick:R,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),S(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),S(!1)},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),S(!1),M.current=0,T(!1),e.dataTransfer.files){const t=Array.from(e.dataTransfer.files);D(e.dataTransfer.files),null==a||a(t)}},role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&R()},"aria-label":(0,cc.__)("Click to upload images or drag and drop","a8c-agenttic"),children:[B&&(0,ve.jsx)("div",{className:"ImageUploader-module_draggingMessage",children:(0,ve.jsxs)("p",{children:[(0,ve.jsx)("strong",{children:(0,cc.__)("Drop files here to use","a8c-agenttic")}),(0,ve.jsx)("br",{}),u&&H]})}),z&&(0,ve.jsxs)("div",{className:"ImageUploader-module_preview",children:[V&&e.map(e=>(0,ve.jsx)(By,{image:e,allowDragToInsert:g,showFileMetadata:m,onDragStart:O,onDragEnd:N,onRemove:_},e.id)),F&&t.map(({id:e})=>(0,ve.jsx)("div",{className:Fy,children:p||(0,ve.jsx)("div",{className:"ImageUploader-module_uploadingIndicator",children:(0,ve.jsx)("div",{className:"ImageUploader-module_spinner"})})},e))]})]})]}),P&&(0,ve.jsx)("div",{className:"ImageUploader-module_invalidMessage",children:(0,ve.jsx)("p",{children:$})})]})})})}),h.Component;const zy=window.wp.primitives;var Uy=(0,ve.jsx)(zy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ve.jsx)(zy.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});const Hy={info:"openclawp-card--info",success:"openclawp-card--success",warning:"openclawp-card--warning"};function $y(e){let t=e;return t=t.replace(/`([^`]+)`/g,"$1"),t=t.replace(/\*\*([^*]+)\*\*/g,"$1"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'$1'),t}function Wy({card:e,onDismiss:t,onAction:n}){if(!e)return null;const i=Hy[e.kind]||Hy.info;return(0,ve.jsxs)("div",{className:"openclawp-card "+i,role:"status",children:[(0,ve.jsx)(d.Button,{className:"openclawp-card__dismiss",icon:Uy,label:"Dismiss",onClick:t,size:"small"}),e.title&&(0,ve.jsx)("h4",{className:"openclawp-card__title",children:e.title}),e.body&&(0,ve.jsx)("div",{className:"openclawp-card__body",dangerouslySetInnerHTML:{__html:(a=e.body,String(a||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").split(/\n{2,}/).map(e=>{const t=e.split("\n"),n=t.length>0&&t.every(e=>/^- /.test(e));if(n){const e=t.map(e=>"
  • "+$y(e.replace(/^- /,""))+"
  • ").join("");return"
      "+e+"
    "}return"

    "+$y(t.join("
    "))+"

    "}).join(""))}}),Array.isArray(e.actions)&&e.actions.length>0&&(0,ve.jsx)("div",{className:"openclawp-card__actions",children:e.actions.map((e,t)=>(0,ve.jsx)(d.Button,{variant:e.variant||"secondary",size:"small",onClick:()=>n&&n(e),href:e.href,target:e.href?"_blank":void 0,rel:e.href?"noreferrer noopener":void 0,children:e.label},t))})]});var a}const qy=[{name:"/help",description:"Show available commands.",offline:!0,handler:async(e,t)=>({type:"card",kind:"info",title:"Available commands",body:(t.commands||[]).map(e=>`- **${e.name}** — ${e.description}`).join("\n")})},{name:"/clear",description:"Clear the active conversation.",offline:!0,handler:async(e,t)=>("function"==typeof t.clearLocalSession&&t.clearLocalSession(),{type:"card",kind:"success",title:"Conversation cleared.",body:"Starting a fresh session on your next message."})},{name:"/reset",description:"Clear the conversation and restore the Discover panel.",offline:!0,handler:async(e,t)=>{"function"==typeof t.clearLocalSession&&t.clearLocalSession();try{window.localStorage.removeItem("openclawp:discover-dismissed")}catch(e){}return{type:"card",kind:"success",title:"Reset done.",body:"Conversation cleared. The Discover panel will reappear on the next session."}}},{name:"/status",description:"Show site, plugin, and agent context.",offline:!0,handler:async(e,t)=>{const n="undefined"!=typeof window&&window.openclaWPConfig||{};return{type:"card",kind:"info",title:"openclaWP status",body:[`- **Site:** ${n.siteUrl||("undefined"!=typeof window&&window.location?window.location.origin:"unknown")}`,`- **Plugin version:** ${n.version||"unknown"}`,`- **Registered agents:** ${Array.isArray(t.agents)?t.agents.length:0}`,`- **Current agent:** \`${t.agentId||"none"}\``].join("\n")}}},{name:"/tools",description:"List tools available to the current agent.",offline:!0,handler:async(e,t)=>({type:"card",kind:"info",title:"Tool inspection coming soon",body:`Per-agent tool inspection isn't wired up yet for ${t.agentId?`\`${t.agentId}\``:"the current agent"}. In the meantime, see **Tool activity** in wp-admin for a log of recent tool calls.`})}];function Ky(e){if(!e)return null;const t=e.startsWith("/")?e.toLowerCase():"/"+e.toLowerCase();return qy.find(e=>e.name.toLowerCase()===t)||null}function Yy(e){if("string"!=typeof e)return null;const t=e.trim();if(!t.startsWith("/"))return null;const n=t.indexOf(" "),i=-1===n?t:t.slice(0,n),a=-1===n?"":t.slice(n+1).trim();return{command:Ky(i),name:i,args:a}}function Gy({pending:e,restNamespace:t,nonce:n,onResolved:i}){const[a,o]=(0,u.useState)(!1),[r,s]=(0,u.useState)(null),l=(0,u.useCallback)(async a=>{o(!0),s(null);try{const o=`/wp-json/${t}/decisions/${e.decision_id}`,r=await fetch(o,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify({action:a})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.message||`HTTP ${r.status}`)}i&&i()}catch(e){s(e.message)}finally{o(!1)}},[e.decision_id,t,n,i]);return(0,ve.jsxs)("div",{className:"openclawp-confirmation-card",role:"alertdialog","aria-live":"polite",children:[(0,ve.jsx)("h3",{className:"openclawp-confirmation-card__title",children:"Permission needed"}),(0,ve.jsxs)("p",{className:"openclawp-confirmation-card__body",children:["The agent wants to run ",(0,ve.jsx)("code",{children:e.ability})," (",(0,ve.jsx)("code",{children:e.effect})," effect)."]}),e.parameters&&Object.keys(e.parameters).length>0&&(0,ve.jsxs)("details",{className:"openclawp-confirmation-card__details",children:[(0,ve.jsx)("summary",{children:"Parameters"}),(0,ve.jsx)("pre",{children:JSON.stringify(e.parameters,null,2)})]}),r&&(0,ve.jsx)(d.Notice,{status:"error",isDismissible:!1,children:r}),(0,ve.jsxs)("div",{className:"openclawp-confirmation-card__actions",children:[(0,ve.jsx)(d.Button,{variant:"primary",isBusy:a,disabled:a,onClick:()=>l("allow"),children:"Allow once"}),(0,ve.jsx)(d.Button,{variant:"secondary",disabled:a,onClick:()=>l("always"),children:"Always allow this tool"}),(0,ve.jsx)(d.Button,{variant:"tertiary",isDestructive:!0,disabled:a,onClick:()=>l("deny"),children:"Deny"})]})]})}function Xy({agents:e,defaultAgent:t,bridgeUrl:n,nonce:i,restNamespace:a}){const[o,r]=(0,u.useState)(t||e[0]?.slug||""),s=(0,u.useCallback)(async()=>({"X-WP-Nonce":i}),[i]),l=(0,u.useMemo)(()=>"openclawp:active-session:"+o,[o]),[c,p]=(0,u.useState)(0),{messages:m,isProcessing:g,error:y,onSubmit:v,abortCurrentRequest:x,suggestions:b,clearSuggestions:w}=function(e){const t={agentId:e.agentId,agentUrl:e.agentUrl,sessionId:e.sessionId,sessionIdStorageKey:e.sessionIdStorageKey},n=(e=>["agentId","agentUrl"].every(t=>{const n=e[t];return"string"==typeof n&&n.trim().length>0}))(t),[i,a]=(0,h.useState)({clientMessages:[],uiMessages:[],isProcessing:!1,error:n?null:"Invalid agent configuration",suggestions:[],progressMessage:null,progressPhase:null}),{registerMessageActions:o,unregisterMessageActions:r,clearAllMessageActions:s,registrations:l}=function(){const[e,t]=(0,h.useState)([]),n=(0,h.useCallback)(e=>{t(t=>{const n=t.findIndex(t=>t.id===e.id);if(n>=0){const i=[...t];return i[n]=e,i}return[...t,e]})},[]),i=(0,h.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return{registerMessageActions:n,unregisterMessageActions:i,clearAllMessageActions:(0,h.useCallback)(()=>{t([])},[]),registrations:e}}(),c=(0,h.useRef)(!1),u=(0,h.useRef)(l);(0,h.useEffect)(()=>{u.current=l},[l]);const d=(0,h.useCallback)(e=>e.map(e=>ye(e,u.current)).filter(e=>null!==e),[]);(0,h.useEffect)(()=>{n&&(async()=>{const n=fe(),i=t.agentId;if(n.hasAgent(i))t.sessionId?(n.updateSessionId(i,t.sessionId),0===n.getConversationHistory(i).length&&a(e=>({...e,clientMessages:[],uiMessages:[]}))):(n.updateSessionId(i,""),await n.replaceMessages(i,[]),a(e=>({...e,clientMessages:[],uiMessages:[]})));else if(await n.createAgent(i,{agentId:t.agentId,agentUrl:t.agentUrl,sessionId:t.sessionId,sessionIdStorageKey:t.sessionIdStorageKey,contextProvider:e.contextProvider||{getClientContext:()=>({})},toolProvider:e.toolProvider||{getAvailableTools:async()=>[],executeTool:async()=>({success:!0,result:"No tools available"})},authProvider:e.authProvider,enableStreaming:e.enableStreaming,odieBotId:e.odieBotId,credentials:e.credentials}),t.sessionId){const e=n.getConversationHistory(i);a(t=>{const n=d(e);return{...t,clientMessages:e,uiMessages:n}})}else a(e=>({...e,clientMessages:[],uiMessages:[]}))})()},[t.sessionId,t.agentId,t.agentUrl,t.sessionIdStorageKey,e.contextProvider,e.toolProvider,e.authProvider,e.enableStreaming,e.odieBotId,e.credentials,n]);const p=(0,h.useCallback)(async(e,i)=>{var o,r;if(!n)throw new Error("Invalid agent configuration");if(c.current)return;c.current=!0;const s="tool_result"===(null==i?void 0:i.type);if(s&&(null==i||!i.toolCallId||null==i||!i.toolId))throw new Error("`toolCallId` and `toolId` are required when type is `tool_result`");const l=fe(),d=t.agentId,h=Date.now();if(s)a(e=>({...e,isProcessing:!0,error:null}));else{const t={id:`user-${h}`,role:"user",content:[{type:(null==i?void 0:i.type)||"text",text:e},...(null==(o=null==i?void 0:i.imageUrls)?void 0:o.map(e=>{const t="string"==typeof e?e:e.url;return ge(t)}))??[]],timestamp:h,archived:(null==i?void 0:i.archived)??!1,showIcon:!1};a(e=>({...e,uiMessages:[...e.uiMessages,t],isProcessing:!0,error:null}))}try{let t=null,n=!1;const o={},c=!(null==i||!i.type||s);(null!=i&&i.archived||c)&&(o.metadata={...(null==i?void 0:i.archived)&&{archived:!0},...c&&{contentType:i.type}}),null!=i&&i.sessionId&&(o.sessionId=i.sessionId),null!=i&&i.imageUrls&&(o.imageUrls=i.imageUrls);const h=s?l.sendToolResult(d,i.toolCallId,i.toolId,{success:!0,message:e},o):l.sendMessageStream(d,e,o);for await(const e of h){if((e.progressMessage||e.progressPhase)&&a(t=>({...t,progressMessage:e.progressMessage||null,progressPhase:e.progressPhase||null})),!e.final&&e.text)if(t)a(n=>({...n,uiMessages:n.uiMessages.map(n=>n.id===t?{...n,content:[{type:"text",text:e.text}]}:n)}));else{t=`agent-streaming-${Date.now()}`;const n={id:t,role:"agent",content:[{type:"text",text:e.text}],timestamp:Date.now(),archived:!1,showIcon:!0,icon:"assistant",reactKey:t};a(e=>({...e,uiMessages:[...e.uiMessages,n]}))}if(e.final&&null!=(r=e.status)&&r.message&&t){n=!0;const i=t,o=ye(e.status.message,u.current);o&&a(e=>{const t=e.uiMessages.map(e=>{var t,n;if(e.id===i){const a=o.content.length>0&&(null==(t=o.content[0])?void 0:t.text)&&(null==(n=e.content[0])?void 0:n.text)&&o.content[0].text.length>e.content[0].text.length;return{...o,reactKey:e.reactKey||i,content:a?o.content:e.content}}return e}),n=l.getConversationHistory(d);return{...e,clientMessages:n,uiMessages:t,isProcessing:!1,progressMessage:null,progressPhase:null}}),t=null}}if(!n){const e=l.getConversationHistory(d);a(n=>{let i=n.uiMessages;t&&(i=n.uiMessages.filter(e=>e.id!==t));const a=e.map(e=>ye(e,u.current)).filter(e=>null!==e),o=new Set(e.map(e=>e.messageId)),r=i.filter(e=>!o.has(e.id)&&"user"!==e.role),s=me([...a,...r]);return{...n,clientMessages:e,uiMessages:s,isProcessing:!1,progressMessage:null,progressPhase:null}})}}catch(e){if(e instanceof Error&&"AbortError"===e.name)return f("Request was aborted by user"),void a(e=>({...e,isProcessing:!1,progressMessage:null,progressPhase:null,error:null}));const t=e instanceof Error?e.message:"Failed to send message";throw a(e=>({...e,isProcessing:!1,progressMessage:null,progressPhase:null,error:t})),e}finally{c.current=!1}},[t.agentId,n]),m=(0,h.useCallback)(e=>{a(t=>({...t,uiMessages:me([...t.uiMessages,e])}))},[]),g=(0,h.useCallback)(e=>{a(t=>({...t,suggestions:e}))},[]),y=(0,h.useCallback)(()=>{a(e=>({...e,suggestions:[]}))},[]);(0,h.useEffect)(()=>{a(e=>{if(0===e.clientMessages.length)return e;const t=d(e.clientMessages),n=new Set(e.clientMessages.map(e=>e.messageId)),i=e.uiMessages.filter(e=>!n.has(e.id)&&"user"!==e.role);return{...e,uiMessages:me([...t,...i])}})},[l]);const v=(0,h.useCallback)(()=>{if(!n)return;const e=fe(),i=t.agentId;e.abortCurrentRequest(i)},[t.agentId,n]),x=(0,h.useCallback)(async e=>{if(!n)return;const i=fe(),o=t.agentId;await i.replaceMessages(o,e);const r=d(e);a(t=>({...t,clientMessages:e,uiMessages:r}))},[t.agentId,n]);return{messages:i.uiMessages,isProcessing:i.isProcessing,error:i.error,onSubmit:p,suggestions:i.suggestions,progressMessage:i.progressMessage,progressPhase:i.progressPhase,registerSuggestions:g,clearSuggestions:y,registerMessageActions:o,unregisterMessageActions:r,clearAllMessageActions:s,addMessage:m,abortCurrentRequest:v,loadMessages:x}}({agentId:o,agentUrl:n,sessionId:"",sessionIdStorageKey:l+":"+c,authProvider:i?s:void 0,credentials:"same-origin"}),[k,S]=function(e){const[t,n]=(0,u.useState)(0),i=(0,u.useCallback)(()=>n(e=>e+1),[]);return[(0,u.useMemo)(()=>{try{return window.localStorage.getItem(e)||""}catch(e){return""}},[e,t]),i]}(l),[C,T]=(0,u.useState)(null),[P,E]=(0,u.useState)([]),A=(0,u.useCallback)(e=>{if(!e)return;const t={...e,__key:Date.now()+":"+Math.random()};E(e=>[t,...e])},[]),I=(0,u.useCallback)(e=>{E(t=>t.filter(t=>t.__key!==e))},[]),M=(0,u.useCallback)(()=>{try{window.localStorage.removeItem(l),window.localStorage.removeItem(l+":"+c)}catch(e){}p(e=>e+1),S()},[l,c,S]),j=(0,u.useCallback)(async t=>{const n=Yy(t);if(!n)return;const r={agents:e,agentId:o,restNamespace:a,nonce:i,commands:qy,clearLocalSession:M};if(n.command){try{const e=await n.command.handler(n.args,r);A(e)}catch(e){A({type:"card",kind:"warning",title:"Command failed",body:e&&e.message?e.message:"Unknown error."})}return}const s=qy.map(e=>`- **${e.name}** — ${e.description}`);A({type:"card",kind:"warning",title:`Unknown command: ${n.name}`,body:"Try one of the bundled commands:\n\n"+s.join("\n")})},[e,o,a,i,M,A]),D=(0,u.useCallback)(async(e,t)=>{if(!Yy(e))return v(e,t);await j(e)},[v,j]),L=(0,u.useCallback)(e=>{e&&e.command&&j(e.command)},[j]);(0,u.useEffect)(()=>{if(g)return;if(S(),!k)return void T(null);let e=!1;return(async()=>{try{const t=await fetch(`/wp-json/${a}/decisions/pending/${k}`,{credentials:"same-origin",headers:{"X-WP-Nonce":i}});if(!t.ok)return;const n=await t.json();e||T(n.pending||null)}catch(e){}})(),()=>{e=!0}},[g,k,a,i,S,m.length]);const R=(0,u.useCallback)(()=>{T(null),S(),setTimeout(()=>S(),250)},[S]);return(0,ve.jsxs)("section",{className:"agenttic",children:[e.length>1&&(0,ve.jsx)(d.SelectControl,{label:"Agent",value:o,options:e.map(e=>({label:e.label,value:e.slug})),onChange:r,__next40pxDefaultSize:!0}),C&&(0,ve.jsx)(Gy,{pending:C,restNamespace:a,nonce:i,onResolved:R}),P.length>0&&(0,ve.jsx)("div",{className:"openclawp-card-stack",children:P.map(e=>(0,ve.jsx)(Wy,{card:e,onDismiss:()=>I(e.__key),onAction:L},e.__key))}),(0,ve.jsx)(Vy,{variant:"embedded",messages:m,isProcessing:g,error:y,onSubmit:D,onStop:x,suggestions:b,clearSuggestions:w,placeholder:"Type a message or /help…"})]})}function Jy(){const e=document.getElementById("openclawp-chat-root");if(!e)return;let t=[];try{t=JSON.parse(e.dataset.agents||"[]")}catch(e){t=[]}const n=e.dataset.defaultAgent||"",i=window.openclaWPConfig||{},a=i.bridgeUrl||"/wp-json/openclawp/v1/agenttic",o=i.nonce||"",r=i.restNamespace||"openclawp/v1";0!==t.length&&(0,c.createRoot)(e).render((0,ve.jsx)(Xy,{agents:t,defaultAgent:n,bridgeUrl:a,nonce:o,restNamespace:r}))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Jy):Jy()})(); \ No newline at end of file +(0,cc.__)("Only %s image files are allowed.","a8c-agenttic"),c.map(e=>e.split("/")[1].toUpperCase()).join(" or "));return(0,ve.jsx)("div",{className:`ImageUploader-module_container ${U?"ImageUploader-module_active":""} ${f}`,"data-slot":"image-uploader",children:(0,ve.jsx)("div",{className:`ImageUploader-module_uploader ${V?"ImageUploader-module_uploading":""} ${k?"ImageUploader-module_draggingOver":""}`,children:(0,ve.jsxs)("div",{className:"ImageUploader-module_content",children:[!P&&(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)("input",{ref:A,type:"file",accept:c.join(","),multiple:!d||d>1,onChange:e=>{if(e.target.files){const t=Array.from(e.target.files);D(e.target.files),null==i||i(t)}e.target.value=""},className:"ImageUploader-module_hiddenInput"}),(0,ve.jsxs)("div",{className:"ImageUploader-module_clickArea",onClick:R,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),S(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),S(!1)},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),S(!1),M.current=0,T(!1),e.dataTransfer.files){const t=Array.from(e.dataTransfer.files);D(e.dataTransfer.files),null==a||a(t)}},role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&R()},"aria-label":(0,cc.__)("Click to upload images or drag and drop","a8c-agenttic"),children:[B&&(0,ve.jsx)("div",{className:"ImageUploader-module_draggingMessage",children:(0,ve.jsxs)("p",{children:[(0,ve.jsx)("strong",{children:(0,cc.__)("Drop files here to use","a8c-agenttic")}),(0,ve.jsx)("br",{}),u&&H]})}),z&&(0,ve.jsxs)("div",{className:"ImageUploader-module_preview",children:[F&&e.map(e=>(0,ve.jsx)(By,{image:e,allowDragToInsert:g,showFileMetadata:m,onDragStart:O,onDragEnd:N,onRemove:_},e.id)),V&&t.map(({id:e})=>(0,ve.jsx)("div",{className:Vy,children:p||(0,ve.jsx)("div",{className:"ImageUploader-module_uploadingIndicator",children:(0,ve.jsx)("div",{className:"ImageUploader-module_spinner"})})},e))]})]})]}),P&&(0,ve.jsx)("div",{className:"ImageUploader-module_invalidMessage",children:(0,ve.jsx)("p",{children:$})})]})})})}),h.Component;const zy=window.wp.primitives;var Uy=(0,ve.jsx)(zy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ve.jsx)(zy.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});const Hy={info:"openclawp-card--info",success:"openclawp-card--success",warning:"openclawp-card--warning"};function $y(e){let t=e;return t=t.replace(/`([^`]+)`/g,"$1"),t=t.replace(/\*\*([^*]+)\*\*/g,"$1"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'$1'),t}function Wy({card:e,onDismiss:t,onAction:n}){if(!e)return null;const i=Hy[e.kind]||Hy.info;return(0,ve.jsxs)("div",{className:"openclawp-card "+i,role:"status",children:[(0,ve.jsx)(d.Button,{className:"openclawp-card__dismiss",icon:Uy,label:"Dismiss",onClick:t,size:"small"}),e.title&&(0,ve.jsx)("h4",{className:"openclawp-card__title",children:e.title}),e.body&&(0,ve.jsx)("div",{className:"openclawp-card__body",dangerouslySetInnerHTML:{__html:(a=e.body,String(a||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").split(/\n{2,}/).map(e=>{const t=e.split("\n"),n=t.length>0&&t.every(e=>/^- /.test(e));if(n){const e=t.map(e=>"
  • "+$y(e.replace(/^- /,""))+"
  • ").join("");return"
      "+e+"
    "}return"

    "+$y(t.join("
    "))+"

    "}).join(""))}}),Array.isArray(e.actions)&&e.actions.length>0&&(0,ve.jsx)("div",{className:"openclawp-card__actions",children:e.actions.map((e,t)=>(0,ve.jsx)(d.Button,{variant:e.variant||"secondary",size:"small",onClick:()=>n&&n(e),href:e.href,target:e.href?"_blank":void 0,rel:e.href?"noreferrer noopener":void 0,children:e.label},t))})]});var a}const qy=[{name:"/help",description:"Show available commands.",offline:!0,handler:async(e,t)=>({type:"card",kind:"info",title:"Available commands",body:(t.commands||[]).map(e=>`- **${e.name}** — ${e.description}`).join("\n")})},{name:"/clear",description:"Clear the active conversation.",offline:!0,handler:async(e,t)=>("function"==typeof t.clearLocalSession&&t.clearLocalSession(),{type:"card",kind:"success",title:"Conversation cleared.",body:"Starting a fresh session on your next message."})},{name:"/reset",description:"Clear the conversation and restore the Discover panel.",offline:!0,handler:async(e,t)=>{"function"==typeof t.clearLocalSession&&t.clearLocalSession();try{window.localStorage.removeItem("openclawp:discover-dismissed")}catch(e){}return{type:"card",kind:"success",title:"Reset done.",body:"Conversation cleared. The Discover panel will reappear on the next session."}}},{name:"/status",description:"Show site, plugin, and agent context.",offline:!0,handler:async(e,t)=>{const n="undefined"!=typeof window&&window.openclaWPConfig||{};return{type:"card",kind:"info",title:"openclaWP status",body:[`- **Site:** ${n.siteUrl||("undefined"!=typeof window&&window.location?window.location.origin:"unknown")}`,`- **Plugin version:** ${n.version||"unknown"}`,`- **Registered agents:** ${Array.isArray(t.agents)?t.agents.length:0}`,`- **Current agent:** \`${t.agentId||"none"}\``].join("\n")}}},{name:"/tools",description:"List tools available to the current agent.",offline:!0,handler:async(e,t)=>({type:"card",kind:"info",title:"Tool inspection coming soon",body:`Per-agent tool inspection isn't wired up yet for ${t.agentId?`\`${t.agentId}\``:"the current agent"}. In the meantime, see **Tool activity** in wp-admin for a log of recent tool calls.`})}];function Ky(e){if(!e)return null;const t=e.startsWith("/")?e.toLowerCase():"/"+e.toLowerCase();return qy.find(e=>e.name.toLowerCase()===t)||null}function Yy(e){if("string"!=typeof e)return null;const t=e.trim();if(!t.startsWith("/"))return null;const n=t.indexOf(" "),i=-1===n?t:t.slice(0,n),a=-1===n?"":t.slice(n+1).trim();return{command:Ky(i),name:i,args:a}}const Gy="welcome",Xy="provider",Jy="agent",Zy=Gy,Qy=[{id:Gy,title:"Welcome to openclaWP",buildBody:()=>"openclaWP turns your WordPress site into a place where an agent lives, reads your content, talks back, and can be reached from outside WordPress through pluggable connectors. This 3-step wizard gets you to a working chat in under a minute.",buildActions:(e,t)=>[{label:"Get started",variant:"primary",onClick:()=>t.advance(Xy)},{label:"Skip setup",variant:"tertiary",onClick:()=>t.finish()}]},{id:Xy,title:"Pick an AI provider",buildBody:e=>{const t=Array.isArray(e.providers)?e.providers:[],n=t.some(e=>e.installed),i=function(e){return e&&0!==e.length?e.map(e=>e.installed?`- **${e.label}** — installed`:`- ${e.label}`).join("\n"):"_No AI providers detected yet._"}(t);return"openclaWP works with any AI provider that registers with the WordPress AI client. Pick one to continue — if you don't have one installed yet, the easiest path is Ollama (runs locally, no API key).\n\n"+i+(n?"":"\n\n_No AI provider plugin detected yet. Install one and click **Recheck**._")},buildActions:(e,t)=>{const n=[];return(Array.isArray(e.providers)?e.providers:[]).some(e=>e.installed)?n.push({label:"Continue",variant:"primary",onClick:()=>t.advance(Jy)}):n.push({label:"Recheck",variant:"primary",onClick:()=>t.refresh()}),n.push({label:"Skip setup",variant:"tertiary",onClick:()=>t.finish()}),n},kindFor:e=>(Array.isArray(e.providers)?e.providers:[]).some(e=>e.installed)?"info":"warning"},{id:Jy,title:"Enable the example agent",buildBody:()=>"Turn on the bundled example agent so there's something to chat with right away. You can register your own agents later via PHP, or via the Agent Files surface.",buildActions:(e,t)=>[{label:"Enable example agent & finish",variant:"primary",onClick:async()=>{await t.setExampleAgent(!0),await t.finish()}},{label:"Finish without example agent",variant:"secondary",onClick:async()=>{await t.setExampleAgent(!1),await t.finish()}}]}];async function ev(e,t,n,i){const a=`/wp-json/${e}/setup/${t}`,o=await fetch(a,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify(i||{})});if(!o.ok){const e=await o.json().catch(()=>({}));throw new Error(e.message||`HTTP ${o.status}`)}return o.json()}async function tv(e,t){const n=`/wp-json/${e}/setup/state`,i=await fetch(n,{credentials:"same-origin",headers:{"X-WP-Nonce":t}});if(!i.ok)throw new Error(`HTTP ${i.status}`);return i.json()}function nv({pending:e,restNamespace:t,nonce:n,onResolved:i}){const[a,o]=(0,u.useState)(!1),[r,s]=(0,u.useState)(null),l=(0,u.useCallback)(async a=>{o(!0),s(null);try{const o=`/wp-json/${t}/decisions/${e.decision_id}`,r=await fetch(o,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify({action:a})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.message||`HTTP ${r.status}`)}i&&i()}catch(e){s(e.message)}finally{o(!1)}},[e.decision_id,t,n,i]);return(0,ve.jsxs)("div",{className:"openclawp-confirmation-card",role:"alertdialog","aria-live":"polite",children:[(0,ve.jsx)("h3",{className:"openclawp-confirmation-card__title",children:"Permission needed"}),(0,ve.jsxs)("p",{className:"openclawp-confirmation-card__body",children:["The agent wants to run ",(0,ve.jsx)("code",{children:e.ability})," (",(0,ve.jsx)("code",{children:e.effect})," effect)."]}),e.parameters&&Object.keys(e.parameters).length>0&&(0,ve.jsxs)("details",{className:"openclawp-confirmation-card__details",children:[(0,ve.jsx)("summary",{children:"Parameters"}),(0,ve.jsx)("pre",{children:JSON.stringify(e.parameters,null,2)})]}),r&&(0,ve.jsx)(d.Notice,{status:"error",isDismissible:!1,children:r}),(0,ve.jsxs)("div",{className:"openclawp-confirmation-card__actions",children:[(0,ve.jsx)(d.Button,{variant:"primary",isBusy:a,disabled:a,onClick:()=>l("allow"),children:"Allow once"}),(0,ve.jsx)(d.Button,{variant:"secondary",disabled:a,onClick:()=>l("always"),children:"Always allow this tool"}),(0,ve.jsx)(d.Button,{variant:"tertiary",isDestructive:!0,disabled:a,onClick:()=>l("deny"),children:"Deny"})]})]})}function iv({agents:e,defaultAgent:t,bridgeUrl:n,nonce:i,restNamespace:a}){const[o,r]=(0,u.useState)(t||e[0]?.slug||""),s=(0,u.useCallback)(async()=>({"X-WP-Nonce":i}),[i]),l=(0,u.useMemo)(()=>"openclawp:active-session:"+o,[o]),[c,p]=(0,u.useState)(0),{messages:m,isProcessing:g,error:y,onSubmit:v,abortCurrentRequest:x,suggestions:b,clearSuggestions:w}=function(e){const t={agentId:e.agentId,agentUrl:e.agentUrl,sessionId:e.sessionId,sessionIdStorageKey:e.sessionIdStorageKey},n=(e=>["agentId","agentUrl"].every(t=>{const n=e[t];return"string"==typeof n&&n.trim().length>0}))(t),[i,a]=(0,h.useState)({clientMessages:[],uiMessages:[],isProcessing:!1,error:n?null:"Invalid agent configuration",suggestions:[],progressMessage:null,progressPhase:null}),{registerMessageActions:o,unregisterMessageActions:r,clearAllMessageActions:s,registrations:l}=function(){const[e,t]=(0,h.useState)([]),n=(0,h.useCallback)(e=>{t(t=>{const n=t.findIndex(t=>t.id===e.id);if(n>=0){const i=[...t];return i[n]=e,i}return[...t,e]})},[]),i=(0,h.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return{registerMessageActions:n,unregisterMessageActions:i,clearAllMessageActions:(0,h.useCallback)(()=>{t([])},[]),registrations:e}}(),c=(0,h.useRef)(!1),u=(0,h.useRef)(l);(0,h.useEffect)(()=>{u.current=l},[l]);const d=(0,h.useCallback)(e=>e.map(e=>ye(e,u.current)).filter(e=>null!==e),[]);(0,h.useEffect)(()=>{n&&(async()=>{const n=fe(),i=t.agentId;if(n.hasAgent(i))t.sessionId?(n.updateSessionId(i,t.sessionId),0===n.getConversationHistory(i).length&&a(e=>({...e,clientMessages:[],uiMessages:[]}))):(n.updateSessionId(i,""),await n.replaceMessages(i,[]),a(e=>({...e,clientMessages:[],uiMessages:[]})));else if(await n.createAgent(i,{agentId:t.agentId,agentUrl:t.agentUrl,sessionId:t.sessionId,sessionIdStorageKey:t.sessionIdStorageKey,contextProvider:e.contextProvider||{getClientContext:()=>({})},toolProvider:e.toolProvider||{getAvailableTools:async()=>[],executeTool:async()=>({success:!0,result:"No tools available"})},authProvider:e.authProvider,enableStreaming:e.enableStreaming,odieBotId:e.odieBotId,credentials:e.credentials}),t.sessionId){const e=n.getConversationHistory(i);a(t=>{const n=d(e);return{...t,clientMessages:e,uiMessages:n}})}else a(e=>({...e,clientMessages:[],uiMessages:[]}))})()},[t.sessionId,t.agentId,t.agentUrl,t.sessionIdStorageKey,e.contextProvider,e.toolProvider,e.authProvider,e.enableStreaming,e.odieBotId,e.credentials,n]);const p=(0,h.useCallback)(async(e,i)=>{var o,r;if(!n)throw new Error("Invalid agent configuration");if(c.current)return;c.current=!0;const s="tool_result"===(null==i?void 0:i.type);if(s&&(null==i||!i.toolCallId||null==i||!i.toolId))throw new Error("`toolCallId` and `toolId` are required when type is `tool_result`");const l=fe(),d=t.agentId,h=Date.now();if(s)a(e=>({...e,isProcessing:!0,error:null}));else{const t={id:`user-${h}`,role:"user",content:[{type:(null==i?void 0:i.type)||"text",text:e},...(null==(o=null==i?void 0:i.imageUrls)?void 0:o.map(e=>{const t="string"==typeof e?e:e.url;return ge(t)}))??[]],timestamp:h,archived:(null==i?void 0:i.archived)??!1,showIcon:!1};a(e=>({...e,uiMessages:[...e.uiMessages,t],isProcessing:!0,error:null}))}try{let t=null,n=!1;const o={},c=!(null==i||!i.type||s);(null!=i&&i.archived||c)&&(o.metadata={...(null==i?void 0:i.archived)&&{archived:!0},...c&&{contentType:i.type}}),null!=i&&i.sessionId&&(o.sessionId=i.sessionId),null!=i&&i.imageUrls&&(o.imageUrls=i.imageUrls);const h=s?l.sendToolResult(d,i.toolCallId,i.toolId,{success:!0,message:e},o):l.sendMessageStream(d,e,o);for await(const e of h){if((e.progressMessage||e.progressPhase)&&a(t=>({...t,progressMessage:e.progressMessage||null,progressPhase:e.progressPhase||null})),!e.final&&e.text)if(t)a(n=>({...n,uiMessages:n.uiMessages.map(n=>n.id===t?{...n,content:[{type:"text",text:e.text}]}:n)}));else{t=`agent-streaming-${Date.now()}`;const n={id:t,role:"agent",content:[{type:"text",text:e.text}],timestamp:Date.now(),archived:!1,showIcon:!0,icon:"assistant",reactKey:t};a(e=>({...e,uiMessages:[...e.uiMessages,n]}))}if(e.final&&null!=(r=e.status)&&r.message&&t){n=!0;const i=t,o=ye(e.status.message,u.current);o&&a(e=>{const t=e.uiMessages.map(e=>{var t,n;if(e.id===i){const a=o.content.length>0&&(null==(t=o.content[0])?void 0:t.text)&&(null==(n=e.content[0])?void 0:n.text)&&o.content[0].text.length>e.content[0].text.length;return{...o,reactKey:e.reactKey||i,content:a?o.content:e.content}}return e}),n=l.getConversationHistory(d);return{...e,clientMessages:n,uiMessages:t,isProcessing:!1,progressMessage:null,progressPhase:null}}),t=null}}if(!n){const e=l.getConversationHistory(d);a(n=>{let i=n.uiMessages;t&&(i=n.uiMessages.filter(e=>e.id!==t));const a=e.map(e=>ye(e,u.current)).filter(e=>null!==e),o=new Set(e.map(e=>e.messageId)),r=i.filter(e=>!o.has(e.id)&&"user"!==e.role),s=me([...a,...r]);return{...n,clientMessages:e,uiMessages:s,isProcessing:!1,progressMessage:null,progressPhase:null}})}}catch(e){if(e instanceof Error&&"AbortError"===e.name)return f("Request was aborted by user"),void a(e=>({...e,isProcessing:!1,progressMessage:null,progressPhase:null,error:null}));const t=e instanceof Error?e.message:"Failed to send message";throw a(e=>({...e,isProcessing:!1,progressMessage:null,progressPhase:null,error:t})),e}finally{c.current=!1}},[t.agentId,n]),m=(0,h.useCallback)(e=>{a(t=>({...t,uiMessages:me([...t.uiMessages,e])}))},[]),g=(0,h.useCallback)(e=>{a(t=>({...t,suggestions:e}))},[]),y=(0,h.useCallback)(()=>{a(e=>({...e,suggestions:[]}))},[]);(0,h.useEffect)(()=>{a(e=>{if(0===e.clientMessages.length)return e;const t=d(e.clientMessages),n=new Set(e.clientMessages.map(e=>e.messageId)),i=e.uiMessages.filter(e=>!n.has(e.id)&&"user"!==e.role);return{...e,uiMessages:me([...t,...i])}})},[l]);const v=(0,h.useCallback)(()=>{if(!n)return;const e=fe(),i=t.agentId;e.abortCurrentRequest(i)},[t.agentId,n]),x=(0,h.useCallback)(async e=>{if(!n)return;const i=fe(),o=t.agentId;await i.replaceMessages(o,e);const r=d(e);a(t=>({...t,clientMessages:e,uiMessages:r}))},[t.agentId,n]);return{messages:i.uiMessages,isProcessing:i.isProcessing,error:i.error,onSubmit:p,suggestions:i.suggestions,progressMessage:i.progressMessage,progressPhase:i.progressPhase,registerSuggestions:g,clearSuggestions:y,registerMessageActions:o,unregisterMessageActions:r,clearAllMessageActions:s,addMessage:m,abortCurrentRequest:v,loadMessages:x}}({agentId:o,agentUrl:n,sessionId:"",sessionIdStorageKey:l+":"+c,authProvider:i?s:void 0,credentials:"same-origin"}),[k,S]=function(e){const[t,n]=(0,u.useState)(0),i=(0,u.useCallback)(()=>n(e=>e+1),[]);return[(0,u.useMemo)(()=>{try{return window.localStorage.getItem(e)||""}catch(e){return""}},[e,t]),i]}(l),[C,T]=(0,u.useState)(null),[P,E]=(0,u.useState)([]),A=(0,u.useCallback)(e=>{if(!e)return;const t={...e,__key:Date.now()+":"+Math.random()};E(e=>[t,...e])},[]),I=(0,u.useCallback)(e=>{E(t=>t.filter(t=>t.__key!==e))},[]),M=(0,u.useCallback)(()=>{try{window.localStorage.removeItem(l),window.localStorage.removeItem(l+":"+c)}catch(e){}p(e=>e+1),S()},[l,c,S]),j=(0,u.useCallback)(async t=>{const n=Yy(t);if(!n)return;const r={agents:e,agentId:o,restNamespace:a,nonce:i,commands:qy,clearLocalSession:M};if(n.command){try{const e=await n.command.handler(n.args,r);A(e)}catch(e){A({type:"card",kind:"warning",title:"Command failed",body:e&&e.message?e.message:"Unknown error."})}return}const s=qy.map(e=>`- **${e.name}** — ${e.description}`);A({type:"card",kind:"warning",title:`Unknown command: ${n.name}`,body:"Try one of the bundled commands:\n\n"+s.join("\n")})},[e,o,a,i,M,A]),D=(0,u.useCallback)(async(e,t)=>{if(!Yy(e))return v(e,t);await j(e)},[v,j]),L=(0,u.useCallback)(e=>{e&&("function"!=typeof e.onClick?e.command&&j(e.command):e.onClick())},[j]),R=function({enabled:e,restNamespace:t,nonce:n,onDone:i}){const[a,o]=(0,u.useState)(Boolean(e)),[r,s]=(0,u.useState)(Zy),[l,c]=(0,u.useState)({completed:!1,providers:[],exampleAgentEnabled:!1}),d=(0,u.useRef)(i);(0,u.useEffect)(()=>{d.current=i},[i]),(0,u.useEffect)(()=>{if(!e)return;let i=!1;return tv(t,n).then(e=>{i||(e&&e.completed?o(!1):c(t=>({...t,...e})))}).catch(()=>{}),()=>{i=!0}},[e,t,n]);const h=(0,u.useCallback)(async()=>{try{const e=await tv(t,n);c(t=>({...t,...e}))}catch(e){}},[t,n]),p=(0,u.useCallback)(async e=>{await h(),s(e)},[h]),f=(0,u.useCallback)(async e=>{try{await ev(t,"enable-example-agent",n,{enabled:Boolean(e)}),c(t=>({...t,exampleAgentEnabled:Boolean(e)}))}catch(e){}},[t,n]),m=(0,u.useCallback)(async()=>{try{await ev(t,"complete",n,{})}catch(e){}"undefined"!=typeof window&&window.openclaWPConfig&&(window.openclaWPConfig.setupCompleted=!0),o(!1),"function"==typeof d.current&&d.current()},[t,n]),g=(0,u.useMemo)(()=>({advance:p,refresh:h,finish:m,setExampleAgent:f}),[p,h,m,f]),y=(0,u.useMemo)(()=>{if(!a)return null;const e=function(e){return Qy.find(t=>t.id===e)||null}(r);return e?function(e,t,n){return{type:"card",kind:e.kindFor?e.kindFor(t):"info",title:e.title,body:e.buildBody(t),actions:e.buildActions(t,n)}}(e,l,g):null},[a,r,l,g]);return{card:y,visible:a,dismiss:m}}({enabled:!1===("undefined"!=typeof window&&window.openclaWPConfig?window.openclaWPConfig:{}).setupCompleted,restNamespace:a,nonce:i});(0,u.useEffect)(()=>{if(g)return;if(S(),!k)return void T(null);let e=!1;return(async()=>{try{const t=await fetch(`/wp-json/${a}/decisions/pending/${k}`,{credentials:"same-origin",headers:{"X-WP-Nonce":i}});if(!t.ok)return;const n=await t.json();e||T(n.pending||null)}catch(e){}})(),()=>{e=!0}},[g,k,a,i,S,m.length]);const O=(0,u.useCallback)(()=>{T(null),S(),setTimeout(()=>S(),250)},[S]);return(0,ve.jsxs)("section",{className:"agenttic",children:[e.length>1&&(0,ve.jsx)(d.SelectControl,{label:"Agent",value:o,options:e.map(e=>({label:e.label,value:e.slug})),onChange:r,__next40pxDefaultSize:!0}),C&&(0,ve.jsx)(nv,{pending:C,restNamespace:a,nonce:i,onResolved:O}),(R.card||P.length>0)&&(0,ve.jsxs)("div",{className:"openclawp-card-stack",children:[R.card&&(0,ve.jsx)(Wy,{card:R.card,onDismiss:R.dismiss,onAction:L}),P.map(e=>(0,ve.jsx)(Wy,{card:e,onDismiss:()=>I(e.__key),onAction:L},e.__key))]}),(0,ve.jsx)(Fy,{variant:"embedded",messages:m,isProcessing:g,error:y,onSubmit:D,onStop:x,suggestions:b,clearSuggestions:w,placeholder:"Type a message or /help…"})]})}function av(){const e=document.getElementById("openclawp-chat-root");if(!e)return;let t=[];try{t=JSON.parse(e.dataset.agents||"[]")}catch(e){t=[]}const n=e.dataset.defaultAgent||"",i=window.openclaWPConfig||{},a=i.bridgeUrl||"/wp-json/openclawp/v1/agenttic",o=i.nonce||"",r=i.restNamespace||"openclawp/v1";0!==t.length&&(0,c.createRoot)(e).render((0,ve.jsx)(iv,{agents:t,defaultAgent:n,bridgeUrl:a,nonce:o,restNamespace:r}))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",av):av()})(); \ No newline at end of file diff --git a/includes/class-openclawp-bootstrap.php b/includes/class-openclawp-bootstrap.php index 6088747..8dd09c1 100644 --- a/includes/class-openclawp-bootstrap.php +++ b/includes/class-openclawp-bootstrap.php @@ -60,6 +60,7 @@ public static function init(): void { OpenclaWP_Oauth_Server::register(); OpenclaWP_Rest::register(); OpenclaWP_Decisions_Rest::register(); + OpenclaWP_Setup_Rest::register(); OpenclaWP_Agenttic_Bridge::register(); OpenclaWP_Canonical_Chat_Handler::register(); OpenclaWP_Workflow_Bootstrap::register(); @@ -149,9 +150,11 @@ public static function localize_chat_block_view_script(): void { $handle, 'openclaWPConfig', array( - 'restNamespace' => 'openclawp/v1', - 'bridgeUrl' => esc_url_raw( rest_url( 'openclawp/v1/agenttic' ) ), - 'nonce' => wp_create_nonce( 'wp_rest' ), + 'restNamespace' => 'openclawp/v1', + 'bridgeUrl' => esc_url_raw( rest_url( 'openclawp/v1/agenttic' ) ), + 'nonce' => wp_create_nonce( 'wp_rest' ), + 'setupCompleted' => '1' === get_option( 'openclawp_setup_completed', '' ), + 'setupRestUrl' => esc_url_raw( rest_url( 'openclawp/v1/setup' ) ), ) ); } diff --git a/includes/class-openclawp-setup-rest.php b/includes/class-openclawp-setup-rest.php new file mode 100644 index 0000000..187a9a5 --- /dev/null +++ b/includes/class-openclawp-setup-rest.php @@ -0,0 +1,146 @@ + WP_REST_Server::READABLE, + 'callback' => array( __CLASS__, 'get_state' ), + 'permission_callback' => array( __CLASS__, 'check_permission' ), + ) + ); + + register_rest_route( + self::NAMESPACE, + '/setup/enable-example-agent', + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( __CLASS__, 'post_enable_example_agent' ), + 'permission_callback' => array( __CLASS__, 'check_permission' ), + 'args' => array( + 'enabled' => array( + 'type' => 'boolean', + 'required' => true, + ), + ), + ) + ); + + register_rest_route( + self::NAMESPACE, + '/setup/complete', + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( __CLASS__, 'post_complete' ), + 'permission_callback' => array( __CLASS__, 'check_permission' ), + ) + ); + } + + /** + * All routes are gated on `manage_options` — first-run setup is an admin + * task. We deliberately don't fan out through `openclawp_rest_permission_callback` + * here: opening setup to non-admins doesn't make sense regardless of how + * a site's wider permission filter is configured. + */ + public static function check_permission(): bool { + return current_user_can( 'manage_options' ); + } + + /** + * Snapshot of setup state the wizard cards render from. + * + * `providers` mirrors `OpenclaWP_Setup_Wizard::detect_providers()` but + * strips the `classes` / `install_url` arrays the card UI doesn't need — + * keeping the response narrow makes future provider additions easier. + */ + public static function get_state(): WP_REST_Response { + $providers = array(); + foreach ( OpenclaWP_Setup_Wizard::detect_providers() as $provider ) { + $providers[] = array( + 'slug' => (string) $provider['slug'], + 'label' => (string) $provider['label'], + 'installed' => ! empty( $provider['installed'] ), + ); + } + + return rest_ensure_response( + array( + 'completed' => '1' === (string) get_option( OpenclaWP_Setup_Wizard::OPTION_COMPLETED, '' ), + 'providers' => $providers, + 'exampleAgentEnabled' => '1' === (string) get_option( OpenclaWP_Setup_Wizard::OPTION_ENABLE_EXAMPLE, '' ), + ) + ); + } + + /** + * Toggle the bundled example agent. The agent registrar reads this option + * via the `openclawp_register_example_agent` filter bridged by + * `OpenclaWP_Setup_Wizard::filter_register_example_agent()`. + */ + public static function post_enable_example_agent( WP_REST_Request $request ): WP_REST_Response { + $enabled = (bool) $request->get_param( 'enabled' ); + update_option( OpenclaWP_Setup_Wizard::OPTION_ENABLE_EXAMPLE, $enabled ? '1' : '0' ); + + return rest_ensure_response( + array( + 'enabled' => $enabled, + ) + ); + } + + /** + * Mark setup as complete. Mirrors the PHP wizard's "done" step and its + * "Skip setup" link — both bounce through here so the welcome notice + * disappears regardless of which surface finished setup. + */ + public static function post_complete(): WP_REST_Response { + update_option( OpenclaWP_Setup_Wizard::OPTION_COMPLETED, '1' ); + + return rest_ensure_response( + array( + 'completed' => true, + ) + ); + } +} diff --git a/includes/class-openclawp-setup-wizard.php b/includes/class-openclawp-setup-wizard.php index f17d6d1..c4281d9 100644 --- a/includes/class-openclawp-setup-wizard.php +++ b/includes/class-openclawp-setup-wizard.php @@ -80,6 +80,10 @@ public static function filter_register_example_agent( bool $enabled ): bool { * Dismissible welcome notice rendered on every admin screen until the * wizard is complete. Skipped on the wizard itself so it doesn't compete * with the wizard's own UI. + * + * The CTA points at the Chat page (`?page=openclawp`) so users land in + * the in-chat card wizard by default. The PHP wizard at + * `?page=openclawp-setup` remains reachable as a deep-link fallback. */ public static function maybe_render_welcome_notice(): void { if ( ! current_user_can( 'manage_options' ) ) { @@ -94,13 +98,13 @@ public static function maybe_render_welcome_notice(): void { return; } - $wizard_url = admin_url( 'admin.php?page=' . self::PAGE_SLUG ); + $chat_url = admin_url( 'admin.php?page=' . OpenclaWP_Admin::PAGE_SLUG ); ?>

    - +